• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[vJASS] Different actions for pawn and drop item

Status
Not open for further replies.
Level 28
Joined
Feb 2, 2006
Messages
1,631
Hey,
in my inventory system I want to use different actions for dropping an item and pawning one.
Dropping, drops an item with all charges but pawning sells an item with only one charge. Otherwise the gold received does not work for non usable items (items which stay in the inventory when being used).

The problem is now that when an item is pawned the drop trigger of course triggers as well. I tried to disable the drop trigger in the pawn trigger action and enable it again but it did not work.

I am starting a 0 timer in the drop trigger action now. If the item is null in the timer function it has been removed. So it could either be pawned or it could have been given to another character where it is removed as well.

How can I detect the item has been pawned? I could store the handle id (which does not become null) and check it in the timer function of the drop trigger but handle IDs might be reused in that time? Is that a problem?

edit: I would not have that problem at all if there was a way to receive the proper gold amount (for every charge price of the item).
 
Level 19
Joined
Dec 12, 2010
Messages
2,074
sellcost multiplies for every charge over/less than stated in docs. best way to ignore it - remove charges from official stats and give them on item appearing manually.
OT: change pawn'd item's user data field for something like -2, then check for that.
 
Status
Not open for further replies.
Top