package InstantBuild import Builder import EscaperKillers import Door import Arcanery import Revivepoint import Executer import Vortex import Powernode import Tracks import Jumper import Teleporter import Waypoint import Spinner import Unitcreator import Trap import Tree import Texter import Booster import Obstacle import Bombertower import UnitRemover import CongaLineHead import TerrainBlocker import Fountain import Decoration import Pedestal import Knockbacker import Pointer import ObjectTarget import Key import TerrainChanger import Faceless import public SerializeIds import Bomber import Wall import Coin import Boots import Tome public function isOrderBuildOrder(int o) returns boolean int i = 1 while buildorders[i] != 0 if buildorders[i] == o return true i++ for i2 = 139 to 152 if o == buildorders[i2] return true return false public function instantBuild(Builder b, vec2 tpos, int id) let rdata = getRegionData(tpos) if rdata != null and rdata.canBuild(b.owner) var i = 1 while buildorders[i] > 0 // by commenting out the line, this loop stops before reaching bottom ids if id == buildorders[i] newObjectFromId(b.owner, tpos, i) break i++ // TODO remove for i2 = 139 to 152 if id == buildorders[i2] newObjectFromId(b.owner, tpos, i2) break else DisplayTextToPlayer(b.owner, 0, 0, "|cffC51019You have no permission to build in this region!") b.actor.abortOrder() public function newObjectFromId(player owner, vec2 tpos, int id) returns Entity switch id case JUMPER_INDEX return new Jumper(tpos, owner) case REVIVE_INDEX return new RevivePoint(vec3(tpos.x,tpos.y, 0.), owner) case TEXTER_INDEX return new Texter(tpos, owner) case BOMBTOWER_INDEX return new Bombertower(tpos, owner) case VORTEX_INDEX return new Vortex(tpos, owner) case EXECUTER_INDEX return new Executer(tpos, owner) case BOOSTER_INDEX return new Booster(tpos, owner) case UNITREMOVER_INDEX return new UnitRemover(tpos, owner) case WAYPOINT_INDEX return new Waypoint(tpos, owner) case TELEPORTER_INDEX return new Teleporter(tpos, owner) case DOOR_INDEX return new Door(tpos, owner) case SMALLOBS_INDEX return new SmallObstacle(tpos, owner) case BIGOBS_INDEX return new BigObstacle(tpos, owner) case HIGH_OBS_INDEX return new HighObstacle(tpos, owner) case TREE_INDEX return new Tree(tpos, owner) case SPINNER_INDEX return new Spinner(tpos, owner) case UNITCREATOR_INDEX return new UnitCreator(tpos, owner) case WALL_INDEX return new Wall(tpos, owner,270., WALL_INDEX) case TRACKS_INDEX return new Tracks(tpos, owner) case FOUNTAIN_INDEX return new Fountain(tpos, owner) case POWERNODE_INDEX return new Powernode(tpos, owner) case TRAP_INDEX return new Trap(tpos, owner) case HWALL_INDEX return new Wall(tpos, owner,270.,HWALL_INDEX) case VWALL_INDEX return new Wall(tpos, owner,270.,VWALL_INDEX) case CONGA_INDEX return new CongaLineHead(tpos, owner) case TBLOCKER_INDEX return new TerrainBlocker(tpos, owner) case VOLCANO_INDEX return new VolcanoObstacle(tpos, owner) case 140 return new Decoration(tpos, owner, GetRandomReal(0, 360), id) case 141 return new Decoration(tpos, owner, GetRandomReal(0, 360), id) case 142 return new Decoration(tpos, owner, GetRandomReal(0, 360), id) case 143 return new Decoration(tpos, owner, GetRandomReal(0, 360), id) case 144 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 145 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 146 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 147 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 148 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 149 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 150 return new Decoration(tpos, owner,GetRandomReal(0, 360), id) case 151 return new MemoryAccessPedestal(tpos, owner) case ARCANERY_INDEX return new Arcanery(tpos, owner) case SMALLKILL_INDEX return new SmallKiller(tpos,owner) case BIGKILL_INDEX return new BigKiller(tpos,owner) case BOMBER_INDEX return new Bomber(tpos,owner) case KEY_INDEX return new Key(tpos, owner) case SMALLRANDKILL_INDEX return new SmallRandomKiller(tpos, owner) case BIGRANDKILL_INDEX return new BigRandomKiller(tpos, owner) case TANKKILL_INDEX return new TankKiller(tpos, owner) case GLAIVEKILL_INDEX return new GlaiveKiller(tpos, owner) case FIREKILL_INDEX return new FireKiller(tpos, owner) case AIRKILL_INDEX return new AirKiller(tpos, owner) case KNOCKBACKER_INDEX return new Knockbacker(tpos, owner, angle(0)) case FACELESS_INDEX return new Faceless(tpos, owner) case POINTER_INDEX return new Pointer(tpos, owner, angle(0)) case OBJ_TARGET_INDEX return new ObjectTarget(tpos, owner) case TC_INDEX return new TerrainChanger(tpos, owner) case COIN_INDEX return new Coin(tpos, owner) case BOOTS_INDEX return new Boots(tpos, owner) case TOME_INDEX return new Tome(tpos, owner) return null public int array buildorders init Log.debug("init buildords") buildorders[JUMPER_INDEX] = JUMPER_ID // Jumper buildorders[REVIVE_INDEX] = REVIVE_POINT_ID// Revivepoint buildorders[TEXTER_INDEX] = TEXTER_ID // Texter buildorders[BOMBTOWER_INDEX] = BOMB_TOWER_ID // BomberTower buildorders[VORTEX_INDEX] = VORTEX_ID // Vortex buildorders[EXECUTER_INDEX] = EXECUTER_ID // Executer buildorders[BOOSTER_INDEX] = BOOSTER_ID // Booster buildorders[UNITREMOVER_INDEX] = UNIT_REMOVER_ID // UnitRemover buildorders[WAYPOINT_INDEX] = WAYPOINT_ID // Waypoint buildorders[TELEPORTER_INDEX] = TELEPORTER_ID // Teleporter buildorders[DOOR_INDEX] = DOORDUMMY_ID // Door buildorders[SMALLOBS_INDEX] = SOBS_DUMMY_ID // Small Obstacle buildorders[BIGOBS_INDEX] = BOBS_DUMMY_ID // Big Obstacle buildorders[HIGH_OBS_INDEX] = HOBS_DUMMY_ID // High Obstacle buildorders[TREE_INDEX] = TREE_DUMMY_ID // Tree buildorders[SPINNER_INDEX] = SPINNER_ID // Spinner buildorders[UNITCREATOR_INDEX] = UNIT_CREATOR_ID // Unitcreator buildorders[TRACKS_INDEX] = BUILD_TRACKS_ID // Tracks buildorders[FOUNTAIN_INDEX] = FOUNTAIN_BOTH_ID // Fountain buildorders[POWERNODE_INDEX] = POWER_NODE_ID // Powernode buildorders[TRAP_INDEX] = TRAP_ID // Trap buildorders[CONGA_INDEX] = CONGA_LINE_HEAD_ID // Conga Line buildorders[TBLOCKER_INDEX] = TC_BLOCKER_ID // TerrainBlocker buildorders[VOLCANO_INDEX] = VOLCANO_ID // Volcano buildorders[WALL_INDEX] = WALL_ID // Wall buildorders[HWALL_INDEX] = HOR_WALL_ID // Horizontal Wall buildorders[VWALL_INDEX] = VER_WALL_ID // Vertical Wall buildorders[ARCANERY_INDEX] = ARCANERY_ID // Arcanery buildorders[SMALLKILL_INDEX] = 'A05K' // Arcanery buildorders[BIGKILL_INDEX] = 'A05F' // Arcanery buildorders[BOMBER_INDEX] = 'A05O' // Arcanery buildorders[KEY_INDEX] = 'n002' // Arcanery buildorders[BIGRANDKILL_INDEX] = 'A05G' // Arcanery buildorders[SMALLRANDKILL_INDEX] = 'A05J' // Arcanery buildorders[TANKKILL_INDEX] = 'A05M' // Arcanery buildorders[GLAIVEKILL_INDEX] = 'A05H' // Arcanery buildorders[AIRKILL_INDEX] = 'A07Y' // Arcanery buildorders[FIREKILL_INDEX] = 'Afre' // Arcanery buildorders[FACELESS_INDEX] = 'A07U' // Arcanery buildorders[KNOCKBACKER_INDEX] = 'A07C' // Arcanery buildorders[POINTER_INDEX] = 'A05I' // Arcanery buildorders[OBJ_TARGET_INDEX] = 'A05N' // Arcanery buildorders[TC_INDEX] = 'A05L' // Arcanery buildorders[139] = 'fuck' // Lantern buildorders[140] = POST_LANTERN_ID // Lantern buildorders[141] = MUSHROOM_ID // Mushroom buildorders[142] = TORCH_ID // Torch buildorders[143] = RUNE_ID // Rune buildorders[144] = SUPERLIGHT_ID // Suppalight buildorders[145] = LANTERN_ID // Magic Lantern buildorders[146] = FARM_ID // Farm buildorders[147] = ICE_CRYSTAL_ID // Ice Crystal buildorders[148] = OBELISK_ID // Obelisk buildorders[149] = POISON_EGGS_ID // Poison eggs buildorders[150] = REMAINS_ID // Remains buildorders[151] = PED_ID // Pedestal buildorders[32] = 1 // FIXME