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

[Spell] Picking Unit Behind Targeted Unit

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
800
  • Actions
    • Set MaxDistance = Whatever
    • Set SourcePosition = (Position of SourceUnit)
    • Set TargetPosition = (Position of TargetUnit)
    • Set TargetGroup = (Units within MaxDistance of TargetPosition)
    • Unit Group - Pick every unit in TargetGroup and do (Actions)
      • Loop - Actions
        • Set SpillTarget = (Position of (Picked unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • YourTargetRequirements Equal to True
            • (Angle from TargetPosition to SpillTarget) Greater than or equal to ((Angle from SourcePosition to TargetPosition) - 15.00)
            • (Angle from TargetPosition to SpillTarget) Less than or equal to ((Angle from SourcePosition to TargetPosition) + 15.00)
          • Then - Actions
            • Unit - Do whatever to Picked Unit
          • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here is an alternative
Units behind a unit
  • Untitled Trigger 008
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set u1 = Paladin 0003 <gen>
      • Set r1 = (Facing of u1)
      • Set p1 = (Position of u1)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of p1) and do (Actions)
        • Loop - Actions
          • Set u2 = (Picked unit)
          • Set p2 = (Position of u2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (u2 is alive) Equal to True
              • (Cos(((Angle from p1 to p2) - r1))) Less than 0.00
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of u2 using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_p2)
      • Custom script: call RemoveLocation(udg_p1)
 
Status
Not open for further replies.
Top