Requesting (simplest) damage cancel

Chocobo

White-Flower
I'm requesting a simple way to cancel damage (with damage event).

ex : footman (100 hp) takes 200 dmg -> footman block -> footman remains 100 hp


My current try is a set of 100 "local" triggers which allows to block 100 times in a very short time, but it appears to bug when I come at damages with interval of 0.16s (I use trigger execute count for indexing), the unit just fully heals after taking damage in that time (and never dies).


note : no vjass or anything like that, I just want simple JASS script
(such as call DamageCancel(GetTriggerUnit(),<somedmg>))
 

Tukki

is Skeleton Pirate.
You mean something like this?

JASS:
constant function GetBlockDamageId takes nothing returns integer
    returns 'A000'
endfunction

function GetKiller takes nothing returns unit
    return bj_ghoul[2000]
endfunction

function BlockDamage_Callback takes nothing returns nothing 
    local real max = GetUnitState(bj_ghoul[1337], UNIT_STATE_MAX_LIFE)
    local unit u = bj_ghoul[1337]
    
    set bj_ghoul[2000]=bj_ghoul[1338]
    call SetWidgetLife(u, (GetWidgetLife(u)+bj_randomSubGroupChance-bj_lastTransmissionDuration)*max/(max-bj_meleeNearestMineDist))
    call UnitRemoveAbility(u, GetBlockDamageId())
    call DestroyTimer(bj_lastStartedTimer)
    set bj_ghoul[2000]=null
endfunction

