package UnitSpawnSystem import BossOne import BossTwo import BossThree import BossFour import BossFive import Special import SpecialOne import SpecialTwo import SpecialThree import SpecialFour import SpecialFive import Boss constant real SPAWN_TIME = 20.0 public constant normalWaves = new LinkedList() public constant bossWaves = new LinkedList() constant specialWaves = new LinkedList() public var stopSpawns = false var level = 1 function onSpawnTime() if stopSpawns return if level mod 7 == 0 and specialWaves.size() > 0 specialWaves.dequeue().spawn() else if normalWaves.size() > 0 normalWaves.dequeue().spawn() if level mod 4 == 0 and bossWaves.size() > 0 bossWaves.dequeue().spawn() level++ if level > 7 level = 1 if specialWaves.size() <= 0 and bossWaves.size() <= 0 and normalWaves.size() <= 0 stopSpawns = true init normalWaves.add(new NormalWave('u000', 'u003', 'n000', 1, 6)) normalWaves.add(new NormalWave('u000', 'u003', 'n000', 2, 6)) normalWaves.add(new NormalWave('u000', 'u003', 'n000', 3, 6)) normalWaves.add(new NormalWave('u001', 'u004', 'n001', 1, 10)) normalWaves.add(new NormalWave('u001', 'u004', 'n001', 2, 10)) normalWaves.add(new NormalWave('u001', 'u004', 'n001', 3, 10)) normalWaves.add(new NormalWave('u002', 'u005', 'n002', 1, 11)) normalWaves.add(new NormalWave('u002', 'u005', 'n002', 2, 11)) normalWaves.add(new NormalWave('u002', 'u005', 'n002', 3, 11)) normalWaves.add(new NormalWave('u006', 'u007', 'n005', 1, 12)) normalWaves.add(new NormalWave('u006', 'u007', 'n005', 2, 12)) normalWaves.add(new NormalWave('u006', 'u007', 'n005', 3, 12)) normalWaves.add(new NormalWave('u008', 'u009', 'n006', 1, 13)) normalWaves.add(new NormalWave('u008', 'u009', 'n006', 2, 13)) normalWaves.add(new NormalWave('u008', 'u009', 'n006', 3, 13)) normalWaves.add(new NormalWave('u00G', 'u00H', 'n008', 1, 14)) normalWaves.add(new NormalWave('u00G', 'u00H', 'n008', 2, 14)) normalWaves.add(new NormalWave('u00G', 'u00H', 'n008', 3, 14)) normalWaves.add(new NormalWave('u00I', 'u00K', 'n009', 1, 15)) normalWaves.add(new NormalWave('u00I', 'u00K', 'n009', 2, 15)) normalWaves.add(new NormalWave('u00I', 'u00K', 'n009', 3, 15)) normalWaves.add(new NormalWave('u00J', 'u00L', 'n00A', 1, 16)) normalWaves.add(new NormalWave('u00J', 'u00L', 'n00A', 2, 16)) normalWaves.add(new NormalWave('u00J', 'u00L', 'n00A', 3, 16)) normalWaves.add(new NormalWave('u00N', 'u00M', 'n00D', 1, 16)) normalWaves.add(new NormalWave('u00N', 'u00M', 'n00D', 2, 16)) normalWaves.add(new NormalWave('u00N', 'u00M', 'n00D', 3, 16)) normalWaves.add(new NormalWave('u00S', 'u00P', 'n00F', 1, 14)) normalWaves.add(new NormalWave('u00S', 'u00P', 'n00F', 2, 14)) normalWaves.add(new NormalWave('u00S', 'u00P', 'n00F', 2, 14)) normalWaves.add(new NormalWave('u00T', 'u00Q', 'n00G', 1, 14)) normalWaves.add(new NormalWave('u00T', 'u00Q', 'n00G', 2, 14)) normalWaves.add(new NormalWave('u00T', 'u00Q', 'n00G', 2, 14)) normalWaves.add(new NormalWave('u00U', 'u00R', 'n00H', 2, 12)) normalWaves.add(new NormalWave('u00U', 'u00R', 'n00H', 2, 12)) normalWaves.add(new NormalWave('u00U', 'u00R', 'n00H', 2, 12)) normalWaves.add(new NormalWave('u00X', 'u010', 'n00I', 2, 12)) normalWaves.add(new NormalWave('u00X', 'u010', 'n00I', 3, 12)) normalWaves.add(new NormalWave('u00X', 'u010', 'n00I', 3, 12)) normalWaves.add(new NormalWave('u00Y', 'u011', 'n00J', 2, 12)) normalWaves.add(new NormalWave('u00Y', 'u011', 'n00J', 2, 12)) normalWaves.add(new NormalWave('u00Z', 'u012', 'n00K', 1, 12)) normalWaves.add(new NormalWave('u00Z', 'u012', 'n00K', 1, 12)) normalWaves.add(new NormalWave('u00Z', 'u012', 'n00K', 1, 10)) normalWaves.add(new NormalWave('u00Z', 'u012', 'n00K', 1, 10)) bossWaves.add(new BossWave('n003', 1, 85, Sounds.skeletonWhat2, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new BossOne(startPos, unitId, bounty, middle) end)) bossWaves.add(new BossWave('n004', 1, 100, Sounds.duneWormDeath1, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new BossTwo(startPos, unitId, bounty, middle) end)) bossWaves.add(new BossWave('n007', 1, 125, Sounds.abominationPissed5, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new BossThree(startPos, unitId, bounty, middle) end)) bossWaves.add(new BossWave('n00B', 1, 150, Sounds.hydraDeath1, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new BossFour(startPos, unitId, bounty, middle) end)) bossWaves.add(new BossWave('n00E', 1, 175, Sounds.airBargeDeath1, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new BossFive(startPos, unitId, bounty, middle) end)) specialWaves.add(new SpecialWave('u00A', 3, 15, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new SpecialOne(startPos, unitId, bounty, middle) end)) specialWaves.add(new SpecialWave('u00B', 1, 25, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new SpecialTwo(startPos, unitId, bounty, middle) end)) specialWaves.add(new SpecialWave('u00F', 4, 10, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new SpecialThree(startPos, unitId, bounty, middle) end)) specialWaves.add(new SpecialWave('u00O', 25, 4, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new SpecialFour(startPos, unitId, bounty, middle) end)) specialWaves.add(new SpecialWave(UNIT_ID_DARKONE, 4, 65, (vec3 startPos, int unitId, int bounty, vec2 middle) -> begin new SpecialFive(startPos, unitId, bounty, middle) end)) public function startSpawn() let t = CreateTimer() if allPlayers.size() <= 1 and (allPlayers.get(0).p.getName() == "WorldEdit" or allPlayers.get(0).p.getName() == "Frotty") print("|cffFFCC00>>|r Fast Spawn") // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // normalWaves.dequeue() // bossWaves.dequeue() // bossWaves.dequeue() // bossWaves.dequeue() // bossWaves.dequeue() // specialWaves.dequeue() // specialWaves.dequeue() // specialWaves.dequeue() // specialWaves.dequeue() t.startPeriodic(SPAWN_TIME / 2., function onSpawnTime) else t.startPeriodic(SPAWN_TIME, function onSpawnTime) printTimed("|cffFFCC00>>|r Enemies spawn in " + SPAWN_TIME.toInt().toString() + " seconds.", 25) public function stopSpawn() stopSpawns = true