diff --git a/sku.0/sys.server/compiled/game/script/event/auto_invasion/auto_invasion.java b/sku.0/sys.server/compiled/game/script/event/auto_invasion/auto_invasion.java old mode 100644 new mode 100755 index ddee4e131..b3e8fe559 --- a/sku.0/sys.server/compiled/game/script/event/auto_invasion/auto_invasion.java +++ b/sku.0/sys.server/compiled/game/script/event/auto_invasion/auto_invasion.java @@ -1,20 +1,8 @@ package script.event.auto_invasion; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.create; +import script.dictionary; import script.library.locations; -import script.library.skill; -import script.library.chat; -import script.library.badge; -import java.util.StringTokenizer; +import script.obj_id; public class auto_invasion extends script.base_script { @@ -26,9 +14,7 @@ public class auto_invasion extends script.base_script public static final float THIRTY_SIX_HOURS = 60 * 60 * 36; public int OnInitialize(obj_id self) throws InterruptedException { - location here = getLocation(self); - String myRegion = locations.getGuardSpawnerRegionName(here); - if (myRegion.equals("@tatooine_region_names:mos_eisley")) + if (locations.getGuardSpawnerRegionName(getLocation(self)).equals("@tatooine_region_names:mos_eisley")) { removeObjVar(self, "event"); removeObjVar(self, "auto_invasion"); diff --git a/sku.0/sys.server/compiled/game/script/event/auto_invasion/invader.java b/sku.0/sys.server/compiled/game/script/event/auto_invasion/invader.java old mode 100644 new mode 100755 index 6e01646df..9d04e2c3a --- a/sku.0/sys.server/compiled/game/script/event/auto_invasion/invader.java +++ b/sku.0/sys.server/compiled/game/script/event/auto_invasion/invader.java @@ -1,17 +1,10 @@ package script.event.auto_invasion; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - +import script.dictionary; import script.library.ai_lib; import script.library.utils; -import script.ai.ai_combat; -import script.library.healing; +import script.obj_id; +import script.string_id; public class invader extends script.base_script { @@ -26,9 +19,7 @@ public class invader extends script.base_script if (hasObjVar(self, "auto_invasion.teh_uber")) { setScale(self, 5.0f); - string_id bossNameSID = new string_id("auto_invasion", "ewok_boss_name"); - String bossName = utils.packStringId(bossNameSID); - setName(self, bossName); + setName(self, utils.packStringId(new string_id("auto_invasion", "ewok_boss_name"))); int bossBuffLevel = getIntObjVar(self, "auto_invasion.boss_buff_level"); int buffAmount = bossBuffLevel * bossBuffLevel * 10000; addAttribModifier(self, "medical_enhance_health", HEALTH, buffAmount, 10000, 0.0f, 10.0f, true, false, true); @@ -40,9 +31,7 @@ public class invader extends script.base_script { obj_id target = getObjIdObjVar(self, "auto_invasion.target"); float destinationOffset = getFloatObjVar(target, "auto_invasion.dest_offset"); - location locationDestination = getLocation(target); - location adjustedLoc = utils.getRandomLocationInRing(locationDestination, destinationOffset, destinationOffset + 10); - ai_lib.aiPathTo(self, adjustedLoc); + ai_lib.aiPathTo(self, utils.getRandomLocationInRing(getLocation(target), destinationOffset, destinationOffset + 10)); setMovementRun(self); return SCRIPT_CONTINUE; } @@ -82,12 +71,9 @@ public class invader extends script.base_script } for (int i = 0; i < tableLength; i++) { - int minRoll = dataTableGetInt(DATATABLE, i, "MIN_ROLL"); - if (minRoll > roll) + if (dataTableGetInt(DATATABLE, i, "MIN_ROLL") > roll) { - String loot = dataTableGetString(DATATABLE, i, "LOOT"); - obj_id inventory = utils.getInventoryContainer(self); - obj_id reward = createObject(loot, inventory, ""); + createObject(dataTableGetString(DATATABLE, i, "LOOT"), utils.getInventoryContainer(self), ""); return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/event/auto_invasion/spawner_spawner.java b/sku.0/sys.server/compiled/game/script/event/auto_invasion/spawner_spawner.java old mode 100644 new mode 100755 index 0453f536d..57d2293ba --- a/sku.0/sys.server/compiled/game/script/event/auto_invasion/spawner_spawner.java +++ b/sku.0/sys.server/compiled/game/script/event/auto_invasion/spawner_spawner.java @@ -1,15 +1,9 @@ package script.event.auto_invasion; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.create; import script.library.locations; +import script.location; +import script.obj_id; public class spawner_spawner extends script.base_script { @@ -18,63 +12,44 @@ public class spawner_spawner extends script.base_script } public static final int[] LOCS = { - -4915, - 6, - 4093, - -1376, - 12, - -3576, - -51, - 28, - -4734, - -977, - 73, - 1554, - 3668, - 96, - -6446, - -2197, - 20, - 2302 + -4915,6,4093, + -1376,12,-3576, + -51,28,-4734, + -977,73,1554, + 3668,96,-6446, + -2197,20,2302 }; public int OnInitialize(obj_id self) throws InterruptedException { if (!hasObjVar(self, "auto_invasion.spawned")) { - location here = getLocation(self); - String myPlanet = getCurrentSceneName(); int locStart = 999; - String myRegion = locations.getGuardSpawnerRegionName(here); - if (myRegion.equals("@naboo_region_names:theed")) - { - locStart = 0; - } - if (myRegion.equals("@tatooine_region_names:bestine")) - { - locStart = 3; - } - if (myRegion.equals("@corellia_region_names:coronet")) - { - locStart = 6; - } - if (myRegion.equals("@endor_region_names:endor_smuggler_outpost")) - { - locStart = 9; - } - if (myRegion.equals("@rori_region_names:sdungeon_rebel_outpost")) - { - locStart = 12; - } - if (myRegion.equals("@talus_region_names:talus_imperial_outpost")) - { - locStart = 15; + String myRegion = locations.getGuardSpawnerRegionName(getLocation(self)); + switch (myRegion) { + case "@naboo_region_names:theed": + locStart = 0; + break; + case "@tatooine_region_names:bestine": + locStart = 3; + break; + case "@corellia_region_names:coronet": + locStart = 6; + break; + case "@endor_region_names:endor_smuggler_outpost": + locStart = 9; + break; + case "@rori_region_names:sdungeon_rebel_outpost": + locStart = 12; + break; + case "@talus_region_names:talus_imperial_outpost": + locStart = 15; + break; } if (locStart > 15) { return SCRIPT_CONTINUE; } - location spawnerLocation = new location(LOCS[locStart], LOCS[locStart + 1], LOCS[locStart + 2], myPlanet); - obj_id spawner = create.object("object/tangible/spawning/auto_invasion_spawner.iff", spawnerLocation); + obj_id spawner = create.object("object/tangible/spawning/auto_invasion_spawner.iff", new location(LOCS[locStart], LOCS[locStart + 1], LOCS[locStart + 2], getCurrentSceneName())); setObjVar(self, "auto_invasion.spawned", 1); setObjVar(self, "auto_invasion.spawner", spawner); }