Requesting (simplest) damage cancel

Chocobo

White-Flower
Reaction score
409
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>))
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Evasion? How would that help on spell damage?
 

Tukki

is Skeleton Pirate.
Reaction score
29
You mean something like this?

JASS:
constant function GetBlockDamageId takes nothing returns integer
    returns &#039;A000&#039;
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
Reaction score
409
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],&#039;A004&#039;)
    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,&#039;A004&#039;)
    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
Reaction score
249
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!
Reaction score
662
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
Reaction score
409
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}],&#039;A004&#039;)
//call UnitRemoveAbility(udg_DamageUnit[{x}],&#039;A004&#039;)
//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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[50],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[49],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[48],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[47],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[46],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[45],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[44],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[43],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[42],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[41],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[40],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[39],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[38],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[37],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[36],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[35],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[34],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[33],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[32],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[31],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[30],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[29],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[280],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[27],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[26],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[25],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[24],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[23],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[22],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[21],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[20],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[19],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[18],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[17],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[16],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[15],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[14],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[13],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[12],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[11],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[10],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[9],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[8],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[7],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[6],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[5],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[4],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[3],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[2],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[1],&#039;A004&#039;)
    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,&#039;A004&#039;) == 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,&#039;A004&#039;)
        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}],&#039;A004&#039;)
//call UnitRemoveAbility(udg_Hero[{x}],&#039;A004&#039;)
//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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[11],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[10],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[9],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[8],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[7],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[6],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[5],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[4],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[3],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[2],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_Hero[1],&#039;A004&#039;)
    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,&#039;A004&#039;) == 0 then
        set udg_DamageLifed[GetConvertedPlayerId(GetOwningPlayer(u))] = GetUnitStateSwap(UNIT_STATE_LIFE,u)
        call UnitAddAbility(u,&#039;A004&#039;)
        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],&#039;A004&#039;)
    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,&#039;A004&#039;)
    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],&#039;A004&#039;)
    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,&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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],&#039;A004&#039;)
    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,&#039;A004&#039;)
        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
Reaction score
409
(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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[50],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[49],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[48],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[47],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[46],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[45],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[44],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[43],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[42],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[41],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[40],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[39],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[38],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[37],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[36],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[35],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[34],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[33],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[32],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[31],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[30],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[29],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[280],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[27],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[26],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[25],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[24],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[23],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[22],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[21],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[20],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[19],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[18],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[17],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[16],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[15],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[14],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[13],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[12],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[11],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[10],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[9],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[8],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[7],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[6],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[5],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[4],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[3],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[2],&#039;A004&#039;)
    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],&#039;A004&#039;)
    call UnitRemoveAbility(udg_DamageUnit[1],&#039;A004&#039;)
    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,&#039;A004&#039;)
        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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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