Moderator
M
Moderator
Death Grip 1.06b | Reviewed by Maker | 23rd Jul 2013 | ||||
| APPROVED | ||||
|
|
DG Configuration

Events


Map initialization

Conditions

Actions


-------- Creating the Hashtable --------


Hashtable - Create a hashtable


Set HashGrip = (Last created hashtable)


-------- Set the Total Damage for each level of the ability --------


Set DG_Damage[1] = 0.15


Set DG_Damage[2] = 0.30


Set DG_Damage[3] = 0.45


-------- Casting Time --------


Set DG_CastingTime = 1.35


-------- Set Effects to be used --------


Set DG_TargetEffect = Abilities\Spells\Undead\DarkSummoning\DarkSummonMissile.mdl


Set DG_Attach_Target = chest


-------- Set Collision of the Caster --------


Set DG_Collision = 125.00


-------- Set the used Ability --------


Set DGAbility = Death Grip
DG Target

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to DGAbility

Actions


-------- Turn on the loop --------


Trigger - Turn on DG Loop <gen>


-------- Setting variables --------


Set DG_Caster = (Triggering unit)


Set DG_Target = (Target unit of ability being cast)


Custom script: set udg_DGTargetKey = GetHandleId(udg_DG_Target)


Set DGPoint1 = (Position of DG_Caster)


Set DGPoint2 = (Position of DG_Target)


Set DG_Angle = (Angle from DGPoint2 to DGPoint1)


Set DG_Timer = DG_CastingTime


Set DG_CurrentDist = (((Distance between DGPoint1 and DGPoint2) - DG_Collision) x (0.03 / DG_Timer))


Set DG_Life = (Life of DG_Target)


Set DGDamageLoop = ((DG_Life x DG_Damage[(Level of DGAbility for DG_Caster)]) / (DG_CastingTime / 0.03))


-------- Check if Unit is already with Special Effect, if not, create the special effect --------


If ((3 is stored as a Handle of DGTargetKey in HashGrip) Equal to True) then do (-------- Do Nothing --------) else do (Special Effect - Create a special effect attached to the DG_Attach_Target of DG_Target using DG_TargetEffect)


-------- Removing Leaks --------


Custom script: call RemoveLocation(udg_DGPoint1)


Custom script: call RemoveLocation(udg_DGPoint2)


-------- Saving values in the Hashtable --------


Hashtable - Save DG_Angle as 0 of DGTargetKey in HashGrip


Hashtable - Save DG_CurrentDist as 1 of DGTargetKey in HashGrip


Hashtable - Save DG_Timer as 2 of DGTargetKey in HashGrip


Hashtable - Save Handle Of(Last created special effect) as 3 of DGTargetKey in HashGrip


Hashtable - Save DGDamageLoop as 4 of DGTargetKey in HashGrip


Hashtable - Save Handle OfDG_Caster as 5 of DGTargetKey in HashGrip


-------- Add the target to the unit group --------


Unit Group - Add DG_Target to DG_Group
DG Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


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



Loop - Actions




Set DG_Target = (Picked unit)




Custom script: set udg_DGTargetKey = GetHandleId(udg_DG_Target)




-------- Load values from the Hashtable --------




Set DG_Timer = (Load 2 of DGTargetKey from HashGrip)




-------- ----------------------- --------




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





If - Conditions






DG_Timer Greater than 0.00






(Life of (Load 5 of DGTargetKey in HashGrip)) Greater than 0.00





Then - Actions






-------- Moving unit --------






Set DGPoint1 = (Position of DG_Target)






Set DGPoint2 = (DGPoint1 offset by (Load 1 of DGTargetKey from HashGrip) towards (Load 0 of DGTargetKey from HashGrip) degrees)






Unit - Move DG_Target instantly to DGPoint2






Custom script: call RemoveLocation(udg_DGPoint1)






Custom script: call RemoveLocation(udg_DGPoint2)






-------- Decrease Timer for the movement of the unit --------






Hashtable - Save (DG_Timer - 0.03) as 2 of DGTargetKey in HashGrip






-------- Apply the damage on the unit --------






Unit - Set life of DG_Target to ((Life of DG_Target) - (Load 4 of DGTargetKey from HashGrip))





Else - Actions






-------- When the spell is done, clear the values... --------






Special Effect - Destroy (Load 3 of DGTargetKey in HashGrip)






Hashtable - Clear all child hashtables of child DGTargetKey in HashGrip






Unit Group - Remove DG_Target from DG_Group






-------- This actions checks if the unit group is empty and turns off the trigger if that case --------






If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
-------- Set the used Ability --------
Set DGAbility = Death Grip