SphereServer BugTracker - SphereServer
View Issue Details
0002421SphereServerexecutable - genericpublic20-10-14 02:0426-10-14 16:29
Stanic 
Coruja 
normalmajorsometimes
resolvedfixed 
16-06-2013, 0.56b Prerelease 
0.56c Nightly 
Automated (specify build number)
None
None
0002421: Sell System
When you cut a bolt of cloth with a scissors, creating 50 folded cloth, the value of 1 folded cloth is the same value of 1 bolt of cloth.
1. Create a new Tailor npc.
2. Buy one (or more) bolt of cloth.
3. Type sell, but cancel the action.
4. Cut the bolt of cloth.
5. Type sell, and as you can see, the value of 1 bolt of cloth will be the same of 1 bolt of cloth.

If don't work, try before the step 3, set "RESTOCK 1" on the npc.
No tags attached.
Issue History
20-10-14 02:04StanicNew Issue
20-10-14 02:06StanicNote Added: 0002489
20-10-14 08:50CorujaNote Added: 0002490
20-10-14 14:14XuNNote Added: 0002493
20-10-14 16:22CorujaNote Added: 0002498
20-10-14 18:49StanicNote Added: 0002500
20-10-14 20:42XuNNote Added: 0002502
20-10-14 21:26StanicNote Added: 0002503
20-10-14 22:09StanicNote Deleted: 0002503
20-10-14 22:15StanicNote Added: 0002504
20-10-14 22:23StanicNote Edited: 0002504bug_revision_view_page.php?bugnote_id=0002504#r727
20-10-14 22:23StanicNote Edited: 0002504bug_revision_view_page.php?bugnote_id=0002504#r728
20-10-14 22:25StanicNote Added: 0002505
21-10-14 01:14CorujaNote Added: 0002506
26-10-14 16:29CorujaStatusnew => resolved
26-10-14 16:29CorujaFixed in Version => 0.56c Nightly
26-10-14 16:29CorujaResolutionopen => fixed
26-10-14 16:29CorujaAssigned To => Coruja

Notes
(0002489)
Stanic   
20-10-14 02:06   
https://www.youtube.com/watch?v=LZwL3kszB58&feature=youtu.be [^]
(0002490)
Coruja   
20-10-14 08:50   
I can confirm it here

on first 'sell' command the npc will generate an 'item list', where it will store the bolt of cloth as 'UID 666666 = price 75'

and using scissors on the bolt of cloth, it will create the new cloth item using the same UID 666666 as the previous bolt cloth

so on next 'sell' command the npc will find this UID 666666 on the price list and it will set the item price = 75 (value stored previously for i_cloth_bolt) instead 2 (the correct value for i_cloth)


so maybe there's 3 ways to fix this problem:
1) rewrite the entire buy/sell engine to always use on-the-fly values instead values stored previously
2) always call RESTOCK before use SELL functions. It's a quick fix but doesn't make any sense let the npc generate a useless item list to then clear this list without even use it.
3) change only bolt of cloth behavior to create the new cloth using a new UID. This will fix the problem on bolt of cloth, but not on all items if this situation applies to more items. Since there's no others items, I think this will be the best solution
(0002493)
XuN   
20-10-14 14:14   
I tried to do some changes to buy/sells some time ago to make dynamic pricing and it was impossible with the current system, and if the system itself is not working fine ... I can think on some ideas to solve all problems at the same time :)
(0002498)
Coruja   
20-10-14 16:22   
it's working fine, the problem is just on items with the same UID :D
I think we can still using it and just change the bolt of cloth behavior. I'm taking a look at the source and the bolt of cloth is doing a strange behavior, its just changing the item base/amount instead delete the bolt of cloth to create the cloth. Maybe just changing this small behavior will be enough to fix this problem
(0002500)
Stanic   
20-10-14 18:49   
Is not possible use the same process of <SERV.ITEMDEF.xxx.VALUE> to get the correct value of some item??
(0002502)
XuN   
20-10-14 20:42   
If you can, go for it, I just don't agree with this fix (not because it being bad nor something similar) but because of looking to the 'future', it would be nice to allow dynamic behaviours :P
(0002504)
Stanic   
20-10-14 22:15   
(edited on: 20-10-14 22:23)
Another solution is when cut something create the new item with a different uid.

I created this workaround and apparently the problem with the folded cloth was fixed, but can exist anothers items with the same problem.

ON=@TargOn_Item
IF (<ARGO.BASEID>==i_cloth_bolt)
 SERV.NEWITEM i_cloth
 NEW.AMOUNT=<eval <ARGO.AMOUNT>*50>
 NEW.CONT=<SRC.FINDLAYER.21>
 ARGO.REMOVE
 return 1
ENDIF

(0002505)
Stanic   
20-10-14 22:25   
Forget, still with the same problem. So probably is not the uid the problem here.
(0002506)
Coruja   
21-10-14 01:14   
I think the bolt of cloth behavior must be changed because the current behavior is a bit odd. Instead create new items with new UIDs, the bolt of cloth is just changing its id/name/amount to transform into a cloth item. It looks weird.

I already fixed it here, probably will be fixed on next nightly build. No more price exploits because now it will create a new item instead just change the item properties. The point of this change is not fix the price, but fix this weird UID behavior. Luckly fixing the UID behavior will fix the price too :P

but sure, a new vending engine will be great too. It will generate values on demand or it will be list-based too? I think we can remove some unusual behaviors like the price based on item quality or char karma