• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[vJASS] Different actions for pawn and drop item

Status
Not open for further replies.
Level 26
Joined
Feb 2, 2006
Messages
1,697
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,070
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