• 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.

[Trigger] Item pickup/drop problem

Status
Not open for further replies.
Level 4
Joined
May 1, 2013
Messages
68
The problem i have is that, when a hero picks a horadric cube up, and the hero doesn't have one, he drops it, which he shouldn't. So if anyone can fix this, please help.

  • Drop
    • Events
      • Unit - A unit owned by Player 1 (Red) Acquires an item
    • Conditions
      • (((Hero manipulating item) has an item of type Horadric Cube) Equal to True) and ((Item-type of (Item being manipulated)) Equal to Horadric Cube)
    • Actions
      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Change Hero Manipulating item for Triggering Unit

The hero doesn't have the item, but once he acquires it, you have an item of that type, so, you drop it.

If conditions are automatically nested with "and", so, there's no need to add "and" conditiones unless you use them inside an "or" block.
 
Use a counter and loop through the items the player has and see if its greater than 1 if it is drop the item.

I like this solution, but another possibility would be to set a variable so if hero acquires HC then set HC = HC+1. In the next trigger if HC=2 then do "drop item HC." Basically the same as above. I don't know counters so I thought maybe he doesn't either. Deathismyfriend is always right though so try that first.
 
Status
Not open for further replies.
Top