FANDOM


Created by Taz.

Using "RC_Core.rcm"
; Morgance Online 0.1
; Date/Time: 3:39:43 AM on 11/1/2012
; By Dan Seguin on TAZCO-PC
;Will be attached to the death chest thats droped in the death loot script this script will retrive the items from the chest.


Function Main()
Player = Actor()
Target = ContextActor()
Pname$ = Name(Player)

ScriptLog("Death_Chest_RightClick script running by " + Pname)

 PlayerStoredName$ = ActorGlobal(Target, 1)
 PublicLoot% = ActorGlobal(Target, 2)

    If (PublicLoot = 5) ;if 5 then public and allow anyone open loot

    Else ;If not 5 then check players name to see if its there loot.
        If Not (PlayerStoredName = Pname) ;if stored name is not player that right clicks tell them its not public yet.
            OutPut(Player, "This loot is not public yet.", 145, 45, 76)
            Return
        EndIf
     EndIf
     
 Slotamount% = 1
 
     Repeat
 
         Itemslot$ = ActorBackPack(Target, Slotamount)
        InvoName$ = ItemName(Itemslot)
        
 
              If (InvoName = "")
                ;Player has no item in slot do display anything. 
            Else
 
        		    GiveItem(Target, InvoName, - 1) ;Take item from player on death
                
                ;Give Item to chest
                GiveItem(Player, InvoName) ;Take item from player on death
                
            EndIf 
        ;------------------------------- 


        Slotamount% = Slotamount + 1
        DoEvents(30)

   Until (Slotamount = 36) ;amount of slots to count, 32 for invo and 6 for gear.

DoEvents(1000)
        SetAttribute(Target, "Health", 0) ;kill chest
        
 
 
 
 
 
 End Function