• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Auto-casting abilities

Status
Not open for further replies.

Mutantbunny

M

Mutantbunny

I want to make a unit auto-cast an ability when it attacks but i cant seem to find the trigger for it. if someone could point me in the right direction it would be much appreciated
 
You mean, like:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Unit - Order (Attacking unit) to Neutral Dark Ranger - Silence (Position of (Triggering unit))
      • -------- // Triggering unit points to the same unit as "Attacked unit" in this scenario. --------
Or, if you wanted to add a conditional response:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Silence for (Attacking unit)) Greater than 0
    • Actions
      • Unit - Order (Attacking unit) to Neutral Dark Ranger - Silence (Position of (Triggering unit))
      • -------- // Triggering unit points to the same unit as "Attacked unit" in this scenario. --------
 
If its a custom spell, use one of the auto-cast base spells. (Orb of Anhilation, Cold Arrows, Searing Arrows, etc.) However, if you want to cast an active spell on attack, you need to detect the attack and order the unit to cast your spell.

  • Auto-Cast
  • Events
    • Unit - Unit is attacked
  • Conditions
    • ((Attacking Unit) Equal to Your_Hero)
  • Actions
    • Unit - Order Your_Hero to Human Archmage - Blizzard
You can add other conditions if you like, such as Mana percentage, Attacked units Health percentage, etc. Note that the spells String ID is the Archmage's Blizzard. Just find your spell base in the list, or change the ID on your spell.
 
T4COBELL said:
If its a custom spell, use one of the auto-cast base spells. (Orb of Anhilation, Cold Arrows, Searing Arrows, etc.) However, if you want to cast an active spell on attack, you need to detect the attack and order the unit to cast your spell.

  • Auto-Cast
  • Events
    • Unit - Unit is attacked
  • Conditions
    • ((Attacking Unit) Equal to Your_Hero)
  • Actions
    • Unit - Order Your_Hero to Human Archmage - Blizzard
You can add other conditions if you like, such as Mana percentage, Attacked units Health percentage, etc. Note that the spells String ID is the Archmage's Blizzard. Just find your spell base in the list, or change the ID on your spell.

Berbanog said:
Or, if you wanted to add a conditional response:

  • Untitled Trigger 001
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Level of Silence for (Attacking unit)) Greater than 0
  • Actions
    • Unit - Order (Attacking unit) to Neutral Dark Ranger - Silence (Position of (Triggering unit))
    • -------- // Triggering unit points to the same unit as "Attacked unit" in this scenario. --------

Does this answer the question?
 
I didn't look at the time, I actually thought your post was recent. Our posts were only 4 minutes apart so I can see how that would happen, apologies. I changed the message.
 
thanks you two. i got it working now. much appreciated
 
Status
Not open for further replies.
Back
Top