package Startmazes import initlater Startmaze import initlater FirstSnow import initlater SecondDesert import initlater ThirdForest import initlater FourthCitadelle import PlayerData import StringUtils import Key import Door import Obstacle import Ball import LobbyTeleporter import MinigameTeleporter import Execute import Arcanery public Startmaze array startmazes public int currentMaze = -1 public RevivePoint svRev public function initStartmazes() forUnitsOfPlayer(STAFF_PLAYER, u -> checkStaffUnit(u)) execute() -> startmazes[0] = new FirstSnowMaze(regions[0]) startmazes[1] = new SecondDesertMaze(regions[1]) startmazes[2] = new ThirdForestMaze(regions[2]) startmazes[3] = new FourthCitadelleMaze(regions[3]) MINI_TP = new MinigameTeleporter(gg_unit_tele_0150) createCenterFText(gg_unit_revp_0322.getPos().toVec3(), "|cff0884D6Lounge", 13.5) new BallItem(vec2(-5780,-6287), DUMMY_PLAYER) EnumItemsInRect(playableMapRect, null, function correctKeys) try() -> setBuilderTeleporter() let rand = GetRandomInt(0,7) if rand < 2 setStartTeleport(0,3) setStartTeleport(1,2) setStartTeleport(2,1) else if rand < 5 setStartTeleport(0,1) setStartTeleport(1,3) setStartTeleport(2,2) else if rand <= 7 setStartTeleport(0,2) setStartTeleport(1,3) setStartTeleport(2,1) function checkStaffUnit(unit u) Log.debug("check staff unit") switch u.getTypeId() case REVIVE_POINT_ID Log.debug("init startmaze rev") var r = new RevivePoint(u) if u == gg_unit_revp_0002 r.startmaze = 0 else if u == gg_unit_revp_0085 r.startmaze = 1 else if u == gg_unit_revp_0022 r.startmaze = 2 else if u == gg_unit_revp_0226 r.startmaze = 3 else if u == gg_unit_revp_0322 r.startmaze = 4 svRev = r case DOORORDER_ID if u != gg_unit_dor2_0023 and u != gg_unit_dor2_0011 new Door(u) case BOBS_ICE_ID new BigObstacle(u) case SOBS_DESERT_ID new SmallObstacle(u) case BOBS_CITADEL_ID new BigObstacle(u) case SOBS_CITADEL_ID new SmallObstacle(u) case SMALL_GRASS_KILLER_ID new SmallKiller(u) case BIG_GRASS_KILLER_ID new BigKiller(u) case BOBS_DESERT_ID new BigObstacle(u) case SOBS_ICE_ID new SmallObstacle(u) case BIG_ICE_KILLER_ID new BigKiller(u) case SMALL_ICE_KILLER_ID new SmallKiller(u) case BIG_CITADEL_KILLER_ID new BigKiller(u) case SMALL_CITADEL_KILLER_ID new SmallKiller(u) case GLAIVE_KILLER_ID new GlaiveKiller(u) case SOBS_GRASS_ID new SmallObstacle(u) case BOBS_GRASS_ID new BigObstacle(u) case HOBS_GRASS_ID new HighObstacle(u) case ARCANERY_ID new Arcanery(u) public function correctKeys() let itm = GetEnumItem() if GetItemTypeId(itm) == 'I009' new Key(vec2(GetItemX(itm), GetItemY(itm)), STAFF_PLAYER) itm.remove() else if GetItemTypeId(itm) == 'I00J' let k = new Key(vec2(GetItemX(itm), GetItemY(itm)), STAFF_PLAYER) k.col = EBRColor.PURPLE k.recolor() itm.remove() else if GetItemTypeId(itm) == 'I008' let k = new Key(vec2(GetItemX(itm), GetItemY(itm)), STAFF_PLAYER) k.col = EBRColor.TEAL k.recolor() itm.remove() function setBuilderTeleporter() if pData[8] != null new LobbyTeleporter(gg_unit_tele_0058, true) else gg_unit_tele_0058.remove() if pData[9] != null new LobbyTeleporter(gg_unit_tele_0063, true) else gg_unit_tele_0063.remove() if pData[10] != null new LobbyTeleporter(gg_unit_tele_0115, true) else gg_unit_tele_0115.remove() if pData[11] != null new LobbyTeleporter(gg_unit_tele_0143, true) else gg_unit_tele_0143.remove() public function setStartTeleport(int tpid, int locid) LobbyTeleporter t = null switch tpid case 0 t = new LobbyTeleporter(gg_unit_tele_0061, false) case 1 t = new LobbyTeleporter(gg_unit_tele_0324, false) case 2 t = new LobbyTeleporter(gg_unit_tele_0323, false) t.actor.removeAbility(REMOVE_OBJECT_ID) switch locid case 1 t.setRallyPoint(vec2(3456,-4160)) t.ftext.tt.center(t.getPos(), "|cffE68C19Desert Startmaze", 12.5) case 2 t.setRallyPoint(vec2(500,-6900)) t.ftext.tt.center(t.getPos(), "|cff3A9C3AForest Startmaze", 12.5) case 3 t.setRallyPoint(vec2(-2433,-6148)) t.ftext.tt.center(t.getPos(), "|cffA5084ACitadel Startmaze", 12.5) t.currentPlus = 999 t.ready = true