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

Adding temporary abilites

Status
Not open for further replies.
Level 7
Joined
May 11, 2010
Messages
278
Hiya.
This is what i want to do:
Unit activates Ability, Aura 1 and Aura 2 is added to Unit. After 5 seconds Aura 1 and Aura 2 is removed from Unit.

I made this
  • Taunt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Taunt
    • Actions
      • Set unit = (Triggering unit)
      • Unit - Add Defense bonus to unit
      • Unit - Add Defense Reduction to unit
      • Unit - Set level of Defense bonus for unit to (Level of Taunt for unit)
      • Unit - Set level of Defense Reduction for unit to (Level of Taunt for unit)
      • Countdown Timer - Start Taunttimer as a One-shot timer that will expire in 5.00 seconds
  • Taunt expire
    • Events
      • Time - Taunttimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Vanguard of Sanctuary) and do (Actions)
        • Loop - Actions
          • Unit - Remove Defense Reduction from (Picked unit)
          • Unit - Remove Defense bonus from (Picked unit)


But then I realized I'm f*cking stupid, because even if i create a unit variable just for this trigger, there can be more than one of this hero on the field at any given time, causing it to fail, yadda yadda.

So, is there a simple way to do it? Thanks in advance!
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Try this way: There is a system called Unit Indexer. U should find it in the Spell section. It make each unit to have a custom value. After import the Unit Indexer into ur map, ur Variaable in that trigger must be changed to the Array. And then change ur trigger into something like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Acid Bomb
    • Actions
      • Set SS_CV = (Custom value of (Triggering unit))
      • Set unit = (Triggering unit)
      • Unit - Add Defense bonus to unit
      • Unit - Add Defense Reduction to unit
      • Unit - Set level of Defense bonus for unit to (Level of Taunt for unit)
      • Unit - Set level of Defense Reduction for unit to (Level of Taunt for unit)
      • Countdown Timer - Start timer as a One-shot timer that will expire in 5.00 seconds
      • Set timer = Last Created Timer
      • Trigger - Add to Taunt Expire the event (Time - timer[SS_CV] expires)
.
EDIT: Oops, this doesnt work. Sorry. :D
 
Status
Not open for further replies.
Top