Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
IMO a dds is a good choice to heal for the actual damaged caused (since the basic damage can be mitigated), unless your system detects thatIf you trigger it... there is no need to use a DDS.
If you just save the amount of life just before you deal the damage and calculate the difference between the original health and new health, you have the most accurate damage calculation that exists.
Triggering the drain itself without DDS is the best IMO.
A DDS is meant to detect damage and do some stuff on the exact same moment.
In this case, you already know the moment so using a DDS can only become worse.
Set LD_Time[LD_MaxIndex] = YourDurationHere
Life Drain Init

Events


Map initialization

Conditions

Actions


-------- ========= Life Drain ========= --------


Set LD_Damage[1] = 10000.00


Set LD_Damage[2] = 20000.00


Set LD_Damage[3] = 30000.00


Set LD_Damage[4] = 40000.00
Life Drain

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Life Drain

Actions


-------- ============================================ --------


Set LD_MaxIndex = (LD_MaxIndex + 1)


Set LD_TrigUnit[LD_MaxIndex] = (Triggering unit)


Set LD_TargetUnit[LD_MaxIndex] = (Target unit of ability being cast)


Set LD_SpellLvl[LD_MaxIndex] = (Level of Life Drain for LD_TrigUnit[LD_MaxIndex])


Set LD_Time[LD_MaxIndex] = 340


Set LD_DamageDeal[LD_MaxIndex] = LD_Damage[LD_SpellLvl[LD_MaxIndex]]


-------- ============================================ --------


Set TempPoint = (Position of LD_TrigUnit[LD_MaxIndex])


Set TempPoint2 = (Position of LD_TargetUnit[LD_MaxIndex])


-------- ============================================ --------


Special Effect - Create a special effect attached to the overhead of LD_TrigUnit[LD_MaxIndex] using Abilities\Spells\Other\Drain\DrainCaster.mdl


Set LD_SpecialEffect1[LD_MaxIndex] = (Last created special effect)


-------- ============================================ --------


Special Effect - Create a special effect attached to the overhead of LD_TargetUnit[LD_MaxIndex] using Abilities\Spells\Other\Drain\DrainTarget.mdl


Set LD_SpecialEffect2[LD_MaxIndex] = (Last created special effect)


-------- ============================================ --------


Lightning - Create a Drain Life lightning effect from source TempPoint to target TempPoint2


Set LD_Lightning[LD_MaxIndex] = (Last created lightning effect)


-------- ============================================ --------


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



If - Conditions




LD_MaxIndex Equal to 1



Then - Actions




Trigger - Turn on Life Drain Loop <gen>



Else - Actions


-------- ============================================ --------


Custom script: call RemoveLocation(udg_TempPoint)


Custom script: call RemoveLocation(udg_TempPoint2)


Custom script: set udg_TempPoint = null


Custom script: set udg_TempPoint2 = null


-------- ============================================ --------
Life Drain Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


Custom script: local integer zOffset = 120


-------- ============================================ --------


For each (Integer LD_Loop) from 1 to LD_MaxIndex, do (Actions)



Loop - Actions




-------- ============================================ --------




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





If - Conditions






Or - Any (Conditions) are true







Conditions








LD_Time[LD_Loop] Equal to 0








(Life of LD_TargetUnit[LD_Loop]) Less than 0.41





Then - Actions






-------- ============================================ --------






Lightning - Destroy LD_Lightning[LD_Loop]






-------- ============================================ --------






Special Effect - Destroy LD_SpecialEffect1[LD_Loop]






Special Effect - Destroy LD_SpecialEffect2[LD_Loop]






-------- ============================================ --------






Set LD_TrigUnit[LD_Loop] = LD_TrigUnit[LD_MaxIndex]






Set LD_TrigUnit[LD_MaxIndex] = No unit






Set LD_TargetUnit[LD_Loop] = LD_TargetUnit[LD_MaxIndex]






Set LD_TargetUnit[LD_MaxIndex] = No unit






Set LD_DamageDeal[LD_Loop] = LD_DamageDeal[LD_MaxIndex]






Set LD_Lightning[LD_Loop] = LD_Lightning[LD_MaxIndex]






Set LD_SpecialEffect1[LD_Loop] = LD_SpecialEffect1[LD_MaxIndex]






Set LD_SpecialEffect2[LD_Loop] = LD_SpecialEffect2[LD_MaxIndex]






Set LD_SpellLvl[LD_Loop] = LD_SpellLvl[LD_MaxIndex]






Set LD_Time[LD_Loop] = LD_Time[LD_MaxIndex]






Set LD_MaxIndex = (LD_MaxIndex - 1)






Set LD_Loop = (LD_Loop - 1)






-------- ============================================ --------





Else - Actions






-------- ============================================ --------






Set LD_Time[LD_Loop] = (LD_Time[LD_Loop] - 1)






Set TempPoint = (Position of LD_TrigUnit[LD_Loop])






Set TempPoint2 = (Position of LD_TargetUnit[LD_Loop])






-------- ============================================ --------






Custom script: call MoveLightningEx(udg_LD_Lightning[udg_LD_Loop], true, GetLocationX(udg_TempPoint), GetLocationY(udg_TempPoint), GetLocationZ(udg_TempPoint)+zOffset, GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), GetLocationZ(udg_TempPoint2)+zOffset)






-------- ============================================ --------






Unit - Set life of LD_TrigUnit[LD_Loop] to ((Life of LD_TrigUnit[LD_Loop]) + (LD_Damage[LD_Loop] x 0.03))






Unit - Cause LD_TrigUnit[LD_Loop] to damage LD_TargetUnit[LD_Loop], dealing (LD_DamageDeal[LD_Loop] x 0.03) damage of attack type Spells and damage type Normal






-------- ============================================ --------




-------- ============================================ --------


-------- ============================================ --------


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



If - Conditions




LD_MaxIndex Equal to 0



Then - Actions




Trigger - Turn off (This trigger)



Else - Actions


-------- ============================================ --------
@BD
Target runs out of range
caster gains a new order and thus interrupting his current order
caster is silenced by any effect
target or caster is dispelled
Caster dies
When using lfh's dds, shouldnt you use his custom action?
just a few things to consider...