function BlockDamage takes real toBlock returns nothing
    local real a=GetEventDamage()-toBlock
    local real b
    local real damage=a+toBlock
    
    set bj_ghoul[1337] = GetTriggerUnit()
    set bj_ghoul[1338] = GetEventDamageSource()
    set bj_lastStartedTimer = CreateTimer()
    set bj_lastTransmissionDuration = a
    set bj_meleeNearestMineDist = GetUnitState(bj_ghoul[1337], UNIT_STATE_MAX_LIFE)
    
    set b = GetWidgetLife(bj_ghoul[1337]
    call UnitAddAbility(bj_ghoul[1337], GetBlockDamageId())
    call SetWidgetLife(bj_ghoul[1337], GetWidgetLife(bj_ghoul[1337])+damage)
    
    set bj_meleeNearestMineDist = GetUnitState(bj_ghoul[1337], UNIT_STATE_MAX_LIFE)-bj_meleeNearestMineDist
    set bj_randomSubGroupChance = b - GetWidgetLife(bj_ghoul[1337]) + damage
    
    call TimerStart(bj_lastStartedTimer, 0., false, function BlockDamage_Callback)
endfunction


Note: You must create an ability based of 'All', 'All', 'Alf', 'Allx' - basically the life giving item bonuses. And this isn't tested.
 

Chocobo

White-Flower
yes, something like that except it can not block twice a damage at same time (ex: Thunder Clap).


Currently I'm using this (to block a whole type of damage) :

JASS:
//[def]
globals
//[int, udg_DamageInt]
    integer udg_DamageInt //autogenerated
//[unit2, udg_DamageUnit]
    unit array udg_DamageUnit //autogenerated
//[real2, udg_DamageLife]
    real array udg_DamageLife //autogenerated
//[edef]
endglobals

//[f, TimerRestore, n, n]
function TimerRestore takes nothing returns nothing //autogenerated
    local integer exe = GetTriggerExecCount(GetTriggeringTrigger()) - 1
    call UnitRemoveAbility(udg_DamageUnit[exe],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[exe],udg_DamageLife[exe])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
    call DestroyTrigger(GetTriggeringTrigger())
//[ef]
endfunction //autogenerated

//[f, DamageRestore, u u, n]
function DamageRestore takes unit u returns nothing //autogenerated
    local trigger trig = CreateTrigger()
    local timer t = CreateTimer()
    local integer i=0
    set udg_DamageInt = udg_DamageInt+1
    if udg_DamageInt == 100 then //allows a max of 100 (or 99?) instances to run exactly at same time, such as 100 (99) units taking Thunder Clap at same time but not more than 100 (99) units to take damage at same time
        set udg_DamageInt = 1
    endif
    set udg_DamageUnit[udg_DamageInt] = u
    set udg_DamageLife[udg_DamageInt] = GetUnitStateSwap(UNIT_STATE_LIFE, u)
    call TriggerRegisterTimerExpireEvent(trig,t)
    loop
        exitwhen i==udg_DamageInt
        set i=i+1
        call TriggerExecute(trig)
    endloop
    call TriggerAddAction(trig, function TimerRestore)
    call UnitAddAbility(u,'A004')
    call TimerStart(t,0.0,false,null)
    set t=null
    set trig=null
//[ef]
endfunction //autogenerated

//[f, DamageEvent, n, n]
function DamageEvent takes nothing returns nothing //autogenerated
    call DamageRestore(GetTriggerUnit()) //event is added through trigger to a trigger that has this function
    //using function calls because my custom damage type is some pages long and my computer is slow when I have to find something in it
//[ef]
endfunction //autogenerated

//[lf, DamageEvent, Player(0~11), CreateTrigger()]



edit: forgot to say it screws up when it comes to low damage intervals on the SAME unit, and sometimes it fully heals the attacker for unknown reasons (happens very randomly and is not often).
 

Vestras

Retired
I really got no idea here, but just some stuff.. may be irrelevent, but meh.

> GetUnitStateSwap

Why not just GetUnitState?

> call TimerStart(t,0.0,false,null)

Why?

> set t=null

Can bug.
 

Flare

Stops copies me!
Staff member
forgot to say it screws up when it comes to low damage intervals on the SAME unit, and sometimes it fully heals the attacker for unknown reasons (happens very randomly and is not often).
Try adding the unit to a global group in DamageRestore, remove it from the group in TimerRestore, and add a condition in DamageRestore along the lines of
JASS:
if IsUnitInGroup (u, udg_DamageBlockGroup) then
  return
endif

I had an issue like that before, where Bash was registering 2 damage sources, so the damage block took place at HP before damage, and then again at HP after first damage with the Bonus Life ability, so the target was constantly put to full HP :|

Why not just GetUnitState?
All that stuff can be fixed once a working solution has been found

To fire the event
 

Chocobo

White-Flower
I guess I'll use your idea since my new attempt failed a bit.

new attempt : check if unit has survival ability -> if it has, then skip everything, else do all the regular blabla like adding survival ability...
without the if-then-else it appeared the unit sometimes has the survival ability forever..;


not very well triggered, but.. somewhat stupid also.

JASS:
//autogenerated
globals
    unit array udg_DamageUnit
    real array udg_DamageLife
    integer udg_DamageInt
    real array udg_DamageLifed
    unit array udg_Hero
endglobals

//gen(f, TimerRestoreE{x=1~50}, n, n)
//TimerRestoreP{x=1~11}
//call UnitRemoveAbility(udg_DamageUnit[{x}],'A004')
//call UnitRemoveAbility(udg_DamageUnit[{x}],'A004')
//call SetUnitLifeBJ(udg_DamageUnit[{x}],udg_DamageLife[{x}])
//call PauseTimer(GetExpiredTimer())
//call DestroyTimer(GetExpiredTimer())


//autogenerated
function TimerRestoreE50 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[50],'A004')
    call UnitRemoveAbility(udg_DamageUnit[50],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[50],udg_DamageLife[50])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE49 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[49],'A004')
    call UnitRemoveAbility(udg_DamageUnit[49],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[49],udg_DamageLife[49])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE48 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[48],'A004')
    call UnitRemoveAbility(udg_DamageUnit[48],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[48],udg_DamageLife[48])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE47 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[47],'A004')
    call UnitRemoveAbility(udg_DamageUnit[47],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[47],udg_DamageLife[47])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE46 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[46],'A004')
    call UnitRemoveAbility(udg_DamageUnit[46],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[46],udg_DamageLife[46])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE45 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[45],'A004')
    call UnitRemoveAbility(udg_DamageUnit[45],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[45],udg_DamageLife[45])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE44 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[44],'A004')
    call UnitRemoveAbility(udg_DamageUnit[44],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[44],udg_DamageLife[44])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE43 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[43],'A004')
    call UnitRemoveAbility(udg_DamageUnit[43],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[43],udg_DamageLife[43])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE42 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[42],'A004')
    call UnitRemoveAbility(udg_DamageUnit[42],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[42],udg_DamageLife[42])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE41 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[41],'A004')
    call UnitRemoveAbility(udg_DamageUnit[41],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[41],udg_DamageLife[41])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE40 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[40],'A004')
    call UnitRemoveAbility(udg_DamageUnit[40],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[40],udg_DamageLife[40])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE39 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[39],'A004')
    call UnitRemoveAbility(udg_DamageUnit[39],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[39],udg_DamageLife[39])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE38 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[38],'A004')
    call UnitRemoveAbility(udg_DamageUnit[38],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[38],udg_DamageLife[38])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE37 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[37],'A004')
    call UnitRemoveAbility(udg_DamageUnit[37],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[37],udg_DamageLife[37])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE36 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[36],'A004')
    call UnitRemoveAbility(udg_DamageUnit[36],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[36],udg_DamageLife[36])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE35 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[35],'A004')
    call UnitRemoveAbility(udg_DamageUnit[35],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[35],udg_DamageLife[35])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE34 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[34],'A004')
    call UnitRemoveAbility(udg_DamageUnit[34],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[34],udg_DamageLife[34])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE33 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[33],'A004')
    call UnitRemoveAbility(udg_DamageUnit[33],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[33],udg_DamageLife[33])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE32 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[32],'A004')
    call UnitRemoveAbility(udg_DamageUnit[32],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[32],udg_DamageLife[32])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE31 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[31],'A004')
    call UnitRemoveAbility(udg_DamageUnit[31],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[31],udg_DamageLife[31])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE30 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[30],'A004')
    call UnitRemoveAbility(udg_DamageUnit[30],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[30],udg_DamageLife[30])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE29 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[29],'A004')
    call UnitRemoveAbility(udg_DamageUnit[29],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[29],udg_DamageLife[29])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE28 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[280],'A004')
    call UnitRemoveAbility(udg_DamageUnit[280],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[28],udg_DamageLife[28])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE27 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[27],'A004')
    call UnitRemoveAbility(udg_DamageUnit[27],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[27],udg_DamageLife[27])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE26 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[26],'A004')
    call UnitRemoveAbility(udg_DamageUnit[26],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[26],udg_DamageLife[26])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE25 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[25],'A004')
    call UnitRemoveAbility(udg_DamageUnit[25],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[25],udg_DamageLife[25])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE24 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[24],'A004')
    call UnitRemoveAbility(udg_DamageUnit[24],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[24],udg_DamageLife[24])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE23 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[23],'A004')
    call UnitRemoveAbility(udg_DamageUnit[23],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[23],udg_DamageLife[23])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE22 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[22],'A004')
    call UnitRemoveAbility(udg_DamageUnit[22],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[22],udg_DamageLife[22])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE21 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[21],'A004')
    call UnitRemoveAbility(udg_DamageUnit[21],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[21],udg_DamageLife[21])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE20 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[20],'A004')
    call UnitRemoveAbility(udg_DamageUnit[20],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[20],udg_DamageLife[20])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE19 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[19],'A004')
    call UnitRemoveAbility(udg_DamageUnit[19],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[19],udg_DamageLife[19])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE18 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[18],'A004')
    call UnitRemoveAbility(udg_DamageUnit[18],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[18],udg_DamageLife[18])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE17 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[17],'A004')
    call UnitRemoveAbility(udg_DamageUnit[17],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[17],udg_DamageLife[17])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE16 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[16],'A004')
    call UnitRemoveAbility(udg_DamageUnit[16],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[16],udg_DamageLife[16])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE15 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[15],'A004')
    call UnitRemoveAbility(udg_DamageUnit[15],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[15],udg_DamageLife[15])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE14 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[14],'A004')
    call UnitRemoveAbility(udg_DamageUnit[14],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[14],udg_DamageLife[14])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE13 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[13],'A004')
    call UnitRemoveAbility(udg_DamageUnit[13],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[13],udg_DamageLife[13])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE12 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[12],'A004')
    call UnitRemoveAbility(udg_DamageUnit[12],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[12],udg_DamageLife[12])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE11 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[11],'A004')
    call UnitRemoveAbility(udg_DamageUnit[11],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[11],udg_DamageLife[11])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE10 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[10],'A004')
    call UnitRemoveAbility(udg_DamageUnit[10],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[10],udg_DamageLife[10])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE9 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[9],'A004')
    call UnitRemoveAbility(udg_DamageUnit[9],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[9],udg_DamageLife[9])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE8 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[8],'A004')
    call UnitRemoveAbility(udg_DamageUnit[8],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[8],udg_DamageLife[8])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE7 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[7],'A004')
    call UnitRemoveAbility(udg_DamageUnit[7],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[7],udg_DamageLife[7])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE6 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[6],'A004')
    call UnitRemoveAbility(udg_DamageUnit[6],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[6],udg_DamageLife[6])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE5 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[5],'A004')
    call UnitRemoveAbility(udg_DamageUnit[5],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[5],udg_DamageLife[5])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE4 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[4],'A004')
    call UnitRemoveAbility(udg_DamageUnit[4],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[4],udg_DamageLife[4])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE3 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[3],'A004')
    call UnitRemoveAbility(udg_DamageUnit[3],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[3],udg_DamageLife[3])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE2 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[2],'A004')
    call UnitRemoveAbility(udg_DamageUnit[2],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[2],udg_DamageLife[2])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE1 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[1],'A004')
    call UnitRemoveAbility(udg_DamageUnit[1],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[1],udg_DamageLife[1])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function DamageRestore4 takes unit u returns nothing
    local timer t
    if GetUnitAbilityLevel(u,'A004') == 0 then
        set udg_DamageInt = udg_DamageInt+1
        if udg_DamageInt == 50 then
            set udg_DamageInt = 1
        endif
        set udg_DamageLife[udg_DamageInt] = GetUnitStateSwap(UNIT_STATE_LIFE, u)
        set udg_DamageUnit[udg_DamageInt] = u
        call UnitAddAbility(u,'A004')
        set t = CreateTimer()
        if udg_DamageInt==1 then
            call TimerStart(t,0.0,false,function TimerRestoreE1)
        endif
        if udg_DamageInt==2 then
            call TimerStart(t,0.0,false,function TimerRestoreE2)
        endif
        if udg_DamageInt==3 then
            call TimerStart(t,0.0,false,function TimerRestoreE3)
        endif
        if udg_DamageInt==4 then
            call TimerStart(t,0.0,false,function TimerRestoreE4)
        endif
        if udg_DamageInt==5 then
            call TimerStart(t,0.0,false,function TimerRestoreE5)
        endif
        if udg_DamageInt==6 then
            call TimerStart(t,0.0,false,function TimerRestoreE6)
        endif
        if udg_DamageInt==7 then
            call TimerStart(t,0.0,false,function TimerRestoreE7)
        endif
        if udg_DamageInt==8 then
            call TimerStart(t,0.0,false,function TimerRestoreE8)
        endif
        if udg_DamageInt==9 then
            call TimerStart(t,0.0,false,function TimerRestoreE9)
        endif
        if udg_DamageInt==10 then
            call TimerStart(t,0.0,false,function TimerRestoreE10)
        endif
        if udg_DamageInt==11 then
            call TimerStart(t,0.0,false,function TimerRestoreE11)
        endif
        if udg_DamageInt==12 then
            call TimerStart(t,0.0,false,function TimerRestoreE12)
        endif
        if udg_DamageInt==13 then
            call TimerStart(t,0.0,false,function TimerRestoreE13)
        endif
        if udg_DamageInt==14 then
            call TimerStart(t,0.0,false,function TimerRestoreE14)
        endif
        if udg_DamageInt==15 then
            call TimerStart(t,0.0,false,function TimerRestoreE15)
        endif
        if udg_DamageInt==16 then
            call TimerStart(t,0.0,false,function TimerRestoreE16)
        endif
        if udg_DamageInt==17 then
            call TimerStart(t,0.0,false,function TimerRestoreE17)
        endif
        if udg_DamageInt==18 then
            call TimerStart(t,0.0,false,function TimerRestoreE18)
        endif
        if udg_DamageInt==19 then
            call TimerStart(t,0.0,false,function TimerRestoreE19)
        endif
        if udg_DamageInt==20 then
            call TimerStart(t,0.0,false,function TimerRestoreE20)
        endif
        if udg_DamageInt==21 then
            call TimerStart(t,0.0,false,function TimerRestoreE21)
        endif
        if udg_DamageInt==22 then
            call TimerStart(t,0.0,false,function TimerRestoreE22)
        endif
        if udg_DamageInt==23 then
            call TimerStart(t,0.0,false,function TimerRestoreE23)
        endif
        if udg_DamageInt==24 then
            call TimerStart(t,0.0,false,function TimerRestoreE24)
        endif
        if udg_DamageInt==25 then
            call TimerStart(t,0.0,false,function TimerRestoreE25)
        endif
        if udg_DamageInt==26 then
            call TimerStart(t,0.0,false,function TimerRestoreE26)
        endif
        if udg_DamageInt==27 then
            call TimerStart(t,0.0,false,function TimerRestoreE27)
        endif
        if udg_DamageInt==28 then
            call TimerStart(t,0.0,false,function TimerRestoreE28)
        endif
        if udg_DamageInt==29 then
            call TimerStart(t,0.0,false,function TimerRestoreE29)
        endif
        if udg_DamageInt==30 then
            call TimerStart(t,0.0,false,function TimerRestoreE30)
        endif
        if udg_DamageInt==31 then
            call TimerStart(t,0.0,false,function TimerRestoreE31)
        endif
        if udg_DamageInt==32 then
            call TimerStart(t,0.0,false,function TimerRestoreE32)
        endif
        if udg_DamageInt==33 then
            call TimerStart(t,0.0,false,function TimerRestoreE33)
        endif
        if udg_DamageInt==34 then
            call TimerStart(t,0.0,false,function TimerRestoreE34)
        endif
        if udg_DamageInt==35 then
            call TimerStart(t,0.0,false,function TimerRestoreE35)
        endif
        if udg_DamageInt==36 then
            call TimerStart(t,0.0,false,function TimerRestoreE36)
        endif
        if udg_DamageInt==37 then
            call TimerStart(t,0.0,false,function TimerRestoreE37)
        endif
        if udg_DamageInt==38 then
            call TimerStart(t,0.0,false,function TimerRestoreE38)
        endif
        if udg_DamageInt==39 then
            call TimerStart(t,0.0,false,function TimerRestoreE39)
        endif
        if udg_DamageInt==40 then
            call TimerStart(t,0.0,false,function TimerRestoreE40)
        endif
        if udg_DamageInt==41 then
            call TimerStart(t,0.0,false,function TimerRestoreE41)
        endif
        if udg_DamageInt==42 then
            call TimerStart(t,0.0,false,function TimerRestoreE42)
        endif
        if udg_DamageInt==43 then
            call TimerStart(t,0.0,false,function TimerRestoreE43)
        endif
        if udg_DamageInt==44 then
            call TimerStart(t,0.0,false,function TimerRestoreE44)
        endif
        if udg_DamageInt==45 then
            call TimerStart(t,0.0,false,function TimerRestoreE45)
        endif
        if udg_DamageInt==46 then
            call TimerStart(t,0.0,false,function TimerRestoreE46)
        endif
        if udg_DamageInt==47 then
            call TimerStart(t,0.0,false,function TimerRestoreE47)
        endif
        if udg_DamageInt==48 then
            call TimerStart(t,0.0,false,function TimerRestoreE48)
        endif
        if udg_DamageInt==49 then
            call TimerStart(t,0.0,false,function TimerRestoreE49)
        endif
        if udg_DamageInt==50 then
            call TimerStart(t,0.0,false,function TimerRestoreE50)
        endif
        set t=null
    endif
