I need a trigger that detects a unit is damaged
I know there is a trigger like that but it contains non-existing functions or are they just old or are they for WEU only anyway I need another one
Im trying to create myself these theys like a trigger that registers events for another trigger for everyunit enters the map but Im confused with this
So you help me and I get your help
EDIT:
Anyway this is my current progress I can easly do it with 1-2 global variables but I dont want anyglobal variable for a spell
Anyway I quite know this doesnt work I thought you can make a working version
I know there is a trigger like that but it contains non-existing functions or are they just old or are they for WEU only anyway I need another one
Im trying to create myself these theys like a trigger that registers events for another trigger for everyunit enters the map but Im confused with this
So you help me and I get your help
EDIT:
JASS:
function actions takes nothing returns nothing
call KillUnit(GetTriggerUnit())
endfunction
function unitadder takes unit dmgedunit,trigger which returns nothing
call TriggerRegisterUnitEvent(which,dmgedunit,EVENT_UNIT_DAMAGED)
endfunction
function InitTrig_another takes nothing returns nothing
local trigger unitdmg
call TriggerAddAction(unitdmg,function actions)
endfunction
function unitdmgfun takes nothing returns nothing
local trigger unitdmg
set unitdmg = CreateTrigger()
call unitadder(GetTriggerUnit(),unitdmg)
endfunction
function InitTrig_gtunits takes nothing returns nothing
local trigger gtunits
set gtunits = CreateTrigger()
call TriggerAddAction(gtunits,function unitdmgfun)
call TriggerRegisterAnyUnitEventBJ(gtunits,EVENT_PLAYER_HERO_REVIVE_FINISH)
call TriggerRegisterEnterRectSimple(gtunits,GetEntireMapRect())
endfunction
function rmunits takes nothing returns nothing
call DoNothing()
endfunction
Anyway I quite know this doesnt work I thought you can make a working version
Last edited: