library ReviveDeadHeroes initializer Init
globals
private hashtable Hash
endglobals
private function ReviveDeadHeroCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
set udg_Dead_Hero = LoadUnitHandle(Hash, id, 0)
set udg_Dead_Revive_Point = LoadLocationHandle(Hash, id, 1)
call ReviveHeroLoc(udg_Dead_Hero, udg_Dead_Revive_Point, false)
call TriggerExecute(gg_trg_Dead_Hero_Revives)
call RemoveLocation(udg_Dead_Revive_Point)
call DestroyTimer(t)
set t = null
endfunction
function ReviveDeadHero takes nothing returns nothing
local timer t = CreateTimer()
local integer id = GetHandleId(t)
call SaveUnitHandle(Hash, id, 0, udg_Dead_Hero)
call SaveLocationHandle(Hash, id, 1, udg_Dead_Revive_Point)
call TimerStart(t, udg_Dead_Revive_Duration, false, function ReviveDeadHeroCallback)
set t = null
endfunction
private function Init takes nothing returns nothing
set Hash = InitHashtable()
endfunction
endlibrary