include library.create; include library.locations; const int[] LOCS = { 110, 52, -5342, // Anchorhead 0-2 -150, 28, -4720, // Coronet 3-5 4812, 4, -4705, // Moenia 6-8 -1280, 0, -3590, // Bestine 9-11 6902, 330, -5550, // Bela Vistal 12-14 -4897, 6, 4106 // Theed 15-17 }; trigger OnInitialize() { if(!hasObjVar(self, "event.gcwlaunch.spawner") ) { location here = getLocation(self); string myPlanet = getCurrentSceneName(); int locStart = 999; string myRegion = locations.getGuardSpawnerRegionName(here); if(myRegion.equals("@tatooine_region_names:anchorhead") ) locStart = 0; if(myRegion.equals("@corellia_region_names:coronet") ) locStart = 3; if(myRegion.equals("@naboo_region_names:moenia") ) locStart = 6; if(myRegion.equals("@tatooine_region_names:bestine") ) locStart = 9; if(myRegion.equals("@corellia_region_names:bela_vistal") ) locStart = 12; if(myRegion.equals("@naboo_region_names:theed") ) locStart = 15; if(locStart > 15) // None of the above return SCRIPT_CONTINUE; location spawnerLocation = new location(LOCS[locStart], LOCS[locStart+1], LOCS[locStart+2], myPlanet); obj_id spawner = create.object("object/tangible/poi/base/poi_base.iff", spawnerLocation); setObjVar(self, "event.gcwlaunch.spawner", spawner); attachScript(spawner, "event.gcwlaunch.gcwlaunch"); } return SCRIPT_CONTINUE; }