Configurables

Events


Map initialization

Conditions

Actions


Hashtable - Create a hashtable


Set Hashtable = (Last created hashtable)


-------- Variables --------


-------- Special Effect on point --------


Set Art = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl


-------- Special Effect on unit --------


Set TargetArt = Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl


-------- Area Of Effect --------


-------- Make sure this corresponds with AoE in object editor --------


Set AreaOfEffect[1] = 300.00


Set AreaOfEffect[2] = 300.00


Set AreaOfEffect[3] = 300.00


-------- Duration --------


Set Duration[1] = 20.00


Set Duration[2] = 20.00


Set Duration[3] = 20.00


-------- Damage --------


-------- This is dealt to all to all units in the AoE --------


Set Damage[1] = 80.00


Set Damage[2] = 100.00


Set Damage[3] = 120.00


-------- Amount of Strength stolen --------


-------- Only applied to heroes --------


Set StrengthSapAmount[1] = 3


Set StrengthSapAmount[2] = 3


Set StrengthSapAmount[3] = 3
Drain

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Drain

Actions


Set Caster = (Triggering unit)


Set Level = (Level of Drain for Caster)


Set Point1 = (Target point of ability being cast)


Special Effect - Create a special effect at Point1 using Art


Special Effect - Destroy (Last created special effect)


Custom script: set bj_wantDestroyGroup = true


Unit Group - Pick every unit in (Units within AreaOfEffect[Level] of Point1 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True)))) and do (Actions)



Loop - Actions




Set Target = (Picked unit)




Special Effect - Create a special effect attached to the origin of Target using TargetArt




Special Effect - Destroy (Last created special effect)




Unit - Cause Caster to damage Target, dealing Damage[Level] damage of attack type Spells and damage type Normal




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





If - Conditions






(Target is A Hero) Equal to True





Then - Actions






Hero - Modify Strength of Caster: Add StrengthSapAmount[Level]






Hero - Modify Strength of Target: Subtract StrengthSapAmount[Level]






Unit - Create 1 Dummy for (Owner of Caster) at Point1 facing Default building facing degrees






Set Dummy = (Last created unit)






Unit Group - Add Dummy to DrainGroup






Custom script: set udg_Integer = GetHandleId(udg_Dummy)






Hashtable - Save Duration[Level] as 1 of Integer in Hashtable






Hashtable - Save Handle OfCaster as 2 of Integer in Hashtable






Hashtable - Save Handle OfTarget as 3 of Integer in Hashtable






Hashtable - Save Level as 4 of Integer in Hashtable






Trigger - Turn on Drain Loop <gen>





Else - Actions


Custom script: call RemoveLocation(udg_Point1)
Drain Loop

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


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



Loop - Actions




Set Dummy = (Picked unit)




Custom script: set udg_Integer = GetHandleId(udg_Dummy)




Set Real = (Load 1 of Integer from Hashtable)




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





If - Conditions






Real Greater than 0.00





Then - Actions






Hashtable - Save (Real - 1.00) as 1 of Integer in Hashtable





Else - Actions






Set Level = (Load 4 of Integer from Hashtable)






Hero - Modify Strength of (Load 2 of Integer in Hashtable): Subtract StrengthSapAmount[Level]






Hero - Modify Strength of (Load 3 of Integer in Hashtable): Add StrengthSapAmount[Level]






Unit Group - Remove Dummy from DrainGroup






Unit - Remove Dummy from the game






Hashtable - Clear all child hashtables of child Integer in Hashtable






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







If - Conditions








(Number of units in DrainGroup) Equal to 0







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions