function UnitDeath_p12 takes unit u returns nothing
local player p=Player(PLAYER_NEUTRAL_AGGRESSIVE)
local integer i=GetUnitUserData(u)
call TriggerSleepAction(60.00)
set u=CreateUnit(p,utypeA[i],utypeAx[i],utypeAy[i],utypeAz[i])
call SetUnitUserData(u,i)
set u=null
endfunction
function CreateUnitP12_AS takes nothing returns nothing
call UnitDeath_p12(GetDyingUnit())
endfunction
function CreateUnitP12 takes nothing returns nothing
local integer i=0
local player p=Player(PLAYER_NEUTRAL_AGGRESSIVE)
local unit u
local trigger t1
local trigger t2
set UChomeA=CreateUnit(p,'nnfm',-7200.0,-4448.0,270.000)
set t1=CreateTrigger()
loop
exitwhen i>10
set u=CreateUnit(p,utypeA[i],utypeAx[i],utypeAy[i],utypeAz[i])
call SetUnitUserData(u,i)
call TriggerRegisterUnitEvent(t1,u,EVENT_UNIT_DEATH)
set i=i+1
endloop
call TriggerAddAction(t1,function CreateUnitP12_AS)
set u=null
endfunction
这代码应该没问题吧?
有疑问的地方是call UnitDeath_p12(GetDyingUnit())这里
如果有2个单位死亡,那么function UnitDeath_p12 takes unit u returns nothing
会在60秒后再2个单位各自的位置创建单位吗?
local player p=Player(PLAYER_NEUTRAL_AGGRESSIVE)
local integer i=GetUnitUserData(u)
call TriggerSleepAction(60.00)
set u=CreateUnit(p,utypeA[i],utypeAx[i],utypeAy[i],utypeAz[i])
call SetUnitUserData(u,i)
set u=null
endfunction
function CreateUnitP12_AS takes nothing returns nothing
call UnitDeath_p12(GetDyingUnit())
endfunction
function CreateUnitP12 takes nothing returns nothing
local integer i=0
local player p=Player(PLAYER_NEUTRAL_AGGRESSIVE)
local unit u
local trigger t1
local trigger t2
set UChomeA=CreateUnit(p,'nnfm',-7200.0,-4448.0,270.000)
set t1=CreateTrigger()
loop
exitwhen i>10
set u=CreateUnit(p,utypeA[i],utypeAx[i],utypeAy[i],utypeAz[i])
call SetUnitUserData(u,i)
call TriggerRegisterUnitEvent(t1,u,EVENT_UNIT_DEATH)
set i=i+1
endloop
call TriggerAddAction(t1,function CreateUnitP12_AS)
set u=null
endfunction
这代码应该没问题吧?
有疑问的地方是call UnitDeath_p12(GetDyingUnit())这里
如果有2个单位死亡,那么function UnitDeath_p12 takes unit u returns nothing
会在60秒后再2个单位各自的位置创建单位吗?