endfunction

//gen(f, TimerRestoreP{x=1~11}, n, n)
//TimerRestoreP{x=1~11}
//call UnitRemoveAbility(udg_Hero[{x}],'A004')
//call UnitRemoveAbility(udg_Hero[{x}],'A004')
//call SetUnitLifeBJ(udg_Hero[{x}],udg_DamageLifed[{x}])
//call PauseTimer(GetExpiredTimer())
//call DestroyTimer(GetExpiredTimer())

//autogenerated
function TimerRestoreP11 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[11],'A004')
    call UnitRemoveAbility(udg_Hero[11],'A004')
    call SetUnitLifeBJ(udg_Hero[11],udg_DamageLifed[11])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP10 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[10],'A004')
    call UnitRemoveAbility(udg_Hero[10],'A004')
    call SetUnitLifeBJ(udg_Hero[10],udg_DamageLifed[10])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP9 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[9],'A004')
    call UnitRemoveAbility(udg_Hero[9],'A004')
    call SetUnitLifeBJ(udg_Hero[9],udg_DamageLifed[9])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP8 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[8],'A004')
    call UnitRemoveAbility(udg_Hero[8],'A004')
    call SetUnitLifeBJ(udg_Hero[8],udg_DamageLifed[8])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP7 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[7],'A004')
    call UnitRemoveAbility(udg_Hero[7],'A004')
    call SetUnitLifeBJ(udg_Hero[7],udg_DamageLifed[7])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP6 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[6],'A004')
    call UnitRemoveAbility(udg_Hero[6],'A004')
    call SetUnitLifeBJ(udg_Hero[6],udg_DamageLifed[6])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP5 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[5],'A004')
    call UnitRemoveAbility(udg_Hero[5],'A004')
    call SetUnitLifeBJ(udg_Hero[5],udg_DamageLifed[5])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP4 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[4],'A004')
    call UnitRemoveAbility(udg_Hero[4],'A004')
    call SetUnitLifeBJ(udg_Hero[4],udg_DamageLifed[4])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP3 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[3],'A004')
    call UnitRemoveAbility(udg_Hero[3],'A004')
    call SetUnitLifeBJ(udg_Hero[3],udg_DamageLifed[3])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP2 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[2],'A004')
    call UnitRemoveAbility(udg_Hero[2],'A004')
    call SetUnitLifeBJ(udg_Hero[2],udg_DamageLifed[2])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP1 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[1],'A004')
    call UnitRemoveAbility(udg_Hero[1],'A004')
    call SetUnitLifeBJ(udg_Hero[1],udg_DamageLifed[1])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function DamageRestore3 takes unit u returns nothing
    local timer t
    local integer i
    if GetUnitAbilityLevel(u,'A004') == 0 then
        set udg_DamageLifed[GetConvertedPlayerId(GetOwningPlayer(u))] = GetUnitStateSwap(UNIT_STATE_LIFE,u)
        call UnitAddAbility(u,'A004')
        set i = GetConvertedPlayerId(GetOwningPlayer(u))
        set t = CreateTimer()
        if i==1 then
            call TimerStart(t,0.0,false,function TimerRestoreP1)
        endif
        if i==2 then
            call TimerStart(t,0.0,false,function TimerRestoreP2)
        endif
        if i==3 then
            call TimerStart(t,0.0,false,function TimerRestoreP3)
        endif
        if i==4 then
            call TimerStart(t,0.0,false,function TimerRestoreP4)
        endif
        if i==5 then
            call TimerStart(t,0.0,false,function TimerRestoreP5)
        endif
        if i==6 then
            call TimerStart(t,0.0,false,function TimerRestoreP6)
        endif
        if i==7 then
            call TimerStart(t,0.0,false,function TimerRestoreP7)
        endif
        if i==8 then
            call TimerStart(t,0.0,false,function TimerRestoreP8)
        endif
        if i==9 then
            call TimerStart(t,0.0,false,function TimerRestoreP9)
        endif
        if i==10 then
            call TimerStart(t,0.0,false,function TimerRestoreP10)
        endif
        if i==11 then
            call TimerStart(t,0.0,false,function TimerRestoreP11)
        endif
    endif
    set t=null
