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
Glass Cannon v0.01.w3x
Variables
Initialization
Initialization
Health restoration
Spell
Glass Cannon Cast
Glass Cannon Shoot
Glass Cannon Slide
Glass Cannon Cancel
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
Casters
group
No
Hashtable
hashtable
No
Integer
integer
No
Missiles
group
No
Points
location
Yes
Real
real
Yes
Target
unit
No
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)
Game - Display to (All players) for 100000000.00 seconds the text: Don't worry, health will restore itself
Health restoration
Events
Unit - Lich 0001 <gen> 's life becomes Less than 500.00
Conditions
Actions
Special Effect - Create a special effect attached to the origin (Unexpected type: 'attachpoint') of (Triggering unit) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Set life of (Triggering unit) to 100 %
Glass Cannon Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Glass Cannon
Actions
-------- Stores Caster and Target into variables --------
Set Variable Set Caster = (Triggering unit)
Set Variable Set Target = (Target unit of ability being cast)
-------- Sets the amount of time between it will shoot --------
-------- NOTE 1: Change your shooting interval here --------
Set Variable Set Real[1] = "1.00"
-------- Stores shooting AoE into variable --------
-------- NOTE 2: Change your shooting AoE here --------
-------- NOTE 3: To make the AoE infinite, just make this number to 9999999999 --------
Set Variable Set Real[2] = "850.00"
-------- Stores the damage dealt per shot into variable --------
-------- NOTE 4: Change your damage per shot here --------
Set Variable Set Real[3] = "75.00"
-------- Stores maximum shots into variable --------
-------- NOTE 5: Change your maximum shots here --------
Set Variable Set Integer = (1 + (Level of Glass Cannon for Caster))
-------- Stores all the information into hashtable --------
-------- NOTE 6: All the information is attached to Caster --------
-------- NOTE 7: Stores the shooting interval twice to make it possible to reset the timer when shot is made --------
Hashtable - Save Handle Of Target as 0 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Real[1] as 1 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Real[1] as 2 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Real[2] as 3 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Real[3] as 4 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Integer as 5 of (Key (Triggering unit).) in Hashtable .
-------- Checks if there is any instance of spell already running --------
-------- If not, turns the shooting trigger on --------
If ((Casters is empty) Equal to True) then do (Turn on Glass_Cannon_Shoot <gen>) else do (Do nothing)
-------- Adds caster to Casters' group --------
Unit Group - Add Caster to Casters
Glass Cannon Shoot
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Casters and do (Actions)
Loop - Actions
-------- Stores Caster and Target into variables --------
Set Variable Set Caster = (Picked unit)
Set Variable Set Target = (Load 0 of (Key (Picked unit).) in Hashtable.)
-------- Finds locations of Caster and Target --------
Set Variable Set Points[1] = (Position of Caster)
Set Variable Set Points[2] = (Position of Target)
-------- Loads time left until next shot and reduces it by 0.05 (the loop interval of this trigger) --------
Set Variable Set Real[1] = (Load 1 of (Key (Picked unit).) from Hashtable.)
Set Variable Set Real[1] = (Real[1] - 0.05)
-------- Counts the Distance between Caster and Target --------
Set Variable Set Real[2] = (Distance between Points[1] and Points[2])
-------- Loads the shooting AoE to check if Caster and Target are close enough to shoot --------
Set Variable Set Real[3] = (Load 3 of (Key (Picked unit).) from Hashtable.)
-------- Loads shots left to make --------
Set Variable Set Integer = (Load 5 of (Key (Picked unit).) from Hashtable.)
-------- If Caster and Target are alive and they are in the shooting range... --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Real[2] Less than or equal to Real[3]
(Caster is alive) Equal to True
(Target is alive) Equal to True
Then - Actions
-------- Checks if it is time to shoot --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Real[1] Equal to 0.00
Then - Actions
-------- If it is, then... --------
-------- Finds a location where will the bolt will be created --------
Set Variable Set Points[3] = (Points[1] offset by 70.00 towards (Angle from Points[1] to Points[2]) degrees.)
-------- Loads the damage to deal --------
Set Variable Set Real[4] = (Load 4 of (Key (Picked unit).) from Hashtable.)
-------- Creates the Bolt --------
-------- NOTE 1: To change the model of the Bolt, change the model file of the Dummy Bolt unit in Object Editor --------
Unit - Create 1 . Dummy Bolt for (Owner of Caster) at Points[3] facing (Angle from Points[1] to Points[2]) degrees
-------- Turns collision off for bolt --------
Unit - Turn collision for (Last created unit) Off .
-------- Stores all the information needed into Hashtable --------
-------- NOTE 2: All information is attached to the Dummy Bolt unit --------
Hashtable - Save Handle Of Target as 0 of (Key (Last created unit).) in Hashtable .
Hashtable - Save Handle Of Caster as 1 of (Key (Last created unit).) in Hashtable .
Hashtable - Save Real[4] as 2 of (Key (Last created unit).) in Hashtable .
-------- Checks if there is any bolt already in effect of the Sliding trigger --------
-------- If not, then turns the Sliding trigger on --------
If ((Missiles is empty) Equal to True) then do (Turn on Glass_Cannon_Slide <gen>) else do (Do nothing)
-------- Adds dummy bolt to the Missiles' group --------
Unit Group - Add (Last created unit) to Missiles
-------- Reduces shots-to-do by 1 --------
Set Variable Set Integer = (Integer - 1)
-------- Removes leak made here --------
Custom script: call RemoveLocation(udg_Points[3])
-------- Checks if there is any shot-to-make left --------
-------- If not... --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Equal to 0
Then - Actions
-------- Clears the Hashtable --------
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable .
-------- Removes Caster from Casters' group --------
Unit Group - Remove (Picked unit) from Casters .
Else - Actions
Hashtable - Save Integer as 5 of (Key (Picked unit).) in Hashtable .
-------- Loads the full interval of shooting --------
Set Variable Set Real[1] = (Load 2 of (Key (Picked unit).) from Hashtable.)
Hashtable - Save Real[1] as 1 of (Key (Picked unit).) in Hashtable .
Else - Actions
-------- Else saves time left for next shot --------
Hashtable - Save Real[1] as 1 of (Key (Picked unit).) in Hashtable .
Else - Actions
-------- If any caster or target is dead, or they are too far to shoot, then... --------
-------- Clears the Hashtable --------
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable .
-------- Removes Caster from Casters' group --------
Unit Group - Remove (Picked unit) from Casters .
-------- Issues Caster to Hold Position (if it isn't dead already) --------
Unit - Order Caster to Hold Position .
-------- Removes Leaks --------
Custom script: call RemoveLocation(udg_Points[1])
Custom script: call RemoveLocation(udg_Points[2])
-------- Checks if there is any instance of spell left after this loop --------
-------- If not, turns this trigger off --------
If ((Casters is empty) Equal to True) then do (Turn off (This trigger)) else do (Do nothing)
Glass Cannon Slide
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Missiles and do (Actions)
Loop - Actions
-------- Loads Caster and Target --------
Set Variable Set Target = (Load 0 of (Key (Picked unit).) in Hashtable.)
Set Variable Set Caster = (Load 1 of (Key (Picked unit).) in Hashtable.)
-------- Finds locations of Dummy Bolt unit and Target --------
Set Variable Set Points[1] = (Position of (Picked unit))
Set Variable Set Points[2] = (Position of Target)
-------- Finds location at which Dummy Bolt unit would be moved --------
Set Variable Set Points[3] = (Points[1] offset by 32.00 towards (Angle from Points[1] to Points[2]) degrees.)
-------- If the Distance between dummy bolt unit and Target is 100 or greater, then... --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Points[1] and Points[2]) Greater than or equal to 100.00
Then - Actions
-------- Moves Dummy bolt unit to Points[3] --------
Unit - Move (Picked unit) instantly to Points[3] , facing (Angle from Points[1] to Points[2]) degrees
Else - Actions
-------- Else... --------
-------- Loads the Damage-to-deal --------
Set Variable Set Real[1] = (Load 2 of (Key (Picked unit).) from Hashtable.)
-------- Causes Caster to Damage target --------
Unit - Cause Caster to damage Target , dealing Real[1] damage of attack type Spells and damage type Normal
-------- Plays the Impact animation and instantly destroys it, fixing the leak --------
-------- NOTE 1: Change this to fit your Dummy Missile's model. You don't want that fire would impact in blue slat, do you? --------
Special Effect - Create a special effect attached to the chest (Unexpected type: 'attachpoint') of Target using Abilities\Weapons\LichMissile\LichMissile.mdl
Special Effect - Destroy (Last created special effect)
-------- Clears the Hashtable --------
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable .
-------- Remvoes Dummy Bolt unit from Missiles' group --------
Unit Group - Remove (Picked unit) from Missiles .
-------- Removes Dummy Bolt unit from game --------
Unit - Remove (Picked unit) from the game
-------- Clears the Leaks --------
Custom script: call RemoveLocation(udg_Points[1])
Custom script: call RemoveLocation(udg_Points[2])
Custom script: call RemoveLocation(udg_Points[3])
-------- Checks if there is any bolt left after loop --------
-------- If not, then turns this trigger off --------
If ((Missiles is empty) Equal to True) then do (Turn off (This trigger)) else do (Do nothing)
Glass Cannon Cancel
Events
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order with no target
Conditions
((Triggering unit) is in Casters.) Equal to True
Actions
-------- This trigger is only for making Caster available to move --------
-------- It only works, if unit is ordered to do anything else after starting channeling the spell --------
-------- It simply cuts the effect of Spell, if Caster is issued an order during Channeling --------
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.