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

Specific unit in X range from another, condition

Status
Not open for further replies.
Level 2
Joined
Jun 27, 2016
Messages
6
Hi, I can't find a way to make this...

Event:
-Sylvanas dies (is in game from the start)

Condition:
-Arthas is in range, maybe 2500 (arthas is in a variable)

Action:
-wait 5 sec
-Replace Sylvanas with her banshee verison under control of player 4

Thanks in advance
 
Level 24
Joined
Feb 27, 2019
Messages
833
  • Events
    • Unit - Sylvanas 0001 <gen> Dies
  • Conditions
    • (Distance between (Position of Sylvanas 0001 <gen>) and (Position of Arthas)) Less than 2500.00 ( Found in Real Comparison - Math - Distance between points )
  • Actions
    • Wait 5.00 game-time seconds
    • Unit - Change ownership of Sylvanas 0001 <gen> to Player 4 (Purple) and Change color
    • Hero - Instantly revive Sylvanas 0001 <gen> at (Position of Sylvanas 0001 <gen>), Hide revival graphics
    • Unit - Replace Sylvanas 0001 <gen> with a Banshee using The new unit's max life and mana
Try this?
  • Events
    • Unit - Sylvanas 0001 <gen> Dies
  • Conditions
    • (Number of units in (Units within 2500.00 of (Position of Sylvanas 0001 <gen>) matching ((Matching unit) Equal to Arthas).)) Equal to 1
  • Actions
An alternative
  • Events
    • Unit - Sylvanas 0001 <gen> Dies
  • Conditions
  • Actions
    • Set VariableSet Loc[1] = (Position of Sylvanas 0001 <gen>)
    • Set VariableSet Group[1] = (Units within 2500.00 of Loc[1] matching ((Matching unit) Equal to Arthas).)
    • Custom script: call RemoveLocation(udg_Loc[1])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in Group[1]) Not equal to 0
      • Then - Actions
        • Custom script: call DestroyGroup(udg_Group[1])
        • Wait 5.00 game-time seconds
        • Unit - Change ownership of Sylvanas 0001 <gen> to Player 4 (Purple) and Change color
        • Set VariableSet Loc[1] = (Position of Sylvanas 0001 <gen>)
        • Hero - Instantly revive Sylvanas 0001 <gen> at Loc[1], Hide revival graphics
        • Custom script: call RemoveLocation(udg_Loc[1])
        • Unit - Replace Sylvanas 0001 <gen> with a Banshee using The new unit's max life and mana
      • Else - Actions
        • Custom script: call DestroyGroup(udg_Group[1])
Another one :/
 
Last edited:
Status
Not open for further replies.
Top