Lightstalker
New Member
- Reaction score
- 55
A trigger made to revive Heroes. Only needs to be MPI.
(Event is added by another trigger.)
(Event is added by another trigger.)
JASS:
scope Revive initializer Init
globals
constant trigger REVIVE = CreateTrigger()
endglobals
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer pid = GetPlayerId(p)
local timer t = CreateTimer()
local timerdialog td = CreateTimerDialog(t)
local real startx = GetStartLocationX(pid)
local real starty = GetStartLocationY(pid)
if GetLocalPlayer() == p then
call TimerStart(t, 15.0, false, null)
call TimerDialogSetTitle(td, GetHeroProperName(u))
call TimerDialogDisplay(td, true)
call PanCameraToTimed(startx, starty, 0.0)
endif
call TriggerSleepAction(15.0)
call ReviveHero(u, startx, starty, true)
call DestroyTimerDialog(td)
call DestroyTimer(t)
set u = null
endfunction
private function Init takes nothing returns nothing
call TriggerAddAction(REVIVE, function Actions )
endfunction
endscope