|
楼主 |
发表于 2008-7-31 17:37:50
|
显示全部楼层
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 i2l takes integer i returns location
return i
return null
endfunction
function i2td takes integer i returns timerdialog
return i
return null
endfunction
//复活
function re takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = i2u(GetStoredInteger(udg_GG,"revive",I2S(h2i(t))))
if IsPlayerAlly(GetOwningPlayer(u), Player(5)) then
call ReviveHero(u,-813.5,-2079.4,true) //这个是玩家6的盟友,玩家5索引必须减掉1,玩家1红色,就是0,玩家6的盟友英雄复活在-813.5 -2079.4
else
call ReviveHero(u,-813.5,-2079.4,true) //这个是玩家12的盟友,玩家12的盟友英雄复活在-813.5 -2079.4
endif
call DestroyTimerDialog(i2td(GetStoredInteger(udg_GG,"td",I2S(h2i(t)))))
call FlushStoredInteger(udg_GG,"revive",I2S(h2i(t)))
call FlushStoredInteger(udg_GG,"td",I2S(h2i(t)))
call DestroyTimer(t)
set t = null
set u = null
endfunction
下面是触发器函数
事件:任意单位死亡
条件:(触发单位)是(英雄)=TUER
动作:
local unit u = GetTriggerUnit()
local timer t = CreateTimer()
local real r = (4*I2R(GetUnitLevel(u)))
local timerdialog td = CreateTimerDialogBJ( t, GetUnitName(u) )
call StoreInteger(udg_GG,"revive",I2S(h2i(t)),h2i(u))
call StoreInteger(udg_GG,"td",I2S(h2i(t)),h2i(td))
call TimerStart(t,r,false,function re)
set u = null
set t = null |
|