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

Question about forcing unit ability

Status
Not open for further replies.
Level 5
Joined
Oct 20, 2019
Messages
60
Hello, i have a question about forcing units to do spells

Right now i have triggered my units to be forced to use spells when attacked and use the spells on the attacker

  • Tauren Shockwave
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Tauren Warrior 9
    • Actions
      • Set VariableSet TaurenShockwave = (Position of (Attacking unit))
      • Unit - Order (Attacked unit) to Orc Tauren Chieftain - ShockwaveTaurenShockwave
      • Custom script: call RemoveLocation(udg_TaurenShockwave)
But i wonder if its possible to force units to use thier spells as soon as A friendly unit is attacked and cast the spell on that attacker

I hope you understand what i mean, i have tried with some various things but with no success

Ty for help
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
  • Ally Is Attacked
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set VariableSet TempPoint = (Position of (Attacked unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 600.00 of TempPoint.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Sorceress
              • ((Picked unit) belongs to an ally of (Owner of (Attacked unit)).) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is hidden) Equal to False
              • ((Picked unit) is an illusion) Equal to False
            • Then - Actions
              • Unit - Order (Picked unit) to Human Mountain King - Storm Bolt(Attacking unit)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
Unit-type of Picked Unit Equal to Sorceress <-- Set this to the unit that will cast a spell on the Attacker.
Human Mountain King - Storm Bolt <-- Set this to the order string that you want your unit to cast.

Note that this could cause performance problems with a lot of units all attacking at once as this trigger will run A LOT.
 

Attachments

  • Cast Spell On Attacker.w3m
    17.4 KB · Views: 19
Last edited:
Status
Not open for further replies.
Top