endfunction


//obsolete

function TimerRestore2 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[GetTriggerExecCount(GetTriggeringTrigger()) - 1],'A004')
    call SetUnitLifeBJ(udg_Hero[GetTriggerExecCount(GetTriggeringTrigger()) - 1],udg_DamageLifed[GetTriggerExecCount(GetTriggeringTrigger()) - 1])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

function DamageRestore2 takes unit u returns nothing
    local trigger trig = CreateTrigger()
    local timer t = CreateTimer()
    local integer i=0
    set udg_DamageLifed[GetConvertedPlayerId(GetOwningPlayer(u))] = GetUnitStateSwap(UNIT_STATE_LIFE, u)
    call UnitAddAbility(u,'A004')
    loop
        exitwhen i==GetConvertedPlayerId(GetOwningPlayer(u))
        set i=i+1
        call TriggerExecute(trig)
    endloop
    call TriggerAddAction(trig, function TimerRestore2)
    call TriggerRegisterTimerExpireEvent(trig,t)
    call TimerStart(t,0.0,false,null)
    set t=null
    set trig=null
endfunction


//obsolete

function TimerRestore takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[GetTriggerExecCount(GetTriggeringTrigger()) - 1],'A004')
    call SetUnitLifeBJ(udg_DamageUnit[GetTriggerExecCount(GetTriggeringTrigger()) - 1],udg_DamageLife[GetTriggerExecCount(GetTriggeringTrigger()) - 1])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

