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
Life Leak v0.02.w3x
Variables
Initialization
Initialization
Restoration
Spell
Life Leak Cast
Life Leak Loop
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
Hashtable
hashtable
No
LifeLeaks
group
No
Lightning
lightning
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 1000000000.00 seconds the text: To restore your hero, press ESC.
Restoration
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Unit - Set life of Cardinal 0000 <gen> to 100 %
Life Leak Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Life Leak
Actions
-------- Sets the Caster and the Target, as the Variable names say. --------
Set Variable Set Caster = (Triggering unit)
Set Variable Set Target = (Target unit of ability being cast)
-------- Sets the position of Caster and Target. --------
Set Variable Set Points[1] = (Position of Caster)
Set Variable Set Points[2] = (Position of Target)
-------- Creates a lightning and stores it into variable --------
-------- It starts where it finishes to avoid the messing --------
Lightning - Create a Drain Life lightning effect from source Points[1] to target Points[1]
Set Variable Set Lightning = (Last created lightning effect)
-------- Creates an Invisible, untargetable dummy unit to allow the stacking of effect --------
Unit - Create 1 . Dummy Unit for (Owner of Caster) at Points[1] facing Default building facing degrees
-------- Stores the maximum duration (in seconds) of the spell --------
Hashtable - Save 8.00 as 0 of (Key (Last created unit).) in Hashtable .
-------- Stores the rate at which Target would lose health by moving. --------
-------- This amount is divided by 100 to store the Percentage amount. --------
-------- 10 of 100 units is 10% of 100 units moved; 15 of 100 - 15%; etc. --------
Hashtable - Save ((5.00 + (5.00 x (Real((Level of Life Leak for Caster))))) / 100.00) as 1 of (Key (Last created unit).) in Hashtable .
-------- Stores the caster and target. --------
Hashtable - Save Handle Of Caster as 2 of (Key (Last created unit).) in Hashtable .
Hashtable - Save Handle Of Target as 3 of (Key (Last created unit).) in Hashtable .
-------- Stores the Lightning effect. --------
Hashtable - Save Handle Of Lightning as 4 of (Key (Last created unit).) in Hashtable .
-------- Stores the current location of Target, to start leaking if it would move. --------
Hashtable - Save (X of Points[2]) as 5 of (Key (Last created unit).) in Hashtable .
Hashtable - Save (Y of Points[2]) as 6 of (Key (Last created unit).) in Hashtable .
-------- Creates and stores overhead effects. --------
Special Effect - Create a special effect attached to the overhead (Unexpected type: 'attachpoint') of Caster using Abilities\Spells\Other\Drain\DrainTarget.mdl
Hashtable - Save Handle Of (Last created special effect) as 7 of (Key (Last created unit).) in Hashtable .
Special Effect - Create a special effect attached to the overhead (Unexpected type: 'attachpoint') of Target using Abilities\Spells\Other\Drain\DrainCaster.mdl
Hashtable - Save Handle Of (Last created special effect) as 8 of (Key (Last created unit).) in Hashtable .
-------- Checks if currently there was any instance of spell in effect. --------
-------- If there isn't, turns the loop trigger. --------
If ((LifeLeaks is empty) Equal to True) then do (Turn on Life_Leak_Loop <gen>) else do (Do nothing)
-------- Adds the Dummy unit to the Dummy Group. --------
Unit Group - Add (Last created unit) to LifeLeaks
-------- Clears leaks. --------
Custom script: call RemoveLocation(udg_Points[1])
Custom script: call RemoveLocation(udg_Points[2])
Life Leak Loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in LifeLeaks and do (Actions)
Loop - Actions
-------- Stores Caster,Target and Lightning effect into variables for faster trigger-work. --------
Set Variable Set Caster = (Load 2 of (Key (Picked unit).) in Hashtable.)
Set Variable Set Target = (Load 3 of (Key (Picked unit).) in Hashtable.)
Set Variable Set Lightning = (Load 4 of (Key (Picked unit).) in Hashtable.)
-------- Sets current locations of the Caster and Target. --------
Set Variable Set Points[1] = (Position of Caster)
Set Variable Set Points[2] = (Position of Target)
-------- Stores the location of Target during last loop or during cast of the spell. --------
Set Variable Set Points[3] = (Point((Load 5 of (Key (Picked unit).) from Hashtable.), (Load 6 of (Key (Picked unit).) from Hashtable.)))
-------- Counts the distance between Current position of Target and position during last Loop. --------
Set Variable Set Real[1] = (Distance between Points[2] and Points[3])
-------- Stores the rate of transfering to the Variable. --------
Set Variable Set Real[2] = (Load 1 of (Key (Picked unit).) from Hashtable.)
-------- Counts the health that would be transfered. --------
Set Variable Set Real[1] = (Real[1] x Real[2])
-------- Counts distance between Caster and Target. --------
Set Variable Set Real[2] = (Distance between Points[1] and Points[2])
-------- Loads the Duration left of the spell. --------
Set Variable Set Real[3] = (Load 0 of (Key (Picked unit).) from Hashtable.)
-------- Reduces the duration of spell by 0.05 (The tick between loops). --------
Set Variable Set Real[3] = (Real[3] - 0.05)
-------- If Duration is equals to 0 or distance between Caster and target is greater than 800 or anyone is dead... --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Real[2] Greater than or equal to 800.00
Real[3] Equal to 0.00
(Caster is dead) Equal to True
(Target is dead) Equal to True
Then - Actions
-------- Destroys Lightning Effect. --------
Lightning - Destroy Lightning
-------- Destroys overhead effects. --------
Special Effect - Destroy (Load 7 of (Key (Picked unit).) in Hashtable.)
Special Effect - Destroy (Load 8 of (Key (Picked unit).) in Hashtable.)
-------- Clears hashtable, removes dummy unit form Dummy group and removes the dummy unit. --------
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable .
Unit Group - Remove (Picked unit) from LifeLeaks .
Unit - Remove (Picked unit) from the game
Else - Actions
-------- Else... --------
-------- Heals target for Counted amount. --------
Unit - Set life of Caster to ((Life of Caster) + Real[1])
-------- Deals PURE damage to the Target. --------
Unit - Cause Caster to damage Target , dealing Real[1] damage of attack type Hero and damage type Divine
-------- Sets the Flying height of target and caster and adds 45+ Z of their current locations. --------
-------- It should be enough for lightning to reach the chest or whatever of caster and target. --------
Custom script: set udg_Real[0] = GetLocationZ(udg_Points[1])
Set Variable Set Real[1] = ((Real[0] + (Current flying height of Caster)) + 45.00)
Custom script: set udg_Real[0] = GetLocationZ(udg_Points[2])
Set Variable Set Real[2] = ((Real[0] + (Current flying height of Target)) + 45.00)
-------- Moves lightning effect. --------
-------- It's custom script to make it not to drag by ground. --------
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.