|
发表于 2008-7-14 13:03:11
|
显示全部楼层
[codes=jass]
function StoreHuanRaoUnit takes unit HuanRaou, unit u returns nothing
call StoreInteger(udg_cache,I2S(H2I(u)),"HuanRaoNumber",GetStoredInteger(udg_cache,I2S(H2I(u)),"HuanRaoNumber")+1)
call StoreInteger(udg_cache,I2S(H2I(u)),"HuanRao"+I2S(GetStoredInteger(udg_cache,I2S(H2I(u)),"HuanRaoNumber")),H2I(HuanRaou))
endfunction
function UnitDeathTrigger takes unit u returns nothing
local integer i=0
local unit HuanRaou=null
local string s=I2S(H2I(u))
set i=1
loop
exitwhen i>GetStoredInteger(udg_cache,s,"HuanRaoNumber")
set HuanRaou=I2U(GetStoredInteger(udg_cache,s,"HuanRao"+I2S(i)))
call RemoveUnit(HuanRaou)
set HuanRaou=null
set i=i+1
endloop
set i=0
set s=null
endfunction
[/codes]
貌似是这样?
当然如果每个环绕单位都有Trigger的话,还要改。 |
|