function DamageRestore takes unit u returns nothing
    local trigger trig = CreateTrigger()
    local timer t = CreateTimer()
    local integer i=0
    set udg_DamageInt = udg_DamageInt+1
    if udg_DamageInt == 50 then
        set udg_DamageInt = 1
    endif
    set udg_DamageUnit[udg_DamageInt] = u
    set udg_DamageLife[udg_DamageInt] = GetUnitStateSwap(UNIT_STATE_LIFE, u)
    call UnitAddAbility(u,'A004')
    loop
        exitwhen i==udg_DamageInt
        set i=i+1
        call TriggerExecute(trig)
    endloop
    call TriggerAddAction(trig, function TimerRestore)
    call TriggerRegisterTimerExpireEvent(trig,t)
    call TimerStart(t,0.0,false,null)
    set t=null
    set trig=null
endfunction



edit : seems your solution is not working like mines, I should know where to put the unit group add/remove, but perhaps I did something wrong.

JASS:
function TimerRestoreP11 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[11],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[11])
    call SetUnitLifeBJ(udg_Hero[11],udg_DamageLifed[11])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP10 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[10],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[10])
    call SetUnitLifeBJ(udg_Hero[10],udg_DamageLifed[10])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP9 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[9],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[9])
    call SetUnitLifeBJ(udg_Hero[9],udg_DamageLifed[9])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP8 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[8],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[8])
    call SetUnitLifeBJ(udg_Hero[8],udg_DamageLifed[8])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP7 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[7],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[7])
    call SetUnitLifeBJ(udg_Hero[7],udg_DamageLifed[7])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP6 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[6],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[6])
    call SetUnitLifeBJ(udg_Hero[6],udg_DamageLifed[6])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP5 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[5],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[5])
    call SetUnitLifeBJ(udg_Hero[5],udg_DamageLifed[5])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP4 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[4],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[4])
    call SetUnitLifeBJ(udg_Hero[4],udg_DamageLifed[4])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP3 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[3],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[3])
    call SetUnitLifeBJ(udg_Hero[3],udg_DamageLifed[3])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP2 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[2],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[2])
    call SetUnitLifeBJ(udg_Hero[2],udg_DamageLifed[2])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreP1 takes nothing returns nothing
    call UnitRemoveAbility(udg_Hero[1],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_Hero[1])
    call SetUnitLifeBJ(udg_Hero[1],udg_DamageLifed[1])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function DamageRestore3 takes unit u returns nothing
    local timer t
    local integer i
    if IsUnitInGroup(u,udg_DamageGroup) == false then
        call GroupAddUnit(udg_DamageGroup,u)
        set udg_DamageLifed[GetConvertedPlayerId(GetOwningPlayer(u))] = GetUnitStateSwap(UNIT_STATE_LIFE,u)
        call UnitAddAbility(u,'A004')
        set i = GetConvertedPlayerId(GetOwningPlayer(u))
        set t = CreateTimer()
        if i==1 then
            call TimerStart(t,0.0,false,function TimerRestoreP1)
        endif
        if i==2 then
            call TimerStart(t,0.0,false,function TimerRestoreP2)
        endif
        if i==3 then
            call TimerStart(t,0.0,false,function TimerRestoreP3)
        endif
        if i==4 then
            call TimerStart(t,0.0,false,function TimerRestoreP4)
        endif
        if i==5 then
            call TimerStart(t,0.0,false,function TimerRestoreP5)
        endif
        if i==6 then
            call TimerStart(t,0.0,false,function TimerRestoreP6)
        endif
        if i==7 then
            call TimerStart(t,0.0,false,function TimerRestoreP7)
        endif
        if i==8 then
            call TimerStart(t,0.0,false,function TimerRestoreP8)
        endif
        if i==9 then
            call TimerStart(t,0.0,false,function TimerRestoreP9)
        endif
        if i==10 then
            call TimerStart(t,0.0,false,function TimerRestoreP10)
        endif
        if i==11 then
            call TimerStart(t,0.0,false,function TimerRestoreP11)
        endif
    endif
    set t=null
endfunction


The unit sometimes suddently have 1mil hp, then after next hit drops down to the usual amount of hit points (fully healed).
 

Chocobo

White-Flower
(still have a problem)
"The unit sometimes suddently have 1mil hp, then after next hit drops down to the usual amount of hit points (fully healed). "

or sometimes the unit would have the bonus hp but with hit points it should have.
Happens only when I'm using this :

