|
发表于 2008-8-1 17:13:37
|
显示全部楼层
[jass]function Trig_hero_1_dies_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
endfunction
function B takes nothing returns nothing
local timer T = GetExpiredTimer()
local timerdialog TG =I2TG(GetStoredInteger(udg_cache,I2S(H2I(T)),"TG"))
local unit U = I2U(GetStoredInteger(udg_cache,I2S(H2I(T)),"Unit"))
local player P =GetOwningPlayer(U)
call FlushStoredMission(udg_cache,I2S(H2I(T)))
call DestroyTimer( T )
call DestroyTimerDialog( TG )
if (P == Player(0) or P == Player(1) or P == Player(2))then
call ReviveHero( U, 0, 0, true )//队伍1复活坐标
endif
if (P == Player(3) or P == Player(4) or P == Player(5))then
call ReviveHero( U, 0, 0, true )//队伍2复活坐标
endif
if (P == Player(6) or P == Player(7) or P == Player(8))then
call ReviveHero( U, 0, 0, true )//队伍3复活坐标
endif
if (P == Player(9) or P == Player(10) or P == Player(11))then
call ReviveHero( U, 0, 0, true )//队伍4复活坐标
endif
if (GetLocalPlayer()==P)then
call PanCameraTo(0,0)
endif
set U =null
set T =null
set TG =null
endfunction
function Trig_hero_1_dies_Actions takes nothing returns nothing
local timer T =CreateTimer()
local timerdialog TG = CreateTimerDialog(T)
call StoreInteger(udg_cache,I2S(H2I(T)),"Unit",H2I(GetTriggerUnit()))
call StoreInteger(udg_cache,I2S(H2I(T)),"TG",H2I(TG))
call TimerStart(T,5,false,function B)//其中5为复活时间
set T =null
call TimerDialogSetTitle(TG,"复活时间")
if (GetLocalPlayer()==GetOwningPlayer(GetTriggerUnit()))then
call TimerDialogDisplay(TG,true)
endif
set TG =null
endfunction[/jass] |
|