buyprice

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

buyprice

Post by OldnGrey »

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 2:21 am, edited 2 times in total.
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Post by ncrsn »

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 Reply