PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Would this script work?

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
Poi



Joined: 14 Apr 2006
Posts: 216

PostPosted: Tue Jun 20, 2006 8:47 pm    Post subject: Would this script work? Reply with quote

Ok i was wodnering if this script would res the person, and put all the items on the corpse back on them:

sres.src:
Code:

use uo;
include "include/res2";

program sres( who, corpse, mobile )
Resurrect(mobile);
itemsback(mobile);
endprogram




res2.inc:
Code:
use uo;
function itemsback(corpse, mobile, item, ghost)
   foreach item in ListRootItemsInContainer( corpse )
         if( !EquipItem( ghost, item ) )
            MoveItemToContainer( item, ghost.backpack );
         endif
   endforeach

   function ListRootItemsInContainer (byref container)

      var ret := { };
           foreach item in enumerateitemsincontainer(container)
         if ( item.container == container )
            ret.append(item);
         endif
      endforeach

      return ret;

   endfunction

endfunction

Author Message
CWO



Joined: 04 Feb 2006
Posts: 691
Location: Chicago, IL USA

PostPosted: Wed Jun 21, 2006 12:46 am    Post subject: Reply with quote

if I were to do it, I would put in death.src to save their equipped items to a prop then when they res, do a foreach on the prop and re-equip the items that way.

Author Message
Xadhoom



Joined: 26 May 2006
Posts: 30

PostPosted: Wed Jun 21, 2006 7:07 am    Post subject: Reply with quote

you cannot compile this script, the function itemsback is defined with 4 paramaters but you invoke it with only 1 parameter

Author Message
Poi



Joined: 14 Apr 2006
Posts: 216

PostPosted: Wed Jun 21, 2006 10:06 am    Post subject: Reply with quote

Ok thanks, once i get better at scripting ill try it again

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty