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

Auto-casting abilities

Status
Not open for further replies.
Level 1
Joined
Jan 17, 2010
Messages
5
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
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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. --------
 
Level 6
Joined
Jul 24, 2008
Messages
180
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.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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.
 
Status
Not open for further replies.
Top