• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Picking Unit Behind Targeted Unit

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
781
  • 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,240
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