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

[Solved] An unit loses an ability when drop item

Status
Not open for further replies.
Level 13
Joined
Oct 28, 2019
Messages
523
  • BowmanDrops
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Archer
      • (Item-type of (Last dropped item)) Equal to Flame Arrow
    • Actions
      • Wait 0.01 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Flame Arrow) Equal to True
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Unit - Remove Flame Arrow (Archer) from (Hero manipulating item)
IDK what happened, it was working , and now isnt anymore, Its simple, if an archer has a flaming arrow item it gains the flaming arrow ability, if drops the item loses ability
 
Level 24
Joined
Feb 27, 2019
Messages
833
I would use Item being manipulated instead of Last dropped item. I would also use Triggering unit instead of Hero manipulating item. They make sense to me and I can be sure that they work as intended. The others... I dont trust em!

When an item is dropped, the game requires an instant to realize that the item is not owned or a unit doesnt have the item. Thats why you needed to add a wait. Timers are faster than waits so I recommend you use one instead.
  • Cheese Dropped 1
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Archer
      • (Item-type of (Item being manipulated)) Equal to Cheese
    • Actions
      • Set VariableSet CheeseUnit = (Triggering unit)
      • Countdown Timer - Start CheeseTimer as a One-shot timer that will expire in 0.00 seconds
  • Cheese Dropped 2
    • Events
      • Time - CheeseTimer expires
    • Conditions
      • (CheeseUnit has an item of type Cheese) Equal to False
    • Actions
      • Unit - Remove Animate Dead from CheeseUnit
      • Game - Display to (All players) the text: Oh no! Cheese Dropp...
Theres an even faster way to keep track of items. Set a variable to +1 when an item is acquired. Set the variable to -1 when an item is lost. The unit doesnt have the item when the variable reaches 0.
 
Status
Not open for further replies.
Top