JASS:
function TimerRestoreE50 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[50],'A004')
    call UnitRemoveAbility(udg_DamageUnit[50],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[50])
    call SetUnitLifeBJ(udg_DamageUnit[50],udg_DamageLife[50])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE49 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[49],'A004')
    call UnitRemoveAbility(udg_DamageUnit[49],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[49])
    call SetUnitLifeBJ(udg_DamageUnit[49],udg_DamageLife[49])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE48 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[48],'A004')
    call UnitRemoveAbility(udg_DamageUnit[48],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[48])
    call SetUnitLifeBJ(udg_DamageUnit[48],udg_DamageLife[48])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE47 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[47],'A004')
    call UnitRemoveAbility(udg_DamageUnit[47],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[47])
    call SetUnitLifeBJ(udg_DamageUnit[47],udg_DamageLife[47])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE46 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[46],'A004')
    call UnitRemoveAbility(udg_DamageUnit[46],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[46])
    call SetUnitLifeBJ(udg_DamageUnit[46],udg_DamageLife[46])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE45 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[45],'A004')
    call UnitRemoveAbility(udg_DamageUnit[45],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[45])
    call SetUnitLifeBJ(udg_DamageUnit[45],udg_DamageLife[45])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE44 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[44],'A004')
    call UnitRemoveAbility(udg_DamageUnit[44],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[44])
    call SetUnitLifeBJ(udg_DamageUnit[44],udg_DamageLife[44])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE43 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[43],'A004')
    call UnitRemoveAbility(udg_DamageUnit[43],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[43])
    call SetUnitLifeBJ(udg_DamageUnit[43],udg_DamageLife[43])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE42 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[42],'A004')
    call UnitRemoveAbility(udg_DamageUnit[42],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[42])
    call SetUnitLifeBJ(udg_DamageUnit[42],udg_DamageLife[42])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE41 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[41],'A004')
    call UnitRemoveAbility(udg_DamageUnit[41],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[41])
    call SetUnitLifeBJ(udg_DamageUnit[41],udg_DamageLife[41])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE40 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[40],'A004')
    call UnitRemoveAbility(udg_DamageUnit[40],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[40])
    call SetUnitLifeBJ(udg_DamageUnit[40],udg_DamageLife[40])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE39 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[39],'A004')
    call UnitRemoveAbility(udg_DamageUnit[39],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[39])
    call SetUnitLifeBJ(udg_DamageUnit[39],udg_DamageLife[39])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE38 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[38],'A004')
    call UnitRemoveAbility(udg_DamageUnit[38],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[38])
    call SetUnitLifeBJ(udg_DamageUnit[38],udg_DamageLife[38])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE37 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[37],'A004')
    call UnitRemoveAbility(udg_DamageUnit[37],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[37])
    call SetUnitLifeBJ(udg_DamageUnit[37],udg_DamageLife[37])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE36 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[36],'A004')
    call UnitRemoveAbility(udg_DamageUnit[36],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[36])
    call SetUnitLifeBJ(udg_DamageUnit[36],udg_DamageLife[36])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE35 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[35],'A004')
    call UnitRemoveAbility(udg_DamageUnit[35],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[35])
    call SetUnitLifeBJ(udg_DamageUnit[35],udg_DamageLife[35])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE34 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[34],'A004')
    call UnitRemoveAbility(udg_DamageUnit[34],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[34])
    call SetUnitLifeBJ(udg_DamageUnit[34],udg_DamageLife[34])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE33 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[33],'A004')
    call UnitRemoveAbility(udg_DamageUnit[33],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[33])
    call SetUnitLifeBJ(udg_DamageUnit[33],udg_DamageLife[33])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE32 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[32],'A004')
    call UnitRemoveAbility(udg_DamageUnit[32],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[32])
    call SetUnitLifeBJ(udg_DamageUnit[32],udg_DamageLife[32])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE31 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[31],'A004')
    call UnitRemoveAbility(udg_DamageUnit[31],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[31])
    call SetUnitLifeBJ(udg_DamageUnit[31],udg_DamageLife[31])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE30 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[30],'A004')
    call UnitRemoveAbility(udg_DamageUnit[30],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[30])
    call SetUnitLifeBJ(udg_DamageUnit[30],udg_DamageLife[30])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE29 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[29],'A004')
    call UnitRemoveAbility(udg_DamageUnit[29],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[29])
    call SetUnitLifeBJ(udg_DamageUnit[29],udg_DamageLife[29])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE28 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[280],'A004')
    call UnitRemoveAbility(udg_DamageUnit[280],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[280])
    call SetUnitLifeBJ(udg_DamageUnit[280],udg_DamageLife[280])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE27 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[27],'A004')
    call UnitRemoveAbility(udg_DamageUnit[27],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[27])
    call SetUnitLifeBJ(udg_DamageUnit[27],udg_DamageLife[27])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE26 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[26],'A004')
    call UnitRemoveAbility(udg_DamageUnit[26],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[26])
    call SetUnitLifeBJ(udg_DamageUnit[26],udg_DamageLife[26])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE25 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[25],'A004')
    call UnitRemoveAbility(udg_DamageUnit[25],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[25])
    call SetUnitLifeBJ(udg_DamageUnit[25],udg_DamageLife[25])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE24 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[24],'A004')
    call UnitRemoveAbility(udg_DamageUnit[24],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[24])
    call SetUnitLifeBJ(udg_DamageUnit[24],udg_DamageLife[24])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE23 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[23],'A004')
    call UnitRemoveAbility(udg_DamageUnit[23],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[23])
    call SetUnitLifeBJ(udg_DamageUnit[23],udg_DamageLife[23])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE22 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[22],'A004')
    call UnitRemoveAbility(udg_DamageUnit[22],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[22])
    call SetUnitLifeBJ(udg_DamageUnit[22],udg_DamageLife[22])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE21 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[21],'A004')
    call UnitRemoveAbility(udg_DamageUnit[21],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[21])
    call SetUnitLifeBJ(udg_DamageUnit[21],udg_DamageLife[21])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE20 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[20],'A004')
    call UnitRemoveAbility(udg_DamageUnit[20],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[20])
    call SetUnitLifeBJ(udg_DamageUnit[20],udg_DamageLife[20])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE19 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[19],'A004')
    call UnitRemoveAbility(udg_DamageUnit[19],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[19])
    call SetUnitLifeBJ(udg_DamageUnit[19],udg_DamageLife[19])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE18 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[18],'A004')
    call UnitRemoveAbility(udg_DamageUnit[18],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[18])
    call SetUnitLifeBJ(udg_DamageUnit[18],udg_DamageLife[18])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE17 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[17],'A004')
    call UnitRemoveAbility(udg_DamageUnit[17],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[17])
    call SetUnitLifeBJ(udg_DamageUnit[17],udg_DamageLife[17])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE16 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[16],'A004')
    call UnitRemoveAbility(udg_DamageUnit[16],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[16])
    call SetUnitLifeBJ(udg_DamageUnit[16],udg_DamageLife[16])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE15 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[15],'A004')
    call UnitRemoveAbility(udg_DamageUnit[15],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[15])
    call SetUnitLifeBJ(udg_DamageUnit[15],udg_DamageLife[15])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE14 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[14],'A004')
    call UnitRemoveAbility(udg_DamageUnit[14],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[14])
    call SetUnitLifeBJ(udg_DamageUnit[14],udg_DamageLife[14])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE13 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[13],'A004')
    call UnitRemoveAbility(udg_DamageUnit[13],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[13])
    call SetUnitLifeBJ(udg_DamageUnit[13],udg_DamageLife[13])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE12 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[12],'A004')
    call UnitRemoveAbility(udg_DamageUnit[12],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[12])
    call SetUnitLifeBJ(udg_DamageUnit[12],udg_DamageLife[12])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE11 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[11],'A004')
    call UnitRemoveAbility(udg_DamageUnit[11],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[11])
    call SetUnitLifeBJ(udg_DamageUnit[11],udg_DamageLife[11])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE10 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[10],'A004')
    call UnitRemoveAbility(udg_DamageUnit[10],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[10])
    call SetUnitLifeBJ(udg_DamageUnit[10],udg_DamageLife[10])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE9 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[9],'A004')
    call UnitRemoveAbility(udg_DamageUnit[9],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[9])
    call SetUnitLifeBJ(udg_DamageUnit[9],udg_DamageLife[9])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE8 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[8],'A004')
    call UnitRemoveAbility(udg_DamageUnit[8],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[8])
    call SetUnitLifeBJ(udg_DamageUnit[8],udg_DamageLife[8])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE7 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[7],'A004')
    call UnitRemoveAbility(udg_DamageUnit[7],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[7])
    call SetUnitLifeBJ(udg_DamageUnit[7],udg_DamageLife[7])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE6 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[6],'A004')
    call UnitRemoveAbility(udg_DamageUnit[6],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[6])
    call SetUnitLifeBJ(udg_DamageUnit[6],udg_DamageLife[6])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE5 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[5],'A004')
    call UnitRemoveAbility(udg_DamageUnit[5],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[5])
    call SetUnitLifeBJ(udg_DamageUnit[5],udg_DamageLife[5])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE4 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[4],'A004')
    call UnitRemoveAbility(udg_DamageUnit[4],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[4])
    call SetUnitLifeBJ(udg_DamageUnit[4],udg_DamageLife[4])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE3 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[3],'A004')
    call UnitRemoveAbility(udg_DamageUnit[3],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[3])
    call SetUnitLifeBJ(udg_DamageUnit[3],udg_DamageLife[3])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE2 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[2],'A004')
    call UnitRemoveAbility(udg_DamageUnit[2],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[2])
    call SetUnitLifeBJ(udg_DamageUnit[2],udg_DamageLife[2])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function TimerRestoreE1 takes nothing returns nothing
    call UnitRemoveAbility(udg_DamageUnit[1],'A004')
    call UnitRemoveAbility(udg_DamageUnit[1],'A004')
    call GroupRemoveUnit(udg_DamageGroup,udg_DamageUnit[1])
    call SetUnitLifeBJ(udg_DamageUnit[1],udg_DamageLife[1])
    call PauseTimer(GetExpiredTimer())
    call DestroyTimer(GetExpiredTimer())
