Cal1991
New Member
- Reaction score
- 7
Some people server split when this trigger runs. Anyone know why?
JASS:
function Trig_Creep_Spawn_Jass_Func002Func001002002 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Creep_Spawn_Jass_Func002Func002C takes nothing returns boolean
if ( not ( IsUnitGroupEmptyBJ(udg_Group) == true ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Spawn_Jass_Actions takes nothing returns nothing
local integer a = 1
local integer b = 18
local integer c = 1
local integer d = 18
call AddItemToStockBJ( ChooseRandomItemExBJ(GetRandomInt(4, 8), ITEM_TYPE_ANY), gg_unit_nmrk_0017, 1, 1 )
loop
exitwhen a > b
set udg_Group = GetUnitsInRectMatching(udg_CreepLocs[a], Condition(function Trig_Creep_Spawn_Jass_Func002Func001002002))
if ( Trig_Creep_Spawn_Jass_Func002Func002C() ) then
set udg_Point[1] = GetRectCenter(udg_CreepLocs[a])
set c = udg_CreepAmountMin[a]
set d = udg_CreepAmountMax[a]
loop
exitwhen c > d
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(udg_CreepLevelMin[a], udg_CreepLevelMax[a])), Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Point[1], bj_UNIT_FACING )
call UnitAddAbilityBJ( 039;Asla039;, GetLastCreatedUnit() )
call PolledWait( 1 )
set c = c + 1
endloop
set udg_CreepAmountMax[a] = ( udg_CreepAmountMax[a] + 1 )
set udg_CreepAmountMin[a] = ( udg_CreepAmountMin[a] + 1 )
set udg_CreepLevelMax[a] = ( udg_CreepLevelMax[a] + 1 )
call RemoveLocation(udg_Point[1])
else
call DoNothing( )
endif
call DestroyGroup(udg_Group)
set a = a + 1
endloop
endfunction
//===========================================================================
function InitTrig_Creep_Spawn_Jass takes nothing returns nothing
set gg_trg_Creep_Spawn_Jass = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Creep_Spawn_Jass, 30.00 )
call TriggerAddAction( gg_trg_Creep_Spawn_Jass, function Trig_Creep_Spawn_Jass_Actions )
endfunction