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!
This is my Life Leak spell.
It is a combination of Rupture and Soul Steal, which are known from DotA.
Everything was made using hashtables.
When after casting this spell, your target starts losing it's life while moving and transfering the lost life to you.
Lasts up to 8 seconds or until Caster wanders 800 range away from target.
If you use it in your map, give me credits.
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 Caster = (Triggering unit)
Set Target = (Target unit of ability being cast)
-------- Sets the position of Caster and Target. --------
Set Points[1] = (Position of Caster)
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 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 OfCaster as 2 of (Key (Last created unit)) in Hashtable
Hashtable - Save Handle OfTarget as 3 of (Key (Last created unit)) in Hashtable
-------- Stores the Lightning effect. --------
Hashtable - Save Handle OfLightning 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 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 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 (Trigger - 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 Caster = (Load 2 of (Key (Picked unit)) in Hashtable)
Set Target = (Load 3 of (Key (Picked unit)) in Hashtable)
Set Lightning = (Load 4 of (Key (Picked unit)) in Hashtable)
-------- Sets current locations of the Caster and Target. --------
Set Points[1] = (Position of Caster)
Set Points[2] = (Position of Target)
-------- Stores the location of Target during last loop or during cast of the spell. --------
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 Real[1] = (Distance between Points[2] and Points[3])
-------- Stores the rate of transfering to the Variable. --------
Set Real[2] = (Load 1 of (Key (Picked unit)) from Hashtable)
-------- Counts the health that would be transfered. --------
Set Real[1] = (Real[1] x Real[2])
-------- Counts distance between Caster and Target. --------
Set Real[2] = (Distance between Points[1] and Points[2])
-------- Loads the Duration left of the spell. --------
Set Real[3] = (Load 0 of (Key (Picked unit)) from Hashtable)
-------- Reduces the duration of spell by 0.05 (The tick between loops). --------
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 Real[1] = ((Real[0] + (Current flying height of Caster)) + 45.00)
Custom script: set udg_Real[0] = GetLocationZ(udg_Points[2])
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. --------
I'm a little confused. Is your spell basicly a Life Drain where you can move at the same time? or does it drain life when the enemy is moving, since you refer to Rupture?
I'm a little confused. Is your spell basicly a Life Drain where you can move at the same time? or does it drain life when the enemy is moving, since you refer to Rupture?
I couldn't find a single thing wrong with this spell, for GUI users that is.
Everything is cleaned up appropriately, and there are no limitations on the insatiability due to the use of your dummy-unit that is created so that a unique handle-ID can be used to store the components of the spell. Very well done.
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.