View unanswered posts | View active topics
|
Page 1 of 1
|
[ 2 posts ] |
|
| Author |
Message |
|
OldnGrey
|
Post subject: buyprice Posted: Tue Mar 18, 2008 12:16 am |
|
Joined: Sat Feb 04, 2006 6:26 pm Posts: 560
|
|
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.
|
|
| Top |
|
 |
|
ncrsn
|
Post subject: Posted: Tue Mar 18, 2008 1:47 am |
|
Joined: Fri Feb 10, 2006 12:15 am Posts: 223
|
|
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.
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: Google [Bot] 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
|
|