Istar made this awesome revival trigger for me.
Can anyone help me out with a revival timer? It'd be appreciated, and you'll be in credits with istar and get +rep.
Can anyone help me out with a revival timer? It'd be appreciated, and you'll be in credits with istar and get +rep.
JASS:
function Trig_rivive_Conditions takes nothing returns boolean
return ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) //this is the condition of trigger, checking if the dying unit is a hero
endfunction
function Trig_rivive_Actions takes nothing returns nothing
local unit dying = GetTriggerUnit()
local player owner = GetOwningPlayer(dying)
local integer id = GetPlayerId(owner)
if (id == 1) or (id == 2) or (id==3) or (id==4) or (id==5) then
call TriggerSleepAction( ( 4 * GetUnitLevel(dying) ) ) //wait for unit's level multiply by 4
call ReviveHeroLoc( dying, GetRectCenter(gg_rct_Region_001), true ) //this means if the owner is player 1 to 5, revive in region 1
endif
if (id==7) or (id==8) or (id==9) or (id==10) or (id==11) then
call TriggerSleepAction( ( 4* GetUnitLevel(dying) ) )
call ReviveHeroLoc( dying, GetRectCenter(gg_rct_Region_002), true ) //the same, if owner is player 7 to 11, revive the hero at region 2 instead
endif
set dying = null
set owner = null
endfunction
//===========================================================================
function InitTrig_rivive takes nothing returns nothing
set gg_trg_rivive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_rivive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_rivive, Condition( function Trig_rivive_Conditions ) )
call TriggerAddAction( gg_trg_rivive, function Trig_rivive_Actions )
endfunction