I dont know what happened... i was trying to use damage engine to make a make-shift charge that teleports the attacker to the unit with damage but the damage engine doesnt even detect it. As far as i can tell, i only made one change, putting a debug trigger before where it sets the variables and that doesnt show when i use the spell on an enemy.
My damage engine (bribe's)
My trigger that runs at 0 damage
My damage engine (bribe's)
-
Damage Engine
-

Events
-


Game - UnitIndexEvent becomes Equal to 1.00
-


Game - UnitIndexEvent becomes Equal to 2.00
-
-

Conditions
-

Actions
-


-------- Copy the Cheat Death Ability from Object Editor into your map and set the following variable respectively: --------
-


Set DamageBlockingAbility = Cheat Death Ability (+500,000)
-


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


Set DamageTypeSpell = 1
-


Set DamageTypeDOT = 2
-


Set DamageTypeRanged = 3
-


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


Custom script: call ExecuteFunc("InitDamageEvent")
-


Custom script: endfunction
-


Custom script:
-


Custom script: function DmgEvFilter takes nothing returns boolean
-


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


-------- The next conditions let you filter out unwanted units. By default, units with Locust will not pass the check. --------
-


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


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



If - Conditions
-




(TempUnit is A structure) Equal to False
-
-



Then - Actions
-




Custom script: return true
-
-



Else - Actions
-
-


Custom script: return false
-


Custom script: endfunction
-


Custom script:
-


Custom script: function DmgEvRemoveAbilities takes nothing returns nothing
-


Custom script: local real r
-


Custom script: loop
-


Set DmgEvN = (DmgEvN - 1)
-


Custom script: set r = GetWidgetLife(udg_DmgEvStack[udg_DmgEvN])
-


Unit - Remove DamageBlockingAbility from DmgEvStack[DmgEvN]
-


Custom script: call SetWidgetLife(udg_DmgEvStack[udg_DmgEvN], r)
-


Set DmgEvStack[DmgEvN] = No unit
-


Custom script: exitwhen udg_DmgEvN == 0
-


Custom script: endloop
-


Custom script: endfunction
-


Custom script:
-


Custom script: function DmgEvSetVars takes nothing returns nothing
-


Game - Display to (All players) the text: fffffffffffffffff
-


Set DamageEventAmount = (Damage taken)
-


Set DamageEventSource = (Damage source)
-


Set DamageEventTarget = (Triggering unit)
-


Set DamageType = Unknown
-


Custom script: endfunction
-


Custom script:
-


Custom script: function FireDmgEv takes nothing returns nothing
-


Custom script: local boolean b = GetUnitAbilityLevel(udg_DamageEventTarget, udg_DamageBlockingAbility) > 0
-


Custom script: local real life = 0
-


Custom script: local real pain = 0
-


Custom script: if b then
-


Custom script: set life = GetWidgetLife(udg_DamageEventTarget)
-


Unit - Remove DamageBlockingAbility from DamageEventTarget
-


Custom script: call SetWidgetLife(udg_DamageEventTarget, life)
-


Custom script: set pain = GetWidgetLife(udg_DamageEventTarget)
-


Custom script: endif
-


Set DamageEventPrevAmt = DamageEventAmount
-


Set DamageEventExplodesUnit = False
-


Set DamageEventOverride = False
-


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



If - Conditions
-




DamageEventAmount Equal to 0.00
-
-



Then - Actions
-




Set DamageEvent = 2.00
-
-



Else - Actions
-




Set DamageModifierEvent = 1.00
-




Set DamageEvent = 1.00
-
-
-


Custom script: if b then
-


Unit - Add DamageBlockingAbility to DamageEventTarget
-


Custom script: call SetWidgetLife(udg_DamageEventTarget, life + GetWidgetLife(udg_DamageEventTarget) - pain)
-


Custom script: endif
-


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



If - Conditions
-




DamageEventAmount Not equal to DamageEventPrevAmt
-
-



Then - Actions
-




Set DmgEvLife = ((Life of DamageEventTarget) + (DamageEventPrevAmt - DamageEventAmount))
-




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





If - Conditions
-






DamageEventAmount Greater than DamageEventPrevAmt
-
-





Then - Actions
-






Unit - Set life of DamageEventTarget to (Max(0.41, DmgEvLife))
-






Custom script: if udg_DmgEvLife <= .405 then
-






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







If - Conditions
-








DamageEventExplodesUnit Equal to True
-
-







Then - Actions
-








Unit - Make DamageEventTarget Explode on death
-
-







Else - Actions
-
-






Trigger - Turn off DamageEventTrigger
-






Custom script: call UnitDamageTarget(udg_DamageEventSource, udg_DamageEventTarget, 999, false, false, null, null, null)
-






Trigger - Turn on DamageEventTrigger
-






Custom script: endif
-
-





Else - Actions
-






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







If - Conditions
-








(Max life of DamageEventTarget) Less than DmgEvLife
-
-







Then - Actions
-








Unit - Add DamageBlockingAbility to DamageEventTarget
-








Set DmgEvStack[DmgEvN] = DamageEventTarget
-








Set DmgEvN = (DmgEvN + 1)
-








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









If - Conditions
-










DmgEvN Equal to 1
-
-









Then - Actions
-










Custom script: call TimerStart(udg_DmgEvTimer, 0, false, function DmgEvRemoveAbilities)
-
-









Else - Actions
-
-
-







Else - Actions
-
-






Unit - Set life of DamageEventTarget to DmgEvLife
-
-
-
-



Else - Actions
-
-


Custom script: endfunction
-


Custom script:
-


Custom script: function FireRecursiveDmgEv takes nothing returns nothing
-


Custom script: local real d = udg_DamageEventAmount
-


Custom script: local unit s = udg_DamageEventSource
-


Custom script: local unit t = udg_DamageEventTarget
-


Custom script: local integer ptype = udg_DmgTypPrev
-


Custom script: local boolean explode = udg_DamageEventExplodesUnit
-


Custom script: local boolean override = udg_DamageEventOverride
-


Custom script: local real prev = udg_DamageEventPrevAmt
-


Custom script: call DmgEvSetVars()
-


Custom script: if udg_DamageEventTarget != t or udg_DamageEventSource != s or udg_DamageEventAmount != d or udg_DamageEventType != ptype then
-


Set DamageEvent = 0.00
-


Set DamageModifierEvent = 0.00
-


Custom script: call FireDmgEv()
-


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


-------- Delete the next three lines to disable the in-game recursion crash warnings --------
-


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


Custom script: else
-


Cinematic - Clear the screen of text messages for (All players)
-


Game - Display to (All players) for 999.00 seconds the text: WARNING: Recursion ...
-


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


Custom script: endif
-


Custom script: set udg_DamageEventOverride = override
-


Custom script: set udg_DamageEventExplodesUnit = explode
-


Custom script: set udg_DamageEventPrevAmt = prev
-


Custom script: set udg_DmgTypPrev = ptype
-


Custom script: set udg_DamageEventAmount = d
-


Custom script: set udg_DamageEventSource = s
-


Custom script: set udg_DamageEventTarget = t
-


Custom script: set s = null
-


Custom script: set t = null
-


Custom script: endfunction
-


Custom script:
-


Custom script: function OnDmgEv takes nothing returns boolean
-


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



If - Conditions
-




DamageEvent Equal to 0.00
-
-



Then - Actions
-




Set DmgTypPrev = DamageEventType
-




Custom script: call DmgEvSetVars()
-




Custom script: call FireDmgEv()
-




Set DamageModifierEvent = 0.00
-




Set DamageEvent = 0.00
-




Set DamageEventType = 0
-
-



Else - Actions
-




Custom script: call FireRecursiveDmgEv()
-
-
-


Custom script: return false
-


Custom script: endfunction
-


Custom script:
-


Custom script: function CreateDmgEv takes nothing returns nothing
-


Custom script: set udg_DamageEventTrigger = CreateTrigger()
-


Custom script: call TriggerAddCondition(udg_DamageEventTrigger, Filter(function OnDmgEv))
-


Custom script: endfunction
-


Custom script:
-


Custom script: function SetupDmgEv takes nothing returns boolean
-


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



If - Conditions
-




UnitIndexEvent Equal to 1.00
-
-



Then - Actions
-




Set TempUnit = UDexUnits[UDex]
-




Custom script: if GetUnitAbilityLevel(udg_TempUnit, 'Aloc') == 0 and DmgEvFilter() then
-




Set UnitDamageRegistered[UDex] = True
-




Trigger - Add to DamageEventTrigger the event (Unit - TempUnit Takes damage)
-




Custom script: endif
-
-



Else - Actions
-




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





If - Conditions
-






UnitDamageRegistered[UDex] Equal to True
-
-





Then - Actions
-






Set UnitDamageRegistered[UDex] = False
-






Set DamageEventsWasted = (DamageEventsWasted + 1)
-






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







If - Conditions
-








DamageEventsWasted Equal to 15
-
-







Then - Actions
-








Set DamageEventsWasted = 0
-








Custom script: call DestroyTrigger(udg_DamageEventTrigger)
-








Custom script: call CreateDmgEv()
-








Set UDex = UDexNext[0]
-








Custom script: loop
-








Custom script: exitwhen udg_UDex == 0
-








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









If - Conditions
-










UnitDamageRegistered[UDex] Equal to True
-
-









Then - Actions
-










Trigger - Add to DamageEventTrigger the event (Unit - UDexUnits[UDex] Takes damage)
-
-









Else - Actions
-
-








Set UDex = UDexNext[UDex]
-








Custom script: endloop
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-


Custom script: return false
-


Custom script: endfunction
-


Custom script:
-


Custom script: function InitDamageEvent takes nothing returns nothing
-


Custom script: call CreateDmgEv()
-


Custom script: call TriggerAddCondition(GetTriggeringTrigger(), Filter(function SetupDmgEv))
-


Set UnitIndexerEnabled = False
-


Custom script: set udg_TempUnit = CreateUnit(Player(15), 'uloc', 0, 0, 0)
-


Set UnitIndexerEnabled = True
-


Unit - Add DamageBlockingAbility to TempUnit
-


Unit - Remove TempUnit from the game
-


Trigger - Run (This trigger) (checking conditions)
-
-
-
Set Damage Copy
-

Events
-


Game - DamageEvent becomes Equal to 2.00
-
-

Conditions
-

Actions
-


Custom script: local unit u = udg_DamageEventSource
-


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



If - Conditions
-




(DamageEventTarget has buff Stunned (Pause) (Charging Strike)) Equal to True
-
-



Then - Actions
-




Set TempLoc = (Position of DamageEventTarget)
-




Set DamageEventAmount = (((Real((Strength of DamageEventSource (Include bonuses)))) x 3.00) x (Real((Level of Charging Strike (|cffffcc00C|r) for DamageEventSource))))
-




Unit - Move DamageEventSource instantly to TempLoc
-




Custom script: call RemoveLocation(udg_TempLoc)
-
-



Else - Actions
-




Game - Display to (All players) the text: g
-
-
-
-







