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
Override properties for CreateItem* functions

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Feature Suggestions
Display posts from previous:   

Author Message
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 293
Location: Myrtle Beach, South Carolina

PostPosted: Mon Mar 17, 2008 10:57 pm    Post subject: Override properties for CreateItem* functions Reply with quote

Just like;
CreateNpcFromTemplate( template, x, y, z, override_properties := 0, realm := _DEFAULT_REALM)

Only for items.

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 168

PostPosted: Tue Mar 18, 2008 3:37 am    Post subject: Reply with quote

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).

Author Message
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 293
Location: Myrtle Beach, South Carolina

PostPosted: Tue Mar 18, 2008 8:49 am    Post subject: Reply with quote

Good stuff, Very Happy
http://docs.polserver.com/pol097/singlefunc.php?funcname=GetItemDescriptor&xmlfile=polsysem.xml

Post new topic   Reply to topic    PenUltima Online Forum Index -> Feature Suggestions All times are GMT - 4 Hours
Page 1 of 1

 




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