endfunction

function DamageRestore4 takes unit u returns nothing
    local timer t
    if IsUnitInGroup(u,udg_DamageGroup) == false then
        call GroupAddUnit(udg_DamageGroup,u)
        set udg_DamageInt = udg_DamageInt+1
        if udg_DamageInt == 50 then
            set udg_DamageInt = 1
        endif
        set udg_DamageLife[udg_DamageInt] = GetUnitStateSwap(UNIT_STATE_LIFE, u)
        set udg_DamageUnit[udg_DamageInt] = u
        call UnitAddAbility(u,'A004')
        set t = CreateTimer()
        if udg_DamageInt==1 then
            call TimerStart(t,0.0,false,function TimerRestoreE1)
        endif
        if udg_DamageInt==2 then
            call TimerStart(t,0.0,false,function TimerRestoreE2)
        endif
        if udg_DamageInt==3 then
            call TimerStart(t,0.0,false,function TimerRestoreE3)
        endif
        if udg_DamageInt==4 then
            call TimerStart(t,0.0,false,function TimerRestoreE4)
        endif
        if udg_DamageInt==5 then
            call TimerStart(t,0.0,false,function TimerRestoreE5)
        endif
        if udg_DamageInt==6 then
            call TimerStart(t,0.0,false,function TimerRestoreE6)
        endif
        if udg_DamageInt==7 then
            call TimerStart(t,0.0,false,function TimerRestoreE7)
        endif
        if udg_DamageInt==8 then
            call TimerStart(t,0.0,false,function TimerRestoreE8)
        endif
        if udg_DamageInt==9 then
            call TimerStart(t,0.0,false,function TimerRestoreE9)
        endif
        if udg_DamageInt==10 then
            call TimerStart(t,0.0,false,function TimerRestoreE10)
        endif
        if udg_DamageInt==11 then
            call TimerStart(t,0.0,false,function TimerRestoreE11)
        endif
        if udg_DamageInt==12 then
            call TimerStart(t,0.0,false,function TimerRestoreE12)
        endif
        if udg_DamageInt==13 then
            call TimerStart(t,0.0,false,function TimerRestoreE13)
        endif
        if udg_DamageInt==14 then
            call TimerStart(t,0.0,false,function TimerRestoreE14)
        endif
        if udg_DamageInt==15 then
            call TimerStart(t,0.0,false,function TimerRestoreE15)
        endif
        if udg_DamageInt==16 then
            call TimerStart(t,0.0,false,function TimerRestoreE16)
        endif
        if udg_DamageInt==17 then
            call TimerStart(t,0.0,false,function TimerRestoreE17)
        endif
        if udg_DamageInt==18 then
            call TimerStart(t,0.0,false,function TimerRestoreE18)
        endif
        if udg_DamageInt==19 then
            call TimerStart(t,0.0,false,function TimerRestoreE19)
        endif
        if udg_DamageInt==20 then
            call TimerStart(t,0.0,false,function TimerRestoreE20)
        endif
        if udg_DamageInt==21 then
            call TimerStart(t,0.0,false,function TimerRestoreE21)
        endif
        if udg_DamageInt==22 then
            call TimerStart(t,0.0,false,function TimerRestoreE22)
        endif
        if udg_DamageInt==23 then
            call TimerStart(t,0.0,false,function TimerRestoreE23)
        endif
        if udg_DamageInt==24 then
            call TimerStart(t,0.0,false,function TimerRestoreE24)
        endif
        if udg_DamageInt==25 then
            call TimerStart(t,0.0,false,function TimerRestoreE25)
        endif
        if udg_DamageInt==26 then
            call TimerStart(t,0.0,false,function TimerRestoreE26)
        endif
        if udg_DamageInt==27 then
            call TimerStart(t,0.0,false,function TimerRestoreE27)
        endif
        if udg_DamageInt==28 then
            call TimerStart(t,0.0,false,function TimerRestoreE28)
        endif
        if udg_DamageInt==29 then
            call TimerStart(t,0.0,false,function TimerRestoreE29)
        endif
        if udg_DamageInt==30 then
            call TimerStart(t,0.0,false,function TimerRestoreE30)
        endif
        if udg_DamageInt==31 then
            call TimerStart(t,0.0,false,function TimerRestoreE31)
        endif
        if udg_DamageInt==32 then
            call TimerStart(t,0.0,false,function TimerRestoreE32)
        endif
        if udg_DamageInt==33 then
            call TimerStart(t,0.0,false,function TimerRestoreE33)
        endif
        if udg_DamageInt==34 then
            call TimerStart(t,0.0,false,function TimerRestoreE34)
        endif
        if udg_DamageInt==35 then
            call TimerStart(t,0.0,false,function TimerRestoreE35)
        endif
        if udg_DamageInt==36 then
            call TimerStart(t,0.0,false,function TimerRestoreE36)
        endif
        if udg_DamageInt==37 then
            call TimerStart(t,0.0,false,function TimerRestoreE37)
        endif
        if udg_DamageInt==38 then
            call TimerStart(t,0.0,false,function TimerRestoreE38)
        endif
        if udg_DamageInt==39 then
            call TimerStart(t,0.0,false,function TimerRestoreE39)
        endif
        if udg_DamageInt==40 then
            call TimerStart(t,0.0,false,function TimerRestoreE40)
        endif
        if udg_DamageInt==41 then
            call TimerStart(t,0.0,false,function TimerRestoreE41)
        endif
        if udg_DamageInt==42 then
            call TimerStart(t,0.0,false,function TimerRestoreE42)
        endif
        if udg_DamageInt==43 then
            call TimerStart(t,0.0,false,function TimerRestoreE43)
        endif
        if udg_DamageInt==44 then
            call TimerStart(t,0.0,false,function TimerRestoreE44)
        endif
        if udg_DamageInt==45 then
            call TimerStart(t,0.0,false,function TimerRestoreE45)
        endif
        if udg_DamageInt==46 then
            call TimerStart(t,0.0,false,function TimerRestoreE46)
        endif
        if udg_DamageInt==47 then
            call TimerStart(t,0.0,false,function TimerRestoreE47)
        endif
        if udg_DamageInt==48 then
            call TimerStart(t,0.0,false,function TimerRestoreE48)
        endif
        if udg_DamageInt==49 then
            call TimerStart(t,0.0,false,function TimerRestoreE49)
        endif
        if udg_DamageInt==50 then
            call TimerStart(t,0.0,false,function TimerRestoreE50)
        endif
        set t=null
    endif
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Jesus4Lyf Jesus4Lyf:
    Hmm, how to summarize... Moved to the USA and got married. Became a professional software engineer and solution lead. Learning Godot for game dev. :)
  • jonas jonas:
    So you are pursuing game dev as a hobby? What industry is your dayjob in?
  • jonas jonas:
    FAANG?
  • Jesus4Lyf Jesus4Lyf:
    Not quite FAANG, less pay for a less hours/stress. Yeah, game dev as a hobby.
  • jonas jonas:
    makes sense. Do we have a hobby game dev subforum to showcase some work?
  • Blackveiled Blackveiled:
    Happy Thursday
    +1
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    TGIF!
  • The Helper The Helper:
    hey tom_mai please do not archive anymore news
  • Ghan Ghan:
    AMD Ryzen 7000 next week :D
    +1
  • The Helper The Helper:
    noice!
  • tom_mai78101 tom_mai78101:
    "hey tom_mai please do not archive anymore news" ----> Got it. What should we do with the "News Archive" subforum?
  • The Helper The Helper:
    I think leave it for real old news that cannot be sorted the reason we had it in the first place was a server issue that we do not have anymore. I don't want to get rid of the archive just not put anything in it for now until we figure it out more
  • The Helper The Helper:
    The side chat has nothing on the discord. it is not possible but the biggest thing on my wish list right now is a sidechat channel on the disord that hooks up to this...
  • Ghan Ghan:
    I've been selected for the Diablo IV beta.
    +1
  • Ghan Ghan:
    Woo!
    +1
  • The Helper The Helper:
    that is so cool
  • V-SNES V-SNES:
    Eh just noticed the new discord section on the side. Looks great!
    +1
  • Blackveiled Blackveiled:
    :( feels bad I can't ever get selected for any beta I sign up for. It's annoying as heck.
    +1
  • The Helper The Helper:
    Hello mgarcia! Happy Monday everyone!
  • The Helper The Helper:
    Happy Tuesday! :)

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top