Moderator
M
Moderator
13:56, 31st Dec 2009
TriggerHappy:
Seemed fine and leakless.
TriggerHappy:
Seemed fine and leakless.
SB Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Spirit Bladestorm

Actions


-------- Sets Values --------


Set SB_Caster = (Triggering unit)


Set SB_Location = (Position of SB_Caster)


Set SB_Level = (Level of Spirit Bladestorm for SB_Caster)


Set SB_Range = ((Real(SB_Level)) x 300.00)


Set SB_Time = ((Real(SB_Level)) x 3.00)


Set SB_Damage = (SB_Level x 100)


Unit - Create 1 Blademaster Spirit for (Owner of SB_Caster) at SB_Location facing (Facing of SB_Caster) degrees


Set SB_Spirit = (Last created unit)


Unit - Turn collision for SB_Caster Off


-------- Plays Spinning Animation --------


Animation - Play SB_Spirit's attack walk stand spin animation


Animation - Change SB_Spirit's vertex coloring to (100.00%, 100.00%, 100.00%) with 65.00% transparency


-------- Stores Values --------


Hashtable - Save SB_Range as (Key range) of (Key (Triggering unit)) in SB_Hashtable


Hashtable - Save Handle OfSB_Location as (Key location) of (Key (Triggering unit)) in SB_Hashtable


Hashtable - Save SB_Time as (Key time) of (Key (Triggering unit)) in SB_Hashtable


Hashtable - Save SB_Damage as (Key damage) of (Key (Triggering unit)) in SB_Hashtable


Hashtable - Save Handle OfSB_Spirit as (Key spirit) of (Key (Triggering unit)) in SB_Hashtable


Hashtable - Save Handle OfSB_Caster as (Key caster) of (Key (Triggering unit)) in SB_Hashtable


-------- Adds to Unit Group --------


Unit Group - Add SB_Caster to SB_Spinners
SB Drag

Events


Time - Every 0.04 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in SB_Spinners and do (Actions)



Loop - Actions




-------- Loads Values --------




Set SB_Location = (Position of (Picked unit))




Set SB_Damage = (Load (Key damage) of (Key (Picked unit)) from SB_Hashtable)




Set SB_Range = (Load (Key range) of (Key (Picked unit)) from SB_Hashtable)




Set SB_DragUnits = (Units within SB_Range of SB_Location)




Set SB_Time = (Load (Key time) of (Key (Picked unit)) from SB_Hashtable)




Set SB_DamagedUnits = (Units within 200.00 of SB_Location)




Set SB_Spirit = (Load (Key spirit) of (Key (Picked unit)) in SB_Hashtable)




Set SB_Caster = (Load (Key caster) of (Key (Picked unit)) in SB_Hashtable)




-------- Moves Spirit --------




Unit - Move SB_Spirit instantly to (Position of (Picked unit)), facing (Facing of (Picked unit)) degrees




-------- Checks for Time Remaning --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






SB_Time Greater than 0.00





Then - Actions






-------- Sets Time Left --------






Hashtable - Save (SB_Time - 0.04) as (Key time) of (Key (Picked unit)) in (Last created hashtable)






Unit Group - Pick every unit in SB_DamagedUnits and do (Actions)







Loop - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










((Picked unit) belongs to an enemy of (Owner of SB_Caster)) Equal to True










((Picked unit) is A structure) Equal to False










((Picked unit) is Magic Immune) Equal to False









Then - Actions










-------- Damages Units --------










Unit - Cause SB_Caster to damage (Picked unit), dealing ((Real(SB_Damage)) / 25.00) damage of attack type Normal and damage type Normal









Else - Actions






Unit Group - Pick every unit in SB_DragUnits and do (Actions)







Loop - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










((Picked unit) belongs to an enemy of (Owner of SB_Caster)) Equal to True










((Picked unit) is A structure) Equal to False










((Picked unit) is Magic Immune) Equal to False









Then - Actions










-------- Sets Values --------










Set SB_Angle = (Angle from SB_Location to (Position of (Picked unit)))










Set SB_Distance = (Distance between SB_Location and (Position of (Picked unit)))










-------- Calculates Next Point --------










Set SB_MoveLoc = (SB_Location offset by (SB_Distance - 4.00) towards (SB_Angle + 4.00) degrees)










-------- Moves Unit --------










Unit - Move (Picked unit) instantly to SB_MoveLoc










-------- Creates a Special Effect --------










Special Effect - Create a special effect at SB_MoveLoc using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl










Special Effect - Destroy (Last created special effect)









Else - Actions





Else - Actions






Unit - Turn collision for SB_Caster On






-------- Removes Spirit --------






Unit - Remove SB_Spirit from the game






Unit Group - Remove SB_Caster from SB_Spinners






-------- Clears Hashtable --------






Hashtable - Clear all child hashtables of child (Key (Picked unit)) in SB_Hashtable




-------- Removes Leaks --------




Custom script: call DestroyGroup (udg_SB_DamagedUnits)




Custom script: call DestroyGroup (udg_SB_DragUnits)




Custom script: call RemoveLocation (udg_SB_Location)




Custom script: call RemoveLocation (udg_SB_MoveLoc)