SphereServer BugTracker - SphereServer
View Issue Details
0002207SphereServerexecutable - windows buildpublic14-09-13 07:5415-09-13 17:03
Coruja 
Ben 
normalminoralways
resolvedfixed 
 
0.56c Nightly 
Automated (specify build number)
None
None
0002207: Wrong ARGN1 on @ItemSell (+ ARGN2 feature request)
I dont know if it really a bug, but ARGN1 on @ItemSell is returning the item total amount, not the amount that I'm selling to the npc.
I think it's not right since ARGN1 will return a duplicated value from <ACT.AMOUNT> and there's no way to get the real item amount that I sold.

Ex: I have 50 potions and sold 10 on NPC. ARGN1 will be 50, and ACT.AMOUNT will be 50 too. I'm getting a duplicated wrong value instead the value that I want (10)


PS: Tested only on @ItemSell (on chars) using 10 sept 2013 nightly build, but probably it could be the same on others triggers like @Sell, @Buy and @ItemBuy

PS²: It would be great to have a new ARGN2 too, returning the final value paid by the npc (including vendormarkup). This will return the value paid on the total amount sold, to get the value for a single item just use <eval <ARGN2>/<ARGN1>>
on sphere 56b changelog:

24-09-2006, Nazghul
[...]
- Added: Item trigger @Buy and character trigger @itemBuy, which are called before item is sold
  by a vendor. The trigger is called only with EF_New_Triggers on.
  ACT/DEFAULT is the item, SRC is the player, ARGN is the item amount, ARGO is the vendor.
  Return 1 prevents the player from buying the item.
- Added: Item trigger @Sell and character trigger @itemSell, which are called before item is bought
  by a vendor. The trigger is called only with EF_New_Triggers on.
  ACT/DEFAULT is the item, SRC is the player, ARGN is the item amount, ARGO is the vendor.
  Return 1 prevents the player from selling the item.

[...]

24-10-2006, Nazghul
- Added: Trigger @(item)Buy now has local.totalcost, which holds the cost of the whole purchase
  and ARGN2, which holds price of this amount of items (price * amount).
No tags attached.
Issue History
14-09-13 07:54CorujaNew Issue
15-09-13 17:03BenNote Added: 0001681
15-09-13 17:03BenStatusnew => resolved
15-09-13 17:03BenFixed in Version => 0.56c Nightly
15-09-13 17:03BenResolutionopen => fixed
15-09-13 17:03BenAssigned To => Ben

Notes
(0001681)
Ben   
15-09-13 17:03   
ARGN1 is fixed and added ARGN2 as the cost after vendermarkup.