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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Repel v0.02.w3x
Variables
Initialization
Initialization
Repel
Repel Cast
Repel Effect
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
Caster
unit
No
DummyGroup
group
No
Enemies
group
No
Hashtable
hashtable
No
Points
location
Yes
Real
real
Yes
Initialization
Events
Map initialization
Conditions
Actions
Visibility - Disable fog of war
Visibility - Disable black mask
Hashtable - Create a hashtable
Set Variable Set Hashtable = (Last created hashtable)
Repel Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Repel
Actions
-------- Sets the Caster --------
Set Variable Set Caster = (Triggering unit)
-------- Creates a location for Dummy Unit spawning --------
Set Variable Set Points[1] = (Position of Caster)
-------- Saves the AoE at which enemies are detected to knockback --------
Set Variable Set Real[1] = (100.00 + (100.00 x (Real((Level of Repel for Caster)))))
-------- Creates a dummy unit and Stores caster and Detection Range --------
Unit - Create 1 . Dummy Unit for (Owner of Caster) at Points[1] facing Default building facing degrees
Hashtable - Save Real[1] as 0 of (Key (Last created unit).) in Hashtable .
Hashtable - Save Handle Of Caster as 1 of (Key (Last created unit).) in Hashtable .
-------- Checks if there is any instance of this spell in effect --------
-------- If not, turns the Effect trigger on --------
If ((DummyGroup is empty) Equal to True) then do (Turn on Repel_Effect <gen>) else do (Do nothing)
-------- Adds dummy unit to Dummy Units' group --------
Unit Group - Add (Last created unit) to DummyGroup
-------- Clears Leak --------
Custom script: call RemoveLocation(udg_Points[1])
Repel Effect
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
-------- Every 0.03 seconds of the game --------
Unit Group - Pick every unit in DummyGroup and do (Actions)
Loop - Actions
-------- Loads the Knockback detection range and Caster --------
Set Variable Set Real[1] = (Load 0 of (Key (Picked unit).) from Hashtable.)
Set Variable Set Caster = (Load 1 of (Key (Picked unit).) in Hashtable.)
-------- Creates a location for knockbacking offset --------
Set Variable Set Points[1] = (Position of Caster)
-------- Finds all enemies to knockback --------
-------- NOTE 1 : Finds all visible organic enemies that are not magic immune --------
Set Variable Set Enemies = (Units within Real[1] of Points[1] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Mechanical) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster).) Equal to True) and (((Matching unit) is visible to (Owner of Caster).) Equal to True)))))).)
-------- Does knockbacking --------
Unit Group - Pick every unit in Enemies and do (Actions)
Loop - Actions
-------- Finds Enemy's location and a place at which it will be knockbacked --------
Set Variable Set Points[2] = (Position of (Picked unit))
Set Variable Set Points[3] = (Points[2] offset by 45.00 towards (Angle from Points[1] to Points[2]) degrees.)
-------- Moves (Knockbacks) the enemy --------
Unit - Move (Picked unit) instantly to Points[3]
-------- Creates an Rocky explosion on target --------
Special Effect - Create a special effect attached to the chest (Unexpected type: 'attachpoint') of (Picked unit) using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
-------- Clears leaks --------
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Points[2])
Custom script: call RemoveLocation(udg_Points[3])
-------- NOTE 2 : This spell is based on Windwalk, so it won't interupt current action --------
-------- NOTE 3 : You don't get invisible because the transition time is much longer than duration --------
-------- NOTE 4 : Repel IS dispellable --------
-------- If the caster isn't alive or the Buff of the Repel is gone... --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Caster is alive) Equal to True
(Caster has buff Wind Walk) Equal to True
Then - Actions
Else - Actions
-------- Rids the Hashtable of the unnecessary information stored inside the dummy unit --------
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable .
-------- Removes Dummy unit for Dummy Group --------
Unit Group - Remove (Picked unit) from DummyGroup .
-------- Removes Dummy unit from Game --------
Unit - Remove (Picked unit) from the game
-------- Clears the Leaks --------
Custom script: call RemoveLocation(udg_Points[1])
Custom script: call DestroyGroup(udg_Enemies)
-------- Checks if there is any instance of this spell left after loop --------
-------- If not, turns this trigger off --------
If ((DummyGroup is empty) Equal to True) then do (Turn off (This trigger)) else do (Do nothing)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.