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
buyprice

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

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 523

PostPosted: Tue Mar 18, 2008 4:16 am    Post subject: buyprice Reply with quote

Since .buyprice is read/write on an item you can set it to be anything you like for sale to merchants.

What I didn't realise was that you can combine stacks of items with different buyprices and that results in a single stack with the existing_stack value retained which messes up all the buyprices.

I don't want to refuse the insert or move with caninsert because it would mess up crafting. Crafting sets a buyprice.

I don't really want to use the oninsert script because there is no opportunity to keep the stack split as the inserttype is already set.

What am I missing? I am sure this has been solved by someone or other!

I'd hate to resort to cprops to keep the stacks separate.


Last edited by OldnGrey on Tue Mar 18, 2008 6:21 am; edited 2 times in total

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 183

PostPosted: Tue Mar 18, 2008 5:47 am    Post subject: Reply with quote

I didn't know this before.

Sorry to say I have no solution to this, just a new thing (maybe) worth knowing: if player combines two stacks with different prices the same will occur.

This should be solveable hooking packet 0x08, and in it, checking if player is trying to add item into a stack (serial packet.GetInt32(10), I think), and if so, comparing the buyprice and sellprice members: if they differ, replying with packet 0x27 and returning 1 so core won't react. Never scripted that myself but should do.

Of course it does not solve the error you mentioned, so...


Storing the real prices (also) in cprops may just be the most clean way, until this bug is fixed.

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

 




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