|
[codes=jass]
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2TMD takes integer i returns timerdialog
return i
return null
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function returnhero takes nothing returns nothing
local integer alive=GetStoredInteger(udg_Gc,I2S(H2I(GetExpiredTimer())),"timerdialog")
local integer hero= GetStoredInteger(udg_Gc,I2S(H2I(GetExpiredTimer())),"hero")
if(hero==null)then
call DisplayTextToPlayer(Player(0),0,0,"空的")
endif
call DisplayTextToPlayer(Player(0),0,0,"也运行了")
call ReviveHeroLoc( I2U(hero), GetRectCenter(gg_rct______________000), false )
call DestroyTimer(GetExpiredTimer())
call DestroyTimerDialog(I2TMD(alive))
call FlushStoredMission(udg_Gc, I2S(H2I(GetExpiredTimer())))
call FlushStoredInteger(udg_Gc, I2S(alive), "timerdialog")
call FlushStoredInteger(udg_Gc, I2S(alive), "hero")
endfunction
function trg_relive_Actions takes nothing returns nothing
local timerdialog hero
call DisplayTextToPlayer(Player(0),0,0,"运行了")
set bj_lastStartedTimer =CreateTimer()
set hero=CreateTimerDialog(bj_lastStartedTimer )
call TimerDialogDisplay(hero, true )
call StoreInteger(udg_Gc,I2S(H2I(bj_lastStartedTimer)),"timerdialog",H2I(hero))
call StoreInteger(udg_Gc,I2S(H2I(bj_lastStartedTimer)),"hero",H2I(GetDyingUnit()))
call TimerStart(bj_lastStartedTimer ,6,false,function returnhero)
endfunction
function trg_relive_Conditions takes nothing returns boolean
if(IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true)then
return true
endif
return false
endfunction
function InitTrig_relive takes nothing returns nothing
set gg_trg_relive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_relive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_relive, Condition( function trg_relive_Conditions ) )
call TriggerAddAction( gg_trg_relive, function trg_relive_Actions )
endfunction
[/codes]
我打死我的英雄打死N个都复活 ,我打死电脑的 他怎么就不复活呢 |
|