|
发表于 2008-8-12 14:11:06
|
显示全部楼层
那就是你没改对,我按我前面说的测试了下,完全通过
[codes=jass]function H2I takes handle h returns integer
return h
return 0
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function I2TD takes integer i returns timerdialog
return i
return null
endfunction
function GameCache takes nothing returns gamecache
if udg_GC == null then
call FlushGameCache(InitGameCache("map.w3v"))
set udg_GC = InitGameCache("map.w3v")
endif
return udg_GC
endfunction
function tiaojian takes nothing returns boolean
if (not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) == true )) then
return false
endif
return true
endfunction
function jishiqi takes nothing returns nothing
local unit u =I2U(GetStoredInteger(GameCache(),I2S(H2I(GetExpiredTimer())),"TriggerUnit"))
local timerdialog td = I2TD(GetStoredInteger(GameCache(),I2S(H2I(GetExpiredTimer())),"TimerDialog"))
call ReviveHeroLoc(u,GetRectCenter(GetPlayableMapRect()), false )
call DestroyTimerDialog(td)
call FlushStoredMission(GameCache(), I2S(H2I(GetExpiredTimer())))
set u = null
set td = null
endfunction
function fh takes nothing returns nothing
local unit u = GetTriggerUnit()
local timer t = CreateTimer()
local timerdialog td = CreateTimerDialog(t)
call TimerDialogSetTitle(td, GetPlayerName(GetOwningPlayer(GetTriggerUnit())) + "复活时间:" )
call StoreInteger(GameCache(),I2S(H2I(t)),"TriggerUnit",H2I(GetTriggerUnit()))
call StoreInteger(GameCache(),I2S(H2I(t)),"TimerDialog",H2I(td))
call TimerStart(t,180,false,function jishiqi)
call TimerDialogDisplay(td,true)
set u = null
set t = null
set td = null
endfunction
//===========================================================================
function InitTrig_rh takes nothing returns nothing
local trigger tri = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(tri,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(tri,Condition(function tiaojian))
call TriggerAddAction(tri,function fh)
set tri = null
endfunction[/codes] |
|