PenUltima Online

It is currently Wed Aug 20, 2008 2:20 pm

All times are UTC - 4 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Override properties for CreateItem* functions
PostPosted: Mon Mar 17, 2008 10:57 pm 
Offline
Distro Developer
User avatar

Joined: Fri Feb 10, 2006 12:08 pm
Posts: 305
Location: Myrtle Beach, South Carolina
Just like;
CreateNpcFromTemplate( template, x, y, z, override_properties := 0, realm := _DEFAULT_REALM)

Only for items.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 3:37 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 4:15 am
Posts: 202
You can already.

Get item's info using GetItemDescriptor(objtype / objtypename) and change values in it before creating the item.

Code:
var objtype := OBJTYPE_AXE; // 3907
var descriptor := GetItemDescriptor(objtype);
print(descriptor);
descriptor.color := COLOR_RED;

// Results a red axe.
CreateItemInBackpack(who, descriptor, 1);


Overriding the values in struct is sometimes a bit hard (cprops...), but it is doable. Also note that r/o values cannot be changed (weight).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 8:49 am 
Offline
Distro Developer
User avatar

Joined: Fri Feb 10, 2006 12:08 pm
Posts: 305
Location: Myrtle Beach, South Carolina
Good stuff, :D
http://docs.polserver.com/pol097/singlefunc.php?funcname=GetItemDescriptor&xmlfile=polsysem.xml


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

All times are UTC - 4 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