|
楼主 |
发表于 2008-8-4 14:26:33
|
显示全部楼层
还有这个 复活后 计时器删不了
[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 )
if (P == Player(0) or P == Player(1) or P == Player(2) or P == Player(3) or P == Player(4))then
call ReviveHero( U, -2537.5, -3044.7, true )//队伍1复活坐标
endif
if (P == Player(5) or P == Player(6) or P == Player(7) or P == Player(8) or P == Player(9))then
call ReviveHero( U, 4471.3, 2320.1, true )//队伍2复活坐标
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,3+2*GetHeroLevel(GetTriggerUnit()),false,function B)//其中3+2*GetHeroLevel为复活时间
set T =null
call TimerDialogSetTitle(TG,"复活等待时间")
if (GetLocalPlayer()==GetOwningPlayer(GetTriggerUnit()))then
call TimerDialogDisplay(TG,true)
endif
set TG =null
endfunction
//===========================================================================
function InitTrig_hero_1_dies takes nothing returns nothing
set gg_trg_hero_1_dies = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_hero_1_dies, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_hero_1_dies, Condition( function Trig_hero_1_dies_Conditions ) )
call TriggerAddAction( gg_trg_hero_1_dies, function Trig_hero_1_dies_Actions )
endfunction
[/jass] |
|