|
发表于 2008-8-14 16:21:38
|
显示全部楼层
额,不知道自己写了些什么,那这个是怎么写出来的?
[codes=jass]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"))
if (not(IsUnitAlly(u,Player(11)) == true)) then
call ReviveHeroLoc(u,GetRectCenter(udg_a),false)
else
call ReviveHeroLoc(u,GetRectCenter(udg_b),false)
endif
call SetUnitManaPercentBJ(u,100)
set u = 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(u))
call StoreInteger(GameCache(),I2S(H2I(u)),"Timer",H2I(t))
call StoreInteger(GameCache(),I2S(H2I(u)),"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 Revive takes nothing returns nothing
local timer t = I2T(GetStoredInteger(GameCache(),I2S(H2I(GetTriggerUnit())),"Timer"))
local timerdialog td = I2TD(GetStoredInteger(GameCache(),I2S(H2I(GetTriggerUnit())),"TimerDialog"))
call DestroyTimerDialog(td)
call PauseTimer(t)
call DestroyTimer(t)
call FlushStoredMission(GameCache(), I2S(H2I(GetTriggerUnit())))
call FlushStoredMission(GameCache(), I2S(H2I(t)))
set t = null
set td = null
endfunction
function InitTrig_rh takes nothing returns nothing
local trigger tri0 = CreateTrigger()
local trigger tri1 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(tri0,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(tri0,Condition(function tiaojian))
call TriggerAddAction(tri0,function fh)
call TriggerRegisterAnyUnitEventBJ(tri1,EVENT_PLAYER_HERO_REVIVE_FINISH)
call TriggerAddCondition(tri1,Condition(function tiaojian))
call TriggerAddAction(tri1,function Revive)
set tri0 = null
set tri1 = null
endfunction[/codes] |
|