|
楼主 |
发表于 2010-3-25 10:35:49
|
显示全部楼层
//创建
function Spawn takes nothing returns nothing
local integer i = 1
local trigger t
local real x
local real y
set t = CreateTrigger()
call TriggerAddAction(t,function ParasiteSporeDeath)
set i=1
loop
exitwhen i>24
set x = GetRandomReal(GetRectMinX(udg_PlayerSpawnBoundary),GetRectMaxX(udg_PlayerSpawnBoundary))
set y = GetRandomReal(GetRectMinY(udg_PlayerSpawnBoundary),GetRectMaxY(udg_PlayerSpawnBoundary))
if IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) and not(IsTerrainPathable(x,y,PATHING_TYPE_AMPHIBIOUSPATHING)) then
call DestroyEffect(AddSpecialEffect( "Objects\\\\Spawnmodels\\\\Naga\\\\NagaDeath\\\\NagaDeath.mdl", x, y ))
else
call DestroyEffect(AddSpecialEffect("Objects\\\\Spawnmodels\\\\Undead\\\\ImpaleTargetDust\\\\ImpaleTargetDust.mdl",x,y))
endif
set udg_ParasiteSpore = CreateUnit(Player(13),'e00C',x,y,0.0)
call TriggerRegisterUnitEvent(t,udg_ParasiteSpore,EVENT_UNIT_DEATH)
set udg_Spores=udg_Spores+1
call TriggerSleepAction(0.)
set i=i+1
endloop
set t = null
endfunction
//死亡统计
function ParasiteSporeDeath takes nothing returns nothing
local integer i = 1
local unit u = GetTriggerUnit()
loop
exitwhen i>24
if u==udg_ParasiteSpore then
set udg_ParasiteSpore = null
exitwhen 1==1
endif
set i=i+1
endloop
set udg_Spores=udg_Spores-1
if udg_Spores<=0 then
//call DestroyTrigger(GetTriggeringTrigger())
if udg_Mode==1 then
call ALICE2Text(10.0, "所有xxx被消灭." )
set i = 1
endif
else
if udg_Spores==1 then
call ALICEText(10.0, I2S(udg_Spores) + " 个剩余." )
else
call ALICEText(10.0, I2S(udg_Spores) + " 个剩余." )
endif
endif
if udg_Spores==4 then
set i=1
endif
set u = null
endfunction |
|