PenUltima Online

It is currently Sat Aug 30, 2008 2:48 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Would this script work?
PostPosted: Tue Jun 20, 2006 4:47 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 8:46 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 745
Location: Chicago, IL USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 3:07 am 
Offline

Joined: Fri May 26, 2006 12:53 am
Posts: 30
you cannot compile this script, the function itemsback is defined with 4 paramaters but you invoke it with only 1 parameter

_________________
Scripter on Faerun's Legend
www.faerunslegends.it


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 6:06 am 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
Ok thanks, once i get better at scripting ill try it again


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl