- Joined
- Sep 9, 2007
- Messages
- 6,759
JASS:
globals
unit array fallenhero
timer array fallentimer
endglobals
function TimerExp_Actions takes nothing returns nothing
local timer r = GetExpiredTimer()
local trigger t = GetTriggeringTrigger()
local unit u
local real x
local real y
local integer i = 0
local integer i2 = 10
local integer j
loop
exitwhen i > i2
set i = i + 1
if fallentimer[i] == r then
set j = i
endif
endloop
set u = fallenhero[j]
set x = GetUnitX(u)
set y = GetUnitY(u)
call ReviveHero(u,x,y,false)
call DestroyTrigger(t)
endfunction
function RevStart_Actions takes nothing returns nothing
local trigger t
local timer r = CreateTimer()
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer i = GetPlayerId(p)
set fallenhero[i] = u
set fallentimer[i] = r
set t = CreateTrigger()
call TriggerRegisterTimerExpireEvent(t,r)
call TriggerAddAction( t, function TimerExp_Actions )
call TimerStart(r,10.00,false,null)
endfunction
function RevStart_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
endfunction
//===========================================================================
function InitTrig_RevStart takes nothing returns nothing
local trigger gg_trg_RevStart = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_RevStart, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition(gg_trg_RevStart, Condition( function RevStart_Conditions))
call TriggerAddAction( gg_trg_RevStart, function RevStart_Actions )
endfunction