The library is quite Big...
but don't focus on the constant , they are used in the whole map, not just this library.
[Jass=]
library Beast
globals
//i removed all constant to increase lisibility
endglobals
function Spawn1 takes nothing returns nothing
local real x
local real y
local integer i = 1
set x = GetRandomReal(GetRectMinX(gg_rct_Mojo_Anaconda), GetRectMaxX(gg_rct_Mojo_Anaconda))
set y = GetRandomReal(GetRectMinY(gg_rct_Mojo_Anaconda), GetRectMaxY(gg_rct_Mojo_Anaconda))
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANACONDA_ID, x, y, bj_UNIT_FACING )
set x = GetRectCenterX(gg_rct_Secret_Deep_Zone)
set y = GetRectCenterY(gg_rct_Secret_Deep_Zone)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEBIRD_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
set x = GetRectCenterX(gg_rct_Froll_Hut)
set y = GetRectCenterY(gg_rct_Froll_Hut)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROLLHUTT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(1.00, 50.00) )
call SetItemCharges( UnitAddItemById( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROLL_ID, x, y, bj_UNIT_FACING ), HARPOON_ID ), GetRandomInt(1, 5) )
loop
exitwhen i > 9
set x = GetRandomReal(GetRectMinX(udg_Area), GetRectMaxX(udg_Area))
set y = GetRandomReal(GetRectMinY(udg_Area), GetRectMaxY(udg_Area))
if GetRandomInt(1, 10) <= 6 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEBIRD_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), VULTURE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
set x = GetRandomReal(GetRectMinX(udg_Area), GetRectMaxX(udg_Area))
set y = GetRandomReal(GetRectMinY(udg_Area), GetRectMaxY(udg_Area))
if GetRandomInt(1, 10) <= 6 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEBIRD_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), VULTURE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
if GetRandomInt(0, 1) == 1 then
set x = GetRandomReal(GetRectMinX(gg_rct_Mojo_Anaconda), GetRectMaxX(gg_rct_Mojo_Anaconda))
set y = GetRandomReal(GetRectMinY(gg_rct_Mojo_Anaconda), GetRectMaxY(gg_rct_Mojo_Anaconda))
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANACONDA_ID, x, y, bj_UNIT_FACING )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 2
set x = GetRectCenterX(gg_rct_Mojo_Tarantula)
set y = GetRectCenterY(gg_rct_Mojo_Tarantula)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TARENTULAQUEEN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
set x = GetRandomReal(GetRectMinX(gg_rct_Mojo_Tarantula), GetRectMaxX(gg_rct_Mojo_Tarantula))
set y = GetRandomReal(GetRectMinY(gg_rct_Mojo_Tarantula), GetRectMaxY(gg_rct_Mojo_Tarantula))
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SPIDER_EGGBAG_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 6
set x = GetRandomReal(GetRectMinX(udg_Cave), GetRectMaxX(udg_Cave))
set y = GetRandomReal(GetRectMinY(udg_Cave), GetRectMaxY(udg_Cave))
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MANGYRAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set x = GetRandomReal(GetRectMinX(udg_Cave), GetRectMaxX(udg_Cave))
set y = GetRandomReal(GetRectMinY(udg_Cave), GetRectMaxY(udg_Cave))
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MANGYRAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set x = GetRandomReal(GetRectMinX(udg_Cave), GetRectMaxX(udg_Cave))
set y = GetRandomReal(GetRectMinY(udg_Cave), GetRectMaxY(udg_Cave))
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MANGYRAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
set x = GetRandomReal(GetRectMinX(udg_water_big), GetRectMaxX(udg_water_big))
set y = GetRandomReal(GetRectMinY(udg_water_big), GetRectMaxY(udg_water_big))
if GetRandomInt(1, 10) != 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATOR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
elseif GetRandomInt(1, 20) <= 6 then
if GetRandomInt(1, 3) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), HERMITCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RIVERCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
elseif GetRandomInt(1, 14) <= 6 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROG_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
elseif GetRandomInt(1, 8) <= 3 then
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MOSQUITOES_ID, x, y, bj_UNIT_FACING )
elseif GetRandomInt(1, 5) <= 3 then
if GetRandomInt(1, 4) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), GIANTTORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
else
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATORHATCHLING_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATOR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
endif
set i = i + 1
endloop
endfunction
function Spawn2 takes nothing returns nothing
local real x
local real y
local integer i = 1
loop
exitwhen i > 86
set x = GetRandomReal(GetRectMinX(udg_ground_normal), GetRectMaxX(udg_ground_normal))
set y = GetRandomReal(GetRectMinY(udg_ground_normal), GetRectMaxY(udg_ground_normal))
if GetRandomInt(1, 10) <= 3 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIGLET_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BOAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
elseif GetRandomInt(1, 7) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPEFAWN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 5) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERKITTEN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERCAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 3) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEARCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
elseif GetRandomInt(1, 2) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOONCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOON_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
else
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BUNNY_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RABBIT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
endif
endif
set i = i + 1
endloop
endfunction
function Spawn3 takes nothing returns nothing
local real x
local real y
local integer i = 1
loop
exitwhen i > 54
set x = GetRandomReal(GetRectMinX(udg_water_normal), GetRectMaxX(udg_water_normal))
set y = GetRandomReal(GetRectMinY(udg_water_normal), GetRectMaxY(udg_water_normal))
if GetRandomInt(1, 20) <= 6 then
if GetRandomInt(1, 3) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), HERMITCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RIVERCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
elseif GetRandomInt(1, 14) <= 5 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROG_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
elseif GetRandomInt(1, 9) <= 1 then
call SetItemCharges( UnitAddItemById( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROLL_ID, x, y, bj_UNIT_FACING ), HARPOON_ID ), GetRandomInt(1, 5) )
elseif GetRandomInt(1, 8) <= 3 then
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MOSQUITOES_ID, x, y, bj_UNIT_FACING )
elseif GetRandomInt(1, 5) <= 3 then
if GetRandomInt(1, 4) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), GIANTTORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
elseif GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATORHATCHLING_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATOR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
set i = i + 1
endloop
endfunction
function Spawn4 takes nothing returns nothing
local real x
local real y
local integer i = 1
loop
exitwhen i > 42
set x = GetRandomReal(GetRectMinX(udg_ground_vermin), GetRectMaxX(udg_ground_vermin))
set y = GetRandomReal(GetRectMinY(udg_ground_vermin), GetRectMaxY(udg_ground_vermin))
if GetRandomInt(1, 20) <= 9 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEASPIC_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
elseif GetRandomInt(1, 11) <= 9 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TARENTULA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BLACKWIDOW_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
set x = GetRandomReal(GetRectMinX(udg_ground_big), GetRectMaxX(udg_ground_big))
set y = GetRandomReal(GetRectMinY(udg_ground_big), GetRectMaxY(udg_ground_big))
if GetRandomInt(1, 10) != 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
elseif GetRandomInt(1, 10) <= 3 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIGLET_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BOAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
elseif GetRandomInt(1, 7) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPEFAWN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 5) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERKITTEN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERCAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 3) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEARCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
elseif GetRandomInt(1, 2) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOONCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOON_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
else
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BUNNY_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RABBIT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
endif
endif
set i = i + 1
endloop
endfunction
function Spawn5 takes nothing returns nothing
local real x
local real y
local unit spawn
local integer i = 1
loop
exitwhen i > 70
set x = GetRectCenterX(udg_ground_food)
set y = GetRectCenterY(udg_ground_food)
if GetRandomInt(1, 7) <= 4 then
if GetRandomInt(1, 20) <= 2 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), BEEHIVE_ID, x, y, bj_UNIT_FACING )
set udg_BeeSwarmCount = ( udg_BeeSwarmCount + 1 )
call SetUnitUserData( spawn, udg_BeeSwarmCount )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
set udg_BeeSwarm[udg_BeeSwarmCount] = CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEEQUEEN_ID, x, y, bj_UNIT_FACING )
elseif GetRandomInt(1, 18) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), ARIA_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
elseif GetRandomInt(1, 17) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), BARDANE_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
elseif GetRandomInt(1, 16) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), CORIAN_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
elseif GetRandomInt(1, 15) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), DRAXIMOR_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
else
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), BERRYBUSH_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
endif
endif
set spawn =null
set i = i + 1
endloop
endfunction
function Spawn6 takes nothing returns nothing
local real x
local real y
local unit spawn
local integer i = 1
loop
exitwhen i > 24
set x = GetRectCenterX(udg_minerals)
set y = GetRectCenterY(udg_minerals)
if GetRandomInt(1, 2) == 1 then
if GetRandomInt(1, 2) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Rock[GetRandomInt(1, 6)], x, y, bj_UNIT_FACING )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
else
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Rock[GetRandomInt(7, 12)], x, y, bj_UNIT_FACING )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
endif
endif
set spawn =null
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
set x = GetRectCenterX(udg_water_piranha)
set y = GetRectCenterY(udg_water_piranha)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIRANHA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIRANHA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIRANHA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
set i = i + 1
endloop
endfunction
endlibrary
[/code]
here is latest modification on the bugging trigger
[Jass=]
function SpawnActions takes nothing returns nothing
call Beast_Spawn1()
call TriggerSleepAction(0.10)
call Beast_Spawn2()
call TriggerSleepAction(0.10)
call Beast_Spawn3()
call TriggerSleepAction(0.10)
call Beast_Spawn4()
call TriggerSleepAction(0.10)
call Beast_Spawn5()
call TriggerSleepAction(0.10)
call Beast_Spawn6()
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_SpawnLauncher_JASS takes nothing returns nothing
set gg_trg_SpawnLauncher_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_SpawnLauncher_JASS, function SpawnActions )
endfunction
[/code]