• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Determine if item Purchased or Pickup

Status
Not open for further replies.
Level 5
Joined
Mar 22, 2009
Messages
170
Currently using EVENT_PLAYER_UNIT_PICKUP_ITEM, and I need to do something different based on whether an item is purchased or picked up. I don't think I can using the "Item purchased" event, due to massive existing complexity in existing map.

Any suggestions on how to differentiate?
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
you could pick every item in a periodic timer trigger that is lying on the ground and change its custom value to 1, now if you create a trigger with a "item purchased" event, you can check if the custom value is 1, if its not, you purchased it.
maybe its not the best solution, but i couldnt think of anything else and at least it should work
 
Level 12
Joined
Oct 16, 2010
Messages
680
check what is the aquiring units owners current selection.. if its a shop then the player purchased the item.

Could be a side effect if u target a shop and other player gives you an item it also triggered as a shopping:/ but maybe you can work it around
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Currently using EVENT_PLAYER_UNIT_PICKUP_ITEM, and I need to do something different based on whether an item is purchased or picked up. I don't think I can using the "Item purchased" event, due to massive existing complexity in existing map.

Any suggestions on how to differentiate?

why would you think anything else could be faster than +1 if in existing/new trigger with item puchased event?
 
Status
Not open for further replies.
Top