diff --git a/sku.0/sys.server/compiled/game/script/ai/ai.java b/sku.0/sys.server/compiled/game/script/ai/ai.java index a6f1b99a6..9e1cf9478 100755 --- a/sku.0/sys.server/compiled/game/script/ai/ai.java +++ b/sku.0/sys.server/compiled/game/script/ai/ai.java @@ -30,6 +30,11 @@ public class ai extends script.base_script public static final string_id SID_GAVE_RECRUIT_ITEM = new string_id("collection", "gave_recruit_item"); public static final string_id SID_NPC_MEATLUMP_SPEAK = new string_id("collection", "npc_meatlump_speak"); public static final string_id SID_NO_RECRUIT_REB_IMP = new string_id("collection", "no_recruit_reb_imp"); + public static final boolean AI_TRIGGER_VOLUMES_DISABLED = utils.checkConfigFlag("GameServer", "disableAITriggerVolumes"); + public static final boolean AI_COMBAT_DISABLED = utils.checkConfigFlag("GameServer", "disableAICombat"); + public static final boolean AI_LOITER_DISABLED = utils.checkConfigFlag("GameServer", "disableAILoitering"); + public static final boolean AI_SCRIPTS_DISABLED = utils.checkConfigFlag("GameServer", "disableAI"); + public void initializeScript() throws InterruptedException { obj_id self = getSelf(); @@ -211,7 +216,7 @@ public class ai extends script.base_script pathTo(npc, pathWaypoint); return; } - if (utils.checkConfigFlag("GameServer", "disableAILoitering")) + if (AI_LOITER_DISABLED) { LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc(" + npc + ") disableAILoitering"); return; diff --git a/sku.0/sys.server/compiled/game/script/ai/hunter.java b/sku.0/sys.server/compiled/game/script/ai/hunter.java index 53ce67d06..0fc1206a7 100755 --- a/sku.0/sys.server/compiled/game/script/ai/hunter.java +++ b/sku.0/sys.server/compiled/game/script/ai/hunter.java @@ -14,7 +14,7 @@ public class hunter extends script.base_script { setAttributeInterested(self, attrib.HERBIVORE); setAttributeInterested(self, attrib.CARNIVORE); - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ALERT_VOLUME_NAME, ai_lib.aiGetApproachTriggerRange(self), true); } diff --git a/sku.0/sys.server/compiled/game/script/ai/monster.java b/sku.0/sys.server/compiled/game/script/ai/monster.java index 71a9bffe7..1aa497069 100755 --- a/sku.0/sys.server/compiled/game/script/ai/monster.java +++ b/sku.0/sys.server/compiled/game/script/ai/monster.java @@ -13,7 +13,7 @@ public class monster extends script.base_script public int OnAttach(obj_id self) throws InterruptedException { setAttributeInterested(self, attrib.NPC); - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ALERT_VOLUME_NAME, ai_lib.aiGetApproachTriggerRange(self), true); } diff --git a/sku.0/sys.server/compiled/game/script/ai/soldier.java b/sku.0/sys.server/compiled/game/script/ai/soldier.java index e8c219315..84247a46d 100755 --- a/sku.0/sys.server/compiled/game/script/ai/soldier.java +++ b/sku.0/sys.server/compiled/game/script/ai/soldier.java @@ -22,7 +22,7 @@ public class soldier extends script.base_script setAttributeInterested(self, attrib.THUG); setAttributeInterested(self, attrib.HERBIVORE); setAttributeInterested(self, attrib.CARNIVORE); - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ai_lib.ALERT_VOLUME_NAME, ai_lib.aiGetApproachTriggerRange(self), true); } @@ -142,7 +142,7 @@ public class soldier extends script.base_script { return; } - if (getConfigSetting("GameServer", "disableAICombat") != null) + if (ai.AI_COMBAT_DISABLED) { return; } diff --git a/sku.0/sys.server/compiled/game/script/ai/townperson.java b/sku.0/sys.server/compiled/game/script/ai/townperson.java index c14b352c7..b7621ba22 100755 --- a/sku.0/sys.server/compiled/game/script/ai/townperson.java +++ b/sku.0/sys.server/compiled/game/script/ai/townperson.java @@ -19,7 +19,7 @@ public class townperson extends script.base_script public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; public int OnAttach(obj_id self) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(SOCIAL_VOLUME, SOCIAL_RANGE, false); } @@ -53,7 +53,7 @@ public class townperson extends script.base_script public int OnAddedToWorld(obj_id self) throws InterruptedException { utils.removeScriptVar(self, "ai.speaking"); - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(SOCIAL_VOLUME, SOCIAL_RANGE, false); } @@ -321,7 +321,7 @@ public class townperson extends script.base_script } public int OnSawAttack(obj_id self, obj_id defender, obj_id[] attackers) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAICombat") != null) + if (ai.AI_COMBAT_DISABLED) { setWantSawAttackTriggers(self, false); return SCRIPT_OVERRIDE; diff --git a/sku.0/sys.server/compiled/game/script/ai/tusken_raider.java b/sku.0/sys.server/compiled/game/script/ai/tusken_raider.java index 0c8b1f379..1e317d7b1 100755 --- a/sku.0/sys.server/compiled/game/script/ai/tusken_raider.java +++ b/sku.0/sys.server/compiled/game/script/ai/tusken_raider.java @@ -49,7 +49,7 @@ public class tusken_raider extends script.base_script public int OnAiTetherComplete(obj_id self) throws InterruptedException { LOGC(aiLoggingEnabled(self), "debug_ai", "tusken_raider::OnAiTetherComplete() self(" + self + ":" + getName(self) + ")"); - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(SOCIAL_VOLUME, SOCIAL_RANGE, false); } @@ -273,7 +273,6 @@ public class tusken_raider extends script.base_script } if (newBehavior >= BEHAVIOR_ALERT && newBehavior < BEHAVIOR_ATTACK) { - doAgitateBehavior(self, newBehavior); return SCRIPT_OVERRIDE; } return SCRIPT_CONTINUE; @@ -289,18 +288,6 @@ public class tusken_raider extends script.base_script } return SCRIPT_CONTINUE; } - public void doAgitateBehavior(obj_id npc, int behavior) throws InterruptedException - { - if (isInvulnerable(npc)) - { - return; - } - if (getConfigSetting("GameServer", "disableAICombat") != null) - { - return; - } - return; - } public void followTusken(obj_id npc, obj_id target) throws InterruptedException { if (!isIncapacitated(npc)) diff --git a/sku.0/sys.server/compiled/game/script/city/bestine/museum_event_master.java b/sku.0/sys.server/compiled/game/script/city/bestine/museum_event_master.java index 3ea459a3f..1e2437376 100755 --- a/sku.0/sys.server/compiled/game/script/city/bestine/museum_event_master.java +++ b/sku.0/sys.server/compiled/game/script/city/bestine/museum_event_master.java @@ -21,16 +21,13 @@ public class museum_event_master extends script.base_script public int getMuseumEventDuration() throws InterruptedException { - String durationConfigSetting = getConfigSetting("BestineEvents", "MuseumEventDuration"); - int museumEventDuration = utils.stringToInt(durationConfigSetting); - if (museumEventDuration == 0 || museumEventDuration == -1) - { - museumEventDuration = 1209600; - } - return museumEventDuration; + return utils.getIntConfigSetting("BestineEvents", "museumEventDuration", 1209600); } public int beginBestineMuseumEvent(obj_id self, dictionary params) throws InterruptedException { + if(utils.checkConfigFlag("BestineEvents", "disableMuseumEvent")) { + return SCRIPT_CONTINUE; + } int museumEventNum = 1; if (hasObjVar(self, "bestine.museumEventEnded")) { diff --git a/sku.0/sys.server/compiled/game/script/city/bestine/politician_event_master.java b/sku.0/sys.server/compiled/game/script/city/bestine/politician_event_master.java index 558c704a7..7bf0847c6 100755 --- a/sku.0/sys.server/compiled/game/script/city/bestine/politician_event_master.java +++ b/sku.0/sys.server/compiled/game/script/city/bestine/politician_event_master.java @@ -16,16 +16,13 @@ public class politician_event_master extends script.base_script } public int getElectionDuration() throws InterruptedException { - String durationConfigSetting = getConfigSetting("BestineEvents", "PoliticianEventDuration"); - int electionDuration = utils.stringToInt(durationConfigSetting); - if (electionDuration == 0 || electionDuration == -1) - { - electionDuration = 2592000; - } - return electionDuration; + return utils.getIntConfigSetting("BestineEvents", "politicianEventDuration", 2592000); } public int beginBestineElection(obj_id self, dictionary params) throws InterruptedException { + if(utils.checkConfigFlag("BestineEvents", "disablePoliticianEvent")) { + return SCRIPT_CONTINUE; + } int electionNum = 1; if (hasObjVar(self, "bestine.electionEnded")) { diff --git a/sku.0/sys.server/compiled/game/script/city/guard_spawner.java b/sku.0/sys.server/compiled/game/script/city/guard_spawner.java index 5b1c896f1..8bb444f83 100755 --- a/sku.0/sys.server/compiled/game/script/city/guard_spawner.java +++ b/sku.0/sys.server/compiled/game/script/city/guard_spawner.java @@ -13,6 +13,8 @@ public class guard_spawner extends script.base_script { } public static final String guardTable = "datatables/npc/guard_spawner/guard.iff"; + public static final boolean EMPIRE_DAY_RUNNING = utils.checkConfigFlag("GameServer", "empireday_ceremony"); + public int OnAttach(obj_id self) throws InterruptedException { messageTo(self, "checkForStart", null, 3, false); @@ -33,8 +35,7 @@ public class guard_spawner extends script.base_script } else if (city.equals("theed")) { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) + if (EMPIRE_DAY_RUNNING) { utils.setScriptVar(self, "OFF", "DUE TO EMPIRE DAY"); return SCRIPT_CONTINUE; @@ -294,19 +295,15 @@ public class guard_spawner extends script.base_script String test_city = city; if (planet.equals("naboo") || planet.equals("corellia")) { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null) + if (EMPIRE_DAY_RUNNING) { - if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) + if (city.equals("coronet")) { - if (city.equals("coronet")) - { - return test_city + "_rebel_hard"; - } - else if (city.equals("theed")) - { - return test_city + "_imperial_hard"; - } + return test_city + "_rebel_hard"; + } + else if (city.equals("theed")) + { + return test_city + "_imperial_hard"; } } } diff --git a/sku.0/sys.server/compiled/game/script/city/imperial_crackdown/crackdown_cantina.java b/sku.0/sys.server/compiled/game/script/city/imperial_crackdown/crackdown_cantina.java index 8e3e943b5..9a7004d28 100755 --- a/sku.0/sys.server/compiled/game/script/city/imperial_crackdown/crackdown_cantina.java +++ b/sku.0/sys.server/compiled/game/script/city/imperial_crackdown/crackdown_cantina.java @@ -53,17 +53,10 @@ public class crackdown_cantina extends script.base_script } else { - String trouble = getConfigSetting("Imperial Crackdown", "troubleChance"); - int chanceOfTrouble = utils.stringToInt(trouble); - if (chanceOfTrouble == 0 || chanceOfTrouble == -1) - { - chanceOfTrouble = 20; - } - int rollForTrouble = rand(1, 100); - if (rollForTrouble < chanceOfTrouble) + int chanceOfTrouble = utils.getIntConfigSetting("EventTeam", "crackdownTroubleChance", 20); + if (rand(1, 100) < chanceOfTrouble) { messageTo(self, "createTrouble", null, 15, false); - return SCRIPT_CONTINUE; } else { @@ -71,8 +64,8 @@ public class crackdown_cantina extends script.base_script { removeObjVar(self, "checkingForTrouble"); } - return SCRIPT_CONTINUE; } + return SCRIPT_CONTINUE; } } public int createTrouble(obj_id self, dictionary params) throws InterruptedException diff --git a/sku.0/sys.server/compiled/game/script/content_tools/interior_buildout.java b/sku.0/sys.server/compiled/game/script/content_tools/interior_buildout.java index 6ebb6ac8e..e94f2ae59 100755 --- a/sku.0/sys.server/compiled/game/script/content_tools/interior_buildout.java +++ b/sku.0/sys.server/compiled/game/script/content_tools/interior_buildout.java @@ -1,6 +1,7 @@ package script.content_tools; import script.dictionary; +import script.library.space_flags; import script.library.utils; import script.obj_id; import script.transform; @@ -13,6 +14,7 @@ public class interior_buildout extends script.base_script public interior_buildout() { } + public int OnInitialize(obj_id self) throws InterruptedException { dictionary dctParams = new dictionary(); @@ -80,7 +82,7 @@ public class interior_buildout extends script.base_script utils.setScriptVar(self, strLocationList[intI] + "Cells", objCells); } } - if (!utils.checkConfigFlag("ScriptFlags", "liveSpaceServer")) + if (space_flags.LIVE_SPACE_SERVER_MODE_OFF) { obj_id objTest = createObject(strTemplates[intI], tr, objCell); if (!strObjVars[intI].equals("")) diff --git a/sku.0/sys.server/compiled/game/script/conversation/boba_fett.java b/sku.0/sys.server/compiled/game/script/conversation/boba_fett.java index 1cd91004e..8b1ad4495 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/boba_fett.java +++ b/sku.0/sys.server/compiled/game/script/conversation/boba_fett.java @@ -23,12 +23,7 @@ public class boba_fett extends script.base_script } public boolean boba_fett_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Death_Watch"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.DEATH_WATCH_DUNGEON_ENABLED; } public boolean boba_fett_condition_hasCompletedQuestOne(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_bronell_neutral_assassin.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_bronell_neutral_assassin.java index 5b2c52bbb..42c601b1e 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_bronell_neutral_assassin.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_bronell_neutral_assassin.java @@ -75,12 +75,7 @@ public class corvette_bronell_neutral_assassin extends script.base_script } public boolean corvette_bronell_neutral_assassin_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Neutral"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_NEUTRAL_DUNGEON_ENABLED; } public boolean corvette_bronell_neutral_assassin_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_bruce_neutral_destroy.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_bruce_neutral_destroy.java index 156005575..53199fdc4 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_bruce_neutral_destroy.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_bruce_neutral_destroy.java @@ -75,12 +75,7 @@ public class corvette_bruce_neutral_destroy extends script.base_script } public boolean corvette_bruce_neutral_destroy_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Neutral"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_NEUTRAL_DUNGEON_ENABLED; } public boolean corvette_bruce_neutral_destroy_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_colonel_imperial1.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_colonel_imperial1.java index 1abe671b0..205a4f1f6 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_colonel_imperial1.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_colonel_imperial1.java @@ -80,12 +80,7 @@ public class corvette_colonel_imperial1 extends script.base_script } public boolean corvette_colonel_imperial1_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Imperial"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_IMPERIAL_DUNGEON_ENABLED; } public boolean corvette_colonel_imperial1_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_crowley_rebel1.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_crowley_rebel1.java index d42a39f29..87632616e 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_crowley_rebel1.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_crowley_rebel1.java @@ -80,12 +80,7 @@ public class corvette_crowley_rebel1 extends script.base_script } public boolean corvette_crowley_rebel1_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Rebel"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_REBEL_DUNGEON_ENABLED; } public boolean corvette_crowley_rebel1_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_imperial_pilot.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_imperial_pilot.java index df2c28009..e4d053313 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_imperial_pilot.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_imperial_pilot.java @@ -15,8 +15,7 @@ public class corvette_imperial_pilot extends script.base_script } public boolean corvette_imperial_pilot_condition_hasImperialTicket(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Imperial"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) + if (!instance.CORVETTE_IMPERIAL_DUNGEON_ENABLED) { return false; } diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_neutral_pilot.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_neutral_pilot.java index dcfd7bc9c..064a9821f 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_neutral_pilot.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_neutral_pilot.java @@ -1,9 +1,6 @@ package script.conversation; -import script.library.ai_lib; -import script.library.chat; -import script.library.group; -import script.library.space_dungeon; +import script.library.*; import script.*; public class corvette_neutral_pilot extends script.base_script @@ -18,8 +15,7 @@ public class corvette_neutral_pilot extends script.base_script } public boolean corvette_neutral_pilot_condition_hasNeutralTicket(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Neutral"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) + if (!instance.CORVETTE_NEUTRAL_DUNGEON_ENABLED) { return false; } diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_pashna_rebel1.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_pashna_rebel1.java index da897fe88..c71d7d799 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_pashna_rebel1.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_pashna_rebel1.java @@ -80,12 +80,7 @@ public class corvette_pashna_rebel1 extends script.base_script } public boolean corvette_pashna_rebel1_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Rebel"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_REBEL_DUNGEON_ENABLED; } public boolean corvette_pashna_rebel1_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_rebel_pilot.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_rebel_pilot.java index 91a47327b..a29a86ae1 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_rebel_pilot.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_rebel_pilot.java @@ -15,8 +15,7 @@ public class corvette_rebel_pilot extends script.base_script } public boolean corvette_rebel_pilot_condition_hasRebelTicket(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Rebel"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) + if (!instance.CORVETTE_REBEL_DUNGEON_ENABLED) { return false; } diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_sabol_imperial1.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_sabol_imperial1.java index 35b63f281..8e9c929ce 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_sabol_imperial1.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_sabol_imperial1.java @@ -80,12 +80,7 @@ public class corvette_sabol_imperial1 extends script.base_script } public boolean corvette_sabol_imperial1_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Imperial"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_IMPERIAL_DUNGEON_ENABLED; } public boolean corvette_sabol_imperial1_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_tallon_rebel1.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_tallon_rebel1.java index 2b9a957d7..61a3ffe08 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_tallon_rebel1.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_tallon_rebel1.java @@ -80,12 +80,7 @@ public class corvette_tallon_rebel1 extends script.base_script } public boolean corvette_tallon_rebel1_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Rebel"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_REBEL_DUNGEON_ENABLED; } public boolean corvette_tallon_rebel1_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_velso_imperial_destroy.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_velso_imperial_destroy.java index 822c28463..9972134f8 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_velso_imperial_destroy.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_velso_imperial_destroy.java @@ -84,12 +84,7 @@ public class corvette_velso_imperial_destroy extends script.base_script } public boolean corvette_velso_imperial_destroy_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Imperial"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_IMPERIAL_DUNGEON_ENABLED; } public boolean corvette_velso_imperial_destroy_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/corvette_yondalla_neutral_rescue.java b/sku.0/sys.server/compiled/game/script/conversation/corvette_yondalla_neutral_rescue.java index dc9ae9fbb..abfef20a7 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/corvette_yondalla_neutral_rescue.java +++ b/sku.0/sys.server/compiled/game/script/conversation/corvette_yondalla_neutral_rescue.java @@ -75,12 +75,7 @@ public class corvette_yondalla_neutral_rescue extends script.base_script } public boolean corvette_yondalla_neutral_rescue_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Corellian_Corvette_Neutral"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.CORVETTE_NEUTRAL_DUNGEON_ENABLED; } public boolean corvette_yondalla_neutral_rescue_condition_onDifferentCorvetteQuest(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/death_watch_imperial_herald.java b/sku.0/sys.server/compiled/game/script/conversation/death_watch_imperial_herald.java index e26c5b00e..f688cd393 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/death_watch_imperial_herald.java +++ b/sku.0/sys.server/compiled/game/script/conversation/death_watch_imperial_herald.java @@ -1,9 +1,6 @@ package script.conversation; -import script.library.ai_lib; -import script.library.chat; -import script.library.factions; -import script.library.utils; +import script.library.*; import script.*; public class death_watch_imperial_herald extends script.base_script @@ -43,12 +40,7 @@ public class death_watch_imperial_herald extends script.base_script } public boolean death_watch_imperial_herald_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Death_Watch"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.DEATH_WATCH_DUNGEON_ENABLED; } public boolean death_watch_imperial_herald_condition_QuestComplete(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/conversation/death_watch_rebel_herald.java b/sku.0/sys.server/compiled/game/script/conversation/death_watch_rebel_herald.java index 9753b211f..a2914bc82 100755 --- a/sku.0/sys.server/compiled/game/script/conversation/death_watch_rebel_herald.java +++ b/sku.0/sys.server/compiled/game/script/conversation/death_watch_rebel_herald.java @@ -4,6 +4,7 @@ import script.library.ai_lib; import script.library.chat; import script.library.factions; import script.*; +import script.library.instance; public class death_watch_rebel_herald extends script.base_script { @@ -71,12 +72,7 @@ public class death_watch_rebel_herald extends script.base_script } public boolean death_watch_rebel_herald_condition_dungeonInactive(obj_id player, obj_id npc) throws InterruptedException { - String isDungeonActive = getConfigSetting("Dungeon", "Death_Watch"); - if (isDungeonActive == null || isDungeonActive.equals("false") || isDungeonActive.equals("0")) - { - return true; - } - return false; + return !instance.DEATH_WATCH_DUNGEON_ENABLED; } public void death_watch_rebel_herald_action_RescueandReward(obj_id player, obj_id npc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/creature/sarlacc.java b/sku.0/sys.server/compiled/game/script/creature/sarlacc.java index 12a916eb6..5ac58ef88 100755 --- a/sku.0/sys.server/compiled/game/script/creature/sarlacc.java +++ b/sku.0/sys.server/compiled/game/script/creature/sarlacc.java @@ -34,7 +34,7 @@ public class sarlacc extends script.base_script { if (volumeName.equals("sarlaccBreach")) { - if (!isPlayer(whoTriggeredMe)) + if (!isPlayer(whoTriggeredMe) || isGod(whoTriggeredMe)) { return SCRIPT_CONTINUE; } @@ -61,7 +61,7 @@ public class sarlacc extends script.base_script } else if (volumeName.equals("sarlaccPreBreach")) { - if (!isPlayer(whoTriggeredMe)) + if (!isPlayer(whoTriggeredMe) || isGod(whoTriggeredMe)) { return SCRIPT_CONTINUE; } @@ -84,7 +84,7 @@ public class sarlacc extends script.base_script if (contents != null) { for (obj_id content : contents) { - if (isPlayer(content)) { + if (isPlayer(content) && !isGod(content)) { playerHint = 1; if (bile == 0) { bile = 1; diff --git a/sku.0/sys.server/compiled/game/script/cureward/cureward.java b/sku.0/sys.server/compiled/game/script/cureward/cureward.java deleted file mode 100755 index 496fce3e1..000000000 --- a/sku.0/sys.server/compiled/game/script/cureward/cureward.java +++ /dev/null @@ -1,59 +0,0 @@ -package script.cureward; - -import script.dictionary; -import script.obj_id; - -public class cureward extends script.base_script -{ - public cureward() - { - } - public int OnAttach(obj_id self) throws InterruptedException - { - if (getConfigSetting("GameServer", "combatUpgradeReward") == null) - { - return SCRIPT_CONTINUE; - } - if (!createRewards(self)) - { - messageTo(self, "handleRetryRewardNextLogin", null, 1, false); - } - return SCRIPT_CONTINUE; - } - public int OnInitialize(obj_id self) throws InterruptedException - { - if (getConfigSetting("GameServer", "combatUpgradeReward") == null) - { - detachScript(self, "cureward.cureward"); - } - return SCRIPT_CONTINUE; - } - public boolean createRewards(obj_id self) throws InterruptedException - { - int bornOnDate = getPlayerBirthDate(self); - if (bornOnDate > 1579) - { - return true; - } - String cuRewardOption = getConfigSetting("GameServer", "combatUpgradeReward"); - obj_id reward = createObjectInInventoryAllowOverload("object/tangible/event_perk/frn_loyalty_award_plaque_silver.iff", self); - if (!isIdValid(reward)) - { - return false; - } - if (cuRewardOption.equals("2")) - { - reward = createObjectInInventoryAllowOverload("object/tangible/event_perk/frn_loyalty_award_plaque_gold.iff", self); - if (!isIdValid(reward)) - { - return false; - } - } - return true; - } - public int handleRetryRewardNextLogin(obj_id self, dictionary params) throws InterruptedException - { - detachScript(self, "cureward.cureward"); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/aprilfools/cantina_controller.java b/sku.0/sys.server/compiled/game/script/event/aprilfools/cantina_controller.java index e43771ff0..0a8ce01ff 100755 --- a/sku.0/sys.server/compiled/game/script/event/aprilfools/cantina_controller.java +++ b/sku.0/sys.server/compiled/game/script/event/aprilfools/cantina_controller.java @@ -1,10 +1,7 @@ package script.event.aprilfools; import script.dictionary; -import script.library.ai_lib; -import script.library.chat; -import script.library.create; -import script.library.utils; +import script.library.*; import script.location; import script.obj_id; import script.string_id; @@ -28,8 +25,7 @@ public class cantina_controller extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("GameServer", "foolsDay"); - if (setting == null || setting.equals("") || !setting.equals("true")) + if (!events.isEventActive(events.FOOLS_DAY)) { return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/event/aprilfools/starport_april_fools.java b/sku.0/sys.server/compiled/game/script/event/aprilfools/starport_april_fools.java index a91ef5593..d16d29463 100755 --- a/sku.0/sys.server/compiled/game/script/event/aprilfools/starport_april_fools.java +++ b/sku.0/sys.server/compiled/game/script/event/aprilfools/starport_april_fools.java @@ -3,6 +3,7 @@ package script.event.aprilfools; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.events; import script.library.utils; import script.location; import script.obj_id; @@ -21,36 +22,21 @@ public class starport_april_fools extends script.base_script public static final String SPAWN_DATATABLE = "datatables/event/aprilfools/aprilfools09.iff"; public int OnInitialize(obj_id self) throws InterruptedException { + if(!events.isEventActive(events.FOOLS_DAY)) { + return SCRIPT_CONTINUE; + } setObjVar(self, LAST_SPAWN, 0); messageTo(self, "heartbeat", null, 60.0f, false); return SCRIPT_CONTINUE; } public int heartbeat(obj_id self, dictionary params) throws InterruptedException { - String foolsDayRunning = getConfigSetting("GameServer", "foolsDay"); - if(foolsDayRunning == null || foolsDayRunning.equals("false") || foolsDayRunning.equals("0")){ - return SCRIPT_CONTINUE; - } - if (foolsDayRunning.length() <= 0) - { + int currentTime = getCalendarTime(); + if(!events.isEventRunning(events.FOOLS_DAY)) { + messageTo(self, "cleanupCreatures", null, 0.0f, false); messageTo(self, "heartbeat", null, 60.0f, false); return SCRIPT_CONTINUE; } - Calendar cal = Calendar.getInstance(); - int currentTime = getCalendarTime(); - int midnightOnAprilFoolsDay = getCalendarTime(cal.get(Calendar.YEAR), 4, 1, 0, 0, 0); - int midnightOnDayAfterAprilFools = getCalendarTime(cal.get(Calendar.YEAR), 4, 2, 0, 0, 0); - String forceAprilFools = getConfigSetting("EventTeam", "forceFoolsDay"); - if (forceAprilFools == null || forceAprilFools.length() <= 0) - { - LOG("AprilFools", "Fools day is being forced into the April Fools real 24 hour period because the [EventTeam] forceFoolsDay setting is null or not set."); - if (currentTime < midnightOnAprilFoolsDay || currentTime > midnightOnDayAfterAprilFools) - { - messageTo(self, "cleanupCreatures", null, 0.0f, false); - messageTo(self, "heartbeat", null, 60.0f, false); - return SCRIPT_CONTINUE; - } - } if (!hasObjVar(self, CITY_OBJVAR)) { LOG("AprilFools", "No City ObjVar, bailing."); @@ -64,9 +50,9 @@ public class starport_april_fools extends script.base_script LOG("AprilFools", "Failed to open table " + spawnDatatable); return SCRIPT_CONTINUE; } - int spawnTime = 60 * 60; - int configTime = utils.stringToInt(getConfigSetting("GameServer", "foolsDayTimer")); - if (configTime >= 0) + int spawnTime = 3600; + int configTime = utils.getIntConfigSetting("GameServer", "foolsDayTimer"); + if (configTime >= 1) { spawnTime = configTime * 60; } diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/firework_show.java b/sku.0/sys.server/compiled/game/script/event/emp_day/firework_show.java index 3c60cd698..83f0f0cbc 100755 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/firework_show.java +++ b/sku.0/sys.server/compiled/game/script/event/emp_day/firework_show.java @@ -2,6 +2,7 @@ package script.event.emp_day; import script.dictionary; import script.library.create; +import script.library.events; import script.library.firework; import script.library.utils; import script.obj_id; @@ -14,8 +15,7 @@ public class firework_show extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("EventTeam", "empireDay"); - if (setting == null || setting.equals("") || !setting.equals("true")) + if (!events.isEventActive(events.EMPIRE_DAY)) { return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/event/ewok_festival/loveday_disillusion_blaire_spawner.java b/sku.0/sys.server/compiled/game/script/event/ewok_festival/loveday_disillusion_blaire_spawner.java index b08bec8cf..9aa0ba436 100755 --- a/sku.0/sys.server/compiled/game/script/event/ewok_festival/loveday_disillusion_blaire_spawner.java +++ b/sku.0/sys.server/compiled/game/script/event/ewok_festival/loveday_disillusion_blaire_spawner.java @@ -3,6 +3,7 @@ package script.event.ewok_festival; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.events; import script.library.utils; import script.location; import script.obj_id; @@ -28,16 +29,7 @@ public class loveday_disillusion_blaire_spawner extends script.base_script { location spawnerLoc = getLocation(self); float spawnerYaw = getYaw(self); - boolean spawnBlaire = false; - String lovedayRunning = getConfigSetting("GameServer", "loveday"); - if (lovedayRunning != null && lovedayRunning.length() > 0) - { - if (lovedayRunning.equals("true") || lovedayRunning.equals("1")) - { - spawnBlaire = true; - } - } - if (spawnBlaire) + if (events.isEventActive(events.EWOK_FESTIVAL_OF_LOVE)) // spawn blaire { obj_id blaire = create.object("loveday_ewok_disillusion_blaire", spawnerLoc); if (isIdValid(blaire)) diff --git a/sku.0/sys.server/compiled/game/script/event/gcwraids/gcwraid.java b/sku.0/sys.server/compiled/game/script/event/gcwraids/gcwraid.java index e894f7073..e22a4e155 100755 --- a/sku.0/sys.server/compiled/game/script/event/gcwraids/gcwraid.java +++ b/sku.0/sys.server/compiled/game/script/event/gcwraids/gcwraid.java @@ -1,10 +1,7 @@ package script.event.gcwraids; import script.dictionary; -import script.library.badge; -import script.library.create; -import script.library.gcw; -import script.library.locations; +import script.library.*; import script.location; import script.obj_id; import script.string_id; @@ -29,8 +26,7 @@ public class gcwraid extends script.base_script { attachScript(self, "systems.gcw.gcw_data_updater"); } - String setting = getConfigSetting("EventTeam", "gcwraid"); - if (setting == null || setting.equals("") || !setting.equals("true")) + if (!utils.checkConfigFlag("EventTeam", "gcwraid")) { return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/event/generic_raid/generic_raid.java b/sku.0/sys.server/compiled/game/script/event/generic_raid/generic_raid.java index c092920ce..2c87db8b0 100755 --- a/sku.0/sys.server/compiled/game/script/event/generic_raid/generic_raid.java +++ b/sku.0/sys.server/compiled/game/script/event/generic_raid/generic_raid.java @@ -4,6 +4,7 @@ import script.dictionary; import script.library.badge; import script.library.create; import script.library.locations; +import script.library.utils; import script.location; import script.obj_id; import script.string_id; @@ -16,8 +17,7 @@ public class generic_raid extends script.base_script public static final String DATATABLE = "datatables/event/generic_raid/city_data.iff"; public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("EventTeam", "genericRaids"); - if (setting == null || setting.equals("") || !setting.equals("true")) + if (utils.checkConfigFlag("EventTeam", "genericRaids")) { return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/event/holiday_controller.java b/sku.0/sys.server/compiled/game/script/event/holiday_controller.java index 1b9575a4e..95d834428 100755 --- a/sku.0/sys.server/compiled/game/script/event/holiday_controller.java +++ b/sku.0/sys.server/compiled/game/script/event/holiday_controller.java @@ -1,6 +1,7 @@ package script.event; import script.dictionary; +import script.library.events; import script.library.holiday; import script.library.utils; import script.obj_id; @@ -10,6 +11,12 @@ public class holiday_controller extends script.base_script public holiday_controller() { } + + public static final boolean GALACTIC_MOON_FESTIVAL_ENABLED = events.isEventActive(events.GALACTIC_MOON_FESTIVAL); + public static final boolean LIFEDAY_ENABLED = events.isEventActive(events.LIFEDAY); + public static final boolean EWOK_FESTIVAL_OF_LOVE_ENABLED = events.isEventActive(events.EWOK_FESTIVAL_OF_LOVE); + public static final boolean EMPIRE_DAY_ENABLED = events.isEventActive(events.EMPIRE_DAY); + public int OnInitialize(obj_id self) throws InterruptedException { CustomerServiceLog("holidayEvent", "holiday_controller.OnInitialize planet initialized, holiday controller called."); @@ -38,11 +45,7 @@ public class holiday_controller extends script.base_script { return SCRIPT_CONTINUE; } - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - String lovedayRunning = getConfigSetting("GameServer", "loveday"); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (halloweenRunning != null && (halloweenRunning.equals("true") || halloweenRunning.equals("1"))) + if (GALACTIC_MOON_FESTIVAL_ENABLED) { names[idx] = "holiday_event"; attribs[idx] = "Halloween Event Running = True"; @@ -54,7 +57,7 @@ public class holiday_controller extends script.base_script attribs[idx] = "Halloween Event Running = False"; idx++; } - if (lifedayRunning != null && (lifedayRunning.equals("true") || lifedayRunning.equals("1"))) + if (LIFEDAY_ENABLED) { names[idx] = "holiday_event"; attribs[idx] = "Life Day Event Running = True"; @@ -66,7 +69,7 @@ public class holiday_controller extends script.base_script attribs[idx] = "Life Day Event Running = False"; idx++; } - if (lovedayRunning != null && (lovedayRunning.equals("true") || lovedayRunning.equals("1"))) + if (EWOK_FESTIVAL_OF_LOVE_ENABLED) { names[idx] = "holiday_event"; attribs[idx] = "Love Day Event Running = True"; @@ -78,7 +81,7 @@ public class holiday_controller extends script.base_script attribs[idx] = "Love Day Event Running = False"; idx++; } - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) + if (EMPIRE_DAY_ENABLED) { names[idx] = "holiday_event"; attribs[idx] = "Empire Day Event Running = True"; @@ -99,59 +102,55 @@ public class holiday_controller extends script.base_script String universeWideEvents = getCurrentUniverseWideEvents(); int halloween = universeWideEvents.indexOf("halloween"); - String halloweenRunning = getConfigSetting("GameServer", "halloween"); int lifeday = universeWideEvents.indexOf("lifeday"); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); int loveday = universeWideEvents.indexOf("loveday"); - String lovedayRunning = getConfigSetting("GameServer", "loveday"); int empireday = universeWideEvents.indexOf("empireday_ceremony"); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); switch (text) { case "halloweenStart": - startHolidayEvent(speaker, "halloween", halloweenRunning, halloween); + startHolidayEvent(speaker, "halloween", GALACTIC_MOON_FESTIVAL_ENABLED, halloween); return SCRIPT_OVERRIDE; case "halloweenStop": - stopHolidayEvent(speaker, "halloween", halloweenRunning, halloween); + stopHolidayEvent(speaker, "halloween", GALACTIC_MOON_FESTIVAL_ENABLED, halloween); return SCRIPT_OVERRIDE; case "halloweenStartForReals": - startHolidayEventForReals(speaker, "halloween", halloweenRunning); + startHolidayEventForReals(speaker, "halloween", GALACTIC_MOON_FESTIVAL_ENABLED); return SCRIPT_OVERRIDE; case "halloweenStopForReals": stopHolidayEventForReals(speaker, "halloween"); return SCRIPT_OVERRIDE; case "lifedayStart": - startHolidayEvent(speaker, "lifeday", lifedayRunning, lifeday); + startHolidayEvent(speaker, "lifeday", LIFEDAY_ENABLED, lifeday); return SCRIPT_OVERRIDE; case "lifedayStop": - stopHolidayEvent(speaker, "lifeday", lifedayRunning, lifeday); + stopHolidayEvent(speaker, "lifeday", LIFEDAY_ENABLED, lifeday); return SCRIPT_OVERRIDE; case "lifedayStartForReals": - startHolidayEventForReals(speaker, "lifeday", lifedayRunning); + startHolidayEventForReals(speaker, "lifeday", LIFEDAY_ENABLED); return SCRIPT_OVERRIDE; case "lifedayStopForReals": stopHolidayEventForReals(speaker, "lifeday"); return SCRIPT_OVERRIDE; case "lovedayStart": - startHolidayEvent(speaker, "loveday", lovedayRunning, loveday); + startHolidayEvent(speaker, "loveday", EWOK_FESTIVAL_OF_LOVE_ENABLED, loveday); return SCRIPT_OVERRIDE; case "lovedayStop": - stopHolidayEvent(speaker, "loveday", lovedayRunning, loveday); + stopHolidayEvent(speaker, "loveday", EWOK_FESTIVAL_OF_LOVE_ENABLED, loveday); return SCRIPT_OVERRIDE; case "lovedayStartForReals": - startHolidayEventForReals(speaker, "loveday", lovedayRunning); + startHolidayEventForReals(speaker, "loveday", EWOK_FESTIVAL_OF_LOVE_ENABLED); return SCRIPT_OVERRIDE; case "lovedayStopForReals": stopHolidayEventForReals(speaker, "loveday"); return SCRIPT_OVERRIDE; case "empiredayStart": - startHolidayEvent(speaker, "empireday_ceremony", empiredayRunning, empireday); + startHolidayEvent(speaker, "empireday_ceremony", EMPIRE_DAY_ENABLED, empireday); return SCRIPT_OVERRIDE; case "empiredayStop": - stopHolidayEvent(speaker, "empireday_ceremony", empiredayRunning, empireday); + stopHolidayEvent(speaker, "empireday_ceremony", EMPIRE_DAY_ENABLED, empireday); return SCRIPT_OVERRIDE; case "empiredayStartForReals": - startHolidayEventForReals(speaker, "empireday_ceremony", empiredayRunning); + startHolidayEventForReals(speaker, "empireday_ceremony", EMPIRE_DAY_ENABLED); return SCRIPT_OVERRIDE; case "empiredayStopForReals": stopHolidayEventForReals(speaker, "empireday_ceremony"); @@ -166,14 +165,13 @@ public class holiday_controller extends script.base_script return SCRIPT_OVERRIDE; } - private void startHolidayEvent(obj_id speaker, String holidayName, String holidayRunning, int holidayStatus) throws InterruptedException + private void startHolidayEvent(obj_id speaker, String holidayName, boolean holidayRunning, int holidayStatus) throws InterruptedException { - if (holidayRunning == null) + if (!holidayRunning) { sendSystemMessageTestingOnly(speaker, "Server config is not marked as " + holidayName + " running"); - return; } - if (holidayRunning.equals("true") || holidayRunning.equals("1")) + else { if (holidayStatus > -1) { @@ -186,22 +184,21 @@ public class holiday_controller extends script.base_script } } } - private void startHolidayEventForReals(obj_id speaker, String holidayName, String holidayRunning) throws InterruptedException + private void startHolidayEventForReals(obj_id speaker, String holidayName, boolean holidayRunning) throws InterruptedException { - if (holidayRunning == null) + if (!holidayRunning) { sendSystemMessageTestingOnly(speaker, "Server config is not marked as " + holidayName + " running"); - return; } - if (holidayRunning.equals("true") || holidayRunning.equals("1")) + else { sendSystemMessageTestingOnly(speaker, holidayName + " started."); startUniverseWideEvent(holidayName); } } - private void stopHolidayEvent(obj_id speaker, String holidayName, String holidayRunning, int holidayStatus) throws InterruptedException + private void stopHolidayEvent(obj_id speaker, String holidayName, boolean holidayRunning, int holidayStatus) throws InterruptedException { - if (holidayRunning.equals("true") || holidayRunning.equals("1")) + if (holidayRunning) { sendSystemMessageTestingOnly(speaker, "Server config is marked as " + holidayName + " running. If you are sure that it should not be running anyway, say " + holidayName + "StopForReals"); } @@ -216,9 +213,8 @@ public class holiday_controller extends script.base_script CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart Halloween event handler called."); String halloweenString = getCurrentUniverseWideEvents(); int halloween = halloweenString.indexOf("halloween"); - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart halloweenString: " + halloweenString + " halloween: " + halloween + " halloweenRunning: " + halloweenRunning); - if (halloweenRunning == null) + CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart halloweenString: " + halloweenString + " halloween: " + halloween + " halloweenRunning: " + GALACTIC_MOON_FESTIVAL_ENABLED); + if (!GALACTIC_MOON_FESTIVAL_ENABLED) { CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart Halloween event is either not running or not in the server configs."); if (halloween > -1) @@ -226,7 +222,7 @@ public class holiday_controller extends script.base_script stopUniverseWideEvent("halloween"); } } - else if (halloweenRunning.equals("true") || halloweenRunning.equals("1")) + else { if (halloween < 0) { @@ -247,9 +243,8 @@ public class holiday_controller extends script.base_script CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart Life Day event handler called."); String lifedayString = getCurrentUniverseWideEvents(); int lifeday = lifedayString.indexOf("lifeday"); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart lifedayString: " + lifedayString + " lifeday: " + lifeday + " lifedayRunning: " + lifedayRunning); - if (lifedayRunning == null) + CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart lifedayString: " + lifedayString + " lifeday: " + lifeday + " lifedayRunning: " + LIFEDAY_ENABLED); + if (!LIFEDAY_ENABLED) { CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart event is either not running or not in the server configs."); if (lifeday > -1) @@ -257,7 +252,7 @@ public class holiday_controller extends script.base_script stopUniverseWideEvent("lifeday"); } } - else if (lifedayRunning.equals("true") || lifedayRunning.equals("1")) + else { if (lifeday < 0) { @@ -278,9 +273,8 @@ public class holiday_controller extends script.base_script CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart Love Day event handler called."); String lovedayString = getCurrentUniverseWideEvents(); int loveday = lovedayString.indexOf("loveday"); - String lovedayRunning = getConfigSetting("GameServer", "loveday"); - CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart lovedayString: " + lovedayString + " loveday: " + loveday + " lovedayRunning: " + lovedayRunning); - if (lovedayRunning == null) + CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart lovedayString: " + lovedayString + " loveday: " + loveday + " lovedayRunning: " + EWOK_FESTIVAL_OF_LOVE_ENABLED); + if (!EWOK_FESTIVAL_OF_LOVE_ENABLED) { CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart event is either not running or not in the server configs."); if (loveday > -1) @@ -288,7 +282,7 @@ public class holiday_controller extends script.base_script stopUniverseWideEvent("loveday"); } } - else if (lovedayRunning.equals("true") || lovedayRunning.equals("1")) + else { if (loveday < 0) { @@ -309,9 +303,8 @@ public class holiday_controller extends script.base_script CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart Empire Day event handler called."); String empiredayString = getCurrentUniverseWideEvents(); int empireday = empiredayString.indexOf("empireday_ceremony"); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart empiredayString: " + empiredayString + " empireday: " + empireday + " empiredayRunning: " + empiredayRunning); - if (empiredayRunning == null) + CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart empiredayString: " + empiredayString + " empireday: " + empireday + " empiredayRunning: " + EMPIRE_DAY_ENABLED); + if (!EMPIRE_DAY_ENABLED) { CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart event is either not running or not in the server configs."); if (empireday > -1) @@ -319,7 +312,7 @@ public class holiday_controller extends script.base_script stopUniverseWideEvent("empireday_ceremony"); } } - else if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) + else { CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart event is starting."); if (empireday < 0) diff --git a/sku.0/sys.server/compiled/game/script/event/lifeday/lifeday_tree.java b/sku.0/sys.server/compiled/game/script/event/lifeday/lifeday_tree.java index 3acf2af00..db6effa9c 100755 --- a/sku.0/sys.server/compiled/game/script/event/lifeday/lifeday_tree.java +++ b/sku.0/sys.server/compiled/game/script/event/lifeday/lifeday_tree.java @@ -1,6 +1,7 @@ package script.event.lifeday; import script.library.badge; +import script.library.events; import script.library.static_item; import script.library.utils; import script.menu_info; @@ -27,13 +28,8 @@ public class lifeday_tree extends script.base_script } public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { - String config = getConfigSetting("GameServer", "grantGift"); - if (config != null) - { - if (config.equals("false")) - { - return SCRIPT_CONTINUE; - } + if(!events.isEventActive(events.LIFEDAY) || !utils.checkConfigFlag("GameServer", "grantGift")) { + return SCRIPT_CONTINUE; } if (!hasObjVar(player, currentYearObjVar())) { diff --git a/sku.0/sys.server/compiled/game/script/event/lost_squadron/spawner.java b/sku.0/sys.server/compiled/game/script/event/lost_squadron/spawner.java index 4b01ddfb5..4ae88db3b 100755 --- a/sku.0/sys.server/compiled/game/script/event/lost_squadron/spawner.java +++ b/sku.0/sys.server/compiled/game/script/event/lost_squadron/spawner.java @@ -1,6 +1,7 @@ package script.event.lost_squadron; import script.dictionary; +import script.library.events; import script.library.utils; import script.location; import script.obj_id; @@ -18,8 +19,7 @@ public class spawner extends script.base_script }; public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("EventTeam", "lostSquadron"); - if (setting == null || setting.equals("") || !setting.equals("true")) + if (!events.isEventActive(events.LOST_SQUADRON)) { return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java b/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java index d871cb0e7..3b0fbb572 100755 --- a/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java +++ b/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java @@ -1,6 +1,7 @@ package script.event; import script.dictionary; +import script.library.events; import script.library.holiday; import script.obj_id; @@ -9,14 +10,16 @@ public class planet_event_handler extends script.base_script public planet_event_handler() { } + private static final String EVENT_TIMESTAMP = "lifeday.time_stamp"; + private static final boolean LIFEDAY_ACTIVE = events.isEventActive(events.LIFEDAY); + public int OnAttach(obj_id self) throws InterruptedException { CustomerServiceLog("holidayEvent", "planet_event_handler.OnAttach: trigger initialized."); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - if (lifedayRunning != null && !lifedayRunning.equals("false")) + if (LIFEDAY_ACTIVE) { - CustomerServiceLog("holidayEvent", "planet_event_handler.OnAttach: Life Day oconfig found."); + CustomerServiceLog("holidayEvent", "planet_event_handler.OnAttach: Life Day config found."); checkLifeDayData(self); } else @@ -32,8 +35,7 @@ public class planet_event_handler extends script.base_script public int OnInitialize(obj_id self) throws InterruptedException { CustomerServiceLog("holidayEvent", "planet_event_handler.OnInitialize: trigger initialized."); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - if (lifedayRunning != null && !lifedayRunning.equals("false")) + if (LIFEDAY_ACTIVE) { CustomerServiceLog("holidayEvent", "planet_event_handler.OnInitialize: Life Day oconfig found."); checkLifeDayData(self); @@ -166,8 +168,7 @@ public class planet_event_handler extends script.base_script } public int lifeDayDailyAlarm(obj_id self, dictionary params) throws InterruptedException { - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - if (lifedayRunning != null && !lifedayRunning.equals("false")) + if (LIFEDAY_ACTIVE) { checkLifeDayData(self); } @@ -267,8 +268,7 @@ public class planet_event_handler extends script.base_script return false; } CustomerServiceLog("holidayEvent", "planet_event_handler.checkForHolidayEventConfigs: Function initialized."); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) + if (events.isEventActive(events.EMPIRE_DAY)) { CustomerServiceLog("holidayEvent", "planet_event_handler.checkForHolidayEventConfigs: EMPIRE DAY CONFIG FOUND."); dictionary params = new dictionary(); diff --git a/sku.0/sys.server/compiled/game/script/gm/cmd.java b/sku.0/sys.server/compiled/game/script/gm/cmd.java index a9e031e1e..a03907549 100755 --- a/sku.0/sys.server/compiled/game/script/gm/cmd.java +++ b/sku.0/sys.server/compiled/game/script/gm/cmd.java @@ -3067,11 +3067,15 @@ public class cmd extends script.base_script } public int cmdHasVeteranReward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - if (!("true").equalsIgnoreCase(getConfigSetting("GameServer", "enableVeteranRewards"))) - { + if(!isGod(self)) { return SCRIPT_CONTINUE; } - if (isGod(self) && veteran_deprecated.checkVeteranTarget(target)) + if (!veteran_deprecated.VETERAN_REWARDS_ENABLED) + { + sendSystemMessageTestingOnly(self, "Veteran rewards are currently disabled."); + return SCRIPT_CONTINUE; + } + if (veteran_deprecated.checkVeteranTarget(target)) { if (params == null || params.length() == 0) { @@ -3099,11 +3103,15 @@ public class cmd extends script.base_script } public int cmdSetVeteranReward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - if (!("true").equalsIgnoreCase(getConfigSetting("GameServer", "enableVeteranRewards"))) - { + if(!isGod(self)) { return SCRIPT_CONTINUE; } - if (isGod(self) && veteran_deprecated.checkVeteranTarget(target)) + if (!veteran_deprecated.VETERAN_REWARDS_ENABLED) + { + sendSystemMessageTestingOnly(self, "Veteran rewards are currently disabled."); + return SCRIPT_CONTINUE; + } + if (veteran_deprecated.checkVeteranTarget(target)) { if (params == null || params.length() == 0) { @@ -3126,11 +3134,15 @@ public class cmd extends script.base_script } public int cmdClearVeteranReward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - if (!("true").equalsIgnoreCase(getConfigSetting("GameServer", "enableVeteranRewards"))) - { + if(!isGod(self)) { return SCRIPT_CONTINUE; } - if (isGod(self) && veteran_deprecated.checkVeteranTarget(target)) + if (!veteran_deprecated.VETERAN_REWARDS_ENABLED) + { + sendSystemMessageTestingOnly(self, "Veteran rewards are currently disabled."); + return SCRIPT_CONTINUE; + } + if (veteran_deprecated.checkVeteranTarget(target)) { if (params == null || params.length() == 0) { @@ -3153,12 +3165,14 @@ public class cmd extends script.base_script } public int cmdOverrideActiveMonths(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - if (!("true").equalsIgnoreCase(getConfigSetting("GameServer", "enableVeteranRewards"))) - { + if(!isGod(self)) { return SCRIPT_CONTINUE; } - if (isGod(self)) + if (!veteran_deprecated.VETERAN_REWARDS_ENABLED) { + sendSystemMessageTestingOnly(self, "Veteran rewards are currently disabled."); + return SCRIPT_CONTINUE; + } if (params == null || params.length() == 0) { sendSystemMessageTestingOnly(self, "format: /overrideActiveMonths "); @@ -3181,7 +3195,6 @@ public class cmd extends script.base_script setObjVar(self, veteran_deprecated.OBJVAR_TIME_ACTIVE, days); sendSystemMessage(self, veteran_deprecated.SID_OK); } - } return SCRIPT_CONTINUE; } public int parseMilestone(String params) throws InterruptedException diff --git a/sku.0/sys.server/compiled/game/script/guild/master_city_object.java b/sku.0/sys.server/compiled/game/script/guild/master_city_object.java index 06198f2c7..e58a7256d 100755 --- a/sku.0/sys.server/compiled/game/script/guild/master_city_object.java +++ b/sku.0/sys.server/compiled/game/script/guild/master_city_object.java @@ -10,8 +10,8 @@ public class master_city_object extends script.base_script public master_city_object() { } - public static final int CITY_PROCESS_INTERVAL = 60 * 60; - public static final int CITY_UPDATE_INTERVAL = 60 * 60 * 24 * 7; + public static final int CITY_PROCESS_INTERVAL = 3600; // 1 hour in seconds + public static final int CITY_UPDATE_INTERVAL = 604800; // 1 week in seconds public static final string_id ELECTION_INCUMBENT_WIN_SUBJECT = new string_id("city/city", "election_incumbent_win_subject"); public static final string_id ELECTION_INCUMBENT_WIN_BODY = new string_id("city/city", "election_incumbent_win_body"); public static final string_id ELECTION_INCUMBENT_LOST_SUBJECT = new string_id("city/city", "election_incumbent_lost_subject"); @@ -47,12 +47,7 @@ public class master_city_object extends script.base_script { int[] cityUpdateIds = objvar_mangle.getMangledIntArrayObjVar(self, "cityUpdate.ids"); int[] cityUpdateTimes = objvar_mangle.getMangledIntArrayObjVar(self, "cityUpdate.times"); - String strCityUpdateInterval = getConfigSetting("GameServer", "cityUpdateInterval"); - int cityUpdateInterval = 0; - if (strCityUpdateInterval != null) - { - cityUpdateInterval = utils.stringToInt(strCityUpdateInterval); - } + int cityUpdateInterval = utils.getIntConfigSetting("GameServer", "cityUpdateInterval", CITY_UPDATE_INTERVAL); if (cityUpdateInterval < CITY_PROCESS_INTERVAL) { cityUpdateInterval = CITY_UPDATE_INTERVAL; diff --git a/sku.0/sys.server/compiled/game/script/guild/master_guild_object.java b/sku.0/sys.server/compiled/game/script/guild/master_guild_object.java index c46234a66..28ae81ce1 100755 --- a/sku.0/sys.server/compiled/game/script/guild/master_guild_object.java +++ b/sku.0/sys.server/compiled/game/script/guild/master_guild_object.java @@ -11,10 +11,9 @@ public class master_guild_object extends script.base_script public master_guild_object() { } - public static int guildProcessInterval = -1; - public static int guildUpdateInterval = -1; - public static final int DEFAULT_GUILD_PROCESS_INTERVAL = 60 * 60; - public static final int DEFAULT_GUILD_UPDATE_INTERVAL = 60 * 60 * 24 * 7; + public static final int GUILD_UPDATE_INTERVAL_CONFIG = utils.getIntConfigSetting("GameServer", "guildUpdateInterval", -1); + public static final int DEFAULT_GUILD_PROCESS_INTERVAL = 3600; + public static final int DEFAULT_GUILD_UPDATE_INTERVAL = 604800; public static final int MIN_GUILD_MEMBERS = 5; public static final String VAR_NAMECHANGE = "guildNamechange"; public static final String VAR_NAMECHANGE_IDS = VAR_NAMECHANGE + ".ids"; @@ -260,36 +259,14 @@ public class master_guild_object extends script.base_script } public int getGuildProcessInterval() throws InterruptedException { - if (guildProcessInterval == -1) - { - String strGuildProcessInterval = getConfigSetting("GameServer", "guildProcessInterval"); - if (strGuildProcessInterval != null) - { - guildProcessInterval = utils.stringToInt(strGuildProcessInterval); - } - if (guildProcessInterval <= 0) - { - guildProcessInterval = DEFAULT_GUILD_PROCESS_INTERVAL; - } - debugServerConsoleMsg(null, "guildProcessInterval set to " + guildProcessInterval + " seconds."); - } - return guildProcessInterval; + return DEFAULT_GUILD_PROCESS_INTERVAL; } public int getGuildUpdateInterval() throws InterruptedException { - if (guildUpdateInterval == -1) - { - String strGuildUpdateInterval = getConfigSetting("GameServer", "guildUpdateInterval"); - if (strGuildUpdateInterval != null) - { - guildUpdateInterval = utils.stringToInt(strGuildUpdateInterval); - } - if (guildUpdateInterval <= 0) - { - guildUpdateInterval = DEFAULT_GUILD_UPDATE_INTERVAL; - } - debugServerConsoleMsg(null, "guildUpdateInterval set to " + guildUpdateInterval + " seconds."); + if (GUILD_UPDATE_INTERVAL_CONFIG < 0 || GUILD_UPDATE_INTERVAL_CONFIG < getGuildProcessInterval()) { + return DEFAULT_GUILD_UPDATE_INTERVAL; + } else { + return GUILD_UPDATE_INTERVAL_CONFIG; } - return guildUpdateInterval; } } diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/cts_test2.java b/sku.0/sys.server/compiled/game/script/hnguyen/cts_test2.java deleted file mode 100755 index 00959f85c..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/cts_test2.java +++ /dev/null @@ -1,168 +0,0 @@ -package script.hnguyen; - -import script.dictionary; -import script.obj_id; -import script.script_entry; - -import java.io.*; -import java.util.StringTokenizer; - -public class cts_test2 extends script.base_script -{ - public cts_test2() - { - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("dctsi2 ")) - { - StringTokenizer st = new StringTokenizer(strText); - if ((st.countTokens() == 2) || (st.countTokens() == 3)) - { - String command = st.nextToken(); - String file = st.nextToken(); - boolean onServer = true; - boolean onClient = false; - if (st.countTokens() == 1) - { - String option = st.nextToken(); - if (option.equals("clientAlso")) - { - onClient = true; - } - else if (option.equals("clientOnly")) - { - onServer = false; - onClient = true; - } - } - dictionary characterData = new dictionary(); - characterData.put("withItems", true); - characterData.put("allowOverride", true); - Object[] triggerParams = new Object[2]; - triggerParams[0] = self; - triggerParams[1] = characterData; - try - { - int err = script_entry.runScripts("OnUploadCharacter", triggerParams); - if (err == SCRIPT_CONTINUE) - { - byte[] dictPacked = characterData.pack(); - if (onServer) - { - FileOutputStream fos = null; - DataOutputStream dos = null; - try - { - fos = new FileOutputStream(file); - dos = new DataOutputStream(fos); - for (byte b : dictPacked) { - dos.writeByte(b); - } - fos.close(); - fos = null; - long fileSize = (new File(file)).length(); - sendSystemMessageTestingOnly(self, "dictionary written to " + file + " file size=" + fileSize); - } - catch(IOException ioe) - { - sendSystemMessageTestingOnly(self, "IO error: " + ioe); - } - try - { - if (fos != null) - { - fos.close(); - } - } - catch(IOException ioe2) - { - sendSystemMessageTestingOnly(self, "IO error on closing file: " + ioe2); - } - } - if (onClient) - { - saveBytesOnClient(self, file, dictPacked); - } - } - else - { - sendSystemMessageTestingOnly(self, "trigger OnUploadCharacter() *DIDN'T* return SCRIPT_CONTINUE"); - } - } - catch(Throwable t) - { - sendSystemMessageTestingOnly(self, "trigger OnUploadCharacter() resulted in exception: " + t); - } - } - } - else if (strText.startsWith("actsi2 ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - removeObjVar(self, "hasTransferred"); - String command = st.nextToken(); - String file = st.nextToken(); - byte[] dictRead = null; - FileInputStream fis = null; - DataInputStream dis = null; - try - { - long fileSize = (new File(file)).length(); - sendSystemMessageTestingOnly(self, "reading dictionary " + file + " file size=" + fileSize); - fis = new FileInputStream(file); - dis = new DataInputStream(fis); - dictRead = new byte[(int)(fileSize)]; - int index = 0; - while (true) - { - dictRead[index++] = dis.readByte(); - } - } - catch(EOFException eof) - { - if (dictRead != null) - { - Object[] triggerParams = new Object[2]; - triggerParams[0] = self; - triggerParams[1] = dictRead; - int err = script_entry.runScripts("OnDownloadCharacter", triggerParams); - if (err == SCRIPT_CONTINUE) - { - sendSystemMessageTestingOnly(self, "trigger OnDownloadCharacter() return SCRIPT_CONTINUE"); - } - else - { - sendSystemMessageTestingOnly(self, "trigger OnDownloadCharacter() *DIDN'T* return SCRIPT_CONTINUE"); - } - } - else - { - sendSystemMessageTestingOnly(self, "couldn't read dictionary"); - } - } - catch(IOException ioe) - { - sendSystemMessageTestingOnly(self, "IO error: " + ioe); - } - try - { - if (fis != null) - { - fis.close(); - } - } - catch(IOException ioe2) - { - sendSystemMessageTestingOnly(self, "IO error on closing file: " + ioe2); - } - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/cwdm_test.java b/sku.0/sys.server/compiled/game/script/hnguyen/cwdm_test.java deleted file mode 100755 index ed69242c4..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/cwdm_test.java +++ /dev/null @@ -1,4013 +0,0 @@ -package script.hnguyen; - -import script.*; -import script.combat_engine.hit_result; -import script.library.*; - -import java.util.Iterator; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.Vector; - -public class cwdm_test extends script.base_script -{ - public cwdm_test() - { - } - public static final String PROP_TEXT = "Text"; - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("createInOverloaded ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String item = st.nextToken(); - String container = st.nextToken(); - obj_id containerOid = utils.stringToObjId(container); - createObjectOverloaded(item, containerOid); - } - } - else if (strText.startsWith("hasProxyOrAuthObject ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id id = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "hasProxyOrAuthObject(id=" + id + ") returns " + hasProxyOrAuthObject(id)); - } - } - else if (strText.startsWith("getCharacterCtsHistory ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getCharacterCtsHistory(player=" + player + ") returns:"); - dictionary ctsHistory = getCharacterCtsHistory(player); - if (ctsHistory == null) - { - sendSystemMessageTestingOnly(self, "null dictionary"); - } - else - { - String[] sourceCharacterNames = ctsHistory.getStringArray("character_name"); - String[] sourceClusterNames = ctsHistory.getStringArray("cluster_name"); - int[] transferTimes = ctsHistory.getIntArray("transfer_time"); - if (sourceCharacterNames == null) - { - sendSystemMessageTestingOnly(self, "null \"character_name\" dictionary"); - } - else if (sourceClusterNames == null) - { - sendSystemMessageTestingOnly(self, "null \"cluster_name\" dictionary"); - } - else if (transferTimes == null) - { - sendSystemMessageTestingOnly(self, "null \"transfer_time\" dictionary"); - } - else if (sourceCharacterNames.length <= 0) - { - sendSystemMessageTestingOnly(self, "empty \"character_name\" dictionary"); - } - else if (sourceClusterNames.length <= 0) - { - sendSystemMessageTestingOnly(self, "empty \"cluster_name\" dictionary"); - } - else if (transferTimes.length <= 0) - { - sendSystemMessageTestingOnly(self, "empty \"transfer_time\" dictionary"); - } - else if (sourceCharacterNames.length != sourceClusterNames.length) - { - sendSystemMessageTestingOnly(self, "\"character_name\" dictionary length != \"cluster_name\" dictionary length"); - } - else if (sourceCharacterNames.length != transferTimes.length) - { - sendSystemMessageTestingOnly(self, "\"character_name\" dictionary length != \"transfer_time\" dictionary length"); - } - else - { - for (int i = 0; i < sourceCharacterNames.length; ++i) - { - sendSystemMessageTestingOnly(self, "(" + sourceCharacterNames[i] + ") (" + sourceClusterNames[i] + ") (" + transferTimes[i] + ", " + getCalendarTimeStringLocal(transferTimes[i]) + ")"); - } - } - } - } - } - else if (strText.startsWith("setHealth ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int value = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling setHealth(target=" + target + ", value=" + value + ")"); - setHealth(target, value); - } - } - else if (strText.startsWith("setHitpoints ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int value = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling setHitpoints(target=" + target + ", value=" + value + ")"); - setHitpoints(target, value); - } - } - else if (strText.startsWith("getShipContents ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id ship = utils.stringToObjId(st.nextToken()); - int got = getGameObjectType(ship); - if (isGameObjectTypeOf(got, GOT_ship)) - { - obj_id[] contents = getContents(ship); - if (contents == null) - { - sendSystemMessageTestingOnly(self, ship + " has null contents"); - } - else if (contents.length <= 0) - { - sendSystemMessageTestingOnly(self, ship + " has " + contents.length + " contents"); - } - else - { - sendSystemMessageTestingOnly(self, ship + " has " + contents.length + " contents"); - for (obj_id content : contents) { - sendSystemMessageTestingOnly(self, "" + content); - } - } - } - else - { - sendSystemMessageTestingOnly(self, ship + " is not of type GOT_ship"); - } - } - } - else if (strText.startsWith("getShipSlots ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id ship = utils.stringToObjId(st.nextToken()); - int got = getGameObjectType(ship); - if (isGameObjectTypeOf(got, GOT_ship)) - { - int[] shipSlots = getShipChassisSlots(ship); - if (shipSlots == null) - { - sendSystemMessageTestingOnly(self, ship + " has null slots"); - } - else if (shipSlots.length <= 0) - { - sendSystemMessageTestingOnly(self, ship + " has " + shipSlots.length + " slots"); - } - else - { - sendSystemMessageTestingOnly(self, ship + " has " + shipSlots.length + " slots"); - for (int i = 0; i < shipSlots.length; ++i) - { - sendSystemMessageTestingOnly(self, ship + " slot " + (i + 1) + " " + (isShipSlotInstalled(ship, shipSlots[i]) ? "installed" : "NOT installed")); - } - sendSystemMessageTestingOnly(self, ship + " getChassisComponentMassMaximum()=" + getChassisComponentMassMaximum(ship)); - sendSystemMessageTestingOnly(self, ship + " getShipMaximumChassisHitPoints()=" + getShipMaximumChassisHitPoints(ship)); - sendSystemMessageTestingOnly(self, ship + " getShipCurrentChassisHitPoints()=" + getShipCurrentChassisHitPoints(ship)); - } - } - else - { - sendSystemMessageTestingOnly(self, ship + " is not of type GOT_ship"); - } - } - } - else if (strText.equals("testEmptyDictionary")) - { - dictionary itemDictionary = new dictionary(); - dictionary itemContentsIn = new dictionary(); - itemDictionary.put("contents", itemContentsIn); - dictionary itemContentsOut = itemDictionary.getDictionary("contents"); - if (itemContentsOut == null) - { - sendSystemMessageTestingOnly(self, "itemContentsOut is null"); - } - else - { - Set keySet = itemContentsOut.keySet(); - if (keySet == null) - { - sendSystemMessageTestingOnly(self, "keySet is null"); - } - else - { - Iterator contentsIterator = keySet.iterator(); - if (contentsIterator == null) - { - sendSystemMessageTestingOnly(self, "contentsIterator is null"); - } - else - { - if (contentsIterator.hasNext()) - { - sendSystemMessageTestingOnly(self, "contentsIterator.hasNext() is true"); - } - Integer[] contents = new Integer[keySet.size()]; - keySet.toArray(contents); - sendSystemMessageTestingOnly(self, "contents.length is " + contents.length); - } - } - } - sendSystemMessageTestingOnly(self, "testEmptyDictionary done"); - } - if (strText.equals("testIntegerLongReferenceParam")) - { - int[] i = new int[1]; - i[0] = 777; - long[] l = new long[1]; - l[0] = 7777L; - sendSystemMessageTestingOnly(self, "before i=" + i[0] + " l=" + l[0]); - testIntegerLongReferenceParam(i, l); - sendSystemMessageTestingOnly(self, "after i=" + i[0] + " l=" + l[0]); - } - else if (strText.startsWith("isAccountQualifiedForHousePackup ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "isAccountQualifiedForHousePackup(target=" + target + ") returns " + isAccountQualifiedForHousePackup(target)); - } - } - else if (strText.equals("nukeItems")) - { - obj_id[] old_waypoints = getWaypointsInDatapad(self); - if (old_waypoints != null && old_waypoints.length > 0) - { - for (obj_id old_waypoint : old_waypoints) { - destroyWaypointInDatapad(old_waypoint, self); - } - } - obj_id[] existingItems = getInventoryAndEquipment(self); - obj_id inv = utils.getInventoryContainer(self); - if (existingItems != null) - { - int existingIter; - for (existingIter = 0; existingIter < existingItems.length; ++existingIter) - { - if (existingItems[existingIter] != self && existingItems[existingIter] != inv) - { - destroyObject(existingItems[existingIter]); - } - } - } - obj_id playerDatapad = utils.getPlayerDatapad(self); - obj_id datapadObjects[] = getContents(playerDatapad); - for (obj_id datapadObject : datapadObjects) { - destroyObject(datapadObject); - } - } - else if (strText.startsWith("getResourceCtsData ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getResourceCtsData(resourceContainer=" + object + ") returns " + getResourceCtsData(object)); - } - } - else if (strText.startsWith("setCount ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int count = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "setCount(target=" + object + ", value=" + count + ") returns " + setCount(object, count)); - } - } - else if (strText.startsWith("setCrafter ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id crafter = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "setCrafter(target=" + target + ", crafter=" + crafter + ") returns " + setCrafter(target, crafter)); - } - } - else if (strText.startsWith("getCrafter ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getCrafter(object=" + object + ") returns " + getCrafter(object)); - } - } - else if (strText.startsWith("recomputeCrateAttributes ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id crate = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling recomputeCrateAttributes(crate=" + crate + ")"); - recomputeCrateAttributes(crate); - } - } - else if (strText.startsWith("getSkillModBonus ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - String skillMod = st.nextToken(); - sendSystemMessageTestingOnly(self, "getSkillModBonus(target=" + target + ", skillMod=" + skillMod + ") returns " + getSkillModBonus(target, skillMod)); - } - } - else if (strText.startsWith("setSkillModBonus ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - String skillMod = st.nextToken(); - int bonus = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "setSkillModBonus(target=" + target + ", skillMod=" + skillMod + ", bonus=" + bonus + ") returns " + setSkillModBonus(target, skillMod, bonus)); - } - } - else if (strText.startsWith("setCategorizedSkillModBonus ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 5) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - String category = st.nextToken(); - String skillMod = st.nextToken(); - int bonus = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "setCategorizedSkillModBonus(target=" + target + ", category=" + category + ", skillMod=" + skillMod + ", bonus=" + bonus + ") returns " + setCategorizedSkillModBonus(target, category, skillMod, bonus)); - } - } - else if (strText.startsWith("removeCategorizedSkillModBonuses ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - String category = st.nextToken(); - sendSystemMessageTestingOnly(self, "calling removeCategorizedSkillModBonuses(target=" + target + ", category=" + category + ")"); - removeCategorizedSkillModBonuses(target, category); - } - } - else if (strText.startsWith("setObjIdScriptVar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String name = st.nextToken(); - obj_id value = utils.stringToObjId(st.nextToken()); - utils.setScriptVar(object, name, value); - } - } - else if (strText.startsWith("setLocationScriptVar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 8) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String name = st.nextToken(); - float x = utils.stringToFloat(st.nextToken()); - float y = utils.stringToFloat(st.nextToken()); - float z = utils.stringToFloat(st.nextToken()); - String scene = st.nextToken(); - obj_id cell = utils.stringToObjId(st.nextToken()); - location value = new location(x, y, z, scene, cell); - utils.setScriptVar(object, name, value); - } - } - else if (strText.startsWith("setLocationArrayScriptVar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 8) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String name = st.nextToken(); - float x = utils.stringToFloat(st.nextToken()); - float y = utils.stringToFloat(st.nextToken()); - float z = utils.stringToFloat(st.nextToken()); - String scene = st.nextToken(); - obj_id cell = utils.stringToObjId(st.nextToken()); - location[] value = new location[1]; - value[0] = new location(x, y, z, scene, cell); - utils.setScriptVar(object, name, value); - } - } - else if (strText.startsWith("setObjIdArrayScriptVar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String name = st.nextToken(); - obj_id value = utils.stringToObjId(st.nextToken()); - obj_id[] existingValues = utils.getObjIdArrayScriptVar(object, name); - utils.removeScriptVar(object, name); - if (existingValues == null) - { - obj_id[] newValues = new obj_id[1]; - newValues[0] = value; - utils.setScriptVar(object, name, newValues); - } - else - { - Vector newValues = new Vector(); - newValues.setSize(existingValues.length); - for (int i = 0; i < existingValues.length; ++i) - { - newValues.set(i, existingValues[i]); - } - newValues = utils.addElement(newValues, value); - utils.setScriptVar(object, name, newValues); - } - } - } - else if (strText.startsWith("setObjIdDictionaryScriptVar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String name = st.nextToken(); - obj_id value = utils.stringToObjId(st.nextToken()); - utils.removeScriptVar(object, name); - dictionary d = new dictionary(); - d.put("value1", value); - obj_id[] valueArray = new obj_id[1]; - valueArray[0] = value; - d.put("value2", valueArray); - utils.setScriptVar(object, name, d); - } - } - else if (strText.equals("checkRadialMenuItems")) - { - sendSystemMessageTestingOnly(self, "SERVER_MENU1 = " + menu_info_types.SERVER_MENU1); - sendSystemMessageTestingOnly(self, "SERVER_MENU2 = " + menu_info_types.SERVER_MENU2); - sendSystemMessageTestingOnly(self, "SERVER_PET_MOUNT = " + menu_info_types.SERVER_PET_MOUNT); - sendSystemMessageTestingOnly(self, "SERVER_VEHICLE_ENTER_EXIT = " + menu_info_types.SERVER_VEHICLE_ENTER_EXIT); - } - else if (strText.startsWith("createStaticItem ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String item = st.nextToken(); - String container = st.nextToken(); - obj_id containerOid = utils.stringToObjId(container); - sendSystemMessageTestingOnly(self, "static_item.createNewItemFunction(item=" + item + ", container=" + containerOid + ") returns " + static_item.createNewItemFunction(item, containerOid)); - } - } - else if (strText.startsWith("random ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - int min = utils.stringToInt(st.nextToken()); - int max = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "rand(min=" + min + ", max=" + max + ") returns " + rand(min, max)); - } - } - else if (strText.startsWith("modifyYaw ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - float degrees = utils.stringToFloat(st.nextToken()); - sendSystemMessageTestingOnly(self, "modifyYaw(object=" + object + ", degrees=" + degrees + ")"); - modifyYaw(object, degrees); - } - } - else if (strText.startsWith("modifyPitch ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - float degrees = utils.stringToFloat(st.nextToken()); - sendSystemMessageTestingOnly(self, "modifyPitch(object=" + object + ", degrees=" + degrees + ")"); - modifyPitch(object, degrees); - } - } - else if (strText.startsWith("modifyRoll ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - float degrees = utils.stringToFloat(st.nextToken()); - sendSystemMessageTestingOnly(self, "modifyRoll(object=" + object + ", degrees=" + degrees + ")"); - modifyRoll(object, degrees); - } - } - else if (strText.startsWith("resetRotation ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "resetRotation(object=" + object + ")"); - setQuaternion(object, 1.0f, 0.0f, 0.0f, 0.0f); - } - } - else if (strText.startsWith("rotateRandom ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int yaw = rand(-180, 180); - int pitch = rand(-180, 180); - int roll = rand(-180, 180); - sendSystemMessageTestingOnly(self, "rotateRandom(object=" + object + ") y=" + yaw + ", p=" + pitch + ", r=" + roll); - modifyYaw(object, yaw); - modifyPitch(object, pitch); - modifyRoll(object, roll); - } - } - else if (strText.startsWith("rotateRandomYaw ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int degrees = rand(-180, 180); - sendSystemMessageTestingOnly(self, "rotateRandomYaw(object=" + object + ") degrees=" + degrees); - modifyYaw(object, degrees); - } - } - else if (strText.startsWith("rotateRandomPitch ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int degrees = rand(-180, 180); - sendSystemMessageTestingOnly(self, "rotateRandomPitch(object=" + object + ") degrees=" + degrees); - modifyPitch(object, degrees); - } - } - else if (strText.startsWith("rotateRandomRoll ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int degrees = rand(-180, 180); - sendSystemMessageTestingOnly(self, "rotateRandomRoll(object=" + object + ") degrees=" + degrees); - modifyRoll(object, degrees); - } - } - else if (strText.startsWith("copyRotation ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id source = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "copyRotation(target=" + target + ", source=" + source + ")"); - float[] quaternion = getQuaternion(source); - if ((quaternion != null) && (quaternion.length == 4)) - { - setQuaternion(target, quaternion[0], quaternion[1], quaternion[2], quaternion[3]); - } - } - } - else if (strText.startsWith("copyPosition ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id source = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "verifying copyPosition(target=" + target + ", source=" + source + ")"); - location sourceLoc = getLocation(source); - location targetLoc = getLocation(target); - sendSystemMessageTestingOnly(self, "sourceLoc=" + sourceLoc); - sendSystemMessageTestingOnly(self, "targetLoc=" + targetLoc); - if ((sourceLoc != null) && (targetLoc != null) && (sourceLoc.area != null) && (targetLoc.area != null) && (sourceLoc.area.equals(targetLoc.area)) && (isIdValid(sourceLoc.cell)) && (isIdValid(targetLoc.cell)) && (sourceLoc.cell == targetLoc.cell)) - { - targetLoc.x = sourceLoc.x; - targetLoc.z = sourceLoc.z; - sendSystemMessageTestingOnly(self, "doing copyPosition(target=" + target + ", source=" + source + ")"); - setLocation(target, targetLoc); - } - } - } - else if (strText.startsWith("copyHeight ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id source = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "verifying copyHeight(target=" + target + ", source=" + source + ")"); - location sourceLoc = getLocation(source); - location targetLoc = getLocation(target); - sendSystemMessageTestingOnly(self, "sourceLoc=" + sourceLoc); - sendSystemMessageTestingOnly(self, "targetLoc=" + targetLoc); - if ((sourceLoc != null) && (targetLoc != null) && (sourceLoc.area != null) && (targetLoc.area != null) && (sourceLoc.area.equals(targetLoc.area)) && (isIdValid(sourceLoc.cell)) && (isIdValid(targetLoc.cell)) && (sourceLoc.cell == targetLoc.cell)) - { - targetLoc.y = sourceLoc.y; - sendSystemMessageTestingOnly(self, "doing copyHeight(target=" + target + ", source=" + source + ")"); - setLocation(target, targetLoc); - } - } - } - else if (strText.startsWith("readStringObjvarConvertToOid ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String objVarName = st.nextToken(); - if (hasObjVar(self, objVarName)) - { - String objVarValue = getStringObjVar(self, objVarName); - if (objVarValue != null && objVarValue.length() > 0) - { - obj_id objVarValueAsOid = utils.stringToObjId(objVarValue.substring(1)); - if (isValidId(objVarValueAsOid)) - { - sendSystemMessageTestingOnly(self, self + " has objvar " + objVarName + " with objvar string value " + objVarValue + " which converts to valid oid " + objVarValueAsOid); - } - else - { - sendSystemMessageTestingOnly(self, self + " has objvar " + objVarName + " but objvar string value " + objVarValue + " is not a valid oid"); - } - } - else - { - sendSystemMessageTestingOnly(self, self + " has objvar " + objVarName + " but objvar string value is null or empty"); - } - } - else - { - sendSystemMessageTestingOnly(self, self + " does have objvar " + objVarName); - } - } - } - else if (strText.startsWith("cspMiss ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspMiss(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = false; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_MISS); - } - } - else if (strText.startsWith("cspDodge ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspDodge(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = false; - hr.dodge = true; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_MISS); - } - } - else if (strText.startsWith("cspParry ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspParry(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = false; - hr.parry = true; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_MISS); - } - } - else if (strText.startsWith("cspHit ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspHit(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = true; - hr.damage = 777; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_HIT); - } - } - else if (strText.startsWith("cspCrush ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspCrush(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = true; - hr.damage = 777; - hr.crushing = true; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_HIT); - } - } - else if (strText.startsWith("cspStrikethrough ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspStrikethrough(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = true; - hr.damage = 777; - hr.strikethrough = true; - hr.strikethroughAmmount = 12.9f; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_HIT); - } - } - else if (strText.startsWith("cspEvade ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspEvade(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = true; - hr.damage = 777; - hr.evadeResult = true; - hr.evadeAmmount = 7.1f; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_HIT); - } - } - else if (strText.startsWith("cspBlock ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id attacker = utils.stringToObjId(st.nextToken()); - obj_id defender = utils.stringToObjId(st.nextToken()); - obj_id weapon = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "cspBlock(attacker=" + attacker + ", defender=" + defender + ", weapon=" + weapon + ")"); - combat_engine.hit_result hr = new combat_engine.hit_result(); - hr.success = true; - hr.damage = 777; - hr.blockResult = true; - hr.block = 183; - sendCombatSpam(attacker, defender, weapon, hr, new string_id(), true, true, true, COMBAT_RESULT_HIT); - } - } - else if (strText.startsWith("residenceHouseId ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id value = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "setting residenceHouseId objvar for " + object + " value " + value); - setObjVar(object, "residenceHouseId", value); - } - } - else if (strText.startsWith("getPlayerIdFromFirstName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String firstName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getPlayerIdFromFirstName(" + firstName + ") returns " + getPlayerIdFromFirstName(firstName)); - } - } - else if (strText.startsWith("getName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getName(object=" + object + ") is (" + getName(object) + ")"); - sendSystemMessageTestingOnly(self, "getFirstName(object=" + object + ") is (" + getFirstName(object) + ")"); - sendSystemMessageTestingOnly(self, "getPlayerName(object=" + object + ") is (" + getPlayerName(object) + ")"); - sendSystemMessageTestingOnly(self, "getPlayerFullName(object=" + object + ") is (" + getPlayerFullName(object) + ")"); - } - } - else if (strText.startsWith("msgDestroyStructure ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id structure = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "sending msgDestroyStructure for structure " + structure + " with a delay of 10 seconds"); - messageTo(structure, "msgDestroyStructure", null, 10.0f, false); - } - } - else if (strText.startsWith("isAuthoritative ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "obj_id.isAuthoritative(object=" + object + ") returns " + object.isAuthoritative()); - sendSystemMessageTestingOnly(self, "obj_id.isLoaded(object=" + object + ") returns " + object.isLoaded()); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - } - else if (strText.startsWith("getOwner ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "getOwner(object=" + object + ") returns " + getOwner(object)); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - } - else if (strText.startsWith("getCitizenOfCityId ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getCitizenOfCityId target=" + object + " returns " + getCitizenOfCityId(object)); - } - } - else if (strText.startsWith("getPlanetByName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String planet = st.nextToken(); - sendSystemMessageTestingOnly(self, "getPlanetByName planet=" + planet + " returns " + getPlanetByName(planet)); - } - } - else if (strText.equals("registerCloningFacility")) - { - location cloneLoc = getWorldLocation(self); - location cloneRespawn = getLocation(self); - obj_id planet = getPlanetByName(cloneLoc.area); - if (isIdValid(planet)) - { - dictionary params = new dictionary(); - params.put("id", self); - params.put("name", getName(self)); - params.put("buildout", ""); - params.put("areaId", self); - params.put("loc", cloneLoc); - params.put("respawn", cloneRespawn); - params.put("type", 0); - messageTo(planet, "registerCloningFacility", params, 1.0f, false); - sendSystemMessageTestingOnly(self, "registerCloningFacility planet=" + planet); - } - } - else if (strText.equals("removeTef")) - { - pvpRemoveAllTempEnemyFlags(self); - sendSystemMessageTestingOnly(self, "removeTef"); - } - else if (strText.startsWith("doDamage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int amount = utils.stringToInt(st.nextToken()); - hit_result hit = new hit_result(); - hit.damage = amount; - sendSystemMessageTestingOnly(self, "doDamage(attacker=" + self + ", target=" + target + ", amount=" + amount + ")"); - doDamage(self, target, hit); - addHate(self, target, 0.0f); - addHate(target, self, 0.0f); - } - } - else if (strText.startsWith("logActivity ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - int activity = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "session.logActivity(player=" + player + ", activity=" + activity + ")"); - session.logActivity(player, activity); - } - } - else if (strText.startsWith("canHelp ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id actor = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "pvpCanHelp(actor=" + actor + ", target=" + target + ") returns " + pvpCanHelp(actor, target)); - } - } - else if (strText.startsWith("canSee ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id source = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "canSee(source=" + source + ", target=" + target + ") returns " + canSee(source, target)); - sendSystemMessageTestingOnly(self, "canSee(source=" + target + ", target=" + source + ") returns " + canSee(target, source)); - } - } - else if (strText.startsWith("testSui ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - int buttons = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling sui.msgbox() with button(s) " + buttons); - int pid = sui.msgbox(self, self, "this is a test message", buttons, "testSuiHandler"); - } - } - else if (strText.startsWith("testSuiObjectRange ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - int buttons = utils.stringToInt(st.nextToken()); - obj_id object = utils.stringToObjId(st.nextToken()); - float range = utils.stringToFloat(st.nextToken()); - int pid = createSUIPage(sui.SUI_MSGBOX, self, self, "testSuiHandler"); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, "this is a test message"); - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, sui.DEFAULT_TITLE); - sui.msgboxButtonSetup(pid, buttons); - setSUIAssociatedObject(pid, object); - setSUIMaxRangeToObject(pid, range); - showSUIPage(pid); - sendSystemMessageTestingOnly(self, "calling sui.msgbox() with button(s)=" + buttons + ", object=" + object + ", range=" + range + " returns pid " + pid); - } - } - else if (strText.startsWith("testSuiLocationRange ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - int buttons = utils.stringToInt(st.nextToken()); - obj_id object = utils.stringToObjId(st.nextToken()); - float range = utils.stringToFloat(st.nextToken()); - int pid = createSUIPage(sui.SUI_MSGBOX, self, self, "testSuiHandler"); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, "this is a test message"); - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, sui.DEFAULT_TITLE); - sui.msgboxButtonSetup(pid, buttons); - setSUIAssociatedLocation(pid, object); - setSUIMaxRangeToObject(pid, range); - showSUIPage(pid); - sendSystemMessageTestingOnly(self, "calling sui.msgbox() with button(s)=" + buttons + ", object=" + object + ", range=" + range + " returns pid " + pid); - } - } - else if (strText.startsWith("hidePlayer ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling setCreatureCoverVisibility(target=" + target + ", isVisible=false)"); - setCreatureCoverVisibility(target, false); - } - } - else if (strText.startsWith("huyPilotShip ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id pilot = utils.stringToObjId(st.nextToken()); - obj_id ship = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "pilotShip(pilot=" + pilot + ", ship=" + ship + ") returns " + pilotShip(pilot, ship)); - } - } - else if (strText.startsWith("showPlayer ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling setCreatureCoverVisibility(target=" + target + ", isVisible=true)"); - setCreatureCoverVisibility(target, true); - } - } - else if (strText.startsWith("hideObject ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling hideFromClient(target=" + target + ", hide=true)"); - hideFromClient(target, true); - } - } - else if (strText.startsWith("showObject ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling hideFromClient(target=" + target + ", hide=false)"); - hideFromClient(target, false); - } - } - else if (strText.startsWith("addPassiveReveal ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - int range = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling addPassiveReveal(object=" + object + ", target=" + target + ", range=" + range + ")"); - addPassiveReveal(object, target, range); - } - } - else if (strText.startsWith("removePassiveReveal ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling removePassiveReveal(object=" + object + ", target=" + target + ")"); - removePassiveReveal(object, target); - } - } - else if (strText.startsWith("clearPassiveRevealList ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling clearPassiveRevealList(object=" + object + ")"); - clearPassiveRevealList(object); - } - } - else if (strText.startsWith("getPassiveRevealRange ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getPassiveRevealRange(object=" + object + ", target=" + target + ") returns " + getPassiveRevealRange(object, target)); - } - } - else if (strText.startsWith("getPassiveRevealList ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - dictionary revealList = getPassiveRevealList(object); - if (revealList == null) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns null"); - } - else - { - obj_id[] ids = revealList.getObjIdArray("id"); - int[] range = revealList.getIntArray("range"); - if (ids == null) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns null id list"); - } - if (ids.length == 0) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns 0-length id list"); - } - if (range == null) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns null range list"); - } - if (range.length == 0) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns 0-length range list"); - } - if (ids.length != range.length) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns different size id (" + ids.length + ") and range (" + range.length + ") lists"); - } - if ((ids != null) && (ids.length > 0) && (range != null) && (range.length > 0) && (ids.length == range.length)) - { - sendSystemMessageTestingOnly(self, "getPassiveRevealList(object=" + object + ") returns:"); - for (int i = 0; i < ids.length; ++i) - { - sendSystemMessageTestingOnly(self, "id=" + ids[i] + ", range=" + range[i]); - } - } - } - } - } - else if (strText.startsWith("modifyCurrentGcwPoints ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int amount = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "modifyCurrentGcwPoints(target=" + target + ", adjustment=" + amount + ")"); - pvpModifyCurrentGcwPoints(target, amount); - } - } - else if (strText.startsWith("modifyCurrentPvpKills ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int amount = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "modifyCurrentPvpKills(target=" + target + ", adjustment=" + amount + ")"); - pvpModifyCurrentPvpKills(target, amount); - } - } - else if (strText.startsWith("getGcwRank ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getGcwRank(target=" + target + ") returns current=" + pvpGetCurrentGcwRank(target) + ", maxImperial=" + pvpGetMaxGcwImperialRank(target) + ", maxRebel=" + pvpGetMaxGcwRebelRank(target)); - } - } - else if (strText.startsWith("getGcwInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getGcwInfo(target=" + target + ") returns points=" + pvpGetCurrentGcwPoints(target) + ", rating=" + pvpGetCurrentGcwRating(target) + ", kills=" + pvpGetCurrentPvpKills(target) + ", lifetime points=" + pvpGetLifetimeGcwPoints(target) + ", max imp rating=" + pvpGetMaxGcwImperialRating(target) + ", max reb rating=" + pvpGetMaxGcwRebelRating(target) + ", lifetime kills=" + pvpGetLifetimePvpKills(target) + ", next recalc=" + pvpGetNextGcwRatingCalcTime(target)); - } - } - else if (strText.startsWith("transferGcwInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id source = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "transferGcwInfo(source=" + source + ", target=" + target + ")"); - dictionary characterData = new dictionary(); - characterData.put("gcw_current_point", pvpGetCurrentGcwPoints(source)); - characterData.put("gcw_current_rating", pvpGetCurrentGcwRating(source)); - characterData.put("gcw_current_pvp_kill", pvpGetCurrentPvpKills(source)); - characterData.put("gcw_lifetime_point", pvpGetLifetimeGcwPoints(source)); - characterData.put("gcw_max_imperial_rating", pvpGetMaxGcwImperialRating(source)); - characterData.put("gcw_max_rebel_rating", pvpGetMaxGcwRebelRating(source)); - characterData.put("gcw_lifetime_pvp_kill", pvpGetLifetimePvpKills(source)); - characterData.put("gcw_next_rating_calc_time", pvpGetNextGcwRatingCalcTime(source)); - ctsUseOnlySetGcwInfo(target, characterData.getInt("gcw_current_point"), characterData.getInt("gcw_current_rating"), characterData.getInt("gcw_current_pvp_kill"), characterData.getLong("gcw_lifetime_point"), characterData.getInt("gcw_max_imperial_rating"), characterData.getInt("gcw_max_rebel_rating"), characterData.getInt("gcw_lifetime_pvp_kill"), characterData.getInt("gcw_next_rating_calc_time")); - } - } - else if (strText.startsWith("isInWorldCell ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "isInWorldCell(target=" + target + ") returns " + isInWorldCell(target)); - } - } - else if (strText.startsWith("isAccountQualifiedForHousePackup ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "isAccountQualifiedForHousePackup(target=" + target + ") returns " + isAccountQualifiedForHousePackup(target)); - } - } - else if (strText.equals("sneak")) - { - sendSystemMessageTestingOnly(self, "doing queueCommand(sp_buff_stealth_1)"); - queueCommand(self, (-1926826718), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (strText.startsWith("checkBadgeCount ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "badge.checkBadgeCount(target=" + target + ") returns " + badge.checkBadgeCount(target)); - } - } - else if (strText.startsWith("addOldBadge ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - int badgeId = utils.stringToInt(st.nextToken()); - int[] badges = getIntArrayObjVar(player, "badge.tracking"); - int count = getIntObjVar(player, "badge.count"); - removeObjVar(player, "badge.tracking"); - removeObjVar(player, "badge.count"); - if ((badges == null) || (badges.length == 0)) - { - badges = new int[15]; - for (int i = 0; i < 15; ++i) - { - badges[i] = 0; - } - } - else if (badges.length < 15) - { - int[] newBadges = new int[15]; - for (int i = 0; i < 15; ++i) - { - newBadges[i] = 0; - } - for (int j = 0; j < badges.length; ++j) - { - newBadges[j] = badges[j]; - } - badges = newBadges; - } - int arrayIdx = badgeId / 32; - int bitIdx = badgeId % 32; - if ((arrayIdx < 15) && (!utils.checkBit(badges[arrayIdx], bitIdx))) - { - badges[arrayIdx] = utils.setBit(badges[arrayIdx], bitIdx); - count++; - } - setObjVar(player, "badge.tracking", badges); - setObjVar(player, "badge.count", count); - sendSystemMessageTestingOnly(self, "addOldBadge player=" + player + ", badgeId=" + badgeId + " (" + getCollectionSlotName(badgeId) + ")"); - } - } - else if (strText.startsWith("explorerBadgeByNumber ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int badgeNum = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "explorerBadgeByNumber(target=" + target + ", badgeNum=" + badgeNum + ")"); - dictionary explorerBadges = new dictionary(); - explorerBadges.put("badgeNumber", badgeNum); - messageTo(target, "explorerBadge", explorerBadges, 0, false); - } - } - else if (strText.startsWith("explorerBadgeByName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - String badgeName = st.nextToken(); - sendSystemMessageTestingOnly(self, "explorerBadgeByNumber(target=" + target + ", badgeName=" + badgeName + ")"); - dictionary explorerBadges = new dictionary(); - explorerBadges.put("badgeName", badgeName); - messageTo(target, "explorerBadge", explorerBadges, 0, false); - } - } - else if (strText.startsWith("addHate ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id hateTarget = utils.stringToObjId(st.nextToken()); - float hateValue = utils.stringToFloat(st.nextToken()); - sendSystemMessageTestingOnly(self, "addHate(object=" + object + ", hateTarget=" + hateTarget + ", hate=" + hateValue + ")"); - addHate(object, hateTarget, hateValue); - } - } - else if (strText.startsWith("addHateDot ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 5) - { - String command = st.nextToken(); - obj_id o = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - float hate = utils.stringToFloat(st.nextToken()); - int seconds = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "addHateDot(object=" + o + ", hateTarget=" + target + ", hateAmount=" + hate + ", seconds=" + seconds + ")"); - addHateDot(o, target, hate, seconds); - } - } - else if (strText.startsWith("getHate ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id hateTarget = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getHate(object=" + object + ", hateTarget=" + hateTarget + ") returns " + getHate(object, hateTarget)); - } - } - else if (strText.startsWith("getDefaultWeapon ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getDefaultWeapon(player=" + player + ") returns " + getDefaultWeapon(player)); - } - } - else if (strText.startsWith("removeOldBadge ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - int badgeId = utils.stringToInt(st.nextToken()); - int[] badges = getIntArrayObjVar(player, "badge.tracking"); - int count = getIntObjVar(player, "badge.count"); - removeObjVar(player, "badge.tracking"); - removeObjVar(player, "badge.count"); - if ((badges == null) || (badges.length == 0)) - { - badges = new int[15]; - for (int i = 0; i < 15; ++i) - { - badges[i] = 0; - } - } - else if (badges.length < 15) - { - int[] newBadges = new int[15]; - for (int i = 0; i < 15; ++i) - { - newBadges[i] = 0; - } - for (int j = 0; j < badges.length; ++j) - { - newBadges[j] = badges[j]; - } - badges = newBadges; - } - int arrayIdx = badgeId / 32; - int bitIdx = badgeId % 32; - if ((arrayIdx < 15) && (utils.checkBit(badges[arrayIdx], bitIdx))) - { - badges[arrayIdx] = utils.clearBit(badges[arrayIdx], bitIdx); - count--; - } - setObjVar(player, "badge.tracking", badges); - setObjVar(player, "badge.count", count); - sendSystemMessageTestingOnly(self, "removeOldBadge player=" + player + ", badgeId=" + badgeId + " (" + getCollectionSlotName(badgeId) + ")"); - } - } - else if (strText.startsWith("modifyCollectionSlotValue ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String slotName = st.nextToken(); - obj_id delta = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "modifyCollectionSlotValue(player=" + player + ", slotName=" + slotName + ", delta=" + delta + ") returns " + modifyCollectionSlotValue(player, slotName, delta.getValue())); - } - } - else if (strText.startsWith("getCollectionSlotValue ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCollectionSlotValue(player=" + player + ", slotName=" + slotName + ") returns " + getCollectionSlotValue(player, slotName)); - } - } - else if (strText.startsWith("hasCompletedCollectionSlotPrereq ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "hasCompletedCollectionSlotPrereq(player=" + player + ", slotName=" + slotName + ") returns " + hasCompletedCollectionSlotPrereq(player, slotName)); - } - } - else if (strText.startsWith("hasCompletedCollectionSlot ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "hasCompletedCollectionSlot(player=" + player + ", slotName=" + slotName + ") returns " + hasCompletedCollectionSlot(player, slotName)); - } - } - else if (strText.startsWith("hasCompletedCollection ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String collectionName = st.nextToken(); - sendSystemMessageTestingOnly(self, "hasCompletedCollection(player=" + player + ", collectionName=" + collectionName + ") returns " + hasCompletedCollection(player, collectionName)); - } - } - else if (strText.startsWith("hasCompletedCollectionPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "hasCompletedCollectionPage(player=" + player + ", pageName=" + pageName + ") returns " + hasCompletedCollectionPage(player, pageName)); - } - } - else if (strText.startsWith("hasCompletedCollectionBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "hasCompletedCollectionBook(player=" + player + ", bookName=" + bookName + ") returns " + hasCompletedCollectionBook(player, bookName)); - } - } - else if (strText.startsWith("getCompletedCollectionSlotsInCollection ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String collectionName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCompletedCollectionSlotsInCollection(player=" + player + ", collectionName=" + collectionName + ") returns:"); - String[] slotNames = getCompletedCollectionSlotsInCollection(player, collectionName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getCompletedCollectionSlotsInPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCompletedCollectionSlotsInPage(player=" + player + ", pageName=" + pageName + ") returns:"); - String[] slotNames = getCompletedCollectionSlotsInPage(player, pageName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getCompletedCollectionsInPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCompletedCollectionsInPage(player=" + player + ", pageName=" + pageName + ") returns:"); - String[] collectionNames = getCompletedCollectionsInPage(player, pageName); - if ((collectionNames == null) || (collectionNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String collectionName : collectionNames) { - sendSystemMessageTestingOnly(self, collectionName); - } - } - } - } - else if (strText.startsWith("getCompletedCollectionSlotsInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCompletedCollectionSlotsInBook(player=" + player + ", bookName=" + bookName + ") returns:"); - String[] slotNames = getCompletedCollectionSlotsInBook(player, bookName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getCompletedCollectionsInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCompletedCollectionsInBook(player=" + player + ", bookName=" + bookName + ") returns:"); - String[] collectionNames = getCompletedCollectionsInBook(player, bookName); - if ((collectionNames == null) || (collectionNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String collectionName : collectionNames) { - sendSystemMessageTestingOnly(self, collectionName); - } - } - } - } - else if (strText.startsWith("getCompletedCollectionPagesInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCompletedCollectionPagesInBook(player=" + player + ", bookName=" + bookName + ") returns:"); - String[] pageNames = getCompletedCollectionPagesInBook(player, bookName); - if ((pageNames == null) || (pageNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String pageName : pageNames) { - sendSystemMessageTestingOnly(self, pageName); - } - } - } - } - else if (strText.startsWith("getCompletedCollectionBooks ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id player = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getCompletedCollectionBooks(player=" + player + ") returns:"); - String[] bookNames = getCompletedCollectionBooks(player); - if ((bookNames == null) || (bookNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String bookName : bookNames) { - sendSystemMessageTestingOnly(self, bookName); - } - } - } - } - else if (strText.startsWith("getCollectionSlotInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCollectionSlotInfo(slotName=" + slotName + ") returns:"); - String[] info = getCollectionSlotInfo(slotName); - if ((info == null) || (info.length != COLLECTION_INFO_ARRAY_SIZE)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - sendSystemMessageTestingOnly(self, "book=" + info[COLLECTION_INFO_INDEX_BOOK]); - sendSystemMessageTestingOnly(self, "page=" + info[COLLECTION_INFO_INDEX_PAGE]); - sendSystemMessageTestingOnly(self, "collection=" + info[COLLECTION_INFO_INDEX_COLLECTION]); - sendSystemMessageTestingOnly(self, "music=" + info[COLLECTION_INFO_INDEX_MUSIC]); - } - } - } - else if (strText.startsWith("isCollectionSlotATitle ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "isCollectionSlotATitle(slotName=" + slotName + ") returns " + isCollectionSlotATitle(slotName)); - } - } - else if (strText.startsWith("isCollectionATitle ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String collectionName = st.nextToken(); - sendSystemMessageTestingOnly(self, "isCollectionATitle(collectionName=" + collectionName + ") returns " + isCollectionATitle(collectionName)); - } - } - else if (strText.startsWith("isCollectionPageATitle ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "isCollectionPageATitle(pageName=" + pageName + ") returns " + isCollectionPageATitle(pageName)); - } - } - else if (strText.startsWith("getCollectionSlotCategoryInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCollectionSlotCategoryInfo(slotName=" + slotName + ") returns:"); - String[] category = getCollectionSlotCategoryInfo(slotName); - if ((category == null) || (category.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String s : category) { - sendSystemMessageTestingOnly(self, s); - } - } - } - } - else if (strText.startsWith("getCollectionSlotPrereqInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String slotName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getCollectionSlotPrereqInfo(slotName=" + slotName + ") returns:"); - String[] prereqs = getCollectionSlotPrereqInfo(slotName); - if ((prereqs == null) || (prereqs.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String prereq : prereqs) { - sendSystemMessageTestingOnly(self, prereq); - } - } - } - } - else if (strText.startsWith("getCollectionSlotName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - int collectionId = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "getCollectionSlotName(collectionId=" + collectionId + ") returns " + getCollectionSlotName(collectionId)); - } - } - else if (strText.startsWith("getAllCollectionSlotsInCollection ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String collectionName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInCollection(collectionName=" + collectionName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInCollection(collectionName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotsInPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInPage(pageName=" + pageName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInPage(pageName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionsInPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionsInPage(pageName=" + pageName + ") returns:"); - String[] collectionNames = getAllCollectionsInPage(pageName); - if ((collectionNames == null) || (collectionNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String collectionName : collectionNames) { - sendSystemMessageTestingOnly(self, collectionName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotsInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInBook(bookName=" + bookName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInBook(bookName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionsInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionsInBook(bookName=" + bookName + ") returns:"); - String[] collectionNames = getAllCollectionsInBook(bookName); - if ((collectionNames == null) || (collectionNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String collectionName : collectionNames) { - sendSystemMessageTestingOnly(self, collectionName); - } - } - } - } - else if (strText.startsWith("getAllCollectionPagesInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionPagesInBook(bookName=" + bookName + ") returns:"); - String[] pageNames = getAllCollectionPagesInBook(bookName); - if ((pageNames == null) || (pageNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String pageName : pageNames) { - sendSystemMessageTestingOnly(self, pageName); - } - } - } - } - else if (strText.equals("getAllCollectionBooks")) - { - sendSystemMessageTestingOnly(self, "getAllCollectionBooks() returns:"); - String[] bookNames = getAllCollectionBooks(); - if ((bookNames == null) || (bookNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String bookName : bookNames) { - sendSystemMessageTestingOnly(self, bookName); - } - } - } - else if (strText.startsWith("getAllCollectionSlotsInCategory ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String categoryName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInCategory(categoryName=" + categoryName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInCategory(categoryName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotsInCategoryInCollection ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String collectionName = st.nextToken(); - String categoryName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInCategoryInCollection(collectionName=" + collectionName + ", categoryName=" + categoryName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInCategoryInCollection(collectionName, categoryName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotsInCategoryInPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String pageName = st.nextToken(); - String categoryName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInCategoryInPage(pageName=" + pageName + ", categoryName=" + categoryName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInCategoryInPage(pageName, categoryName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotsInCategoryInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String bookName = st.nextToken(); - String categoryName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotsInCategoryInBook(bookName=" + bookName + ", categoryName=" + categoryName + ") returns:"); - String[] slotNames = getAllCollectionSlotsInCategoryInBook(bookName, categoryName); - if ((slotNames == null) || (slotNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String slotName : slotNames) { - sendSystemMessageTestingOnly(self, slotName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotCategoriesInCollection ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String collectionName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotCategoriesInCollection(collectionName=" + collectionName + ") returns:"); - String[] categoryNames = getAllCollectionSlotCategoriesInCollection(collectionName); - if ((categoryNames == null) || (categoryNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String categoryName : categoryNames) { - sendSystemMessageTestingOnly(self, categoryName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotCategoriesInPage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String pageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotCategoriesInPage(pageName=" + pageName + ") returns:"); - String[] categoryNames = getAllCollectionSlotCategoriesInPage(pageName); - if ((categoryNames == null) || (categoryNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String categoryName : categoryNames) { - sendSystemMessageTestingOnly(self, categoryName); - } - } - } - } - else if (strText.startsWith("getAllCollectionSlotCategoriesInBook ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String bookName = st.nextToken(); - sendSystemMessageTestingOnly(self, "getAllCollectionSlotCategoriesInBook(bookName=" + bookName + ") returns:"); - String[] categoryNames = getAllCollectionSlotCategoriesInBook(bookName); - if ((categoryNames == null) || (categoryNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String categoryName : categoryNames) { - sendSystemMessageTestingOnly(self, categoryName); - } - } - } - } - else if (strText.equals("getAllCollectionSlotCategories")) - { - sendSystemMessageTestingOnly(self, "getAllCollectionSlotCategories() returns:"); - String[] categoryNames = getAllCollectionSlotCategories(); - if ((categoryNames == null) || (categoryNames.length < 1)) - { - sendSystemMessageTestingOnly(self, "no entries"); - } - else - { - for (String categoryName : categoryNames) { - sendSystemMessageTestingOnly(self, categoryName); - } - } - } - else if (strText.startsWith("transferCollections ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id source = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id playerObjectSource = getPlayerObject(source); - if (isIdValid(playerObjectSource)) - { - obj_id playerObjectTarget = getPlayerObject(target); - if (isIdValid(playerObjectTarget)) - { - byte[] collections = getByteStreamFromAutoVariable(playerObjectSource, "collections"); - if (collections != null && collections.length > 0) - { - setAutoVariableFromByteStream(playerObjectTarget, "collections", collections); - sendSystemMessageTestingOnly(self, "transferCollections(source=" + source + ", target=" + target + ")"); - } - else - { - sendSystemMessageTestingOnly(self, "transferCollections(source=" + source + ", target=" + target + ") source doesn't have any collections"); - } - } - else - { - sendSystemMessageTestingOnly(self, "transferCollections(source=" + source + ", target=" + target + ") target has invalid PlayerObject"); - } - } - else - { - sendSystemMessageTestingOnly(self, "transferCollections(source=" + source + ", target=" + target + ") source has invalid PlayerObject"); - } - } - } - else if (strText.startsWith("makeOnLeave ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "makeOnLeave(target=" + target + ")"); - pvpMakeOnLeave(target); - } - } - else if (strText.startsWith("modifyShipShield ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 7) - { - String command = st.nextToken(); - obj_id shipOid = utils.stringToObjId(st.nextToken()); - float frontCurrent = utils.stringToFloat(st.nextToken()); - float frontMax = utils.stringToFloat(st.nextToken()); - float backCurrent = utils.stringToFloat(st.nextToken()); - float backMax = utils.stringToFloat(st.nextToken()); - float rechargeRate = utils.stringToFloat(st.nextToken()); - sendSystemMessageTestingOnly(self, "changing shield for ship " + shipOid + " (front=" + frontCurrent + "/" + frontMax + " back=" + backCurrent + "/" + backMax + " rechargeRate=" + rechargeRate + ")"); - setShipShieldHitpointsFrontCurrent(shipOid, frontCurrent); - setShipShieldHitpointsFrontMaximum(shipOid, frontMax); - setShipShieldHitpointsBackCurrent(shipOid, backCurrent); - setShipShieldHitpointsBackMaximum(shipOid, backMax); - setShipShieldRechargeRate(shipOid, rechargeRate); - } - } - else if (strText.startsWith("setResidenceHouseId ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id value = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "setResidenceHouseId for " + object + " to " + value); - setHouseId(object, value); - } - } - else if (strText.startsWith("getResidenceHouseId ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getResidenceHouseId for " + object + " returned " + getHouseId(object)); - } - } - else if (strText.equals("progressBar")) - { - int result = progressBar(self); - sendSystemMessageTestingOnly(self, "progress bar SUI page " + result + " shown"); - } - else if (strText.startsWith("setProgressBarText ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - int pageId = utils.stringToInt(st.nextToken()); - String newText = st.nextToken(); - setSUIProperty(pageId, "comp.pText.text", PROP_TEXT, newText); - flushSUIPage(pageId); - sendSystemMessageTestingOnly(self, "setting progress bar SUI page " + pageId + " text to " + newText); - } - } - else if (strText.startsWith("createCountdownTimerBar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 6) - { - String command = st.nextToken(); - String type = st.nextToken(); - String sid_table = st.nextToken(); - String sid_text = st.nextToken(); - string_id sid = new string_id(sid_table, sid_text); - int currentTime = utils.stringToInt(st.nextToken()); - int totalTime = utils.stringToInt(st.nextToken()); - int pid = sui.countdownTimerSUI(self, self, type, sid, currentTime, totalTime, "CountdownTimerBarCallback"); - sendSystemMessageTestingOnly(self, "sui.countdownTimerSUI(...," + type + ", " + utils.packStringId(sid) + ", " + currentTime + ", " + totalTime + ", ...) returned pid " + pid); - } - } - else if (strText.startsWith("updateCountdownTimerBar ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 6) - { - String command = st.nextToken(); - int pageId = utils.stringToInt(st.nextToken()); - String sid_table = st.nextToken(); - String sid_text = st.nextToken(); - string_id sid = new string_id(sid_table, sid_text); - int currentTime = utils.stringToInt(st.nextToken()); - int totalTime = utils.stringToInt(st.nextToken()); - boolean result = sui.updateCountdownTimerSUI(pageId, sid, currentTime, totalTime); - sendSystemMessageTestingOnly(self, "sui.updateCountdownTimerSUI(" + pageId + ", " + utils.packStringId(sid) + ", " + currentTime + ", " + totalTime + ") returned result " + result); - } - } - else if (strText.startsWith("factionMessagePP ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - float radius = utils.stringToFloat(st.nextToken()); - int notifyImperial = utils.stringToInt(st.nextToken()); - int notifyRebel = utils.stringToInt(st.nextToken()); - int callTime = 45; - prose_package pp = prose.getPackage(pet_lib.SID_SYS_CALL_PET_DELAY, callTime); - sendSystemMessageTestingOnly(self, "calling sendFactionalSystemMessagePlanet() for radius " + radius); - sendFactionalSystemMessagePlanet(pp, getLocation(self), radius, (notifyImperial != 0), (notifyRebel != 0)); - } - } - else if (strText.startsWith("factionMessage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 6) - { - String command = st.nextToken(); - float radius = utils.stringToFloat(st.nextToken()); - String sid_table = st.nextToken(); - String sid_text = st.nextToken(); - string_id sid = new string_id(sid_table, sid_text); - int notifyImperial = utils.stringToInt(st.nextToken()); - int notifyRebel = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling sendFactionalSystemMessagePlanet() for radius " + radius); - sendFactionalSystemMessagePlanet(sid, null, radius, (notifyImperial != 0), (notifyRebel != 0)); - } - } - else if (strText.startsWith("setCondition ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int condition = utils.stringToInt(st.nextToken()); - setCondition(object, condition); - sendSystemMessageTestingOnly(self, "setting condition " + condition + " for object " + object); - } - } - else if (strText.startsWith("clearCondition ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - int condition = utils.stringToInt(st.nextToken()); - clearCondition(object, condition); - sendSystemMessageTestingOnly(self, "clearing condition " + condition + " for object " + object); - } - } - else if (strText.startsWith("addMapLocation ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - boolean result = planetary_map.addMapLocation(object); - sendSystemMessageTestingOnly(self, "addMapLocation for object " + object + " result " + result); - } - } - else if (strText.startsWith("removeMapLocation ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - planetary_map.removeMapLocation(object); - sendSystemMessageTestingOnly(self, "removeMapLocation for object " + object); - } - } - else if (strText.startsWith("updateBankTerminalMapLocationName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String newName = st.nextToken(); - newName = "\\#FFFF22" + newName; - location loc = getWorldLocation(object); - boolean result = addPlanetaryMapLocationIgnoreLocationCountLimits(object, newName, (int)loc.x, (int)loc.z, "terminal", "terminal_bank", MLT_STATIC, 0); - sendSystemMessageTestingOnly(self, "updateBankTerminalMapLocationName for object " + object + " newName " + newName + " result " + result); - } - } - else if (strText.startsWith("updateMissionTerminalMapLocationName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - String newName = st.nextToken(); - newName = "\\#FFFF22" + newName; - location loc = getWorldLocation(object); - boolean result = addPlanetaryMapLocationIgnoreLocationCountLimits(object, newName, (int)loc.x, (int)loc.z, "terminal", "terminal_mission", MLT_STATIC, 0); - sendSystemMessageTestingOnly(self, "updateMissionTerminalMapLocationName for object " + object + " newName " + newName + " result " + result); - } - } - else if (strText.startsWith("pvpSetAttackableOverride ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int value = utils.stringToInt(st.nextToken()); - boolean bValue; - if (value != 0) - { - bValue = true; - } - else - { - bValue = false; - } - sendSystemMessageTestingOnly(self, "calling pvpSetAttackableOverride(" + target + ", " + bValue + ")"); - pvpSetAttackableOverride(target, bValue); - } - } - else if (strText.startsWith("setMaxHitpoints ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int value = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling setMaxHitpoints(" + target + ", " + value + ")"); - setMaxHitpoints(target, value); - } - } - else if (strText.startsWith("areAllContentsLoaded ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "areAllContentsLoaded(" + target + ")=" + areAllContentsLoaded(target)); - } - } - else if (strText.startsWith("enterClientTicketPurchaseMode ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String startPlanet = st.nextToken(); - enterClientTicketPurchaseMode(self, startPlanet, "Starport", false); - } - } - else if (strText.startsWith("spawnNoAI ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String creature = st.nextToken(); - create.object(creature, getLocation(self), false); - } - } - else if (strText.equals("getTime")) - { - int gameTime = getGameTime(); - int[] convertedGameTime = player_structure.convertSecondsTime(gameTime); - sendSystemMessageTestingOnly(self, "getGameTime() returns " + gameTime + " (" + (convertedGameTime[0] / 365) + "y:" + (convertedGameTime[0] % 365) + "d:" + convertedGameTime[1] + "h:" + convertedGameTime[2] + "m:" + convertedGameTime[3] + "s)"); - int calendarTime = getCalendarTime(); - int[] convertedCalendarTime = player_structure.convertSecondsTime(calendarTime); - sendSystemMessageTestingOnly(self, "getCalendarTime() returns " + calendarTime + " (" + (convertedCalendarTime[0] / 365) + "y:" + (convertedCalendarTime[0] % 365) + "d:" + convertedCalendarTime[1] + "h:" + convertedCalendarTime[2] + "m:" + convertedCalendarTime[3] + "s)"); - sendSystemMessageTestingOnly(self, "getCalendarTimeStringGMT(" + calendarTime + ") returns " + getCalendarTimeStringGMT(calendarTime)); - sendSystemMessageTestingOnly(self, "getCalendarTimeStringLocal(" + calendarTime + ") returns " + getCalendarTimeStringLocal(calendarTime)); - } - else if (strText.startsWith("getTime ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 7) - { - String command = st.nextToken(); - int year = utils.stringToInt(st.nextToken()); - int month = utils.stringToInt(st.nextToken()); - int day = utils.stringToInt(st.nextToken()); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int time = getCalendarTime(year, month, day, hour, minute, second); - if (time < 0) - { - sendSystemMessageTestingOnly(self, month + "/" + day + "/" + year + " " + hour + ":" + minute + ":" + second + " is not a valid date/time (" + time + ")"); - } - else - { - sendSystemMessageTestingOnly(self, month + "/" + day + "/" + year + " " + hour + ":" + minute + ":" + second + " is " + time + ", " + getCalendarTimeStringLocal(time) + ", " + getCalendarTimeStringGMT(time)); - } - } - } - else if (strText.startsWith("makeInvulnerable ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id obj = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "making " + obj + " invulnerable"); - setInvulnerable(obj, true); - } - } - else if (strText.startsWith("makeVulnerable ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id obj = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "making " + obj + " vulnerable"); - setInvulnerable(obj, false); - } - } - else if (strText.startsWith("hourlyAlarm ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getGameTime(); - dictionary d = new dictionary(); - d.put("gameTime", now); - int timeUntil = createHourlyAlarmClock(self, "huyHourlyAlarmClock", d, minute, second); - if (timeUntil <= -1) - { - sendSystemMessageTestingOnly(self, "createHourlyAlarmClock(minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil); - } - else - { - sendSystemMessageTestingOnly(self, "createHourlyAlarmClock(minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil + " (" + (timeUntil / (60 * 60 * 24)) + "d:" + ((timeUntil % (60 * 60 * 24)) / (60 * 60)) + "h:" + ((timeUntil % (60 * 60)) / 60) + "m:" + (timeUntil % 60) + "s)"); - } - } - } - else if (strText.startsWith("dailyAlarm ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getGameTime(); - dictionary d = new dictionary(); - d.put("gameTime", now); - int timeUntil = createDailyAlarmClock(self, "huyDailyAlarmClock", d, hour, minute, second); - if (timeUntil <= -1) - { - sendSystemMessageTestingOnly(self, "createDailyAlarmClock(hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil); - } - else - { - sendSystemMessageTestingOnly(self, "createDailyAlarmClock(hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil + " (" + (timeUntil / (60 * 60 * 24)) + "d:" + ((timeUntil % (60 * 60 * 24)) / (60 * 60)) + "h:" + ((timeUntil % (60 * 60)) / 60) + "m:" + (timeUntil % 60) + "s)"); - } - } - } - else if (strText.startsWith("weeklyAlarm ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 5) - { - String command = st.nextToken(); - String dayOfWeek = st.nextToken(); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int intDayOfWeek = -1; - switch (dayOfWeek) { - case "sun": - intDayOfWeek = DAY_OF_WEEK_SUN; - break; - case "mon": - intDayOfWeek = DAY_OF_WEEK_MON; - break; - case "tue": - intDayOfWeek = DAY_OF_WEEK_TUE; - break; - case "wed": - intDayOfWeek = DAY_OF_WEEK_WED; - break; - case "thu": - intDayOfWeek = DAY_OF_WEEK_THU; - break; - case "fri": - intDayOfWeek = DAY_OF_WEEK_FRI; - break; - case "sat": - intDayOfWeek = DAY_OF_WEEK_SAT; - break; - } - if ((intDayOfWeek < DAY_OF_WEEK_SUN) || (intDayOfWeek > DAY_OF_WEEK_SAT)) - { - sendSystemMessageTestingOnly(self, "weeklyAlarm invalid day of week " + intDayOfWeek); - } - else - { - int now = getGameTime(); - dictionary d = new dictionary(); - d.put("gameTime", now); - int timeUntil = createWeeklyAlarmClock(self, "huyWeeklyAlarmClock", d, intDayOfWeek, hour, minute, second); - if (timeUntil <= -1) - { - sendSystemMessageTestingOnly(self, "createWeeklyAlarmClock(dow=" + intDayOfWeek + ", hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil); - } - else - { - sendSystemMessageTestingOnly(self, "createWeeklyAlarmClock(dow=" + intDayOfWeek + ", hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil + " (" + (timeUntil / (60 * 60 * 24)) + "d:" + ((timeUntil % (60 * 60 * 24)) / (60 * 60)) + "h:" + ((timeUntil % (60 * 60)) / 60) + "m:" + (timeUntil % 60) + "s)"); - } - } - } - } - else if (strText.startsWith("monthlyAlarm ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 5) - { - String command = st.nextToken(); - int dayOfMonth = utils.stringToInt(st.nextToken()); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getGameTime(); - dictionary d = new dictionary(); - d.put("gameTime", now); - int timeUntil = createMonthlyAlarmClock(self, "huyMonthlyAlarmClock", d, dayOfMonth, hour, minute, second); - if (timeUntil <= -1) - { - sendSystemMessageTestingOnly(self, "createMonthlyAlarmClock(dom=" + dayOfMonth + ", hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil); - } - else - { - sendSystemMessageTestingOnly(self, "createMonthlyAlarmClock(dom=" + dayOfMonth + ", hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil + " (" + (timeUntil / (60 * 60 * 24)) + "d:" + ((timeUntil % (60 * 60 * 24)) / (60 * 60)) + "h:" + ((timeUntil % (60 * 60)) / 60) + "m:" + (timeUntil % 60) + "s)"); - } - } - } - else if (strText.startsWith("yearlyAlarm ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 6) - { - String command = st.nextToken(); - int month = utils.stringToInt(st.nextToken()); - int dayOfMonth = utils.stringToInt(st.nextToken()); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getGameTime(); - dictionary d = new dictionary(); - d.put("gameTime", now); - int timeUntil = createYearlyAlarmClock(self, "huyYearlyAlarmClock", d, month, dayOfMonth, hour, minute, second); - if (timeUntil <= -1) - { - sendSystemMessageTestingOnly(self, "createYearlyAlarmClock(month=" + month + ", dom=" + dayOfMonth + ", hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil); - } - else - { - sendSystemMessageTestingOnly(self, "createYearlyAlarmClock(month=" + month + ", dom=" + dayOfMonth + ", hour=" + hour + ", minute=" + minute + ", second=" + second + ") now=" + now + " returns " + timeUntil + " (" + (timeUntil / (60 * 60 * 24)) + "d:" + ((timeUntil % (60 * 60 * 24)) / (60 * 60)) + "h:" + ((timeUntil % (60 * 60)) / 60) + "m:" + (timeUntil % 60) + "s)"); - } - } - } - else if (strText.startsWith("secondsUntilHourly ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextHourlyTime(minute, second); - int then = now + secondsUntil; - sendSystemMessageTestingOnly(self, "now is " + getCalendarTimeStringLocal(now) + ", " + getCalendarTimeStringGMT(now)); - sendSystemMessageTestingOnly(self, secondsUntil + " seconds until " + getCalendarTimeStringLocal(then) + ", " + getCalendarTimeStringGMT(then)); - } - } - else if (strText.startsWith("secondsUntilDaily ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextDailyTime(hour, minute, second); - int then = now + secondsUntil; - sendSystemMessageTestingOnly(self, "now is " + getCalendarTimeStringLocal(now) + ", " + getCalendarTimeStringGMT(now)); - sendSystemMessageTestingOnly(self, secondsUntil + " seconds until " + getCalendarTimeStringLocal(then) + ", " + getCalendarTimeStringGMT(then)); - } - } - else if (strText.startsWith("secondsUntilWeekly ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 5) - { - String command = st.nextToken(); - int dayOfWeek = utils.stringToInt(st.nextToken()); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextWeeklyTime(dayOfWeek, hour, minute, second); - int then = now + secondsUntil; - sendSystemMessageTestingOnly(self, "now is " + getCalendarTimeStringLocal(now) + ", " + getCalendarTimeStringGMT(now)); - sendSystemMessageTestingOnly(self, secondsUntil + " seconds until " + getCalendarTimeStringLocal(then) + ", " + getCalendarTimeStringGMT(then)); - } - } - else if (strText.startsWith("secondsUntilMonthly ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 5) - { - String command = st.nextToken(); - int dayOfMonth = utils.stringToInt(st.nextToken()); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextMonthlyTime(dayOfMonth, hour, minute, second); - int then = now + secondsUntil; - sendSystemMessageTestingOnly(self, "now is " + getCalendarTimeStringLocal(now) + ", " + getCalendarTimeStringGMT(now)); - sendSystemMessageTestingOnly(self, secondsUntil + " seconds until " + getCalendarTimeStringLocal(then) + ", " + getCalendarTimeStringGMT(then)); - } - } - else if (strText.startsWith("secondsUntilYearly ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 6) - { - String command = st.nextToken(); - int month = utils.stringToInt(st.nextToken()); - int dayOfMonth = utils.stringToInt(st.nextToken()); - int hour = utils.stringToInt(st.nextToken()); - int minute = utils.stringToInt(st.nextToken()); - int second = utils.stringToInt(st.nextToken()); - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextYearlyTime(month, dayOfMonth, hour, minute, second); - int then = now + secondsUntil; - sendSystemMessageTestingOnly(self, "now is " + getCalendarTimeStringLocal(now) + ", " + getCalendarTimeStringGMT(now)); - sendSystemMessageTestingOnly(self, secondsUntil + " seconds until " + getCalendarTimeStringLocal(then) + ", " + getCalendarTimeStringGMT(then)); - } - } - else if (strText.startsWith("createRegion ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String regionName = st.nextToken(); - int regionSize = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "createRegion " + regionName + " " + regionSize + " meters"); - createCircleRegion(getWorldLocation(self), regionSize, regionName, regions.PVP_REGION_TYPE_NORMAL, regions.BUILD_FALSE, regions.MUNI_TRUE, regions.GEO_CITY, 0, 0, regions.SPAWN_FALSE, regions.MISSION_NONE, false, true); - } - } - else if (strText.startsWith("getRegionsByPlanet ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String planetName = st.nextToken(); - region[] regions = getRegions(planetName); - if ((regions != null) && (regions.length > 0)) - { - String strOutput = ""; - for (region region : regions) { - strOutput += "region ("; - strOutput += region; - strOutput += ","; - strOutput += planetName; - strOutput += ","; - strOutput += region.getName(); - strOutput += ",notify="; - strOutput += isNotifyRegion(region); - strOutput += ")\r\n"; - } - saveTextOnClient(self, planetName + "_regions.txt", strOutput); - sendSystemMessageTestingOnly(self, regions.length + " regions saved in " + planetName + "_regions.txt"); - } - else - { - sendSystemMessageTestingOnly(self, "no regions returned for planet " + planetName); - } - } - } - else if (strText.startsWith("deleteRegion ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - String planetName = st.nextToken(); - String regionName = st.nextToken(); - region region = getRegion(planetName, regionName); - if (region != null) - { - sendSystemMessageTestingOnly(self, "deleteRegion(" + planetName + ", " + regionName + ") returned " + deleteRegion(region)); - } - else - { - sendSystemMessageTestingOnly(self, "no region returned for planet " + planetName + ", region " + regionName); - } - } - } - else if (strText.startsWith("setBountyValue ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - int bountyValue = utils.stringToInt(st.nextToken()); - setJediBountyValue(target, bountyValue); - } - } - else if (strText.startsWith("requestJediBounty ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id hunter = utils.stringToObjId(st.nextToken()); - requestJediBounty(target, hunter, "huyRequestJediBountySuccess", "huyRequestJediBountyFailure"); - } - } - else if (strText.startsWith("removeJediBounty ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id hunter = utils.stringToObjId(st.nextToken()); - removeJediBounty(target, hunter); - } - } - else if (strText.startsWith("removeAllJediBounties ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - removeAllJediBounties(target); - } - } - else if (strText.startsWith("listenToMessage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id broadcasterOid = utils.stringToObjId(st.nextToken()); - String messageName = st.nextToken(); - sendSystemMessageTestingOnly(self, self + " listen to " + broadcasterOid + " for message " + messageName); - listenToMessage(broadcasterOid, messageName); - } - } - else if (strText.startsWith("stopListeningToMessage ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id broadcasterOid = utils.stringToObjId(st.nextToken()); - String messageName = st.nextToken(); - sendSystemMessageTestingOnly(self, self + " stop listen to " + broadcasterOid + " for message " + messageName); - stopListeningToMessage(broadcasterOid, messageName); - } - } - else if (strText.startsWith("getListeners ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String messageName = st.nextToken(); - sendSystemMessageTestingOnly(self, "get listeners for " + self + " for message " + messageName); - obj_id[] listeners = getMessageListeners(messageName); - if (listeners != null && listeners.length > 0) - { - for (obj_id listener : listeners) { - sendSystemMessageTestingOnly(self, "" + listener); - } - } - } - } - else if (strText.startsWith("guildWarCoolDown ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String dest = st.nextToken(); - obj_id destOid = utils.stringToObjId(dest); - pvpSetGuildWarCoolDownPeriodEnemyFlag(destOid); - } - } - else if (strText.startsWith("getGuildId ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String dest = st.nextToken(); - obj_id destOid = utils.stringToObjId(dest); - int intGuildId = getGuildId(destOid); - if (intGuildId != 0) - { - sendSystemMessageTestingOnly(self, destOid + " is in guild " + intGuildId + " (" + guildGetName(intGuildId) + "," + guildGetAbbrev(intGuildId) + ")"); - } - else - { - sendSystemMessageTestingOnly(self, destOid + " is in guild " + intGuildId); - } - } - } - else if (strText.startsWith("guildGetEnemiesAB ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String guildId = st.nextToken(); - int intGuildId = utils.stringToInt(guildId); - int[] enemies_A_to_B = guildGetEnemies(intGuildId); - if (enemies_A_to_B == null || enemies_A_to_B.length <= 0) - { - sendSystemMessageTestingOnly(self, "guild " + intGuildId + " has not declared war on any other guild"); - } - else - { - for (int i1 : enemies_A_to_B) { - sendSystemMessageTestingOnly(self, "guild " + intGuildId + " has declared war on guild " + i1 + " (" + guildGetName(i1) + "," + guildGetAbbrev(i1) + ")"); - } - } - } - } - else if (strText.startsWith("guildGetEnemiesBA ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String guildId = st.nextToken(); - int intGuildId = utils.stringToInt(guildId); - int[] enemies_B_to_A = getGuildsAtWarWith(intGuildId); - if (enemies_B_to_A == null || enemies_B_to_A.length <= 0) - { - sendSystemMessageTestingOnly(self, "no other guild has declared war on guild " + intGuildId); - } - else - { - for (int i1 : enemies_B_to_A) { - sendSystemMessageTestingOnly(self, "guild " + i1 + " (" + guildGetName(i1) + "," + guildGetAbbrev(i1) + ") has declared war on guild " + intGuildId); - } - } - } - } - else if (strText.startsWith("addRebelFactionStanding ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - float factionPoints = utils.stringToFloat(st.nextToken()); - sendSystemMessageTestingOnly(self, "setting rebel faction points for " + self + " to " + factionPoints); - factions.addFactionStanding(self, factions.FACTION_REBEL, factionPoints); - } - } - else if (strText.equals("unequipFactionEquipmentCheckObjvar")) - { - sendSystemMessageTestingOnly(self, "unequipping faction equipments (check objvar) for " + self); - factions.unequipFactionEquipment(self, true); - } - else if (strText.equals("unequipFactionEquipmentNoCheckObjvar")) - { - sendSystemMessageTestingOnly(self, "unequipping faction equipments (no check objvar) for " + self); - factions.unequipFactionEquipment(self, false); - } - else if (strText.equals("tblair_bug")) - { - Vector objJedis = new Vector(); - objJedis.setSize(0); - Vector boolOnline = new Vector(); - boolOnline.setSize(0); - objJedis = utils.addElement(objJedis, utils.stringToObjId("1")); - boolOnline = utils.addElement(boolOnline, true); - objJedis = utils.addElement(objJedis, utils.stringToObjId("2")); - boolOnline = utils.addElement(boolOnline, false); - objJedis = utils.addElement(objJedis, utils.stringToObjId("3")); - boolOnline = utils.addElement(boolOnline, true); - objJedis = utils.addElement(objJedis, utils.stringToObjId("4")); - boolOnline = utils.addElement(boolOnline, false); - objJedis = utils.addElement(objJedis, utils.stringToObjId("5")); - boolOnline = utils.addElement(boolOnline, true); - objJedis = utils.addElement(objJedis, utils.stringToObjId("6")); - boolOnline = utils.addElement(boolOnline, false); - objJedis = utils.addElement(objJedis, utils.stringToObjId("7")); - boolOnline = utils.addElement(boolOnline, true); - objJedis = utils.addElement(objJedis, utils.stringToObjId("8")); - boolOnline = utils.addElement(boolOnline, false); - objJedis = utils.addElement(objJedis, utils.stringToObjId("9")); - boolOnline = utils.addElement(boolOnline, true); - objJedis = utils.addElement(objJedis, utils.stringToObjId("10")); - boolOnline = utils.addElement(boolOnline, false); - for (int iHuy = 0; iHuy < objJedis.size(); ++iHuy) - { - if ((Boolean) boolOnline.get(iHuy)) - { - LOG("***TBLAIR***", "jedi " + ((obj_id)objJedis.get(iHuy)) + " is online"); - } - else - { - LOG("***TBLAIR***", "jedi " + ((obj_id)objJedis.get(iHuy)) + " is offline"); - } - } - LOG("***TBLAIR***", "starting test loop"); - int jHuy = 0; - for (jHuy = 1; jHuy <= 100000; ++jHuy) - { - int intRoll = -1; - Vector jediList = new Vector(); - Vector jediIdx = new Vector(); - for (int i = 0; i < objJedis.size(); i++) - { - jediIdx = utils.addElement(jediIdx, i); - } - jediList = utils.concatArrays(jediList, objJedis); - while (jediList.size() > 0) - { - intRoll = rand(0, jediList.size() - 1); - if (!isIdValid(((obj_id)jediList.get(intRoll))) || !(Boolean) boolOnline.get((Integer) (jediIdx.get(intRoll)))) - { - jediList = utils.removeElementAt(jediList, intRoll); - jediIdx = utils.removeElementAt(jediIdx, intRoll); - } - else - { - intRoll = (Integer) jediIdx.get(intRoll); - obj_id objTarget = ((obj_id)objJedis.get(intRoll)); - boolean online = (Boolean) boolOnline.get(intRoll); - if (!online) - { - LOG("***TBLAIR***", "WRONG MATCH!!!! " + objTarget); - } - break; - } - } - } - LOG("***TBLAIR***", "done with tblair_bug jHuy=" + jHuy); - } - else if (strText.startsWith("createVendorMarket ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "calling createVendorMarket() for vendor " + object); - createVendorMarket(self, object, 0); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("setState ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - int state = utils.stringToInt(st.nextToken()); - int on = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling setState() for " + self + " state " + state + " on " + on); - setState(self, state, ((on != 0) ? true : false)); - } - } - else if (strText.startsWith("isAFK ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "isAFK object " + object + " is " + isAwayFromKeyBoard(object)); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("getVolume ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "getVolume for object " + object + " is " + getVolume(object)); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("getNumItemsIn ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "getNumItemsIn for object " + object + " is " + getNumItemsIn(object)); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("putInOverloaded ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "calling putInOverloaded() for object " + object); - obj_id inv = getObjectInSlot(self, "inventory"); - putInOverloaded(object, inv); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("isInWorld ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "isInWorld for object " + object + " is " + isInWorld(object)); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("getTravelPointName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - sendSystemMessageTestingOnly(self, "getCurrentSceneName is " + getCurrentSceneName() + " getTravelPointName for object " + object + " is " + travel.getTravelPointName(object) + " getArrivalLocation for object " + object + " is " + travel.getArrivalLocation(object) + " getTravelCost for object " + object + " is " + travel.getTravelCost(object)); - String planet = getCurrentSceneName(); - String travel_point = travel.getTravelPointName(object); - location arrival_loc = travel.getArrivalLocation(object); - int travel_cost = travel.getTravelCost(object); - if (travel_point == null || travel_cost == -1) - { - sendSystemMessageTestingOnly(self, "not calling calling initializeStarport()"); - } - else - { - sendSystemMessageTestingOnly(self, "calling initializeStarport()"); - initializeStarport(self, object, travel_point, travel_cost, true); - } - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.equals("getCityAtLocation")) - { - location loc = getWorldLocation(self); - sendSystemMessageTestingOnly(self, "I am currently at " + loc); - sendSystemMessageTestingOnly(self, "City I am currently in " + getCityAtLocation(loc, 0)); - } - else if (strText.startsWith("useTicketTerminal ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - if (isIdValid(object)) - { - if (exists(object)) - { - String planet = getCurrentSceneName(); - obj_id starport = travel.getStarportFromTerminal(object); - String travel_point = travel.getTravelPointName(starport); - if (player_structure.isCivic(starport)) - { - int city_id = getCityAtLocation(getLocation(starport), 0); - if (city.isCityBanned(self, city_id)) - { - sendSystemMessageTestingOnly(self, "Can't buy ticket"); - return SCRIPT_CONTINUE; - } - } - String config = getConfigSetting("GameServer", "disableTravelSystem"); - if (config != null) - { - if (config.equals("on")) - { - sendSystemMessageTestingOnly(self, "Travel disabled"); - return SCRIPT_CONTINUE; - } - } - sendSystemMessageTestingOnly(self, "OK to buy ticket"); - } - else - { - sendSystemMessageTestingOnly(self, "object " + object + " does not exist"); - } - } - else - { - sendSystemMessageTestingOnly(self, "invalid id for object " + object); - } - } - } - else if (strText.startsWith("getGroupInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - obj_id groupObject = getGroupObject(object); - if (isIdValid(groupObject)) - { - sendSystemMessageTestingOnly(self, "group " + groupObject + " has " + getPCGroupSize(groupObject) + "/" + getGroupSize(groupObject) + " player controlled member(s)"); - } - else - { - sendSystemMessageTestingOnly(self, "invalid group id for object " + object); - } - } - } - else if (strText.startsWith("NMGetPlayerName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getPlayerName(" + object + ") is " + getPlayerName(object)); - } - } - else if (strText.startsWith("NMGetPlayerFullName ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "getPlayerFullName(" + object + ") is " + getPlayerFullName(object)); - } - } - else if (strText.startsWith("messageToAtSameTime ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - int count = utils.stringToInt(st.nextToken()); - int delay = utils.stringToInt(st.nextToken()); - sendSystemMessageTestingOnly(self, "messageToAtSameTime count=" + count + " delay=" + delay); - dictionary d = new dictionary(); - for (int i = 1; i <= count; ++i) - { - d.put("count", i); - messageTo(self, "huyTestMessageTo3", d, delay, false); - } - } - } - else if (strText.startsWith("destroyObject ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - destroyObject(object); - } - } - else if (strText.equals("getServerSpawnLimit")) - { - sendSystemMessageTestingOnly(self, "serverSpawnLimit is " + getServerSpawnLimit()); - } - else if (strText.startsWith("getOneJedi ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - dictionary result = requestJedi(object); - if (result != null) - { - if (result.size() > 0) - { - sendSystemMessageTestingOnly(self, result.getString("name") + "(" + result.getObjId("id") + ") " + result.getInt("spentJediSkillPoints")); - } - else - { - sendSystemMessageTestingOnly(self, "No jedi " + object); - } - } - else - { - sendSystemMessageTestingOnly(self, "Error getting jedi " + object); - } - } - } - else if (strText.equals("getAllJedi")) - { - dictionary result = requestJedi(IGNORE_JEDI_STAT, IGNORE_JEDI_STAT, 1, 1000, IGNORE_JEDI_STAT, IGNORE_JEDI_STAT, IGNORE_JEDI_STAT); - if (result != null) - { - obj_id[] id = result.getObjIdArray("id"); - String[] name = result.getStringArray("name"); - int[] spentJediSkillPoints = result.getIntArray("spentJediSkillPoints"); - if (id != null && id.length > 0) - { - for (int i = 0; i < id.length; ++i) - { - sendSystemMessageTestingOnly(self, name[i] + "(" + id[i] + ") " + spentJediSkillPoints[i]); - } - } - else - { - sendSystemMessageTestingOnly(self, "No jedi"); - } - } - else - { - sendSystemMessageTestingOnly(self, "Error getting jedi"); - } - } - else if (strText.equals("getNumAI")) - { - sendSystemMessageTestingOnly(self, "getNumAI=" + getNumAI()); - } - else if (strText.equals("calculateWeaponRepair")) - { - float base_complexity = 10.0f; - int assembly_mod = getSkillStatMod(self, "general_assembly"); - float complexity = base_complexity * (1.0f - (0.15f * assembly_mod / 100.0f)); - sendSystemMessageTestingOnly(self, "assembly_mod=" + assembly_mod + " complexity=" + complexity); - int elite_mod = getSkillStatMod(self, "weapon_assembly"); - if (elite_mod > 0) - { - complexity -= base_complexity * (0.35f * elite_mod / 100.0f); - } - sendSystemMessageTestingOnly(self, "elite_mod=" + elite_mod + " complexity=" + complexity); - } - else if (strText.startsWith("getEntitlementInfo ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id object = utils.stringToObjId(st.nextToken()); - dictionary timeData = getAccountTimeData(object); - if (timeData == null) - { - sendSystemMessageTestingOnly(self, "couldn't get entitlement info for " + object); - } - else - { - int totalTime = timeData.getInt("total_subscription_time"); - int entitledTime = timeData.getInt("total_entitled_time"); - int lastLoginTime = timeData.getInt("last_login_time"); - int entitledLoginTime = timeData.getInt("entitled_login_time"); - sendSystemMessageTestingOnly(self, "entitlement info for " + object + " is total: " + entitledTime + "/" + totalTime + ", since last login: " + entitledLoginTime + "/" + lastLoginTime); - } - } - } - else if (strText.equals("createFsTheater")) - { - sendSystemMessageTestingOnly(self, "Creating FS Theater"); - createTheater("datatables/theater/fs_quest_combat3/fs_quest_combat3.iff", getLocation(self), "", TLT_flatten); - } - else if (strText.equals("setJediVisibility")) - { - sendSystemMessageTestingOnly(self, "Setting Jedi Visibility to 9000"); - setJediVisibility(self, 9000); - } - else if (strText.equals("clearJediVisibility")) - { - sendSystemMessageTestingOnly(self, "Setting Jedi Visibility to 0"); - setJediVisibility(self, 0); - } - else if (strText.equals("cwdm_doit")) - { - LOG("***HUY***", "OnHearSpeech() initiating cluster wide data test"); - int requestId = getClusterWideData("dungeon", "Corellian Corvette - Instance 1", true, self); - LOG("***HUY***", "getClusterWideData() to lock data for initial registration returned request Id (" + requestId + ")"); - } - else if (strText.equals("cwdm_ticket_tatooine")) - { - space_dungeon.createTicket(self, "tatooine", "huy_terminal", "test_dungeon"); - } - else if (strText.equals("cwdm_ticket_lok")) - { - space_dungeon.createTicket(self, "lok", "huy_terminal", "test_dungeon"); - } - else if (strText.equals("cwdm_ticket_corvette_neutral")) - { - space_dungeon.createTicket(self, "lok", "corvette_neutral_terminal", "corvette_neutral"); - } - else if (strText.equals("cwdm_ticket_corvette_imperial")) - { - space_dungeon.createTicket(self, "lok", "corvette_imperial_terminal", "corvette_imperial"); - } - else if (strText.equals("cwdm_ticket_corvette_rebel")) - { - space_dungeon.createTicket(self, "lok", "corvette_rebel_terminal", "corvette_rebel"); - } - else if (strText.equals("cwdm_reset_dungeon")) - { - obj_id dungeon = getTopMostContainer(self); - if (isIdValid(dungeon)) - { - LOG("***HUY***", "OnHearSpeech() ending dungeon session for dungeon (" + dungeon + ")"); - space_dungeon.endDungeonSession(dungeon); - } - else - { - LOG("***HUY***", "OnHearSpeech() could not find top most container for ending dungeon session"); - } - } - else if (strText.equals("start_messageto_test")) - { - int messageNumber = 1; - dictionary d = new dictionary(); - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo", d, 120, true); - LOG("***HUY***", "start_messageto_test with messageNumber=" + messageNumber); - } - else if (strText.equals("start_messageto_test2")) - { - int messageNumber = 1; - dictionary d = new dictionary(); - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 5, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 2; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 5, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 3; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 5, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 4; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 5, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 5; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 5, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 6; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 10, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 7; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 10, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 8; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 10, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 9; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 10, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - messageNumber = 10; - d.put("messageNumber", messageNumber); - messageTo(self, "huyTestMessageTo2", d, 10, false); - LOG("***HUY***", "start_messageto_test2 with messageNumber=" + messageNumber); - } - else if (strText.equals("start_messageto_test_remote")) - { - int messageNumber = 1; - dictionary d = new dictionary(); - d.put("messageNumber", messageNumber); - obj_id target = obj_id.getObjId(5461449); - messageTo(target, "huyTestMessageTo", d, 300, true); - LOG("***HUY***", "start_messageto_test_remote to " + target + " with messageNumber=" + messageNumber); - } - else if (strText.equals("testDictionaryPackUnpack")) - { - obj_id target = obj_id.getObjId(7600674); - dictionary d = new dictionary(); - d.put("target", target); - d.put("amt", 100); - d.put("useCash", true); - d.put("targetName", "Weaponsmith"); - d.put("actor", self); - d.put("actorName", "vendortest"); - byte[] packed = d.pack(); - dictionary unpacked = dictionary.unpack(packed); - LOG("***HUY***", "testDictionaryPackUnpack unpacked dictionary is " + unpacked); - } - else if (strText.equals("start_messageto_test_persisted")) - { - obj_id target = obj_id.getObjId(7600674); - dictionary d = new dictionary(); - d.put("target", target); - d.put("amt", 100); - d.put("useCash", true); - d.put("targetName", "Weaponsmith"); - d.put("actor", self); - d.put("actorName", "vendortest"); - messageTo(target, "huyTestPersistedMessageTo", d, 1.0f, true); - } - else if (strText.equals("start_messageto_test_persisted2")) - { - obj_id target = obj_id.getObjId(7600674); - dictionary d = new dictionary(); - d.put("amt", 100); - messageTo(target, "huyTestPersistedMessageTo2", d, 1.0f, true); - } - else if (strText.equals("start_xp_test")) - { - obj_id target = self; - messageTo(target, "huyTestXP", null, 5, false); - LOG("***HUY***", "start_xp_test to " + target); - } - else if (strText.equals("hmmm")) - { - if (objSpeaker == self) - { - obj_id target = getLookAtTarget(self); - if (target != null) - { - deltadictionary dctScriptVars = target.getScriptVars(); - } - } - } - else if (strText.equals("doJediTest")) - { - obj_id inv = getObjectInSlot(self, "inventory"); - if (inv == null) - { - LOG("***HUY***", "player " + self + " inventory is null."); - return SCRIPT_CONTINUE; - } - int free_space = getVolumeFree(inv); - if (free_space < 1) - { - LOG("***HUY***", "player " + self + " inventory is full."); - return SCRIPT_CONTINUE; - } - obj_id ticket = createObject("object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_gen1.iff", inv, ""); - } - return SCRIPT_CONTINUE; - } - public int OnClusterWideDataResponse(obj_id self, String strManagerName, String strElementNameRegex, int requestID, String[] elementNameList, dictionary[] dictionaryList, int lockKey) throws InterruptedException - { - LOG("***HUY***", "OnClusterWideDataResponse() manager name (" + strManagerName + ") element name regex (" + strElementNameRegex + ") request id (" + requestID + ") match count (" + elementNameList.length + ") lock key (" + lockKey + ")"); - for (int i = 0; i < elementNameList.length; ++i) - { - LOG("***HUY***", "element " + (i + 1) + " is (" + elementNameList[i] + ")"); - LOG("***HUY***", "dictionary " + dictionaryList[i].toString()); - } - if (requestID == 1) - { - dictionary dict = new dictionary(); - dict.put("bool true", true); - dict.put("bool false", false); - dict.put("float 77.77", Float.valueOf(77.77f)); - dict.put("objid", self); - dict.put("int 7777", 7777); - dict.put("string 77777", "77777"); - updateClusterWideData(strManagerName, "Corellian Corvette - Instance 1", dict, lockKey); - replaceClusterWideData(strManagerName, "Corellian Corvette - Instance 1", dict, true, lockKey); - replaceClusterWideData(strManagerName, "Corellian Corvette - Instance 1", dict, true, lockKey); - int requestId = getClusterWideData(strManagerName, "Corellian Corvette - Instance 1", true, self); - LOG("***HUY***", "getClusterWideData() to lock data for update returned request Id (" + requestId + ")"); - requestId = getClusterWideData(strManagerName, "Corellian Corvette - Instance 1", true, self); - LOG("***HUY***", "getClusterWideData() to lock data for update returned request Id (" + requestId + ")"); - requestId = getClusterWideData(strManagerName, "Corellian Corvette - Instance 1", true, self); - LOG("***HUY***", "getClusterWideData() to lock data for update returned request Id (" + requestId + ")"); - } - else if (requestID == 2) - { - dictionary dict = new dictionary(); - dict.put("new value 1", "added value 1"); - updateClusterWideData(strManagerName, "Corellian Corvette - Instance 1", dict, lockKey); - dictionary dict2 = new dictionary(); - dict2.put("new value 2", "added value 2"); - updateClusterWideData(strManagerName, "Corellian Corvette - Instance 1", dict2, lockKey); - dictionary dict3 = new dictionary(); - dict3.put("new value 3", "added value 3"); - updateClusterWideData(strManagerName, "Corellian Corvette - Instance 1", dict3, lockKey); - } - else if (requestID == 3) - { - removeClusterWideData(strManagerName, "Corellian Corvette - Instance 1", 0); - removeClusterWideData(strManagerName, "Corellian Corvette - Instance 1", lockKey); - } - return SCRIPT_CONTINUE; - } - public int huyTestMessageTo(obj_id self, dictionary params) throws InterruptedException - { - int messageNumber = params.getInt("messageNumber"); - LOG("***HUY***", "huyTestMessageTo processing message with messageNumber=" + messageNumber); - if (self.getValue() != 5461449) - { - dictionary d = new dictionary(); - d.put("messageNumber", messageNumber + 1); - messageTo(self, "huyTestMessageTo", d, 300, true); - } - return SCRIPT_CONTINUE; - } - public int huyTestMessageTo2(obj_id self, dictionary params) throws InterruptedException - { - int messageNumber = params.getInt("messageNumber"); - LOG("***HUY***", "huyTestMessageTo2 processing message with messageNumber=" + messageNumber); - return SCRIPT_CONTINUE; - } - public int huyTestMessageTo3(obj_id self, dictionary params) throws InterruptedException - { - int count = params.getInt("count"); - sendSystemMessageTestingOnly(self, "huyTestMessageTo3 count=" + count); - return SCRIPT_CONTINUE; - } - public int huyTestXP(obj_id self, dictionary params) throws InterruptedException - { - LOG("***HUY***", "in huyTestXP messageHandler"); - xp.grant(self, "combat_general", 10); - return SCRIPT_CONTINUE; - } - public int huyTestPersistedMessageTo(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "huyTestPersistedMessageTo() params is " + params.toString()); - return SCRIPT_CONTINUE; - } - public int huyTestPersistedMessageTo2(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "huyTestPersistedMessageTo2() params is " + params.toString()); - return SCRIPT_CONTINUE; - } - public boolean initializeStarport(obj_id self, obj_id structure, String travel_point, int travel_cost, boolean civic) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "initializeStarport() in"); - if (structure == null || structure == obj_id.NULL_ID) - { - sendSystemMessageTestingOnly(self, "structure == null || structure == obj_id.NULL_ID"); - return false; - } - int num_items = dataTableGetNumRows(travel.STARPORT_DATATABLE); - String template = getTemplateName(structure); - int idx = travel.getStarportTableIndex(template); - if (idx == -1) - { - sendSystemMessageTestingOnly(self, "idx == -1"); - return false; - } - String planet = getCurrentSceneName(); - dictionary row = dataTableGetRow(travel.STARPORT_DATATABLE, idx); - float arrival_x = row.getFloat(travel.DATATABLE_COL_ARRIVAL_X); - float arrival_y = row.getFloat(travel.DATATABLE_COL_ARRIVAL_Y); - float arrival_z = row.getFloat(travel.DATATABLE_COL_ARRIVAL_Z); - String arrival_cell = row.getString(travel.DATATABLE_COL_ARRIVAL_CELL); - int ground_time = row.getInt(travel.DATATABLE_COL_GROUND_TIME); - int air_time = row.getInt(travel.DATATABLE_COL_AIR_TIME); - int is_shuttleport = row.getInt(travel.DATATABLE_COL_IS_SHUTTLEPORT); - location arrival_loc; - if (arrival_cell.equals("WORLD_DELTA")) - { - location s_loc = getLocation(structure); - float s_yaw = getYaw(structure); - if (s_yaw < 0.0f) - { - s_yaw = s_yaw + 360.0f; - } - int rotation = (int)(s_yaw + 1) / 90; - float[] transform = travel.transformDeltaWorldYaw(structure, arrival_x, arrival_z); - arrival_x = transform[0]; - arrival_z = transform[1]; - arrival_loc = new location(s_loc.x - arrival_x, s_loc.y - arrival_y, s_loc.z - arrival_z, planet, obj_id.NULL_ID); - } - else - { - obj_id cell_id = getCellId(structure, arrival_cell); - if (cell_id == null || cell_id == obj_id.NULL_ID) - { - sendSystemMessageTestingOnly(self, "cell_id == null || cell_id == obj_id.NULL_ID"); - return false; - } - arrival_loc = new location(arrival_x, arrival_y, arrival_z, planet, cell_id); - } - setObjVar(structure, travel.VAR_GROUND_TIME, ground_time); - setObjVar(structure, travel.VAR_AIR_TIME, air_time); - setObjVar(structure, travel.VAR_SHUTTLE_AVAILABLE, 1); - setObjVar(structure, travel.VAR_SHUTTLE_TIMESTAMP, getGameTime()); - setObjVar(structure, travel.VAR_VERSION, travel.CURRENT_VERSION); - if (is_shuttleport > 0) - { - setObjVar(structure, travel.VAR_IS_SHUTTLEPORT, is_shuttleport); - } - else if (hasObjVar(structure, travel.VAR_IS_SHUTTLEPORT)) - { - removeObjVar(structure, travel.VAR_IS_SHUTTLEPORT); - } - if (travel.setStarportTravelPoint(structure, travel_point, arrival_loc, travel_cost, civic)) - { - sendSystemMessageTestingOnly(self, "travel.setStarportTravelPoint() OK"); - } - else - { - sendSystemMessageTestingOnly(self, "travel.setStarportTravelPoint() FAILED"); - } - if (hasObjVar(structure, travel.VAR_BASE_OBJECT)) - { - travel.destroyBaseObjects(structure); - } - if (num_items > idx + 1) - { - float s_yaw = getYaw(structure); - if (s_yaw < 0.0f) - { - s_yaw = s_yaw + 360.0f; - } - int rotation = (int)(s_yaw + 1) / 90; - LOG("LOG_CHANNEL", "(" + structure + ")" + "rotation ->" + rotation); - Vector object_list = new Vector(); - object_list.setSize(0); - for (int i = idx + 1; i < num_items; i++) - { - String struct_temp = dataTableGetString(travel.STARPORT_DATATABLE, i, travel.DATATABLE_COL_STRUCTURE); - if (struct_temp.length() > 0) - { - break; - } - dictionary object_row = dataTableGetRow(travel.STARPORT_DATATABLE, i); - String obj_template = object_row.getString(travel.DATATABLE_COL_OBJECT); - float x = object_row.getFloat(travel.DATATABLE_COL_X); - float y = object_row.getFloat(travel.DATATABLE_COL_Y); - float z = object_row.getFloat(travel.DATATABLE_COL_Z); - String cell = object_row.getString(travel.DATATABLE_COL_CELL); - float heading = object_row.getFloat(travel.DATATABLE_COL_HEADING); - int is_terminal = object_row.getInt(travel.DATATABLE_COL_IS_TERMINAL); - int is_transport = object_row.getInt(travel.DATATABLE_COL_IS_TRANSPORT); - int is_pilot = object_row.getInt(travel.DATATABLE_COL_IS_PILOT); - location obj_loc; - obj_id object; - if (cell.equals("WORLD_DELTA")) - { - float[] delta_trans = travel.transformDeltaWorldYaw(structure, x, z); - x = delta_trans[0]; - z = delta_trans[1]; - heading = heading + s_yaw; - if (heading > 360) - { - heading = heading - 360; - } - location s_loc = getLocation(structure); - obj_loc = new location(s_loc.x - x, s_loc.y - y, s_loc.z - z, planet, obj_id.NULL_ID); - LOG("LOG_CHANNEL", "obj_loc ->" + obj_loc); - object = createObject(obj_template, obj_loc); - } - else - { - obj_id cell_id = getCellId(structure, cell); - if (cell_id == null || cell_id == obj_id.NULL_ID) - { - LOG("LOG_CHANNEL", "Unable to find valid cell name for " + obj_template); - continue; - } - obj_loc = new location(x, y, z, planet, cell_id); - object = createObjectInCell(obj_template, structure, cell, obj_loc); - LOG("LOG_CHANNEL", "object ->" + object); - } - if (obj_loc == null) - { - LOG("LOG_CHANNEL", "Unable to create " + obj_template); - } - else - { - if (heading != 0.0f) - { - - } - - { - setYaw(object, heading); - object_list = utils.addElement(object_list, object); - } - if (is_terminal == 1) - { - setObjVar(object, travel.VAR_STARPORT, structure); - } - if (is_transport == 1) - { - setObjVar(object, travel.VAR_STARPORT, structure); - attachScript(object, travel.SCRIPT_SHUTTLE); - } - if (is_pilot == 1) - { - setObjVar(object, travel.VAR_STARPORT, structure); - attachScript(object, travel.SCRIPT_SHUTTLE_PILOT); - } - } - if (object_list.size() > 0) - { - setObjVar(structure, travel.VAR_BASE_OBJECT, object_list); - } - } - } - sendSystemMessageTestingOnly(self, "initializeStarport() out"); - return true; - } - public int huyRequestJediBountySuccess(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "huyRequestJediBountySuccess() params is " + params.toString()); - return SCRIPT_CONTINUE; - } - public int huyRequestJediBountyFailure(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "huyRequestJediBountyFailure() params is " + params.toString()); - return SCRIPT_CONTINUE; - } - public int huyTestSUIProgressBar(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "ProgressBar update"); - int startTime = params.getInt("startTime"); - int pid = params.getInt("pid"); - if (setSUIProperty(pid, "comp.pText.text", PROP_TEXT, (getGameTime() - startTime) + " seconds have elapsed")) - { - flushSUIPage(pid); - messageTo(self, "huyTestSUIProgressBar", params, 5, false); - } - return SCRIPT_CONTINUE; - } - public int progressBar(obj_id player) throws InterruptedException - { - int pid = createSUIPage("Script.ProgressBar", player, player, "ProgressBarCallback"); - setSUIProperty(pid, "comp.pText.text", PROP_TEXT, "0 seconds have elapsed"); - showSUIPage(pid); - int now = getGameTime(); - dictionary d = new dictionary(); - d.put("startTime", now); - d.put("pid", pid); - messageTo(player, "huyTestSUIProgressBar", d, 5, false); - return pid; - } - public int ProgressBarCallback(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "ProgressBarCallback"); - return SCRIPT_CONTINUE; - } - public int countdownTimerBar(obj_id player) throws InterruptedException - { - int pid = createSUIPage("Script.CountdownTimerBar", player, player, "CountdownTimerBarCallback"); - string_id testStringId = new string_id("error_message", "prose_over_max_entries"); - String prompt = utils.packStringId(testStringId); - setSUIProperty(pid, "comp.text", PROP_TEXT, prompt); - setSUIProperty(pid, "bg.caption.lbltitle", PROP_TEXT, prompt); - setSUIProperty(pid, "this", "countdownTimerTimeValue", "0,60"); - showSUIPage(pid); - return pid; - } - public int CountdownTimerBarCallback(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "CountdownTimerBarCallback"); - return SCRIPT_CONTINUE; - } - public int OnEnterRegion(obj_id self, String planetName, String regionName) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnEnterRegion planet=" + planetName + " region=" + regionName); - LOG("***HUY_REGION***", self + " OnEnterRegion planet=" + planetName + " region=" + regionName); - return SCRIPT_CONTINUE; - } - public int OnExitRegion(obj_id self, String planetName, String regionName) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnExitRegion planet=" + planetName + " region=" + regionName); - LOG("***HUY_REGION***", self + " OnExitRegion planet=" + planetName + " region=" + regionName); - return SCRIPT_CONTINUE; - } - public int OnCollectionSlotModified(obj_id self, String bookName, String pageName, String collectionName, String slotName, boolean isCounterTypeSlot, int previousValue, int currentValue, int maxSlotValue, boolean slotCompleted) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnCollectionSlotModified book=" + bookName + ", page=" + pageName + ", collection=" + collectionName + ", slot=" + slotName + ", isCounterTypeSlot=" + isCounterTypeSlot + ", previousValue=" + previousValue + ", currentValue=" + currentValue + ", maxSlotValue=" + maxSlotValue + ", slotCompleted=" + slotCompleted); - return SCRIPT_CONTINUE; - } - public int OnCollectionServerFirst(obj_id self, String bookName, String pageName, String collectionName) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnCollectionServerFirst book=" + bookName + ", page=" + pageName + ", collection=" + collectionName); - return SCRIPT_CONTINUE; - } - public int OnIncubatorCommitted(obj_id self, obj_id playerId, obj_id terminalId, obj_id slot1Id, obj_id slot2Id, obj_id slot3Id, obj_id slot4Id, int initialPointsSurvival, int initialPointsBeastialResilience, int initialPointsCunning, int initialPointsIntelligence, int initialPointsAggression, int initialPointsHuntersInstinct, int totalPointsSurvival, int totalPointsBeastialResilience, int totalPointsCunning, int totalPointsIntelligence, int totalPointsAggression, int totalPointsHuntersInstinct, int temperatureGauge, int nutrientGauge, int newCreatureColorIndex) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnIncubatorCommitted"); - return SCRIPT_CONTINUE; - } - public int OnIncubatorCancelled(obj_id self, obj_id playerId, obj_id terminalId) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnIncubatorCancelled"); - return SCRIPT_CONTINUE; - } - public int endDuelCommandNotification(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = params.getObjId("target"); - sendSystemMessageTestingOnly(self, "endDuelCommandNotification() I am=" + self + " target=" + target); - return SCRIPT_CONTINUE; - } - public int OnPvpRankingChanged(obj_id self, int oldRank, int newRank) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "OnPvpRankingChanged oldRank=" + oldRank + " newRank=" + newRank); - LOG("***HUY_ONPVPRANKINGCHANGED***", self + " OnPvpRankingChanged oldRank=" + oldRank + " newRank=" + newRank); - return SCRIPT_CONTINUE; - } - public int huyHourlyAlarmClock(obj_id self, dictionary params) throws InterruptedException - { - int now = params.getInt("gameTime"); - sendSystemMessageTestingOnly(self, "huyHourlyAlarmClock now=" + now); - return SCRIPT_CONTINUE; - } - public int huyDailyAlarmClock(obj_id self, dictionary params) throws InterruptedException - { - int now = params.getInt("gameTime"); - sendSystemMessageTestingOnly(self, "huyDailyAlarmClock now=" + now); - return SCRIPT_CONTINUE; - } - public int huyWeeklyAlarmClock(obj_id self, dictionary params) throws InterruptedException - { - int now = params.getInt("gameTime"); - sendSystemMessageTestingOnly(self, "huyWeeklyAlarmClock now=" + now); - return SCRIPT_CONTINUE; - } - public int huyMonthlyAlarmClock(obj_id self, dictionary params) throws InterruptedException - { - int now = params.getInt("gameTime"); - sendSystemMessageTestingOnly(self, "huyMonthlyAlarmClock now=" + now); - return SCRIPT_CONTINUE; - } - public int huyYearlyAlarmClock(obj_id self, dictionary params) throws InterruptedException - { - int now = params.getInt("gameTime"); - sendSystemMessageTestingOnly(self, "huyYearlyAlarmClock now=" + now); - return SCRIPT_CONTINUE; - } - public int testSuiHandler(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "buttonPressed=" + params.getString("buttonPressed")); - return SCRIPT_CONTINUE; - } - public int OnUnloadedFromMemory(obj_id self) throws InterruptedException - { - LOG("***HUY_SSI***", "OnUnloadedFromMemory() " + self); - return SCRIPT_CONTINUE; - } - public void testIntegerLongReferenceParam(int[] i, long[] l) throws InterruptedException - { - i[0] = i[0] + 1; - l[0] = l[0] + 1L; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/cwdm_test2.java b/sku.0/sys.server/compiled/game/script/hnguyen/cwdm_test2.java deleted file mode 100755 index 43916c409..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/cwdm_test2.java +++ /dev/null @@ -1,31 +0,0 @@ -package script.hnguyen; - -import script.dictionary; -import script.obj_id; - -public class cwdm_test2 extends script.base_script -{ - public cwdm_test2() - { - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (strText.equals("cwdm_doit")) - { - LOG("***HUY***", "OnHearSpeech() initiating cluster wide data test"); - int requestId = getClusterWideData("dungeon", "Corellian Corvette - Instance 1", true, self); - LOG("***HUY***", "getClusterWideData() to lock data for initial registration returned request Id (" + requestId + ")"); - } - return SCRIPT_CONTINUE; - } - public int OnClusterWideDataResponse(obj_id self, String strManagerName, String strElementNameRegex, int requestID, String[] elementNameList, dictionary[] dictionaryList, int lockKey) throws InterruptedException - { - LOG("***HUY***", "OnClusterWideDataResponse() manager name (" + strManagerName + ") element name regex (" + strElementNameRegex + ") request id (" + requestID + ") match count (" + elementNameList.length + ") lock key (" + lockKey + ")"); - for (int i = 0; i < elementNameList.length; ++i) - { - LOG("***HUY***", "element " + (i + 1) + " is (" + elementNameList[i] + ")"); - LOG("***HUY***", "dictionary " + dictionaryList[i].toString()); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/initialize_starport.java b/sku.0/sys.server/compiled/game/script/hnguyen/initialize_starport.java deleted file mode 100755 index a205f3aa7..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/initialize_starport.java +++ /dev/null @@ -1,67 +0,0 @@ -package script.hnguyen; - -import script.library.player_structure; -import script.library.travel; -import script.library.utils; -import script.location; -import script.obj_id; - -import java.util.StringTokenizer; - -public class initialize_starport extends script.base_script -{ - public initialize_starport() - { - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("initializeStarport ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id starportOid = utils.stringToObjId(st.nextToken()); - if (!hasScript(starportOid, "structure.municipal.starport")) - { - sendSystemMessageTestingOnly(self, "object " + starportOid + " doesn't have script structure.municipal.starport"); - } - else - { - sendSystemMessageTestingOnly(self, "inializing starport " + starportOid); - if (player_structure.isCivic(starportOid)) - { - sendSystemMessageTestingOnly(self, "starport " + starportOid + " is civic"); - } - else - { - String planet = getCurrentSceneName(); - String travel_point = travel.getTravelPointName(starportOid); - int travel_cost = travel.getTravelCost(starportOid); - if (travel_point == null || travel_cost == -1) - { - sendSystemMessageTestingOnly(self, "starport " + starportOid + " has null travel point or travel cost of -1"); - } - else - { - location loc = getPlanetTravelPointLocation(planet, travel_point); - if (loc != null) - { - sendSystemMessageTestingOnly(self, "starport " + starportOid + " is already registered with the travel system"); - } - else - { - travel.initializeStarport(starportOid, travel_point, travel_cost, false); - } - } - } - } - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/online_jedi_test.java b/sku.0/sys.server/compiled/game/script/hnguyen/online_jedi_test.java deleted file mode 100755 index 402c232c8..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/online_jedi_test.java +++ /dev/null @@ -1,217 +0,0 @@ -package script.hnguyen; - -import script.dictionary; -import script.location; -import script.obj_id; - -import java.util.StringTokenizer; - -public class online_jedi_test extends script.base_script -{ - public online_jedi_test() - { - } - public int OnInitialize(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("ojt3")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String file = st.nextToken(); - if (true) - { - int numOnlineJedis = 0; - int numOfflineJedis = 0; - String strOutput = ""; - String strOffline = "offline jedi\r\n"; - dictionary dctJediInfo = requestJedi(IGNORE_JEDI_STAT, IGNORE_JEDI_STAT, 1, 1000, IGNORE_JEDI_STAT, IGNORE_JEDI_STAT); - if (dctJediInfo == null) - { - strOutput = "requestJedi() returned NULL dctJediInfo\r\n"; - } - else - { - obj_id[] objJedis = dctJediInfo.getObjIdArray("id"); - boolean[] boolOnline = dctJediInfo.getBooleanArray("online"); - String[] strNames = dctJediInfo.getStringArray("name"); - int[] visibility = dctJediInfo.getIntArray("visibility"); - int[] bountyValue = dctJediInfo.getIntArray("bountyValue"); - int[] level = dctJediInfo.getIntArray("level"); - int[] faction = dctJediInfo.getIntArray("faction"); - location[] loc = dctJediInfo.getLocationArray("location"); - obj_id[][] bounties = (obj_id[][])(dctJediInfo.get("bounties")); - if (objJedis != null && boolOnline != null && strNames != null && visibility != null) - { - strOutput = "requestJedi() returned " + objJedis.length + " jedis\r\n"; - for (int i = 0; i < objJedis.length; ++i) - { - if (boolOnline[i]) - { - ++numOnlineJedis; - strOutput += objJedis[i]; - strOutput += " ["; - strOutput += strNames[i]; - strOutput += ","; - strOutput += visibility[i]; - strOutput += ","; - strOutput += bountyValue[i]; - strOutput += ","; - strOutput += level[i]; - strOutput += ","; - strOutput += getFactionString(faction[i]); - strOutput += ","; - strOutput += loc[i]; - strOutput += ", hunted by ("; - for (int j = 0; j < bounties[i].length; ++j) - { - if (j > 0) - { - strOutput += ","; - } - strOutput += bounties[i][j]; - strOutput += "-"; - strOutput += getPlayerName(bounties[i][j]); - } - strOutput += ")"; - strOutput += "] is online\r\n"; - } - else - { - ++numOfflineJedis; - strOffline += objJedis[i]; - strOffline += " ["; - strOffline += strNames[i]; - strOffline += ","; - strOffline += visibility[i]; - strOffline += ","; - strOffline += bountyValue[i]; - strOffline += ","; - strOffline += level[i]; - strOffline += ","; - strOffline += getFactionString(faction[i]); - strOffline += ","; - strOffline += loc[i]; - strOffline += ", hunted by ("; - for (int j = 0; j < bounties[i].length; ++j) - { - if (j > 0) - { - strOffline += ","; - } - strOffline += bounties[i][j]; - strOffline += "-"; - strOffline += getPlayerName(bounties[i][j]); - } - strOffline += ")"; - strOffline += "] is offline\r\n"; - } - } - } - else - { - strOutput = "requestJedi() returned null data\r\n"; - } - } - strOutput += numOnlineJedis; - strOutput += " online jedis\r\n"; - strOffline += numOfflineJedis; - strOffline += " offline jedis\r\n"; - saveTextOnClient(self, "online_jedi" + file + ".txt", strOutput); - saveTextOnClient(self, "offline_jedi" + file + ".txt", strOffline); - } - } - } - return SCRIPT_CONTINUE; - } - public int hnguyencrbtConfirmed(obj_id self, dictionary params) throws InterruptedException - { - obj_id bhId = params.getObjId("hunter"); - obj_id jediId = params.getObjId("jedi"); - int bounties = params.getInt("bounties"); - String bhName = ""; - String jediName = ""; - if ((bhId != null) && (isIdValid(bhId))) - { - bhName = getPlayerName(bhId); - } - if ((jediId != null) && (isIdValid(jediId))) - { - jediName = getPlayerName(jediId); - } - sendSystemMessageTestingOnly(self, "SUCCESS - bounty created bh=(" + bhId + "," + bhName + ") jedi=(" + jediId + "," + jediName + "," + bounties + ")"); - return SCRIPT_CONTINUE; - } - public int hnguyencrbtFailed(obj_id self, dictionary params) throws InterruptedException - { - obj_id bhId = params.getObjId("hunter"); - obj_id jediId = params.getObjId("jedi"); - int bounties = params.getInt("bounties"); - String bhName = ""; - String jediName = ""; - if ((bhId != null) && (isIdValid(bhId))) - { - bhName = getPlayerName(bhId); - } - if ((jediId != null) && (isIdValid(jediId))) - { - jediName = getPlayerName(jediId); - } - sendSystemMessageTestingOnly(self, "FAILED - bounty not created bh=(" + bhId + "," + bhName + ") jedi=(" + jediId + "," + jediName + "," + bounties + ")"); - return SCRIPT_CONTINUE; - } - public String getFactionString(int iTefFac) throws InterruptedException - { - String sTefFacName = ""; - if (iTefFac == (-526735576)) - { - sTefFacName = "battlefield"; - } - else if (iTefFac == (1183528962)) - { - sTefFacName = "duel"; - } - else if (iTefFac == (-429740311)) - { - sTefFacName = "bountyduel"; - } - else if (iTefFac == (221551254)) - { - sTefFacName = "nonaggressive"; - } - else if (iTefFac == (-160237431)) - { - sTefFacName = "unattackable"; - } - else if (iTefFac == (84709322)) - { - sTefFacName = "bountytarget"; - } - else if (iTefFac == (-1526926610)) - { - sTefFacName = "guildwarcooldownperiod"; - } - else if (iTefFac == (-615855020)) - { - sTefFacName = "imperial"; - } - else if (iTefFac == (370444368)) - { - sTefFacName = "rebel"; - } - else if (iTefFac == (-377582139)) - { - sTefFacName = "bubblecombat"; - } - return sTefFacName; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/pvp_test.java b/sku.0/sys.server/compiled/game/script/hnguyen/pvp_test.java deleted file mode 100755 index 8c28c431d..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/pvp_test.java +++ /dev/null @@ -1,67 +0,0 @@ -package script.hnguyen; - -import script.library.utils; -import script.obj_id; - -import java.util.StringTokenizer; - -public class pvp_test extends script.base_script -{ - public pvp_test() - { - } - public int OnInitialize(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("setpe")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id dest = utils.stringToObjId(st.nextToken()); - obj_id enemy = utils.stringToObjId(st.nextToken()); - pvpSetPersonalEnemyFlag(dest, enemy); - sendSystemMessageTestingOnly(self, dest + " now has " + enemy + " as a personal enemy"); - } - } - else if (strText.startsWith("haspe")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id actor = utils.stringToObjId(st.nextToken()); - obj_id target = utils.stringToObjId(st.nextToken()); - if (pvpHasPersonalEnemyFlag(actor, target)) - { - sendSystemMessageTestingOnly(self, actor + " has " + target + " as a personal enemy"); - } - else - { - sendSystemMessageTestingOnly(self, actor + " DOESN'T have " + target + " as a personal enemy"); - } - } - } - else if (strText.startsWith("removepe")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 3) - { - String command = st.nextToken(); - obj_id target = utils.stringToObjId(st.nextToken()); - obj_id enemyId = utils.stringToObjId(st.nextToken()); - pvpRemovePersonalEnemyFlags(target, enemyId); - sendSystemMessageTestingOnly(self, target + " no longer has " + enemyId + " as a personal enemy"); - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/sc_cts_test.java b/sku.0/sys.server/compiled/game/script/hnguyen/sc_cts_test.java deleted file mode 100755 index 0513b3d8b..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/sc_cts_test.java +++ /dev/null @@ -1,33 +0,0 @@ -package script.hnguyen; - -import script.library.cts; -import script.library.utils; -import script.obj_id; - -import java.util.StringTokenizer; - -public class sc_cts_test extends script.base_script -{ - public sc_cts_test() - { - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("initiateCtsFromItem ")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - obj_id item = utils.stringToObjId(st.nextToken()); - sendSystemMessageTestingOnly(self, "calling cts.initiateCtsFromItem(player=" + self + ", item=" + item + ")"); - cts.initiateCtsFromItem(self, item); - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/hnguyen/scriptvar_test.java b/sku.0/sys.server/compiled/game/script/hnguyen/scriptvar_test.java deleted file mode 100755 index 854a59eaa..000000000 --- a/sku.0/sys.server/compiled/game/script/hnguyen/scriptvar_test.java +++ /dev/null @@ -1,145 +0,0 @@ -package script.hnguyen; - -import script.deltadictionary; -import script.dictionary; -import script.library.utils; -import script.obj_id; - -import java.util.StringTokenizer; - -public class scriptvar_test extends script.base_script -{ - public scriptvar_test() - { - } - public int OnInitialize(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (objSpeaker != self) - { - return SCRIPT_CONTINUE; - } - if (strText.startsWith("ahh")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String id = st.nextToken(); - obj_id target = utils.stringToObjId(id); - if (isIdValid(target)) - { - if (exists(target)) - { - dictionary d = target.getScriptDictionary(); - sendSystemMessageTestingOnly(self, "scriptDictionary for " + target + " are: " + d.toString()); - } - else - { - sendSystemMessageTestingOnly(self, "ahh " + target + " - no object"); - } - } - else - { - sendSystemMessageTestingOnly(self, "ahh " + target + " - bad id"); - } - } - } - else if (strText.startsWith("ohh")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - String id = st.nextToken(); - String var = st.nextToken(); - String val = st.nextToken(); - obj_id target = utils.stringToObjId(id); - if (isIdValid(target)) - { - if (exists(target)) - { - dictionary d = target.getScriptDictionary(); - d.put(var, val); - sendSystemMessageTestingOnly(self, "Setting scriptDictionary for " + target + " " + var + "=" + val); - } - else - { - sendSystemMessageTestingOnly(self, "ohh " + target + " - no object"); - } - } - else - { - sendSystemMessageTestingOnly(self, "ohh " + target + " - bad id"); - } - } - } - else if (strText.startsWith("ah")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 2) - { - String command = st.nextToken(); - String id = st.nextToken(); - obj_id target = utils.stringToObjId(id); - if (isIdValid(target)) - { - if (exists(target)) - { - deltadictionary dctScriptVars = target.getScriptVars(); - sendSystemMessageTestingOnly(self, "Scriptvars for " + target + " are: " + dctScriptVars.toString()); - } - else - { - sendSystemMessageTestingOnly(self, "ah " + target + " - no object"); - } - } - else - { - sendSystemMessageTestingOnly(self, "ah " + target + " - bad id"); - } - } - } - else if (strText.startsWith("oh")) - { - StringTokenizer st = new StringTokenizer(strText); - if (st.countTokens() == 4) - { - String command = st.nextToken(); - String id = st.nextToken(); - String var = st.nextToken(); - String val = st.nextToken(); - obj_id target = utils.stringToObjId(id); - if (isIdValid(target)) - { - if (exists(target)) - { - utils.setScriptVar(target, var, val); - sendSystemMessageTestingOnly(self, "Setting scriptvar for " + target + " " + var + "=" + val); - } - else - { - sendSystemMessageTestingOnly(self, "oh " + target + " - no object"); - } - } - else - { - sendSystemMessageTestingOnly(self, "oh " + target + " - bad id"); - } - } - } - else if (strText.equals("gc")) - { - sendSystemMessageTestingOnly(self, "telling Java to do garbage collection"); - System.gc(); - } - else if (strText.equals("getGameTime")) - { - sendSystemMessageTestingOnly(self, "getGameTime() returns " + getGameTime()); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/levelup_orb/levelup_orb.java b/sku.0/sys.server/compiled/game/script/item/levelup_orb/levelup_orb.java index 4d0425147..7e471da2d 100755 --- a/sku.0/sys.server/compiled/game/script/item/levelup_orb/levelup_orb.java +++ b/sku.0/sys.server/compiled/game/script/item/levelup_orb/levelup_orb.java @@ -72,14 +72,11 @@ public class levelup_orb extends script.base_script int xpNeeded = dataTableGetInt("datatables/player/player_level.iff", currentLevel, "xp_required"); int prevNeeded = dataTableGetInt("datatables/player/player_level.iff", currentLevel - 1, "xp_required"); xpNeeded -= prevNeeded; - if (getConfigSetting("GameServer", "xpMultiplier") != null) + int xpMultiplier = utils.getIntConfigSetting("GameServer", "xpMultiplier"); + if (xpMultiplier > 0) { - int xpBonusValue = utils.stringToInt(getConfigSetting("GameServer", "xpMultiplier")); - if (xpBonusValue > 1) - { - xpNeeded = xpNeeded / xpBonusValue; - xpNeeded += 1; - } + xpNeeded = xpNeeded / xpMultiplier; + xpNeeded += 1; } xp.grant(player, "combat_general", xpNeeded); } diff --git a/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java b/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java index 2d4937e0a..bc28b2d87 100755 --- a/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java +++ b/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java @@ -814,10 +814,6 @@ public class reverse_engineering_tool extends script.base_script } public float getReverseEngineeringBonusMultiplier() throws InterruptedException { - String config = getConfigSetting("Custom", "reverseEngineeringBonusMultiplier"); - if (config != null && config.length() > 0) { - return utils.stringToFloat(config); - } - return 1.0f; + return utils.getFloatConfigSetting("Custom", "reverseEngineeringBonusMultiplier", 1.0f); } } diff --git a/sku.0/sys.server/compiled/game/script/library/battlefield.java b/sku.0/sys.server/compiled/game/script/library/battlefield.java index 1a4b399db..4b1db61bf 100755 --- a/sku.0/sys.server/compiled/game/script/library/battlefield.java +++ b/sku.0/sys.server/compiled/game/script/library/battlefield.java @@ -147,6 +147,8 @@ public class battlefield extends script.base_script public static final String STRING_TRIG_BOUNDARY = "battlefield_boundary"; public static final String STRING_TRIG_OUTER_PERIMETER = "battlefield_outer_perimeter"; public static final String GAME_SCRIPT_PATH = "systems.battlefield.game_"; + public static final boolean BATTLEFIELDS_DISABLED = utils.checkConfigFlag("GameServer", "disableBattlefields"); + public static void createBattlefieldRegions(String area) throws InterruptedException { int numItems = dataTableGetNumRows(BATTLEFIELD_DATATABLE); diff --git a/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java b/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java index 3ea2b4c5d..fdb1639d9 100755 --- a/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java +++ b/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java @@ -471,21 +471,8 @@ public class bounty_hunter extends script.base_script return false; } int numHunters = hunters.length; - String Smax = getConfigSetting("GameServer", "maxJediBounties"); - int maxHunters = 3; - if (Smax != null && !Smax.equals("")) - { - Integer Imax = Integer.getInteger(Smax); - if (Imax != null) - { - maxHunters = Imax; - } - } - if (numHunters >= maxHunters) - { - return true; - } - return false; + int maxHunters = utils.getIntConfigSetting("GameServer", "maxJediBounties", 3); + return numHunters >= maxHunters; } public static float getBountyFactionPointAdjustment(obj_id hunter, obj_id target) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/city.java b/sku.0/sys.server/compiled/game/script/library/city.java index 6a589475d..29fa88296 100755 --- a/sku.0/sys.server/compiled/game/script/library/city.java +++ b/sku.0/sys.server/compiled/game/script/library/city.java @@ -1082,7 +1082,7 @@ public class city extends script.base_script { return 0; } - if (getConfigSetting("GameServer", "disableStructureFees") != null) + if (player_structure.STRUCTURE_FEES_DISABLED) { return 0; } diff --git a/sku.0/sys.server/compiled/game/script/library/create.java b/sku.0/sys.server/compiled/game/script/library/create.java index 7a75a4523..6793702aa 100755 --- a/sku.0/sys.server/compiled/game/script/library/create.java +++ b/sku.0/sys.server/compiled/game/script/library/create.java @@ -1,6 +1,7 @@ package script.library; import script.*; +import script.ai.ai; import java.util.Vector; @@ -810,7 +811,7 @@ public class create extends script.base_script } public static void attachCreatureScripts(obj_id creature, String scriptList, boolean withAi) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAI") != null) + if (ai.AI_SCRIPTS_DISABLED) { return; } @@ -936,23 +937,6 @@ public class create extends script.base_script { attachScript(npc, "systems.combat.combat_actions"); } - obj_id primaryWeapon = aiGetPrimaryWeapon(npc); - obj_id secondaryWeapon = aiGetSecondaryWeapon(npc); - boolean hasJediWeapon = false; - if (isIdValid(primaryWeapon)) - { - if (jedi.isLightsaber(primaryWeapon)) - { - hasJediWeapon = true; - } - } - if (isIdValid(secondaryWeapon)) - { - if (jedi.isLightsaber(secondaryWeapon)) - { - hasJediWeapon = true; - } - } } public static void applySkillStatisticModifiers(obj_id creature, int toHitChance, int defenseValue) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/dump.java b/sku.0/sys.server/compiled/game/script/library/dump.java index 20e733a39..37e520a19 100755 --- a/sku.0/sys.server/compiled/game/script/library/dump.java +++ b/sku.0/sys.server/compiled/game/script/library/dump.java @@ -643,11 +643,17 @@ public class dump extends script.base_script { String playerFullName = getName(objTarget); String playerCodeString = getPlayerName(objTarget); - strTest += "PLAYER FULL NAME: \t"; + strTest += "\nPLAYER FULL NAME: \t\t"; strTest += playerFullName + "\r\n"; - strTest += "INTERNAL NAME: \t\t"; + strTest += "INTERNAL NAME: \t\t\t"; strTest += playerCodeString + "\r\n"; - strTest += "LOTS USED: \t\t\t" + getAccountNumLots(objTarget) + "\r\n\r\n"; + strTest += "ACCOUNT USERNAME: \t\t"; + strTest += getPlayerAccountUsername(objTarget) + "\r\n"; + strTest += "LOTS USED: \t\t\t\t" + getAccountNumLots(objTarget) + "\r\n"; + strTest += "PLAYER PLAY TIME:\t\t" + getPlayerPlayedTime(objTarget) + "\r\n"; + strTest += "PLAYER AGE: \t\t\t\t" + (getCurrentBirthDate() - getPlayerBirthDate(objTarget)) + "\r\n"; + strTest += "PLAYER BIRTHDAY: \t\t" + getPlayerBirthDate(objTarget) + "\r\n\r\n"; + } if (isMob(objTarget) || isPlayer(objTarget)) { diff --git a/sku.0/sys.server/compiled/game/script/library/event_perk.java b/sku.0/sys.server/compiled/game/script/library/event_perk.java index 7a0c80e68..9298548eb 100755 --- a/sku.0/sys.server/compiled/game/script/library/event_perk.java +++ b/sku.0/sys.server/compiled/game/script/library/event_perk.java @@ -29,6 +29,8 @@ public class event_perk extends script.base_script public static final string_id SHAPECHANGE_SPACE = new string_id("spam", "shapechange_space"); public static final String DATATABLE = "datatables/event_perk/perk_data.iff"; public static final String STF_FILE = "event_perk"; + public static final int COIN_LIMIT_OVERRIDE = utils.getIntConfigSetting("GameServer", "halloweenCoinLimit", event_perk.COIN_LIMIT); + public static boolean canPlaceEventPerkHere(obj_id self, obj_id player, location here) throws InterruptedException { if (!isIdValid(player) || (here == null)) @@ -158,12 +160,7 @@ public class event_perk extends script.base_script int currentCoinLimit = getIntObjVar(player, COUNTER); int newCoinLimit = currentCoinLimit + COIN_AMOUNT_LOW; setObjVar(player, COUNTER, newCoinLimit); - int limit = utils.stringToInt(getConfigSetting("GameServer", "halloweenCoinLimit")); - if (limit <= 0) - { - limit = event_perk.COIN_LIMIT; - } - if (newCoinLimit > limit) + if (COIN_LIMIT_OVERRIDE != -1 && newCoinLimit > COIN_LIMIT_OVERRIDE) { buff.applyBuff(player, "event_halloween_coin_limit"); } @@ -289,12 +286,7 @@ public class event_perk extends script.base_script } public static boolean timeStampCheck(obj_id player) throws InterruptedException { - int limit = utils.stringToInt(getConfigSetting("GameServer", "halloweenCoinLimit")); - if (limit <= 0) - { - limit = event_perk.COIN_LIMIT; - } - if (newDayOrNot(player) == true) + if (newDayOrNot(player)) { if (buff.hasBuff(player, "event_halloween_coin_limit")) { @@ -327,7 +319,7 @@ public class event_perk extends script.base_script } } int currentCoinCount = getIntObjVar(player, event_perk.COUNTER); - if (currentCoinCount > limit) + if (COIN_LIMIT_OVERRIDE != -1 && currentCoinCount > COIN_LIMIT_OVERRIDE) { buff.applyBuff(player, "event_halloween_coin_limit"); sendSystemMessage(player, event_perk.REACHED_LIMIT); @@ -336,12 +328,12 @@ public class event_perk extends script.base_script } return true; } - if (newDayOrNot(player) == false) + if (!newDayOrNot(player)) { if (hasObjVar(player, event_perk.COUNTER)) { int currentCoinCount = getIntObjVar(player, event_perk.COUNTER); - if (currentCoinCount > limit) + if (COIN_LIMIT_OVERRIDE != -1 && currentCoinCount > COIN_LIMIT_OVERRIDE) { if (!buff.hasBuff(player, "event_halloween_coin_limit")) { diff --git a/sku.0/sys.server/compiled/game/script/library/events.java b/sku.0/sys.server/compiled/game/script/library/events.java new file mode 100644 index 000000000..f88be8f33 --- /dev/null +++ b/sku.0/sys.server/compiled/game/script/library/events.java @@ -0,0 +1,101 @@ +package script.library; + +import java.util.Calendar; + +public class events extends script.base_script { + + public events() + { + } + + public static final String EMPIRE_DAY = "empireday"; + public static final String LIFEDAY = "lifeday"; + public static final String EWOK_FESTIVAL_OF_LOVE = "loveday"; + public static final String GALACTIC_MOON_FESTIVAL = "halloween"; + public static final String FOOLS_DAY = "foolsday"; + public static final String LOST_SQUADRON = "lostsquadron"; + public static final String ANNIVERSARY = "anniversary"; + + private static final boolean EMPIRE_DAY_CONIFG = utils.checkConfigFlag("GameServer", "empireday_ceremony"); + private static final boolean LIFEDAY_CONFIG = utils.checkConfigFlag("GameServer", "lifeday"); + private static final boolean EWOK_FESTIVAL_CONFIG = utils.checkConfigFlag("GameServer", "loveday"); + private static final boolean GALACTIC_MOON_CONFIG = utils.checkConfigFlag("GameServer", "halloween"); + private static final boolean FOOLS_DAY_CONFIG = utils.checkConfigFlag("GameServer", "foolsDay"); + private static final boolean FORCE_FOOLS_DAY_CONFIG = utils.checkConfigFlag("GameServer", "forceFoolsDay"); + private static final boolean LOST_SQUADRON_CONFIG = utils.checkConfigFlag("EventTeam", "lostSquadron"); + private static final boolean ANNIVERSARY_CONFIG = utils.checkConfigFlag("EventTeam", "anniversary"); + + + /** + * Used to determine if an event is currently configured to run + * @param eventName the name of the event (uses constants above) + * @return true if it is active, false otherwise + */ + public static boolean isEventActive(String eventName) { + + switch (eventName) { + + case EMPIRE_DAY: + return EMPIRE_DAY_CONIFG; + + case EWOK_FESTIVAL_OF_LOVE: + return EWOK_FESTIVAL_CONFIG; + + case GALACTIC_MOON_FESTIVAL: + return GALACTIC_MOON_CONFIG; + + case LIFEDAY: + return LIFEDAY_CONFIG; + + case FOOLS_DAY: + return FOOLS_DAY_CONFIG; + + case LOST_SQUADRON: + return LOST_SQUADRON_CONFIG; + + case ANNIVERSARY: + return ANNIVERSARY_CONFIG; + + default: + WARNING("events.isEventActive() was called for event named "+eventName+" but no handling for that name is in the method so either the event name is wrong or handling here is missing."); + break; + } + return false; + } + + /** + * Used to determine if an event is currently running, meaning, + * not that it is just active (configured to be on) but that + * certain other requisites have triggered/been met to make the + * sequences of the event start + * @param eventName the name of the event (uses constants above) + * @return true if it is running, false otherwise + */ + public static boolean isEventRunning(String eventName) { + + switch (eventName) { + + case FOOLS_DAY: + if(!isEventActive(FOOLS_DAY)) { + return false; + } else { + if(FORCE_FOOLS_DAY_CONFIG) { + return true; + } else { // if fools day isn't forced, only start it on literally April 1 from 12AM to 11:59PM + Calendar cal = Calendar.getInstance(); + int currentTime = getCalendarTime(); + int midnightOnAprilFoolsDay = getCalendarTime(cal.get(Calendar.YEAR), 4, 1, 0, 0, 0); + int midnightOnDayAfterAprilFools = getCalendarTime(cal.get(Calendar.YEAR), 4, 2, 0, 0, 0); + return currentTime >= midnightOnAprilFoolsDay && currentTime <= midnightOnDayAfterAprilFools; + } + } + + default: + WARNING("events.isEventRunning() was called for event named "+eventName+" but no handling for that name is in the method so either the event name is wrong or handling here is missing."); + break; + + } + return false; + } + +} diff --git a/sku.0/sys.server/compiled/game/script/library/gcw.java b/sku.0/sys.server/compiled/game/script/library/gcw.java index 5a69c0356..0c5b87a29 100755 --- a/sku.0/sys.server/compiled/game/script/library/gcw.java +++ b/sku.0/sys.server/compiled/game/script/library/gcw.java @@ -254,6 +254,11 @@ public class gcw extends script.base_script public static final String GCW_TUTORIAL_FLAG = "gcw_tutorial_flag.has_received_tutorial"; public static final String COLOR_REBELS = "\\" + colors_hex.COLOR_REBELS; public static final String COLOR_IMPERIALS = "\\" + colors_hex.COLOR_IMPERIALS; + public static final float GCW_POINT_BONUS = utils.getFloatConfigSetting("GameServer", "gcwPointBonus", 1.0f); + public static final float GCW_TOKEN_BONUS = utils.getFloatConfigSetting("GameServer", "gcwTokenBonus", 1.0f); + public static final int GCW_CYCLE_INVASION_TIME = utils.getIntConfigSetting("GameServer", "gcwInvasionCycleTime", 3); + public static final int GCW_MAX_INVASION_CITY_RUNNING = utils.getIntConfigSetting("GameServer", "gcwInvasionCityMaximumRunning", 3); + public static void assignScanInterests(obj_id npc) throws InterruptedException { if (!isIdValid(npc) || isPlayer(npc) || pet_lib.isPet(npc)) @@ -1275,11 +1280,7 @@ public class gcw extends script.base_script { return; } - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "gcwPointBonus")); - if (multiplier > 1) - { - pointValue *= multiplier; - } + pointValue *= GCW_POINT_BONUS; pvpModifyCurrentGcwPoints(attacker, pointValue); prose_package pp = new prose_package(); pp.target.set(getName(victim)); @@ -2455,11 +2456,7 @@ public class gcw extends script.base_script else { tokenStaticName = GCW_REBEL_TOKEN; } - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "gcwTokenBonus")); - if (multiplier > 1) - { - gcwTokenAmt *= multiplier; - } + gcwTokenAmt *= GCW_TOKEN_BONUS; for (Object o : participantList) { if (!isValidId(((obj_id) o)) || !exists(((obj_id) o))) { CustomerServiceLog("gcw_city_invasion", "gcw.awardGcwInvasionParticipants: Player: " + ((obj_id) o) + " is NOT receiving " + gcwTokenAmt + " " + tokenStaticName + " tokens or " + gcwPointAmt + " " + factionFlag + " GCW points (GCW points only awarded to pure faction players, not factionalHelpers) because this player OID is invalid or doesn't exist. Probably due to the player exiting the battle field, traveling or moving to another server process (crossing server boundary)."); @@ -2637,12 +2634,7 @@ public class gcw extends script.base_script } public static int gcwGetTimeToInvasion() throws InterruptedException { - String timeConfig = getConfigSetting("GameServer", "gcwInvasionCycleTime"); - if (timeConfig == null || timeConfig.length() <= 0) - { - return 3; - } - int time = utils.stringToInt(timeConfig); + int time = GCW_CYCLE_INVASION_TIME; if (time > 6) { time = 6; @@ -2655,13 +2647,7 @@ public class gcw extends script.base_script } public static int gcwGetInvasionMaximumRunning() throws InterruptedException { - String maxConfig = getConfigSetting("GameServer", "gcwInvasionCityMaximumRunning"); - int max = 3; - if (maxConfig == null || maxConfig.length() <= 0) - { - return max; - } - return utils.stringToInt(maxConfig); + return GCW_MAX_INVASION_CITY_RUNNING; } public static boolean gcwIsInvasionCityOn(String city) throws InterruptedException { @@ -2669,17 +2655,20 @@ public class gcw extends script.base_script { return false; } - String cityConfig = getConfigSetting("GameServer", "gcwcity" + city); - if (cityConfig == null || (!cityConfig.equals("1") && !cityConfig.toLowerCase().equals("true"))) - { - CustomerServiceLog("gcw_city_invasion", "gcw.gcwIsInvasionCityOn: GCW City: " + city + " is not configured to run a city invasion. Function returning False."); + if (city.equalsIgnoreCase("keren") || city.equalsIgnoreCase("bestine")) { + return utils.checkConfigFlag("GameServer", "gcwcity"+city); + } + else if (city.equalsIgnoreCase("dearic")) { + if(events.isEventActive(events.LIFEDAY)) { + return false; + } else { + return utils.checkConfigFlag("GameServer", "gcwcity"+city); + } + } + else { + WARNING("gcwIsInvasionCityOn() Got call to check invasion for city "+city+" but there is no logic accounting for it here."); return false; } - if (city.equalsIgnoreCase("dearic") && utils.checkConfigFlag("GameServer", "lifeday")) { - CustomerServiceLog("gcw_city_invasion", "gcw.gcwIsInvasionCityOn: GCW City: " + city + " is not running because life day is turned on."); - return false; - } - return true; } public static int gcwGetNextInvasionHour(String cityName) throws InterruptedException { @@ -2849,8 +2838,7 @@ public class gcw extends script.base_script { Vector activeCities = new Vector<>(); for (String cityName : INVASION_CITIES){ - String value = getConfigSetting("GameServer", "gcwcity" + cityName); - if (value != null && (value.equals("1") || value.toLowerCase().equals("true"))) { + if (utils.checkConfigFlag("GameServer", "gcwcity" + cityName)) { activeCities.add(cityName); } } diff --git a/sku.0/sys.server/compiled/game/script/library/groundquests.java b/sku.0/sys.server/compiled/game/script/library/groundquests.java index 94cdee5f6..2cfe42190 100755 --- a/sku.0/sys.server/compiled/game/script/library/groundquests.java +++ b/sku.0/sys.server/compiled/game/script/library/groundquests.java @@ -1088,11 +1088,7 @@ public class groundquests extends script.base_script { declared = true; } - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "gcwTokenBonus")); - if (multiplier > 1) - { - grantGcwRebRewardCount *= multiplier; - } + grantGcwRebRewardCount *= utils.getFloatConfigSetting("GameServer", "gcwTokenBonus", 1.0f); if (declared && grantGcwSFRewardMultip != 0) { grantGcwRebRewardCount *= grantGcwSFRewardMultip; @@ -1126,11 +1122,7 @@ public class groundquests extends script.base_script { declared = true; } - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "gcwTokenBonus")); - if (multiplier > 1) - { - grantGcwImpRewardCount *= multiplier; - } + grantGcwImpRewardCount *= utils.getFloatConfigSetting("GameServer", "gcwTokenBonus", 1.0f); if (declared && grantGcwSFRewardMultip != 0) { grantGcwImpRewardCount *= grantGcwSFRewardMultip; diff --git a/sku.0/sys.server/compiled/game/script/library/guild.java b/sku.0/sys.server/compiled/game/script/library/guild.java index 3e64b9bec..fee422ada 100755 --- a/sku.0/sys.server/compiled/game/script/library/guild.java +++ b/sku.0/sys.server/compiled/game/script/library/guild.java @@ -1670,7 +1670,7 @@ public class guild extends script.base_script if (timeJoinedGcwDefenderRegion > 0) { guildInfoStr += (" (started defending on " + getCalendarTimeStringLocal(timeJoinedGcwDefenderRegion) + ")\n"); - final int gcwDaysRequiredForGcwRegionDefenderBonus = utils.stringToInt(getConfigSetting("GameServer", "gcwDaysRequiredForGcwRegionDefenderBonus")); + final int gcwDaysRequiredForGcwRegionDefenderBonus = utils.getIntConfigSetting("GameServer", "gcwDaysRequiredForGcwRegionDefenderBonus"); final int age = getCalendarTime() - timeJoinedGcwDefenderRegion; if (age > (gcwDaysRequiredForGcwRegionDefenderBonus * 86400)) { diff --git a/sku.0/sys.server/compiled/game/script/library/healing.java b/sku.0/sys.server/compiled/game/script/library/healing.java index 9be15ec41..909d807e5 100755 --- a/sku.0/sys.server/compiled/game/script/library/healing.java +++ b/sku.0/sys.server/compiled/game/script/library/healing.java @@ -196,6 +196,8 @@ public class healing extends script.base_script public static final string_id SID_DROID_REPAIR_DAMAGE_OTHER = new string_id("healing", "droid_repair_damage_other"); public static final String RESPONSE_TEXT = "datatables/healing/healing_response.iff"; public static final String PP_FILE_LOC = "healing_response"; + public static final boolean CYBERNETIC_DEATH_EVENT = utils.checkConfigFlag("EventTeam", "enableCyberneticDeathEvent"); + public static final int[] COMBAT_STATES = { STATE_DIZZY, @@ -1075,7 +1077,7 @@ public class healing extends script.base_script } if (woundPlayer) { - if (getConfigSetting("GameServer", "enableCybernetics") != null) + if (CYBERNETIC_DEATH_EVENT) { cybernetic.applyDeathCybernetic(player); } diff --git a/sku.0/sys.server/compiled/game/script/library/holiday.java b/sku.0/sys.server/compiled/game/script/library/holiday.java index 4f8de9f1b..2d1fd89c4 100755 --- a/sku.0/sys.server/compiled/game/script/library/holiday.java +++ b/sku.0/sys.server/compiled/game/script/library/holiday.java @@ -241,6 +241,7 @@ public class holiday extends script.base_script public static final String LOVEDAY_CUPID_ELEMENT_NAME = "loveday_cupid_spawner_"; public static final String LOVEDAY_CUPID_SPAWNER_CITY_VAR = "loveday_city"; public static final String GETTING_CUPID_SPAWNER_IDS = "manager_gettingCupidSpawnerIds"; + public static final int EMPIRE_DAY_MAX_CEREMONY_WINNERS_CONFIG = utils.getIntConfigSetting("GameServer", "empireday_ceremony_winners", MAXIMUM_EMPIRE_DAY_WINNERS); public static final String[] LOVEDAY_LOCATIONS = { "endor", @@ -654,19 +655,7 @@ public class holiday extends script.base_script { return null; } - int maxEmpireDayWinners = MAXIMUM_EMPIRE_DAY_WINNERS; - String empiredayWinnerConfig = getConfigSetting("GameServer", "empireday_ceremony_winners"); - if (empiredayWinnerConfig != null && utils.stringToInt(empiredayWinnerConfig) > -1) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: The max badge winners was: " + maxEmpireDayWinners + " but there is a server config that might overwrite this amount."); - int configWinners = utils.stringToInt(empiredayWinnerConfig); - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: The server config shows the max badge winners should be: " + configWinners + " checking to see if that is less or more than the current amount."); - if (configWinners != maxEmpireDayWinners) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: The server config if a different amount than the current max so we are using the server config."); - maxEmpireDayWinners = configWinners; - } - } + int maxEmpireDayWinners = EMPIRE_DAY_MAX_CEREMONY_WINNERS_CONFIG; int originalListSize = eligiblePlayers.size(); if (originalListSize <= maxEmpireDayWinners) { diff --git a/sku.0/sys.server/compiled/game/script/library/instance.java b/sku.0/sys.server/compiled/game/script/library/instance.java index f13c32e8a..a302dda38 100755 --- a/sku.0/sys.server/compiled/game/script/library/instance.java +++ b/sku.0/sys.server/compiled/game/script/library/instance.java @@ -36,6 +36,13 @@ public class instance extends script.base_script public static final int FAIL_INSTANCE_FEW_PLAYERS = 5; public static final int FAIL_WARN_TOO_FEW = 6; public static final string_id SID_UNDER_FIVE_MINUTE_WARNING = new string_id("instance", "five_minute_warning"); + public static final boolean CORVETTE_REBEL_DUNGEON_ENABLED = utils.checkConfigFlag("Dungeon", "Corellian_Corvette_Rebel"); + public static final boolean CORVETTE_IMPERIAL_DUNGEON_ENABLED = utils.checkConfigFlag("Dungeon", "Corellian_Corvette_Imperial"); + public static final boolean CORVETTE_NEUTRAL_DUNGEON_ENABLED = utils.checkConfigFlag("Dungeon", "Corellian_Corvette_Neutral"); + public static final boolean DEATH_WATCH_DUNGEON_ENABLED = utils.checkConfigFlag("Dungeon", "Death_Watch"); + public static final boolean GEONOSIAN_BUNKER_ENABLED = utils.checkConfigFlag("Dungeon", "Geonosian"); + public static final float HEROIC_TOKEN_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "heroicTokenBonus", 1.0f); + public static void registerInstance(obj_id instance_id) throws InterruptedException { registerInstance(instance_id, getInstanceName(instance_id)); diff --git a/sku.0/sys.server/compiled/game/script/library/load_test.java b/sku.0/sys.server/compiled/game/script/library/load_test.java index fd79b2cd3..7d0fa53ff 100755 --- a/sku.0/sys.server/compiled/game/script/library/load_test.java +++ b/sku.0/sys.server/compiled/game/script/library/load_test.java @@ -79,12 +79,7 @@ public class load_test extends script.base_script }; public static boolean loadClientSupportEnabled() throws InterruptedException { - String value = getConfigSetting("GameServer", "loadClientSupportEnabled"); - if (value != null && (value.equals("1") || value.equals("true") || value.equals("yes"))) - { - return true; - } - return false; + return utils.checkConfigFlag("GameServer", "loadClientSupportEnabled"); } public static void handleLoadClientSetup(obj_id clientCreature, String optionsString) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/loot.java b/sku.0/sys.server/compiled/game/script/library/loot.java index c6f79bf29..83dd910f7 100755 --- a/sku.0/sys.server/compiled/game/script/library/loot.java +++ b/sku.0/sys.server/compiled/game/script/library/loot.java @@ -107,6 +107,19 @@ public class loot extends script.base_script private static final String CHEST_BASE = "rare_loot_chest_quality_"; private static final String RLS_EFFECT = "appearance/pt_rare_chest.prt"; private static final String RLS_SOUND = "sound/rare_loot_chest.snd"; + public static final boolean RLS_DISABLED = utils.checkConfigFlag("GameServer", "rlsDisabled"); + public static final boolean RLS_MACROS_DISABLED = utils.checkConfigFlag("GameServer", "rlsDropChanceDisableMacros"); + public static final int RLS_DROP_CHANCE = utils.getIntConfigSetting("GameServer", "rlsDropChance", 1); + public static final int RLS_RARE_CHOICE_CHANCE = utils.getIntConfigSetting("GameServer", "rlsRareDropChance", 70); + public static final int RLS_EXCEPTIONAL_CHOICE_CHANCE = utils.getIntConfigSetting("GameServer", "rlsExceptionalDropChance", 25); + public static final int RLS_LEGENDARY_CHOICE_CHANCE = utils.getIntConfigSetting("GameServer", "rlsLegendaryDropChance", 5); + public static final int RLS_TIME_BETWEEN_AWARDS = utils.getIntConfigSetting("GameServer", "rlsMinTimeBetweenAwards", 900); + public static final int RLS_LOWER_LEVEL_BAND = utils.getIntConfigSetting("GameServer", "rlsMaxLevelsBelowPlayerLevel", 6); + public static final int RLS_UPPER_LEVEL_BAND = utils.getIntConfigSetting("GameServer", "rlsMaxLevelsAbovePlayerLevel", 6); + public static final int RLS_MIN_DIST_FROM_LAST_LOOT = utils.getIntConfigSetting("GameServer", "rlsMinDistanceFromLastLoot", 5); + public static final String OBJVAR_RLS_LAST_LOOT_TIME = "loot.rls.lastChestAwardTime"; + public static final String OBJVAR_RLS_LAST_LOOT_LOCATION = "loot.rls.lastLootedLocation"; + public static final String OBJVAR_RLS_LAST_LOOT_CHEST = "loot.rls.lastLootedChest"; public static boolean addLoot(obj_id target) throws InterruptedException { @@ -1367,16 +1380,7 @@ public class loot extends script.base_script int mobLevel = getIntObjVar(target, "intCombatDifficulty"); obj_id mobInv = utils.getInventoryContainer(target); - int chronicleLootChance = creatureRow.getInt("chronicleLootChance"); - String configChance_string = getConfigSetting("GameServer", "chroniclesLootChanceOverride"); - if (configChance_string != null && configChance_string.length() > 0) - { - int configChance = utils.stringToInt(configChance_string); - if (configChance > 0) - { - chronicleLootChance = configChance; - } - } + int chronicleLootChance = utils.getIntConfigSetting("GameServer", "chroniclesLootChanceOverride", creatureRow.getInt("chronicleLootChance")); int chronicleLootRoll = rand(1, 100); if (chronicleLootRoll <= chronicleLootChance) { @@ -1426,16 +1430,7 @@ public class loot extends script.base_script } } } - int fragmentLootChance = pgc_quests.PGC_CHRONICLE_BASE_FRAGEMENT_CHANCE; - String configFragChance_string = getConfigSetting("GameServer", "fragmentLootChanceOverride"); - if (configFragChance_string != null && configFragChance_string.length() > 0) - { - int configFragChance = utils.stringToInt(configFragChance_string); - if (configFragChance > 0) - { - fragmentLootChance = configFragChance; - } - } + int fragmentLootChance = utils.getIntConfigSetting("GameServer", "fragmentLootChanceOverride", pgc_quests.PGC_CHRONICLE_BASE_FRAGEMENT_CHANCE); int fragmentLootRoll = rand(1, 100); if (fragmentLootRoll <= fragmentLootChance) { @@ -1498,17 +1493,9 @@ public class loot extends script.base_script } public static obj_id chroniclesNonCorpseLootDrop(obj_id player, String relicCategory, int relicChance, String activityType) throws InterruptedException { - String configChance_string = getConfigSetting("GameServer", "chroniclesLootChanceOverride"); - if (configChance_string != null && configChance_string.length() > 0) - { - int configChance = utils.stringToInt(configChance_string); - if (configChance > 0) - { - relicChance = configChance; - } - } + int chance = utils.getIntConfigSetting("GameServer", "chroniclesLootChanceOverride", relicChance); int lootRoll = rand(1, 100); - if (lootRoll <= relicChance) + if (lootRoll <= chance) { String relicName = getChronicleRelicLootOfCategory(relicCategory); if (relicName != null && relicName.length() > 0) @@ -2488,6 +2475,11 @@ public class loot extends script.base_script } public static boolean addRareLoot(obj_id target) throws InterruptedException { + // make sure system is on before we do anything else + if(RLS_DISABLED) { + return false; + } + // get the attacker who did the most damage. obj_id player = getObjIdObjVar(target, xp.VAR_TOP_GROUP); @@ -2496,68 +2488,49 @@ public class loot extends script.base_script return false; } - // if they're AFK then skip to the next. - if(isAwayFromKeyBoard(player)) return false; - - // get custom settings from the configuration - boolean rlsEnabled = Boolean.parseBoolean(getConfigSetting("GameServer", "rlsEnabled")); - if (!rlsEnabled) return false; - - // get RLS Chance - default: 1% - String rlsc = getConfigSetting("GameServer", "rlsDropChance"); - double rlsChance = rlsc == null ? 0.005d : Double.parseDouble(rlsc) / 100; - - // did they qualify for a RLS chest? - double rollValue = Math.random(); - if(rollValue > rlsChance){ - // did not qualify due to roll out of range. + // player must be ATK + if(isAwayFromKeyBoard(player)) { return false; } - LOG("rare_loot", "Player (" + player + ") qualified for an RLS chest (chance: " + rlsChance + " roll: " + rollValue + ")"); - String lb = getConfigSetting("GameServer", "rlsMaxLevelsBelowPlayerLevel"); - int levelsBelow = lb == null ? 6 : Math.abs(Integer.parseInt(lb)); - String la = getConfigSetting("GameServer", "rlsMaxLevelsAbovePlayerLevel"); - int levelsAbove = la == null ? 6 : Math.abs(Integer.parseInt(la)); - String rdc = getConfigSetting("GameServer", "rlsRareDropChance"); - int rareDropChance = rdc == null ? 70 : Math.abs(Integer.parseInt(rdc)); - String edc = getConfigSetting("GameServer", "rlsExceptionalDropChance"); - int exceptionalDropChance = edc == null ? 25 : Math.abs(Integer.parseInt(edc)); - String ldc = getConfigSetting("GameServer", "rlsLegendaryDropChance"); - int legendaryDropChance = ldc == null ? 5 : Math.abs(Integer.parseInt(ldc)); - String dist = getConfigSetting("GameServer", "rlsMinDistanceFromLastLoot"); - int minDistanceFromLast = dist == null ? 0 : Math.abs(Integer.parseInt(dist)); - String tmpTime = getConfigSetting("GameServer", "rlsMinTimeBetweenAwards"); + // if enabled player must have provided user input (not macros) in last 15 mins to get RLC + if(RLS_MACROS_DISABLED && !isPlayerActive(player)) { + return false; + } - // check to make sure player is far enough away from the last looted location (if set) - location targetLocation = getLocation(target); - if(minDistanceFromLast > 0 && hasObjVar(player, "loot.rls.lastLootedLocation")){ - location last = getLocationObjVar(player, "loot.rls.lastLootedLocation"); - float distanceFromLast = getDistance(last, targetLocation); - if(distanceFromLast <= minDistanceFromLast){ - LOG("rare_loot", "Player (" + player + ") last looted a chest only " + distanceFromLast + " meters away - which is too close to this current location."); + // variance between mob level and player level must be within acceptable range (default is +/- 6) + int playerLevel = getLevel(player); + int mobLevel = getLevel(target); + if(mobLevel < (playerLevel - RLS_LOWER_LEVEL_BAND) || mobLevel > (playerLevel + RLS_UPPER_LEVEL_BAND)) { + return false; + } + + location playerLoc = getLocation(player); + location targetLoc = getLocation(target); + // variance between your last kill location and current kill location must show you've moved (> 5m is default) + if(hasObjVar(player, OBJVAR_RLS_LAST_LOOT_LOCATION) && RLS_MIN_DIST_FROM_LAST_LOOT > 0) { + location lastLocation = getLocationObjVar(player, OBJVAR_RLS_LAST_LOOT_LOCATION); + if(getDistance(playerLoc, lastLocation) < RLS_MIN_DIST_FROM_LAST_LOOT) { return false; } } - // make sure it's been longer than minimum time required between chests (default 15 minutes) since last looted chest - int rlsMinTimeBetweenAwards = (tmpTime == null ? 15 * 60 : Integer.parseInt(tmpTime)); - if(hasObjVar(player, "loot.rls.lastChestAwardTime")) { - int lastLootTime = getIntObjVar(player, "loot.rls.lastChestAwardTime"); - int elapsedTime = getGameTime() - lastLootTime; - LOG("rare_loot", "Player (" + player + ") last looted a chest " + elapsedTime + " game seconds ago (should be greater than " + rlsMinTimeBetweenAwards + ")!"); - if (elapsedTime < rlsMinTimeBetweenAwards) return false; - } - else{ - LOG("rare_loot", "Player (" + player + ") is looting their first RLS chest!"); + // at least X amount of time must have passed between chest loots (default is 15 min) + if(hasObjVar(player, OBJVAR_RLS_LAST_LOOT_TIME) && RLS_TIME_BETWEEN_AWARDS > 0) { + int currentTime = getGameTime(); + int lastTime = getIntObjVar(player, OBJVAR_RLS_LAST_LOOT_TIME); + if(currentTime < (lastTime + RLS_TIME_BETWEEN_AWARDS)) { + return false; + } } - // make sure the level range is appropriate for this attacker. - int playerLevel = getLevel(player); - int mobLevel = getLevel(target); - int mobMinLevel = playerLevel - levelsBelow; - int mobMaxLevel = playerLevel + levelsAbove; - if(mobLevel < mobMinLevel || mobLevel > mobMaxLevel) return false; + // roll to see if we've won a chest, default chance is 1% + int roll = rand(1, 100); + if(roll <= RLS_DROP_CHANCE) { + return false; + } + // We've won a chest, let's decide which type + LOG("rare_loot", "Player (" + player + ") qualified for an RLS chest (chance: " + RLS_DROP_CHANCE + " roll: " + roll + ")"); int bonus = 0; // make sure the player has an extremely more difficult time to loot a chest if they're still going through the tutorial @@ -2602,12 +2575,12 @@ public class loot extends script.base_script int lootType = 1; String type = "RARE"; - // evaluate Rare drop chance first, then Exceptional... if it's not either of those two, then it's Rare. - if (rareLootRoll <= legendaryDropChance) { + // evaluate Legendary drop chance first, then Exceptional... if it's not either of those two, then it's Rare. + if (rareLootRoll <= RLS_LEGENDARY_CHOICE_CHANCE) { lootType = 3; type = "LEGENDARY"; } - else if (rareLootRoll <= exceptionalDropChance) { + else if (rareLootRoll <= RLS_EXCEPTIONAL_CHOICE_CHANCE) { lootType = 2; type = "EXCEPTIONAL"; } @@ -2615,18 +2588,20 @@ public class loot extends script.base_script obj_id chest = createRareLootChest(target, lootType); - setObjVar(player, "loot.rls.lastChestAwardTime", getGameTime()); - setObjVar(player, "loot.rls.lastLootedChest", chest); - setObjVar(player, "loot.rls.lastLootedLocation", targetLocation); + setObjVar(player, OBJVAR_RLS_LAST_LOOT_TIME, getGameTime()); + setObjVar(player, OBJVAR_RLS_LAST_LOOT_CHEST, chest); + setObjVar(player, OBJVAR_RLS_LAST_LOOT_LOCATION, playerLoc); - playClientEffectLoc(target, RLS_EFFECT, targetLocation, 1.0f); - playClientEffectLoc(target, RLS_SOUND, targetLocation, 1.0f); + playClientEffectLoc(target, RLS_EFFECT, targetLoc, 1.0f); + playClientEffectLoc(target, RLS_SOUND, targetLoc, 1.0f); return true; } + public static obj_id createRareLootChest(obj_id creature, int lootType) throws InterruptedException { obj_id chest = static_item.createNewItemFunction(CHEST_BASE + lootType, utils.getInventoryContainer(creature)); LOG("rare_loot", "Just created item #" + chest + " in the inventory of creature " + creature); return chest; } + } diff --git a/sku.0/sys.server/compiled/game/script/library/missions.java b/sku.0/sys.server/compiled/game/script/library/missions.java index e1c1a2890..d7c53e5b0 100755 --- a/sku.0/sys.server/compiled/game/script/library/missions.java +++ b/sku.0/sys.server/compiled/game/script/library/missions.java @@ -33,13 +33,11 @@ public class missions extends script.base_script public static final String DAILY_MISSION_OBJVAR = "missions.daily"; public static final String DAILY_MISSION_CLOCK_OBJVAR = "missions.dailyClock"; public static final string_id DAILY_REWARD_XP = new string_id("base_player", "prose_mission_xp_amount"); + public static final int DAILY_XP_LIMIT = utils.getIntConfigSetting("Custom", "dailyMissionXpLimit", DAILY_MISSION_XP_REWARD_DEFAULT); + public static int getDailyMissionXpLimit() throws InterruptedException { - String config = getConfigSetting("Custom", "dailyMissionXpLimit"); - if (config != null && config.length() > 0) { - return utils.stringToInt(config); - } - return DAILY_MISSION_XP_REWARD_DEFAULT; + return DAILY_XP_LIMIT; } public static void sendBountyFail(obj_id hunter, obj_id target) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/npe.java b/sku.0/sys.server/compiled/game/script/library/npe.java index 2d38ea90e..11596d0d9 100755 --- a/sku.0/sys.server/compiled/game/script/library/npe.java +++ b/sku.0/sys.server/compiled/game/script/library/npe.java @@ -166,11 +166,11 @@ public class npe extends script.base_script } public static int getMinInstancePopulation() throws InterruptedException { - return utils.stringToInt(getConfigSetting("GameServer", "npeMinInstancePopulation")); + return utils.stringToInt(getConfigSetting("GameServer", "npeMinInstancePopulation")); // src set value, default is 20 } public static int getMaxInstancePopulation() throws InterruptedException { - return utils.stringToInt(getConfigSetting("GameServer", "npeMaxInstancePopulation")); + return utils.stringToInt(getConfigSetting("GameServer", "npeMaxInstancePopulation")); // src set value, default is 50 } public static int getBestStationInstanceIndex(obj_id player, dictionary[] stations) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/pgc_quests.java b/sku.0/sys.server/compiled/game/script/library/pgc_quests.java index 77aa40a71..b75ea814d 100755 --- a/sku.0/sys.server/compiled/game/script/library/pgc_quests.java +++ b/sku.0/sys.server/compiled/game/script/library/pgc_quests.java @@ -13,8 +13,6 @@ public class pgc_quests extends script.base_script public static final int CHRONICLE_HOLOCRON_VERSION = 0; public static final int CHRONICLE_CREATION_XP_BASE = 99; public static final int CHRONICLE_SHARED_XP_BASE = 4; - public static final int CHRONICLES_QUESTOR_GOLD_TOKEN_CHANCE = 5; - public static final int CHRONICLES_CHRONICLER_GOLD_TOKEN_CHANCE = 5; public static final float CHRONICLE_SILVER_TOKENS_FOR_CHRONICLER_MOD = 0.42f; public static final float CHRONICLE_SILVER_TOKENS_FOR_QUESTOR_MOD = 1.2f; public static final boolean TEXT_FILTER_DISABLED = false; @@ -126,6 +124,11 @@ public class pgc_quests extends script.base_script public static final int PGC_NUM_QUESTS_YOU_COMPLETED_HIGH_QUALITY_INDEX = 11; public static final float PGC_MIN_MID_QUALITY_QUEST_WEIGHT = 15.0f; public static final float PGC_MIN_HIGH_QUALITY_QUEST_WEIGHT = 30.0f; + public static final float CHRONICLES_XP_MODIFIER = utils.getFloatConfigSetting("GameServer", "chroniclesXpModifier", 1.0f); + public static final float CHRONICLES_CHRONCILER_SILVER_TOKEN_MODIFIER = utils.getFloatConfigSetting("GameServer", "chroniclesChroniclerSilverTokenNumModifier", 1.0f); + public static final float CHRONICLES_QUESTOR_SILVER_TOKEN_MODIFIER = utils.getFloatConfigSetting("GameServer", "chroniclesQuestorSilverTokenNumModifier", 1.0f); + public static final int CHRONICLES_GOLD_TOKEN_CHANCE_SETTING = utils.getIntConfigSetting("GameServer", "chroniclesGoldTokenChanceOverride", 5); + public static boolean activateQuestHolocron(obj_id questHolocron, obj_id player) throws InterruptedException { obj_id datapad = utils.getPlayerDatapad(player); @@ -1089,16 +1092,7 @@ public class pgc_quests extends script.base_script } public static int getConfigModifiedChroniclesXPAmount(int xpAmount) throws InterruptedException { - String configMod_string = getConfigSetting("GameServer", "chroniclesXpModifier"); - if (configMod_string != null && configMod_string.length() > 0) - { - float configMod = utils.stringToFloat(configMod_string); - if (configMod > 0) - { - xpAmount *= configMod; - } - } - return xpAmount; + return xpAmount *= CHRONICLES_XP_MODIFIER; } public static void checkForGainedChroniclesLevel(obj_id player) throws InterruptedException { @@ -1287,18 +1281,8 @@ public class pgc_quests extends script.base_script } if (questWeight >= pgc_quests.PGC_MIN_MID_QUALITY_QUEST_WEIGHT && !isCompletingYourOwnChronicleQuest(player, questHolocron)) { - int goldTokenChance = CHRONICLES_QUESTOR_GOLD_TOKEN_CHANCE; - String configChance_string = getConfigSetting("GameServer", "chroniclesQuestorGoldTokenChanceOverride"); - if (configChance_string != null && configChance_string.length() > 0) - { - int configChance = utils.stringToInt(configChance_string); - if (configChance > 0) - { - goldTokenChance = configChance; - } - } int goldTokenRoll = rand(1, 100); - if (goldTokenRoll <= goldTokenChance) + if (goldTokenRoll <= CHRONICLES_GOLD_TOKEN_CHANCE_SETTING) { grantGoldChroniclesRewardTokens(player, 1); showFlyText(player, new string_id("saga_system", "bonus_gold_token"), 2.0f, colors.GOLDENROD); @@ -1390,15 +1374,7 @@ public class pgc_quests extends script.base_script float relicTypeDiversity = getFloatObjVar(questHolocron, PCG_QUEST_RELIC_DIVERSITY); int count = 1; count = (int)((float)(count + (questWeight * relicTypeDiversity)) * CHRONICLE_SILVER_TOKENS_FOR_CHRONICLER_MOD); - String tokenNumMod_string = getConfigSetting("GameServer", "chroniclesChroniclerSilverTokenNumModifier"); - if (tokenNumMod_string != null && tokenNumMod_string.length() > 0) - { - float tokenNumMod = utils.stringToFloat(tokenNumMod_string); - if (tokenNumMod > 0) - { - count *= tokenNumMod; - } - } + count *= CHRONICLES_CHRONCILER_SILVER_TOKEN_MODIFIER; return count; } public static int getNumQuestCompleteQuestorRewardTokens(obj_id player, obj_id questHolocron) throws InterruptedException @@ -1411,15 +1387,7 @@ public class pgc_quests extends script.base_script float relicTypeDiversity = getFloatObjVar(questHolocron, PCG_QUEST_RELIC_DIVERSITY); int count = 1; count = (int)((float)(count + (questWeight * relicTypeDiversity)) * CHRONICLE_SILVER_TOKENS_FOR_QUESTOR_MOD); - String tokenNumMod_string = getConfigSetting("GameServer", "chroniclesQuestorSilverTokenNumModifier"); - if (tokenNumMod_string != null && tokenNumMod_string.length() > 0) - { - float tokenNumMod = utils.stringToFloat(tokenNumMod_string); - if (tokenNumMod > 0) - { - count *= tokenNumMod; - } - } + count *= CHRONICLES_QUESTOR_SILVER_TOKEN_MODIFIER; return count; } public static obj_id grantSilverChroniclesRewardTokens(obj_id player, int count) throws InterruptedException diff --git a/sku.0/sys.server/compiled/game/script/library/player_structure.java b/sku.0/sys.server/compiled/game/script/library/player_structure.java index b67e174a3..76abede20 100755 --- a/sku.0/sys.server/compiled/game/script/library/player_structure.java +++ b/sku.0/sys.server/compiled/game/script/library/player_structure.java @@ -225,6 +225,11 @@ public class player_structure extends script.base_script public static final string_id SID_NO_CITY = new string_id("city/city", "no_city_during_packup"); public static final string_id SID_GENERIC_CITY_PACKUP_ERROR = new string_id("city/city", "city_packup_generic_fail"); public static final string_id SID_MAYOR_PROTECTED = new string_id("city/city", "city_packup_mayor_protected"); + public static final boolean STRUCTURE_FEES_DISABLED = utils.checkConfigFlag("GameServer", "disableStructureFees"); + public static final int STRUCTURE_MAINTENANCE_HEARTBEAT = utils.getIntConfigSetting("GameServer", "maintenanceHeartbeat", 1800); + public static final boolean ENABLE_ABANDONED_STRUCTURES_SYSTEM = utils.checkConfigFlag("GameServer", "enableAbandonedHousePackup"); + public static final boolean ALLOW_PACKING_ABANDONED_STRUCTURES = utils.checkConfigFlag("GameServer", "allowPlayersToPackAbandonedStructures"); + public static obj_id createPlayerStructure(String template, obj_id owner, location loc, int rotation, dictionary deed_info) throws InterruptedException { if (template == null) @@ -3577,7 +3582,7 @@ public class player_structure extends script.base_script } public static int decrementMaintenancePool(obj_id structure, int amt) throws InterruptedException { - if (getConfigSetting("GameServer", "disableStructureFees") != null) + if (STRUCTURE_FEES_DISABLED) { return 1; } @@ -5388,17 +5393,7 @@ public class player_structure extends script.base_script } public static int getMaintenanceHeartbeat() throws InterruptedException { - final int MAINTENANCE_HEARTBEAT = 1800; - String strConfigSetting = getConfigSetting("GameServer", "maintenanceHeartbeat"); - if ((strConfigSetting != null) && (!strConfigSetting.equals(""))) - { - int intHeartBeat = utils.stringToInt(strConfigSetting); - if (intHeartBeat > 0) - { - return intHeartBeat; - } - } - return MAINTENANCE_HEARTBEAT; + return STRUCTURE_MAINTENANCE_HEARTBEAT; } public static void sendOutOfMaintenanceMail(obj_id objStructure) throws InterruptedException { @@ -5504,10 +5499,10 @@ public class player_structure extends script.base_script { return false; } - if (!utils.checkConfigFlag("GameServer", "enableHousePackup")) - { - return false; - } + //if (!utils.checkConfigFlag("GameServer", "enableHousePackup")) + //{ + // return false; + //} if (isAbandoned(structure) || isPreAbandoned(structure)) { return true; @@ -5520,7 +5515,7 @@ public class player_structure extends script.base_script { return false; } - if (!utils.checkConfigFlag("GameServer", "enableAbandonedHousePackup")) + if (!ENABLE_ABANDONED_STRUCTURES_SYSTEM) { return false; } @@ -5618,7 +5613,7 @@ public class player_structure extends script.base_script { return false; } - if (!utils.checkConfigFlag("GameServer", "allowPlayersToPackAbandonedStructures")) + if (!ALLOW_PACKING_ABANDONED_STRUCTURES) { return false; } diff --git a/sku.0/sys.server/compiled/game/script/library/scheduled_drop.java b/sku.0/sys.server/compiled/game/script/library/scheduled_drop.java index d638c8974..6ac1afb07 100755 --- a/sku.0/sys.server/compiled/game/script/library/scheduled_drop.java +++ b/sku.0/sys.server/compiled/game/script/library/scheduled_drop.java @@ -79,6 +79,8 @@ public class scheduled_drop extends script.base_script "entertainer", "crafter" }; + public static final boolean SYSTEM_ENABLED = utils.checkConfigFlag("Custom", "enableScheduledDropSystem"); + public static void testingSpam(obj_id self, String str) throws InterruptedException { if (isIdValid(self) && isGod(self) && hasObjVar(self, "qa_tcg")) @@ -496,6 +498,6 @@ public class scheduled_drop extends script.base_script return card; } public static boolean isSystemEnabled() throws InterruptedException { - return utils.checkConfigFlag("Custom", "enableScheduledDropSystem"); + return SYSTEM_ENABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/library/space_combat.java b/sku.0/sys.server/compiled/game/script/library/space_combat.java index 12bd9c52e..2c9101009 100755 --- a/sku.0/sys.server/compiled/game/script/library/space_combat.java +++ b/sku.0/sys.server/compiled/game/script/library/space_combat.java @@ -64,6 +64,8 @@ public class space_combat extends script.base_script public static final int NPC_DAMAGE_MULTIPLIER = 4; public static final string_id SID_DISABLED = new string_id("space/space_interaction", "disabled"); public static final String SPACE_COLLECTIONS_LOOT_TABLE = "datatables/space_loot/space_collection_loot.iff"; + public static final boolean GROUND_XP_IN_SPACE_DISABLED = utils.checkConfigFlag("GameServer", "disableGroundXpInSpace"); + public static void addToCombatDamage(obj_id objAttacker, obj_id objDefender, int intDamage) throws InterruptedException { Vector objAttackers = utils.getResizeableObjIdArrayLocalVar(objDefender, "damage.objAttackers"); @@ -635,8 +637,7 @@ public class space_combat extends script.base_script String information = getName(objDefender); gcw.grantModifiedGcwPoints(((obj_id) objPlayer), credit, gcw.GCW_POINT_TYPE_SPACE_PVE, information); } - String disableGroundXp = getConfigSetting("GameServer", "disableGroundXpInSpace"); - if (disableGroundXp == null || disableGroundXp.equals("false") || disableGroundXp.equals("0")) { + if (!GROUND_XP_IN_SPACE_DISABLED) { if (!utils.isProfession(((obj_id) objPlayer), utils.TRADER) && !utils.isProfession(((obj_id) objPlayer), utils.ENTERTAINER)) { int combatLevel = getLevel(((obj_id) objPlayer)); if (combatLevel < 90) { @@ -997,15 +998,18 @@ public class space_combat extends script.base_script if (strItems.length > 0) { int intRoll2 = rand(0, strItems.length - 1); - String itemTemplateName; + String itemTemplateName = strItems[intRoll2]; + /* + // deprecated from Publish 26 if (getConfigSetting("GameServer", "enableLevelUpLoot") != null && (rand(1, 10000) == 1)) { itemTemplateName = "object/tangible/loot/quest/levelup_lifeday_orb.iff"; } - else + else { - itemTemplateName = strItems[intRoll2]; + itemTemplateName = strItems[intRoll2]; } + */ if (space_battlefield.isInBattlefield(objAttacker)) { CustomerServiceLog("battlefield", "%TU Created " + itemTemplateName + " in " + objContainer + " contained by " + objAttacker, getOwner(objAttacker)); @@ -1641,7 +1645,7 @@ public class space_combat extends script.base_script public static obj_id getClosestSpaceStation(obj_id objShip) throws InterruptedException { obj_id objQuestManager; - if (!utils.checkConfigFlag("ScriptFlags", "liveSpaceServer")) + if (space_flags.LIVE_SPACE_SERVER_MODE_OFF) { try { diff --git a/sku.0/sys.server/compiled/game/script/library/space_flags.java b/sku.0/sys.server/compiled/game/script/library/space_flags.java index 0d09bd218..2e010d6f1 100755 --- a/sku.0/sys.server/compiled/game/script/library/space_flags.java +++ b/sku.0/sys.server/compiled/game/script/library/space_flags.java @@ -18,6 +18,8 @@ public class space_flags extends script.base_script public static final String REBEL_NABOO = "nabooRebel"; public static final String REBEL_CORELLIA = "corelliaRebel"; public static final String SPACE_TRACK_FLAG = "spaceTrackFlagListName"; + public static final boolean LIVE_SPACE_SERVER_MODE_OFF = utils.checkConfigFlag("ScriptFlags", "liveSpaceServerModeOff"); + public static void setSpaceTrack(obj_id player, String spaceTrack) throws InterruptedException { clearSpaceTrack(player); diff --git a/sku.0/sys.server/compiled/game/script/library/space_transition.java b/sku.0/sys.server/compiled/game/script/library/space_transition.java index 322c7a289..f866ee9dc 100755 --- a/sku.0/sys.server/compiled/game/script/library/space_transition.java +++ b/sku.0/sys.server/compiled/game/script/library/space_transition.java @@ -25,6 +25,8 @@ public class space_transition extends script.base_script public static final String SHIP_PILOT_SLOT_NAME = "ship_pilot"; public static final string_id SID_PVP_NOW_OVERT = new string_id("space/space_interaction", "pvp_now_overt"); public static final string_id SID_PVP_NOW_NEUTRAL = new string_id("space/space_interaction", "pvp_now_neutral"); + public static final boolean SEND_TO_GROUND_ON_LOGOUT = utils.checkConfigFlag("ScriptFlags", "sendToGroundOnLogout"); + public static void handlePotentialSceneChange(obj_id player) throws InterruptedException { if (utils.hasLocalVar(player, "loggingOut")) @@ -188,12 +190,7 @@ public class space_transition extends script.base_script } public static boolean shouldSendToGroundOnLogout() throws InterruptedException { - String s = getConfigSetting("ScriptFlags", "sendToGroundOnLogout"); - if (s != null && (s.equals("false") || s.equals("0") || s.equals("off"))) - { - return false; - } - return true; + return SEND_TO_GROUND_ON_LOGOUT; } public static void setLaunchInfo(obj_id player, obj_id ship, int startLocationIndex, location groundLoc) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/spawning.java b/sku.0/sys.server/compiled/game/script/library/spawning.java index df0f2135c..0d821f7cf 100755 --- a/sku.0/sys.server/compiled/game/script/library/spawning.java +++ b/sku.0/sys.server/compiled/game/script/library/spawning.java @@ -11,6 +11,13 @@ public class spawning extends script.base_script public spawning() { } + + public static final boolean AREA_SPAWNERS_DISABLED = utils.checkConfigFlag("GameServer", "disableAreaSpawners"); + public static final boolean GENERIC_SPAWNERS_DISABLED = utils.checkConfigFlag("GameServer", "disableGenericSpawner"); + public static final boolean PATROL_SPAWNERS_DISABLED = utils.checkConfigFlag("GameServer", "disablePatrolSpawners"); + public static final boolean FAST_SPAWN = utils.checkConfigFlag("GameServer", "fastSpawn"); + public static final boolean SPAWNER_INITIAL_STATE_OFF = utils.checkConfigFlag("GameServer", "spawningInitialStateDefaultOff"); + public static void activateSpawnerHack(obj_id objPlayer) throws InterruptedException { obj_id[] objSpawners = getAllObjectsWithObjVar(getLocation(objPlayer), 24000, "intSpawnSystem"); diff --git a/sku.0/sys.server/compiled/game/script/library/travel.java b/sku.0/sys.server/compiled/game/script/library/travel.java index 00cd5daed..eab129190 100755 --- a/sku.0/sys.server/compiled/game/script/library/travel.java +++ b/sku.0/sys.server/compiled/game/script/library/travel.java @@ -67,6 +67,8 @@ public class travel extends script.base_script public static final string_id SID_MUSTAFAR_UNAUTHORIZED = new string_id("travel", "mustafar_unauthorized"); public static final string_id SID_KASHYYYK_UNAUTHORIZED = new string_id("travel", "kashyyyk_unauthorized"); public static final int TRAVEL_BLOCK_ALLOW_LAUNCH = 1; + public static final boolean TRAVEL_SYSTEM_DISABLED = utils.checkConfigFlag("GameServer", "disableTravelSystem"); + public static boolean initializeStarport(obj_id structure, String travel_point, int travel_cost, boolean civic) throws InterruptedException { LOG("LOG_CHANNEL", "structure ->" + structure + " travel ->" + travel_point + " cost ->" + travel_cost); diff --git a/sku.0/sys.server/compiled/game/script/library/utils.java b/sku.0/sys.server/compiled/game/script/library/utils.java index 3e668f841..b985e0fdb 100755 --- a/sku.0/sys.server/compiled/game/script/library/utils.java +++ b/sku.0/sys.server/compiled/game/script/library/utils.java @@ -4745,6 +4745,11 @@ public class utils extends script.base_script { return getIntBatchScriptVar(target, base_path) != null; } + + /** + * Gets a config value where the anticipated value is an int and parses it + * If it doesn't find a value, returns 0 + */ public static int getIntConfigSetting(String section, String key) { String setting = getConfigSetting(section, key); @@ -4761,6 +4766,22 @@ public class utils extends script.base_script } return 0; } + + /** + * Overload of getIntConfigSetting which allows you to provide a default value that will + * be returned if the regular getIntConfigSetting does not find the setting set in config. + * @param defaultValueIfNotFound the value to use if we get a 0 from getFloatConfigSetting + */ + public static int getIntConfigSetting(String section, String key, int defaultValueIfNotFound) + { + int value = getIntConfigSetting(section, key); + return value == 0 ? defaultValueIfNotFound : value; + } + + /** + * Gets a config value where the anticipated value is a float and parses it + * If it doesn't find a value, returns 0 + */ public static float getFloatConfigSetting(String section, String key) { String setting = getConfigSetting(section, key); @@ -4777,11 +4798,31 @@ public class utils extends script.base_script } return 0; } + + /** + * Overload of getFloatConfigSetting which allows you to provide a default value that will + * be returned if the regular getFloatConfigSetting does not find the setting set in config. + * @param defaultValueIfNotFound the value to use if we get a 0 from getFloatConfigSetting + */ + public static float getFloatConfigSetting(String section, String key, float defaultValueIfNotFound) + { + float value = getFloatConfigSetting(section, key); + return value == 0 ? defaultValueIfNotFound : value; + } + + /** + * Parses a config option where a boolean is anticipated. + * Returns true if it finds a value and the value equals true or 1. + * Otherwise (e.g. improper value, value not set in config, or false/0) returns false. + * @param strSection the section header of the target config option, e.g. GameServer + * @param strConfigSetting the actual option to check, e.g. disableMuseumEvent + */ public static boolean checkConfigFlag(String strSection, String strConfigSetting) { String strTest = toLower(getConfigSetting(strSection, strConfigSetting)); return (strTest != null && (strTest.equals("true") || strTest.equals("1"))); } + public static boolean checkServerSpawnLimits() throws InterruptedException { final int intNumPlayers = getNumPlayers(); @@ -6709,48 +6750,6 @@ public class utils extends script.base_script } return newList; } - public static boolean grantGift(obj_id player) throws InterruptedException - { - if ((getCurrentBirthDate() - getPlayerBirthDate(player)) < 10) - { - return false; - } - if (hasObjVar(player, XMAS_RECEIVED_VI1)) - { - return false; - } - if (!isIdValid(player)) - { - return false; - } - String config = getConfigSetting("GameServer", "grantGift"); - if (config != null) - { - if (config.equals("false")) - { - return false; - } - } - if (isInTutorialArea(player)) - { - setObjVar(player, XMAS_NOT_RECEIVED_TUTORIAL, 1); - CustomerServiceLog("grantGift", getFirstName(player) + "(" + player + ") did not receive Christmas '06 gift because they logged in on the tutorial planet."); - return false; - } - removeObjVar(player, XMAS_NOT_RECEIVED_TUTORIAL); - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv)) - { - CustomerServiceLog("grantGift", getFirstName(player) + "(" + player + ") did not have an inventory container. Didn't receive Christmas '06 gift, but not blocked from future attempt."); - return false; - } - obj_id giftOther = static_item.createNewItemFunction("item_lifeday_gift_other_01_02", inv); - setObjVar(giftOther, LIFEDAY_OWNER, player); - utils.sendMail(GIFT_GRANTED_SUB, GIFT_GRANTED, player, "System"); - setObjVar(player, XMAS_RECEIVED_VI1, 1); - CustomerServiceLog("grantGift", getFirstName(player) + "(" + player + ") has received his Christmas '06 gift."); - return true; - } public static void fullExpertiseReset(obj_id player, boolean storeBeast) throws InterruptedException { if (storeBeast) diff --git a/sku.0/sys.server/compiled/game/script/library/vendor_lib.java b/sku.0/sys.server/compiled/game/script/library/vendor_lib.java index d89d8229f..9ce06624e 100755 --- a/sku.0/sys.server/compiled/game/script/library/vendor_lib.java +++ b/sku.0/sys.server/compiled/game/script/library/vendor_lib.java @@ -140,6 +140,8 @@ public class vendor_lib extends script.base_script public static final string_id SID_GREETER_PACK_UP_SUCCESS = new string_id("player_structure", "greeter_packup_success"); public static final string_id SID_GREETER_PACK_UP_FAILURE = new string_id("player_structure", "greeter_packup_failure"); public static final string_id SID_MUST_BE_IN_VALID_LOCATION = new string_id("player_structure", "must_be_valid_location"); + public static final boolean VENDOR_PACKUP_ALLOWED = utils.checkConfigFlag("GameServer", "allowPlayersToPackVendors"); + public static boolean payMaintenance(obj_id player, obj_id vendor, int amt) throws InterruptedException { if (player == null || player == obj_id.NULL_ID) @@ -333,7 +335,7 @@ public class vendor_lib extends script.base_script } public static boolean isVendorPackUpEnabled() throws InterruptedException { - return utils.checkConfigFlag("GameServer", "allowPlayersToPackVendors"); + return VENDOR_PACKUP_ALLOWED; } public static obj_id getAuctionContainer(obj_id vendor) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/library/veteran_deprecated.java b/sku.0/sys.server/compiled/game/script/library/veteran_deprecated.java index 89c33cc93..7f41a11f7 100755 --- a/sku.0/sys.server/compiled/game/script/library/veteran_deprecated.java +++ b/sku.0/sys.server/compiled/game/script/library/veteran_deprecated.java @@ -97,14 +97,17 @@ public class veteran_deprecated extends script.base_script public static final string_id SID_UNAVAILABLE_NEEDS_EXPANSION = new string_id(VETERAN_STRING_TABLE, "unavailable_needs_expansion"); public static final string_id SID_UNAVAILABLE_NOT_ENOUGH_MILESTONE = new string_id(VETERAN_STRING_TABLE, "unavailable_not_enough_milestone"); public static final string_id SID_UNKNOWN = new string_id(VETERAN_STRING_TABLE, "unknown"); + public static final boolean VETERAN_REWARDS_ENABLED = utils.checkConfigFlag("GameServer", "enableVeteranRewards"); + public static final boolean ONE_YEAR_ANNIV_ENABLED = utils.checkConfigFlag("GameServer", "enableOneYearAnniversary"); + public static final boolean FLASH_SPEEDER_REWARD_ENABLED = utils.checkConfigFlag("GameServer", "flashSpeederReward"); + public static void updateVeteranTime(obj_id player) throws InterruptedException { if (!isIdValid(player)) { return; } - if (!("true").equals(getConfigSetting("GameServer", "enableVeteranRewards"))) - { + if (!VETERAN_REWARDS_ENABLED) { return; } if ((player.getScriptVars()).hasKey(SCRIPTVAR_VETERAN_LOGGED_IN)) @@ -641,8 +644,7 @@ public class veteran_deprecated extends script.base_script } public static void giveOneYearAnniversaryReward(obj_id player) throws InterruptedException { - if (!("true").equals(getConfigSetting("GameServer", "enableOneYearAnniversary"))) - { + if(!ONE_YEAR_ANNIV_ENABLED) { return; } if (!isPlayer(player)) @@ -698,42 +700,22 @@ public class veteran_deprecated extends script.base_script } public static boolean checkFlashSpeederReward(obj_id player) throws InterruptedException { - if (!isIdValid(player)) - { - LOG("flash_speeder", "veteran_deprecated.checkFlashSpeeder: Player is invalid."); - return false; - } - if (!isPlayer(player)) - { - LOG("flash_speeder", "veteran_deprecated.checkFlashSpeeder: " + player + " is not a player."); - return false; - } - if (isUsingAdminLogin(player)) + if (!isIdValid(player) || !isPlayer(player)) { return false; } - String config = getConfigSetting("GameServer", "flashSpeederReward"); - if (config != null && config.equals("true")) - { - int sub_bits = getGameFeatureBits(player); - if (hasObjVar(player, "flash_speeder.eligible")) - { - sub_bits = getIntObjVar(player, "flash_speeder.eligible"); - } - if ((features.isSpaceEdition(player) && utils.checkBit(sub_bits, 3)) || features.isJPCollectorEdition(player)) - { - if (!hasObjVar(player, "flash_speeder.granted")) - { - createObjectInInventoryAllowOverload("object/tangible/deed/vehicle_deed/speederbike_flash_deed.iff", player); - CustomerServiceLog("flash_speeder", "%TU has received a JtL pre-order Flash Speeder.", player); - string_id sub = new string_id(VETERAN_STRING_TABLE, "flash_speeder_granted_sub"); - string_id body = new string_id(VETERAN_STRING_TABLE, "flash_speeder_granted_body"); - utils.sendMail(sub, body, player, "System"); - setObjVar(player, "flash_speeder.granted", 1); - return true; - } + if (FLASH_SPEEDER_REWARD_ENABLED) { + if (!hasObjVar(player, "flash_speeder.granted")) { + createObjectInInventoryAllowOverload("object/tangible/deed/vehicle_deed/speederbike_flash_deed.iff", player); + CustomerServiceLog("flash_speeder", "%TU has received a JtL pre-order Flash Speeder.", player); + string_id sub = new string_id(VETERAN_STRING_TABLE, "flash_speeder_granted_sub"); + string_id body = new string_id(VETERAN_STRING_TABLE, "flash_speeder_granted_body"); + utils.sendMail(sub, body, player, "System"); + setObjVar(player, "flash_speeder.granted", 1); + return true; } } return false; } + } diff --git a/sku.0/sys.server/compiled/game/script/npc/assassin_device_quest/assassin_mission_npc_spawner.java b/sku.0/sys.server/compiled/game/script/npc/assassin_device_quest/assassin_mission_npc_spawner.java index 4b743155e..e90456e5b 100755 --- a/sku.0/sys.server/compiled/game/script/npc/assassin_device_quest/assassin_mission_npc_spawner.java +++ b/sku.0/sys.server/compiled/game/script/npc/assassin_device_quest/assassin_mission_npc_spawner.java @@ -11,6 +11,8 @@ public class assassin_mission_npc_spawner extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { + // pre-cu deprecated + /* String strConfigSetting = getConfigSetting("GameServer", "assassinMissionsEnabled"); if ((strConfigSetting == null) || (strConfigSetting.equals(""))) { @@ -23,6 +25,7 @@ public class assassin_mission_npc_spawner extends script.base_script setInvulnerable(celeb, true); ai_lib.setDefaultCalmBehavior(celeb, ai_lib.BEHAVIOR_SENTINEL); } + */ return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/npc/celebrity/emp_day_spawner.java b/sku.0/sys.server/compiled/game/script/npc/celebrity/emp_day_spawner.java index 38610e97f..1b0cad933 100755 --- a/sku.0/sys.server/compiled/game/script/npc/celebrity/emp_day_spawner.java +++ b/sku.0/sys.server/compiled/game/script/npc/celebrity/emp_day_spawner.java @@ -3,6 +3,7 @@ package script.npc.celebrity; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.events; import script.obj_id; public class emp_day_spawner extends script.base_script @@ -12,12 +13,7 @@ public class emp_day_spawner extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("EventTeam", "empireDay"); - if (setting == null || setting.equals("")) - { - return SCRIPT_CONTINUE; - } - if (setting.equals("true") || setting.equals("1")) + if (events.isEventActive(events.EMPIRE_DAY)) { String spawn = getStringObjVar(self, "spawns"); obj_id celeb = create.object(spawn, getLocation(self)); diff --git a/sku.0/sys.server/compiled/game/script/npc/celebrity/event_ls_npc_spawner.java b/sku.0/sys.server/compiled/game/script/npc/celebrity/event_ls_npc_spawner.java index 202678e67..5e034c135 100755 --- a/sku.0/sys.server/compiled/game/script/npc/celebrity/event_ls_npc_spawner.java +++ b/sku.0/sys.server/compiled/game/script/npc/celebrity/event_ls_npc_spawner.java @@ -3,6 +3,7 @@ package script.npc.celebrity; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.events; import script.obj_id; public class event_ls_npc_spawner extends script.base_script @@ -16,12 +17,7 @@ public class event_ls_npc_spawner extends script.base_script { setObjVar(self, "event.lost_squadron.num_rewards", 0); } - String setting = getConfigSetting("EventTeam", "lostSquadron"); - if (setting == null || setting.equals("")) - { - return SCRIPT_CONTINUE; - } - if (setting.equals("true") || setting.equals("1")) + if (events.isEventActive(events.LOST_SQUADRON)) { String spawn = getStringObjVar(self, "spawns"); obj_id celeb = create.object(spawn, getLocation(self)); diff --git a/sku.0/sys.server/compiled/game/script/npc/celebrity/herald_spawner.java b/sku.0/sys.server/compiled/game/script/npc/celebrity/herald_spawner.java index ac3698427..4b928578b 100755 --- a/sku.0/sys.server/compiled/game/script/npc/celebrity/herald_spawner.java +++ b/sku.0/sys.server/compiled/game/script/npc/celebrity/herald_spawner.java @@ -2,6 +2,7 @@ package script.npc.celebrity; import script.library.ai_lib; import script.library.create; +import script.library.instance; import script.obj_id; public class herald_spawner extends script.base_script @@ -11,18 +12,8 @@ public class herald_spawner extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - if (hasObjVar(self, "switch")) - { - String serverSwitch = getStringObjVar(self, "switch"); - String switchValue = getConfigSetting("Dungeon", serverSwitch); - if (switchValue == null || switchValue.equals("")) - { - return SCRIPT_CONTINUE; - } - if ((toLower(switchValue)).equals("false")) - { - return SCRIPT_CONTINUE; - } + if(!instance.GEONOSIAN_BUNKER_ENABLED) { + return SCRIPT_CONTINUE; } String spawn = getStringObjVar(self, "spawns"); obj_id celeb = create.object(spawn, getLocation(self)); diff --git a/sku.0/sys.server/compiled/game/script/npc/celebrity/lifeday_spawner.java b/sku.0/sys.server/compiled/game/script/npc/celebrity/lifeday_spawner.java index be2c1f908..5a60148ae 100755 --- a/sku.0/sys.server/compiled/game/script/npc/celebrity/lifeday_spawner.java +++ b/sku.0/sys.server/compiled/game/script/npc/celebrity/lifeday_spawner.java @@ -2,6 +2,7 @@ package script.npc.celebrity; import script.library.ai_lib; import script.library.create; +import script.library.events; import script.obj_id; public class lifeday_spawner extends script.base_script @@ -11,12 +12,7 @@ public class lifeday_spawner extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("EventTeam", "lifeday"); - if (setting == null || setting.equals("")) - { - return SCRIPT_CONTINUE; - } - if (setting.equals("true") || setting.equals("1")) + if (events.isEventActive(events.LIFEDAY)) { String spawn = getStringObjVar(self, "spawns"); obj_id celeb = create.object(spawn, getLocation(self)); diff --git a/sku.0/sys.server/compiled/game/script/npc/celebrity/nym_goodie_dispenser.java b/sku.0/sys.server/compiled/game/script/npc/celebrity/nym_goodie_dispenser.java index c79c72fdb..5d1a78286 100755 --- a/sku.0/sys.server/compiled/game/script/npc/celebrity/nym_goodie_dispenser.java +++ b/sku.0/sys.server/compiled/game/script/npc/celebrity/nym_goodie_dispenser.java @@ -2,6 +2,7 @@ package script.npc.celebrity; import script.library.ai_lib; import script.library.create; +import script.library.events; import script.obj_id; public class nym_goodie_dispenser extends script.base_script @@ -11,12 +12,7 @@ public class nym_goodie_dispenser extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - String setting = getConfigSetting("EventTeam", "anniversary"); - if (setting == null || setting.equals("")) - { - return SCRIPT_CONTINUE; - } - if (setting.equals("true") || setting.equals("1")) + if (events.isEventActive(events.ANNIVERSARY)) { String spawn = getStringObjVar(self, "spawns"); obj_id celeb = create.object(spawn, getLocation(self)); diff --git a/sku.0/sys.server/compiled/game/script/npc/stormtrooper_respect/overdue_fines.java b/sku.0/sys.server/compiled/game/script/npc/stormtrooper_respect/overdue_fines.java index 260820e3b..bad949453 100755 --- a/sku.0/sys.server/compiled/game/script/npc/stormtrooper_respect/overdue_fines.java +++ b/sku.0/sys.server/compiled/game/script/npc/stormtrooper_respect/overdue_fines.java @@ -19,19 +19,6 @@ public class overdue_fines extends script.base_script public static int DAY_IN_SECONDS = 60 * 60 * 24; public int OnInitialize(obj_id self) throws InterruptedException { - if (isGod(self)) - { - String delayWeekStr = getConfigSetting("GameServer", "STRespectWeekDelay"); - String delayDayStr = getConfigSetting("GameServer", "STRespectDayDelay"); - if (delayWeekStr != null && !delayWeekStr.equals("")) - { - WEEK_IN_SECONDS = Integer.parseInt(delayWeekStr); - } - if (delayDayStr != null && !delayDayStr.equals("")) - { - DAY_IN_SECONDS = Integer.parseInt(delayDayStr); - } - } if (hasObjVar(self, "overdue_fine")) { if ((getGameTime() - getIntObjVar(self, "overdue_fine") > WEEK_IN_SECONDS)) diff --git a/sku.0/sys.server/compiled/game/script/player/base/base_player.java b/sku.0/sys.server/compiled/game/script/player/base/base_player.java index 91fd33078..a2ab5c8b1 100755 --- a/sku.0/sys.server/compiled/game/script/player/base/base_player.java +++ b/sku.0/sys.server/compiled/game/script/player/base/base_player.java @@ -283,6 +283,11 @@ public class base_player extends script.base_script }; public static final boolean LOGGING_ON = true; public static final String LOGNAME = "junk_log"; + public static final int EXTRAORDINARY_WEALTH_LOGGING_THRESHOLD = 10000000; + public static final int PROFIT_LOGGING_THRESHOLD = 500000; + public static final boolean FORCE_SKIP_TUTORIAL = utils.checkConfigFlag("GameServer", "skipTutorial"); + public static final boolean WALL_OF_MIST_DISABLED = utils.checkConfigFlag("GameServer", "fsWallOfMistDisabled"); + public int OnCustomizeFinished(obj_id self, obj_id object, String params) throws InterruptedException { if (utils.hasScriptVar(self, "armor_colorize.tool_oid") || utils.hasScriptVar(self, "structure_colorize.tool_oid")) @@ -629,17 +634,9 @@ public class base_player extends script.base_script } int totalMoney = getTotalMoney(self); utils.setScriptVar(self, "profit", totalMoney); - String balanceThreshold = getConfigSetting("GameServer", "wealthLoggingThreshold"); - if (balanceThreshold == null || balanceThreshold.equals("")) + if (totalMoney > EXTRAORDINARY_WEALTH_LOGGING_THRESHOLD) { - balanceThreshold = "10000000"; - } - if (utils.stringToInt(balanceThreshold) > -1) - { - if (totalMoney > utils.stringToInt(balanceThreshold)) - { - CustomerServiceLog("Wealth", "Extraordinary Wealth: " + getName(self) + " (" + self + ") logged in with " + totalMoney + " credits"); - } + CustomerServiceLog("Wealth", "Extraordinary Wealth: " + getName(self) + " (" + self + ") logged in with " + totalMoney + " credits"); } utils.unequipAndNotifyUncerted(self); utils.checkInventoryForSnowflakeItemSwaps(self); @@ -1297,8 +1294,7 @@ public class base_player extends script.base_script } public int OnMadeAuthoritative(obj_id self) throws InterruptedException { - String flag = getConfigSetting("GameServer", "skipTutorial"); - if (flag != null && (flag.equals("true") || flag.equals("1"))) + if (FORCE_SKIP_TUTORIAL) { setObjVar(self, "skipTutorial", 1); } @@ -1375,13 +1371,6 @@ public class base_player extends script.base_script setObjVar(self, "combatLevel", getIntObjVar(self, "clickRespec.combatLevel")); removeObjVar(self, "clickRespec.combatLevel"); } - if (getConfigSetting("GameServer", "combatUpgradeReward") != null) - { - if (!hasScript(self, "cureward.cureward")) - { - attachScript(self, "cureward.cureward"); - } - } obj_id bldg = getTopMostContainer(self); if (isIdValid(bldg)) { @@ -1389,10 +1378,9 @@ public class base_player extends script.base_script parms.put("player", self); messageTo(bldg, "handlePlayerLogin", parms, 0, false); String bldgName = getTemplateName(bldg); - String setting = getConfigSetting("Dungeon", "Death_Watch"); if (bldgName.equals("object/building/general/bunker_allum_mine.iff")) { - if (setting == null || setting.equals("false") || setting.equals("0")) + if (instance.DEATH_WATCH_DUNGEON_ENABLED) { CustomerServiceLog("DUNGEON_DeathWatchBunker", "*Death Watch Unauthorized Entry: %TU entered the death watch bunker while it was turned off.", self); } @@ -1872,8 +1860,7 @@ public class base_player extends script.base_script } } } - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - if (halloweenRunning == null) + if (!events.isEventActive(events.GALACTIC_MOON_FESTIVAL)) { if (hasObjVar(self, event_perk.COUNTER_TIMESTAMP)) { @@ -1888,15 +1875,14 @@ public class base_player extends script.base_script removeObjVar(self, event_perk.COUNTER_RESTARTTIME); } } - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - if (lifedayRunning == null) + if (!events.isEventActive(events.LIFEDAY)) { if (hasObjVar(self, "lifeday")) { removeObjVar(self, "lifeday"); } } - if (lifedayRunning != null) + else { if (lifeDayNewDay(self)) { @@ -2200,17 +2186,9 @@ public class base_player extends script.base_script int startMoney = utils.getIntScriptVar(self, "profit"); int endMoney = getTotalMoney(self); utils.removeScriptVar(self, "profit"); - String profitThreshold = getConfigSetting("GameServer", "profitLoggingThreshold"); - if (profitThreshold == null || profitThreshold.equals("")) + if ((endMoney - startMoney) > PROFIT_LOGGING_THRESHOLD) { - profitThreshold = "500000"; - } - if (utils.stringToInt(profitThreshold) > -1) - { - if ((endMoney - startMoney) > utils.stringToInt(profitThreshold)) - { - CustomerServiceLog("Wealth", "Extraordinary Profit: " + getName(self) + " (" + self + ") logged in with " + startMoney + " credits and logged out with " + endMoney + " credits, for a profit of " + (endMoney - startMoney) + " credits"); - } + CustomerServiceLog("Wealth", "Extraordinary Profit: " + getName(self) + " (" + self + ") logged in with " + startMoney + " credits and logged out with " + endMoney + " credits, for a profit of " + (endMoney - startMoney) + " credits"); } } if (guild.hasWindowPid(self)) @@ -9581,7 +9559,7 @@ public class base_player extends script.base_script } public int cmdGetVeteranRewardTime(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - if (!("true").equals(getConfigSetting("GameServer", "enableVeteranRewards"))) + if (!veteran_deprecated.VETERAN_REWARDS_ENABLED) { return SCRIPT_CONTINUE; } @@ -9620,7 +9598,7 @@ public class base_player extends script.base_script } public int cmdListVeteranRewards(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - if (!("true").equals(getConfigSetting("GameServer", "enableVeteranRewards"))) + if (!veteran_deprecated.VETERAN_REWARDS_ENABLED) { return SCRIPT_CONTINUE; } @@ -9780,9 +9758,7 @@ public class base_player extends script.base_script } public int cmdFlashSpeeder(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { - String config = getConfigSetting("GameServer", "flashSpeederReward"); - if (config == null || !config.equals("true")) - { + if (!veteran_deprecated.FLASH_SPEEDER_REWARD_ENABLED) { return SCRIPT_CONTINUE; } int sub_bits = getGameFeatureBits(self); @@ -9979,13 +9955,8 @@ public class base_player extends script.base_script } else if (regionName.equals("dathomir_fs_village_unpassable")) { - String config = getConfigSetting("GameServer", "fsWallOfMistEnabled"); - if (config != null) - { - if (config.equals("false")) - { - return SCRIPT_CONTINUE; - } + if(WALL_OF_MIST_DISABLED) { + return SCRIPT_CONTINUE; } if (!township.isTownshipEligible(self) || ai_lib.isInCombat(self)) { diff --git a/sku.0/sys.server/compiled/game/script/player/live_conversions.java b/sku.0/sys.server/compiled/game/script/player/live_conversions.java index 5983e3e10..4c0467f90 100755 --- a/sku.0/sys.server/compiled/game/script/player/live_conversions.java +++ b/sku.0/sys.server/compiled/game/script/player/live_conversions.java @@ -9,6 +9,13 @@ import java.util.Vector; public class live_conversions extends script.base_script { + /** + * This file is used to handle "conversions" which is anything that needs to change + * about a player when they login or travel. This script is attached to every player + * so you can easily add a handler/task that needs to impact/touch/check all players. + * Add a void method to the bottom of the script and then call that method in either + * RunOncePerSessionConversions or RunOncePerTravelConversions + */ public live_conversions() { } @@ -32,6 +39,14 @@ public class live_conversions extends script.base_script public static final String UPDATE_COLLECTION_SLOT_TO_GRANT = "slot_to_grant"; public static final String UPDATE_COLLECTION_INCREMENT_AMOUNT = "increment_amount"; public static final String FORCE_RESPEC_OBJVAR = "configEnforcedRespecVersion"; + + public static final boolean FORCE_PROFESION_RESPEC = utils.checkConfigFlag("GameServer", "forceProfessionRespec"); + public static final boolean GRANT_ESB_AWARDS = utils.checkConfigFlag("Custom", "grantEsbAnniversaryRewards"); + public static final boolean GRANT_MAIL_OPT_IN_AWARDS = utils.checkConfigFlag("Custom", "grantMailOptInRewards"); + public static final boolean GRANT_ELDER_BUFF = utils.checkConfigFlag("Custom", "grantElderBuff"); + public static final int CU_REWARD_LEVEL = utils.getIntConfigSetting("GameServer", "combatUpgradeReward", 0); + public static final int CU_REWARD_AGE_REQUIRED = utils.getIntConfigSetting("GameServer", "combatUpgradeRewardAge", 365); + public int OnAttach(obj_id self) throws InterruptedException { runOncePerSessionConversions(self); @@ -79,17 +94,16 @@ public class live_conversions extends script.base_script validateExpertises(player); expertiseRespecCheck(player); updatePermanentSchematics(player); - updateHothFlawless(player); utils.updateCTSObjVars(player); respec.checkRespecDecay(player); updateRenameCharacterComplete(player); forceRespecBasedOnConfig(player); givePlayersDeathTroopersOutbreakQuest(player); givePlayersDeathTroopersPrologQuestComlink(player); - removeDeprecatedQuests(player); addPlayerScripts(player); handleEsbAnniversaryGifts(player); handleMailOptInRewards(player); + handleCombatUpgradePlaqueReward(player); } public void runOncePerTravelConversions(obj_id player) throws InterruptedException { @@ -341,15 +355,7 @@ public class live_conversions extends script.base_script setConversionFlag(player, POLITICIAN_CONVERSION); } public static final int NPE_BIRTH_DATE = 1777; - public void grantElderBuff(obj_id player) throws InterruptedException - { - String config = getConfigSetting("Custom", "grantElderBuff"); - if(config != null && utils.stringToInt(config) == 1) { - if (!hasCommand(player, "veteranPlayerBuff")) { - grantCommand(player, "veteranPlayerBuff"); - } - } - } + public int handleBirthDateCallBack(obj_id self, dictionary params) throws InterruptedException { obj_id player = self; @@ -737,7 +743,6 @@ public class live_conversions extends script.base_script public void validateExpertises(obj_id player) throws InterruptedException { skill.validateExpertise(player); - return; } public boolean expertiseRespecCheck(obj_id player) throws InterruptedException { @@ -780,11 +785,6 @@ public class live_conversions extends script.base_script { return craftinglib.updatePermanentSchematics(player); } - public int fullExpertiseReset(obj_id self, dictionary params) throws InterruptedException - { - utils.fullExpertiseReset(self, false); - return SCRIPT_CONTINUE; - } public void updateCollectionSlots(obj_id player) throws InterruptedException { if (!isIdValid(player) && !exists(player)) @@ -811,25 +811,6 @@ public class live_conversions extends script.base_script } } } - public void updateHothFlawless(obj_id player) throws InterruptedException - { - if (!isIdValid(player) && !exists(player)) - { - return; - } - if (hasObjVar(player, "hoth.flawless_reward")) - { - return; - } - if (badge.hasBadge(player, "champion_of_hoth")) - { - obj_id[] rewards = new obj_id[1]; - obj_id inventory = utils.getInventoryContainer(player); - rewards[0] = static_item.createNewItemFunction("item_hoth_flawless_painting", inventory); - showLootBox(player, rewards); - setObjVar(player, "hoth.flawless_reward", 1); - } - } public void updateRenameCharacterComplete(obj_id player) throws InterruptedException { if (!isIdValid(player) || !exists(player)) @@ -847,14 +828,10 @@ public class live_conversions extends script.base_script removeObjVar(player, "renameCharacterRequest.requestNewName"); } } + public void forceRespecBasedOnConfig(obj_id player) throws InterruptedException { - if (getConfigSetting("GameServer", "forceProfessionRespec") == null) - { - return; - } - if (!hasObjVar(player, "character_builder")) - { + if(!FORCE_PROFESION_RESPEC) { return; } if (hasObjVar(player, FORCE_RESPEC_OBJVAR)) @@ -876,68 +853,54 @@ public class live_conversions extends script.base_script setObjVar(player, FORCE_RESPEC_OBJVAR, FORCED_RESPEC_VERSION); } } - public boolean givePlayersDeathTroopersOutbreakQuest(obj_id player) throws InterruptedException + + public void givePlayersDeathTroopersOutbreakQuest(obj_id player) throws InterruptedException { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Player: " + player + " is being checked for old prolog quest line."); if (!groundquests.isQuestActiveOrComplete(player, "quest_08_dathomir_outpost")) { - return false; + return; } - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " has quest quest_08_dathomir_outpost active or completed."); if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel") || groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial") || groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral") || groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral") || groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel") || groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial")) { - return false; + return; } - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " does not have quest outbreak_live_conversion_rebel, imperial or neutral active or completed."); if (groundquests.isQuestActive(player, "quest_08_dathomir_outpost")) { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " has quest quest_08_dathomir_outpost currently active!"); if (groundquests.isTaskActive(player, "quest_08_dathomir_outpost", "travelDathomir")) { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " has quest quest_08_dathomir_outpost with task travelDathomir currently active! We need to complete this quest immediatly so this player is not gated!"); int questid = questGetQuestId("quest/quest_08_dathomir_outpost"); - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " has quest quest_08_dathomir_outpost and that quest ID is: " + questid); if (questid != 0) { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " is having quest quest_08_dathomir_outpost completed to avoid a gate!"); questCompleteQuest(questid, player); } } else { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: " + player + " does not have the quest quest_08_dathomir_outpost task travelDathomir currently so we are not completing the quest prematurely."); - return false; + return; } } if (factions.isRebel(player)) { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Granting Player: " + player + " the outbreak_live_conversion_rebel quest because they are currently of rebel faction."); groundquests.grantQuest(player, "outbreak_live_conversion_rebel"); - return true; + return; } else if (factions.isImperial(player)) { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Granting Player: " + player + " the outbreak_live_conversion_rebel quest because they are currently of imp faction."); groundquests.grantQuest(player, "outbreak_live_conversion_imperial"); - return true; + return; } - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Granting Player: " + player + " the outbreak_live_conversion_rebel quest because they are currently of neutral faction."); groundquests.grantQuest(player, "outbreak_live_conversion_neutral"); - return true; } - public boolean givePlayersDeathTroopersPrologQuestComlink(obj_id player) throws InterruptedException + + public void givePlayersDeathTroopersPrologQuestComlink(obj_id player) throws InterruptedException { - if (isFreeTrialAccount(player)) - { - return false; - } if (isInTutorialArea(player)) { - return false; + return; } if (hasObjVar(player, "prologComlink")) { - return false; + return; } if (!groundquests.isQuestActiveOrComplete(player, "quest_01_comlink_call_to_adventure_neg_faction") && !groundquests.isQuestActiveOrComplete(player, "quest_01_comlink_call_to_adventure_neut_faction") && !groundquests.isQuestActiveOrComplete(player, "quest_01_comlink_call_to_adventure_pos_faction")) { @@ -945,29 +908,24 @@ public class live_conversions extends script.base_script obj_id inventory = utils.getInventoryContainer(player); if (!isValidId(inventory)) { - return false; + return; } rewards[0] = static_item.createNewItemFunction("item_publish_gift_update_14_comlink", inventory); if (!isValidId(rewards[0])) { - return false; + return; } showLootBox(player, rewards); } sendSystemMessage(player, JABBAS_COMLINK); setObjVar(player, "prologComlink", true); - return true; - } - public boolean removeDeprecatedQuests(obj_id player) throws InterruptedException - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_weed_pulling")) - { - groundquests.clearQuest(player, "u16_nym_themepark_weed_pulling"); - } - return true; } + + /** + * Gives players the unattainable awards for participating in the Empire Strikes Back Anniversary Events + */ public void handleEsbAnniversaryGifts(obj_id player) throws InterruptedException { - if(!utils.checkConfigFlag("Custom", "grantEsbAnniversaryRewards")) { + if(!GRANT_ESB_AWARDS) { return; } if(hasObjVar(player, "publish_gifts.has_esb_rewards")) { @@ -986,8 +944,11 @@ public class live_conversions extends script.base_script setObjVar(player, "publish_gifts.has_esb_rewards", 1); } + /** + * Gives players the unattainable rewards for opting into the SOE mailing list + */ public void handleMailOptInRewards(obj_id player) throws InterruptedException { - if(!utils.checkConfigFlag("Custom", "grantMailOptInRewards")) { + if(!GRANT_MAIL_OPT_IN_AWARDS) { return; } if(hasObjVar(player, "publish_gifts.has_mail_opt_in_rewards")) { @@ -1008,4 +969,41 @@ public class live_conversions extends script.base_script showLootBox(player, new obj_id[] {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11}); setObjVar(player, "publish_gifts.has_mail_opt_in_rewards", 1); } + + /** + * Gives a player the Combat Upgrade Reward Plaque if they have reached a specified age + * and if the setting is enabled. Gives the Silver plaque if setting = 1 or the gold if setting = 2 + * Note: age = days since they created the character, so 45 "age" is 45 days after character creation + */ + public void handleCombatUpgradePlaqueReward(obj_id player) throws InterruptedException { + if (CU_REWARD_LEVEL != 0) { + if (!hasObjVar(player, "publish_gifts.hasCombatUpgradePlaque")) { + int playerAge = getCurrentBirthDate() - getPlayerBirthDate(player); + if (playerAge >= CU_REWARD_AGE_REQUIRED) { + obj_id reward = obj_id.NULL_ID; + if (CU_REWARD_LEVEL == 1) { + reward = createObjectInInventoryAllowOverload("object/tangible/event_perk/frn_loyalty_award_plaque_silver.iff", player); + } else if (CU_REWARD_LEVEL == 2) { + reward = createObjectInInventoryAllowOverload("object/tangible/event_perk/frn_loyalty_award_plaque_gold.iff", player); + } + if (isIdValid(reward)) { + showLootBox(player, new obj_id[]{reward}); + } + } + } + } + } + + /** + * Gives every player the otherwise unattainable Elder Buff + */ + public void grantElderBuff(obj_id player) throws InterruptedException + { + if(GRANT_ELDER_BUFF) { + if (!hasCommand(player, "veteranPlayerBuff")) { + grantCommand(player, "veteranPlayerBuff"); + } + } + } + } diff --git a/sku.0/sys.server/compiled/game/script/player/player_guild.java b/sku.0/sys.server/compiled/game/script/player/player_guild.java index b70289faa..5d6b66030 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_guild.java +++ b/sku.0/sys.server/compiled/game/script/player/player_guild.java @@ -1955,7 +1955,7 @@ public class player_guild extends script.base_script { return SCRIPT_CONTINUE; } - if (guildGetCountMembersOnly(guildId) < utils.stringToInt(getConfigSetting("GameServer", "gcwGuildMinMembersForGcwRegionDefender"))) + if (guildGetCountMembersOnly(guildId) < utils.getIntConfigSetting("GameServer", "gcwGuildMinMembersForGcwRegionDefender", 10)) { return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/player/player_instance.java b/sku.0/sys.server/compiled/game/script/player/player_instance.java index 6fe5bd853..a2c75e1ce 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_instance.java +++ b/sku.0/sys.server/compiled/game/script/player/player_instance.java @@ -691,11 +691,7 @@ public class player_instance extends script.base_script { count = params.getInt("tokenCount"); } - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "heroicTokenBonus")); - if (multiplier > 1) - { - count = (int)(count * (float)multiplier); - } + count *= instance.HEROIC_TOKEN_MULTIPLIER; if (tokenIndex < 0 || tokenIndex >= trial.HEROIC_TOKENS.length) { sendSystemMessageTestingOnly(self, "DEBUG: handleAwardtoken sent with out of range tokenIndex."); diff --git a/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java b/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java index e25cfc226..f2655f1e8 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java +++ b/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java @@ -968,16 +968,7 @@ public class player_saga_quest extends script.base_script } if (questWeight >= pgc_quests.PGC_MIN_MID_QUALITY_QUEST_WEIGHT) { - int goldTokenChance = pgc_quests.CHRONICLES_CHRONICLER_GOLD_TOKEN_CHANCE; - String configChance_string = getConfigSetting("GameServer", "chroniclesChroniclerGoldTokenChanceOverride"); - if (configChance_string != null && configChance_string.length() > 0) - { - int configChance = utils.stringToInt(configChance_string); - if (configChance > 0) - { - goldTokenChance = configChance; - } - } + int goldTokenChance = pgc_quests.CHRONICLES_GOLD_TOKEN_CHANCE_SETTING; int goldTokenRoll = rand(1, 100); if (goldTokenRoll <= goldTokenChance) { diff --git a/sku.0/sys.server/compiled/game/script/player/player_travel.java b/sku.0/sys.server/compiled/game/script/player/player_travel.java index 6bc782624..ab2006dae 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_travel.java +++ b/sku.0/sys.server/compiled/game/script/player/player_travel.java @@ -45,6 +45,9 @@ public class player_travel extends script.base_script public static final int SHIP_TYPE_TCG_LOCATION_SHIP = 6; public static final int SHIP_TYPE_SNOWSPEEDER_SHIP = 7; public static final int SHIP_TYPE_TCG_SLAVE1_SHIP = 8; + public static final boolean ITV_DISABLED = utils.checkConfigFlag("GameServer", "disableInstantTravelVehicles"); + public static final int ITV_MIN_LEVEL_TO_USE = utils.getIntConfigSetting("GameServer", "itvMinUsageLevel", 1); + public int OnInitialize(obj_id self) throws InterruptedException { LOG("LOG_CHANNEL", "player_travel.OnInitialize"); @@ -1071,17 +1074,20 @@ public class player_travel extends script.base_script } public boolean canCallForPickup(obj_id player) throws InterruptedException { - debugLogging("//***// canCallForPickup", "////>>>> ENTERED"); - // get the setting for minimum ITV level (if its not set, make it the max player level) - String minLevelSetting = getConfigSetting("GameServer", "itvMinUsageLevel"); - if(minLevelSetting == null) minLevelSetting = "0"; - int minimumLevel = Integer.parseInt(minLevelSetting); - obj_id playerCurrentMount = getMountId(player); - if(getLevel(player) < minimumLevel){ - sendSystemMessage(player, "Instant Travel vehicles may not be used until you have reached level " + minLevelSetting, null); + if(ITV_DISABLED) { + sendSystemMessageTestingOnly(player, "You cannot call an Instant Travel Vehicle because they are currently disabled."); return false; } + + if(ITV_MIN_LEVEL_TO_USE > 1) { + if(getLevel(player) < ITV_MIN_LEVEL_TO_USE) { + sendSystemMessageTestingOnly(player, "You cannot call an Instant Travel Vehicle until you reach level "+ITV_MIN_LEVEL_TO_USE+"."); + return false; + } + } + + obj_id playerCurrentMount = getMountId(player); if (isIdValid(playerCurrentMount)) { sendSystemMessage(player, SID_INSTANT_MOUNT_NO); diff --git a/sku.0/sys.server/compiled/game/script/player/player_utility.java b/sku.0/sys.server/compiled/game/script/player/player_utility.java index 974b2aee0..b797218a6 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_utility.java +++ b/sku.0/sys.server/compiled/game/script/player/player_utility.java @@ -59,20 +59,6 @@ public class player_utility extends script.base_script public static final String GUARD_OCCUPIED = "occupied"; public int OnLogin(obj_id self) throws InterruptedException { - if (utils.checkConfigFlag("GameServer", "jediTestResources")) - { - if (hasSkill(self, "class_bountyhunter_phase4_novice")) - { - createNewBHResources(self); - } - } - if (utils.checkConfigFlag("GameServer", "jediTestBuffs")) - { - if (hasSkill(self, "class_bountyhunter_phase4_novice")) - { - createBuffs(self); - } - } removeObjVar(self, VAR_FIND_BASE); if (buff.hasBuff(self, "tcg_series3_hands_of_seduction")) { diff --git a/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/spawner_pirate_leader.java b/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/spawner_pirate_leader.java index 48f7939bb..ed749d845 100755 --- a/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/spawner_pirate_leader.java +++ b/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/spawner_pirate_leader.java @@ -3,6 +3,7 @@ package script.quest.hero_of_tatooine; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.spawning; import script.library.utils; import script.location; import script.obj_id; @@ -100,15 +101,6 @@ public class spawner_pirate_leader extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/quest/task/pgc/fan_faire_demo/spawner_fan_faire.java b/sku.0/sys.server/compiled/game/script/quest/task/pgc/fan_faire_demo/spawner_fan_faire.java index 6ed716411..391ec23ae 100755 --- a/sku.0/sys.server/compiled/game/script/quest/task/pgc/fan_faire_demo/spawner_fan_faire.java +++ b/sku.0/sys.server/compiled/game/script/quest/task/pgc/fan_faire_demo/spawner_fan_faire.java @@ -3,6 +3,7 @@ package script.quest.task.pgc.fan_faire_demo; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.spawning; import script.library.utils; import script.location; import script.obj_id; @@ -108,16 +109,7 @@ public class spawner_fan_faire extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return spawning.AREA_SPAWNERS_DISABLED; } public int OnDestroy(obj_id self) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/space/content_tools/spawner.java b/sku.0/sys.server/compiled/game/script/space/content_tools/spawner.java index 0d2b2cb2d..a5d1e50af 100755 --- a/sku.0/sys.server/compiled/game/script/space/content_tools/spawner.java +++ b/sku.0/sys.server/compiled/game/script/space/content_tools/spawner.java @@ -10,11 +10,14 @@ public class spawner extends script.base_script public spawner() { } + + public static final boolean DISABLE_SPACE_SPAWNERS = utils.checkConfigFlag("GameServer", "disableSpaceSpawners"); + public int getSpawnerData(obj_id self, dictionary params) throws InterruptedException { if (hasObjVar(self, "strAsteroidType")) { - if (utils.checkConfigFlag("ScriptFlags", "spawnersOn")) + if (!DISABLE_SPACE_SPAWNERS) { messageTo(self, "startSpawning", null, 3, false); } @@ -53,7 +56,7 @@ public class spawner extends script.base_script } utils.setScriptVar(self, "trPatrolPoints", trPatrolPoints); } - if (utils.checkConfigFlag("ScriptFlags", "spawnersOn")) + if (!DISABLE_SPACE_SPAWNERS) { messageTo(self, "startSpawning", null, 3, false); return SCRIPT_CONTINUE; diff --git a/sku.0/sys.server/compiled/game/script/space/crafting/interior_component.java b/sku.0/sys.server/compiled/game/script/space/crafting/interior_component.java index 1cee6aa0b..76e2199d7 100755 --- a/sku.0/sys.server/compiled/game/script/space/crafting/interior_component.java +++ b/sku.0/sys.server/compiled/game/script/space/crafting/interior_component.java @@ -2,6 +2,7 @@ package script.space.crafting; import script.*; import script.library.space_crafting; +import script.library.space_flags; import script.library.space_transition; import script.library.utils; @@ -53,7 +54,7 @@ public class interior_component extends script.base_script else { LOG("space", "Component " + intSlot + " is not installed on " + objShip + " cleaning up interior piece"); - if (utils.checkConfigFlag("ScriptFlags", "liveSpaceServer")) + if (space_flags.LIVE_SPACE_SERVER_MODE_OFF) { destroyObject(self); } diff --git a/sku.0/sys.server/compiled/game/script/space/ship/ship_interior.java b/sku.0/sys.server/compiled/game/script/space/ship/ship_interior.java index 83e1b7d3a..7e8bc8212 100755 --- a/sku.0/sys.server/compiled/game/script/space/ship/ship_interior.java +++ b/sku.0/sys.server/compiled/game/script/space/ship/ship_interior.java @@ -83,7 +83,7 @@ public class ship_interior extends script.base_script utils.setScriptVar(self, strLocationList[intI] + "Cells", objCells); } } - if (!utils.checkConfigFlag("ScriptFlags", "liveSpaceServer")) + if (space_flags.LIVE_SPACE_SERVER_MODE_OFF) { obj_id objTest = createObject(strTemplates[intI], tr, objCell); if (!strObjVars[intI].equals("")) diff --git a/sku.0/sys.server/compiled/game/script/systems/battlefield/battlefield_region.java b/sku.0/sys.server/compiled/game/script/systems/battlefield/battlefield_region.java index ad9d656b1..fe9317951 100755 --- a/sku.0/sys.server/compiled/game/script/systems/battlefield/battlefield_region.java +++ b/sku.0/sys.server/compiled/game/script/systems/battlefield/battlefield_region.java @@ -24,14 +24,9 @@ public class battlefield_region extends script.base_script messageTo(self, "msgInitializeRegion", null, 0.0f, true); if (hasObjVar(self, battlefield.VAR_BATTLEFIELD)) { - String config = getConfigSetting("GameServer", "disableBattlefields"); - if (config != null) - { - if (config.equals("true")) - { - battlefield.endBattlefield(self, false); - return SCRIPT_CONTINUE; - } + if(battlefield.BATTLEFIELDS_DISABLED) { + battlefield.endBattlefield(self, false); + return SCRIPT_CONTINUE; } int version = battlefield.getBattlefieldVersion(self); LOG("LOG_CHANNEL", "version ->" + version + " current_version ->" + battlefield.CURRENT_VERSION); diff --git a/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java b/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java index 1175a3935..bf5f65d04 100755 --- a/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java +++ b/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java @@ -3827,8 +3827,7 @@ public class buff_handler extends script.base_script } public int lifedayCompetitiveBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException { - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - if (lifedayRunning != null && !lifedayRunning.equals("false")) + if (events.isEventActive(events.LIFEDAY)) { obj_id tatooine = getPlanetByName("tatooine"); setObjVar(self, "lifeday.locked_out", 1); diff --git a/sku.0/sys.server/compiled/game/script/systems/combat/combat_base.java b/sku.0/sys.server/compiled/game/script/systems/combat/combat_base.java index a226f1ed8..06ec37cd1 100755 --- a/sku.0/sys.server/compiled/game/script/systems/combat/combat_base.java +++ b/sku.0/sys.server/compiled/game/script/systems/combat/combat_base.java @@ -34,6 +34,8 @@ public class combat_base extends script.base_script public static final int HIT_RESULT_STRIKETHROUGH = 9; public static final String PROGRESSIVE_DAMAGE_COUNTER = "hitData.progressive.counter"; public static final string_id SID_NONE = new string_id(); + public static final boolean PVP_DISABLED = utils.checkConfigFlag("GameServer", "disablePvP"); + public boolean combatStandardAction(String actionName, obj_id self, obj_id target, String params, String successHandler, String failHandler) throws InterruptedException { return combatStandardAction(actionName, self, target, getCurrentWeapon(self), params, null, false, false, 0); @@ -731,13 +733,8 @@ public class combat_base extends script.base_script verbose = false; if ((isPlayer(attackerData.id) && isPlayer(defenderData[0].id)) && (attackerData.id != defenderData[0].id)) { - String setting = getConfigSetting("GameServer", "disablePvP"); - if (setting != null && (setting.equals("1") || setting.equals("true"))) - { - if (verbose) - { - return false; - } + if(PVP_DISABLED) { + return false; } } if (isDead(attackerData.id)) diff --git a/sku.0/sys.server/compiled/game/script/systems/combat/combat_mine_spawner.java b/sku.0/sys.server/compiled/game/script/systems/combat/combat_mine_spawner.java index 0dff00096..9fd62eb62 100755 --- a/sku.0/sys.server/compiled/game/script/systems/combat/combat_mine_spawner.java +++ b/sku.0/sys.server/compiled/game/script/systems/combat/combat_mine_spawner.java @@ -13,6 +13,8 @@ public class combat_mine_spawner extends script.base_script } public static final String dataTable = "datatables/combat/npc_landmines.iff"; public static final boolean doLogging = false; + public static final boolean MINE_FIELDS_DISABLED = utils.checkConfigFlag("GameServer", "disableMineFields"); + public int OnAttach(obj_id self) throws InterruptedException { if (canSpawnByConfigSetting()) @@ -109,15 +111,6 @@ public class combat_mine_spawner extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableMineFields"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !MINE_FIELDS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/systems/crafting/droid/modules/interplanetary_survey.java b/sku.0/sys.server/compiled/game/script/systems/crafting/droid/modules/interplanetary_survey.java index b18cc3699..37f1438ea 100755 --- a/sku.0/sys.server/compiled/game/script/systems/crafting/droid/modules/interplanetary_survey.java +++ b/sku.0/sys.server/compiled/game/script/systems/crafting/droid/modules/interplanetary_survey.java @@ -153,14 +153,6 @@ public class interplanetary_survey extends script.base_script Vector surveyToolList = utils.getResizeableObjIdArrayScriptVar(self, "surveyToolId"); obj_id[] resourceIdList = getAvailablePlanetResources(planet, (String)surveyResourceList.get(idx)); int time = getSurveyTime(); - if (isGod(player)) - { - String delayStr = getConfigSetting("GameServer", "InterplanetarySurveyDelay"); - if (delayStr != null && !delayStr.equals("")) - { - time = Integer.parseInt(delayStr); - } - } dictionary data = new dictionary(); data.put("resourceList", resourceIdList); data.put("planetName", planet); diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner.java b/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner.java index 80d68166f..cf6b62624 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner.java @@ -1,6 +1,7 @@ package script.systems.gcw; import script.*; +import script.library.events; import script.library.gcw; import script.library.locations; import script.library.utils; @@ -73,8 +74,7 @@ public class flip_banner extends script.base_script } public void spawnBanner(obj_id self, String faction) throws InterruptedException { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) + if (events.isEventActive(events.EMPIRE_DAY)) { location here = getLocation(self); String city = locations.getCityName(here); @@ -106,6 +106,5 @@ public class flip_banner extends script.base_script } setObjVar(banner, "spawner", self); utils.setScriptVar(self, "banner", banner); - return; } } diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner_onpole.java b/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner_onpole.java index 919c4da23..ab07f9030 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner_onpole.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner_onpole.java @@ -1,10 +1,7 @@ package script.systems.gcw; import script.dictionary; -import script.library.gcw; -import script.library.locations; -import script.library.trial; -import script.library.utils; +import script.library.*; import script.location; import script.obj_id; import script.transform; @@ -77,27 +74,23 @@ public class flip_banner_onpole extends script.systems.gcw.flip_banner } public void spawnBanner(obj_id self, String faction) throws InterruptedException { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null) + if (events.isEventActive(events.EMPIRE_DAY)) { - if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) + location here = getLocation(self); + String city = locations.getCityName(here); + if (city == null) { - location here = getLocation(self); - String city = locations.getCityName(here); - if (city == null) + city = locations.getGuardSpawnerRegionName(here); + } + if (city != null && city.length() > 0) + { + if (city.equals("coronet")) { - city = locations.getGuardSpawnerRegionName(here); + faction = "rebel"; } - if (city != null && city.length() > 0) + else if (city.equals("theed")) { - if (city.equals("coronet")) - { - faction = "rebel"; - } - else if (city.equals("theed")) - { - faction = "imperial"; - } + faction = "imperial"; } } } diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java index db047cc21..15ebff636 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java @@ -166,8 +166,7 @@ public class gcw_city extends script.base_script debugSpeakMsg(self, "GCW Controller: Failed to find city name."); return SCRIPT_CONTINUE; } - String cityConfig = getConfigSetting("GameServer", "gcwcity" + city); - if (cityConfig == null || cityConfig.length() <= 0) { + if (!gcw.gcwIsInvasionCityOn(city)) { sendSystemMessageTestingOnly(objSpeaker, "The city configuration (gcwcity" + city + ") is turned off. OVERRIDING"); utils.setScriptVar(self, "gcw.configOverride", 1); } diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/player_pvp.java b/sku.0/sys.server/compiled/game/script/systems/gcw/player_pvp.java index d000c468e..5e7550103 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/player_pvp.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/player_pvp.java @@ -814,11 +814,7 @@ public class player_pvp extends script.base_script tokens = 5; } } - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "gcwTokenBonus")); - if (multiplier > 1) - { - tokens *= multiplier; - } + tokens *= gcw.GCW_TOKEN_BONUS; if (canReceiveReward(self)) { gcw._grantGcwPoints(null, self, gcwCredits, false, gcw.GCW_POINT_TYPE_GROUND_PVP_REGION, ""); diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/pvp_battlefield.java b/sku.0/sys.server/compiled/game/script/systems/gcw/pvp_battlefield.java index 767e9d670..a9004d4a9 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/pvp_battlefield.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/pvp_battlefield.java @@ -37,6 +37,8 @@ public class pvp_battlefield extends script.base_script public static final int BATTLEFIELD_MAXIMUM_TEAM_SIZE = 16; public static final int BATTLEFIELD_PLAYER_KILL_VALUE = 10; public static final int BATTLEFIELD_TERMINAL_CAPTURE_VALUE = 500; + public static final int BATTLEFIELD_MINIMUM_TEAM_SIZE_OVERRIDE = utils.getIntConfigSetting("GameServer", "BfMinimumTeamSize", BATTLEFIELD_MINIMUM_TEAM_SIZE); + public static final int BATTLEFIELD_MAXIMUM_TEAM_SIZE_OVERRIDE = utils.getIntConfigSetting("GameServer", "BfTeamSize", BATTLEFIELD_MAXIMUM_TEAM_SIZE); public void doLogging(String section, String message) throws InterruptedException { } @@ -223,11 +225,7 @@ public class pvp_battlefield extends script.base_script extra = " Rebels Accepted: " + bfActiveGetRebelCount(self) + " Imperials Accepted: " + bfActiveGetImperialCount(self); break; case pvp.PVP_STATE_INVITE_OVER: - int minimumTeamSize = BATTLEFIELD_MINIMUM_TEAM_SIZE; - if (getConfigSetting("GameServer", "BfMinimumTeamSize") != null && (getConfigSetting("GameServer", "BfMinimumTeamSize")).length() > 0) - { - minimumTeamSize = utils.stringToInt(getConfigSetting("GameServer", "BfMinimumTeamSize")); - } + int minimumTeamSize = BATTLEFIELD_MINIMUM_TEAM_SIZE_OVERRIDE; extra = "checkBattlefieldState Invitations over. minimumTeamSize: " + minimumTeamSize; if (bfActiveGetRebelCount(self) < minimumTeamSize || bfActiveGetImperialCount(self) < minimumTeamSize) { @@ -970,11 +968,7 @@ public class pvp_battlefield extends script.base_script } int rebelPlayersSize = bfQueueGetSize(controller, BATTLEFIELD_REBEL_INDIVIDUAL_QUEUE); int imperialPlayersSize = bfQueueGetSize(controller, BATTLEFIELD_IMPERIAL_INDIVIDUAL_QUEUE); - int minimumTeamSize = BATTLEFIELD_MINIMUM_TEAM_SIZE; - if (getConfigSetting("GameServer", "BfMinimumTeamSize") != null && (getConfigSetting("GameServer", "BfMinimumTeamSize")).length() > 0) - { - minimumTeamSize = utils.stringToInt(getConfigSetting("GameServer", "BfMinimumTeamSize")); - } + int minimumTeamSize = BATTLEFIELD_MINIMUM_TEAM_SIZE_OVERRIDE; if (rebelPlayersSize < minimumTeamSize || imperialPlayersSize < minimumTeamSize) { return false; @@ -988,11 +982,7 @@ public class pvp_battlefield extends script.base_script imperials.setSize(0); int potentialRebels = 0; int potentialImperials = 0; - int maxTeamSize = BATTLEFIELD_MAXIMUM_TEAM_SIZE; - if (getConfigSetting("GameServer", "BfTeamSize") != null && (getConfigSetting("GameServer", "BfTeamSize")).length() > 0) - { - maxTeamSize = utils.stringToInt(getConfigSetting("GameServer", "BfTeamSize")); - } + int maxTeamSize = BATTLEFIELD_MAXIMUM_TEAM_SIZE_OVERRIDE; blog(controller, "bfQueueBuildPotentialEnemies maxTeamSize: " + maxTeamSize); for (int i = 0, j = (rebelPlayersSize < maxTeamSize - potentialRebels ? rebelPlayersSize : maxTeamSize - potentialRebels); i < j; i++) { diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_controller.java b/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_controller.java index 1136dabe4..b5dc497da 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_controller.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_controller.java @@ -7,18 +7,21 @@ import script.obj_id; public class battle_controller extends script.base_script { - public final int DEFAULT_TATOOINE_DELAY = 3; - public final int DEFAULT_CORELLIA_DELAY = 3; - public final int DEFAULT_DANTOOINE_DELAY = 3; - public final int DEFAULT_LOK_DELAY = 3; - public final int DEFAULT_NABOO_DELAY = 3; - - public final int DEFAULT_TATOOINE_STAGGER = 0; - public final int DEFAULT_CORELLIA_STAGGER = 2; - public final int DEFAULT_DANTOOINE_STAGGER = 0; - public final int DEFAULT_LOK_STAGGER = 2; - public final int DEFAULT_NABOO_STAGGER = 4; - + public static final boolean TATOOINE_ACTIVE = utils.checkConfigFlag("GameServer", "spaceGcwTatooineActive"); + public static final boolean CORELLIA_ACTIVE = utils.checkConfigFlag("GameServer", "spaceGcwCorelliaActive"); + public static final boolean DANTOOINE_ACTIVE = utils.checkConfigFlag("GameServer", "spaceGcwDantooineActive"); + public static final boolean LOK_ACTIVE = utils.checkConfigFlag("GameServer", "spaceGcwLokActive"); + public static final boolean NABOO_ACTIVE = utils.checkConfigFlag("GameServer", "spaceGcwNabooActive"); + public static final int TATOOINE_DELAY = utils.getIntConfigSetting("GameServer", "spaceGcwTatooineDelay", 3); + public static final int CORELLIA_DELAY = utils.getIntConfigSetting("GameServer", "spaceGcwCorelliaDelay", 3); + public static final int DANTOOINE_DELAY = utils.getIntConfigSetting("GameServer", "spaceGcwDantooineDelay", 3); + public static final int LOK_DELAY = utils.getIntConfigSetting("GameServer", "spaceGcwLokDelay", 3); + public static final int NABOO_DELAY = utils.getIntConfigSetting("GameServer", "spaceGcwNabooDelay", 3); + public static final int TATOOINE_STAGGER = utils.getIntConfigSetting("GameServer", "spaceGcwTatooineStagger", 0); + public static final int CORELLIA_STAGGER = utils.getIntConfigSetting("GameServer", "spaceGcwCorelliaStagger", 2); + public static final int DANTOOINE_STAGGER = utils.getIntConfigSetting("GameServer", "spaceGcwDantooineStagger", 0); + public static final int LOK_STAGGER = utils.getIntConfigSetting("GameServer", "spaceGcwLokStagger", 2); + public static final int NABOO_STAGGER = utils.getIntConfigSetting("GameServer", "spaceGcwNabooStagger", 4); // Configuration Array: // 1. Zone. // 2. Initial Battle Type. @@ -29,23 +32,6 @@ public class battle_controller extends script.base_script { {"space_lok", battle_spawner.BATTLE_TYPE_PVP}, {"space_naboo", battle_spawner.BATTLE_TYPE_PVE} }; - public boolean tatooineActive = true; - public boolean corelliaActive = true; - public boolean dantooineActive = true; - public boolean lokActive = true; - public boolean nabooActive = true; - - public int tatooineDelay = 3; - public int corelliaDelay = 3; - public int dantooineDelay = 3; - public int lokDelay = 3; - public int nabooDelay = 3; - - public int tatooineStagger = 0; - public int corelliaStagger = 2; - public int dantooineStagger = 0; - public int lokStagger = 2; - public int nabooStagger = 4; public int OnAttach(obj_id self) throws InterruptedException { @@ -62,7 +48,6 @@ public class battle_controller extends script.base_script { int[] convertedCalendarTime = player_structure.convertSecondsTime(calendarTime); //float minutesToTopOfHour = 59 - convertedCalendarTime[2]; float minutesToTopOfHour = 0; - getSettings(); LOG("space_gcw", "battle_controller.OnInitialize: Starting check for battle status in roughly " + minutesToTopOfHour + " minutes."); // check battle status at the top of the hour messageTo(self, "checkBattleStatus", null, minutesToTopOfHour * 60.0f, false); @@ -182,15 +167,15 @@ public class battle_controller extends script.base_script { public int getHoursBetweenBattles(String scene){ switch(scene){ case "space_tatooine": - return tatooineDelay; + return TATOOINE_DELAY; case "space_corellia": - return corelliaDelay; + return CORELLIA_DELAY; case "space_dantooine": - return dantooineDelay; + return DANTOOINE_DELAY; case "space_lok": - return lokDelay; + return LOK_DELAY; case "space_naboo": - return nabooDelay; + return NABOO_DELAY; default: return 0; } @@ -198,15 +183,15 @@ public class battle_controller extends script.base_script { public boolean isSceneActive(String zone) { switch(zone){ case "space_tatooine": - return tatooineActive; + return TATOOINE_ACTIVE; case "space_corellia": - return corelliaActive; + return CORELLIA_ACTIVE; case "space_dantooine": - return dantooineActive; + return DANTOOINE_ACTIVE; case "space_lok": - return lokActive; + return LOK_ACTIVE; case "space_naboo": - return nabooActive; + return NABOO_ACTIVE; } return true; } @@ -221,53 +206,19 @@ public class battle_controller extends script.base_script { int stagger = 0; switch(zone){ case "space_tatooine": - return tatooineStagger; + return TATOOINE_STAGGER; case "space_corellia": - return corelliaStagger; + return CORELLIA_STAGGER; case "space_dantooine": - return dantooineStagger; + return DANTOOINE_STAGGER; case "space_lok": - return lokStagger; + return LOK_STAGGER; case "space_naboo": - return nabooStagger; + return NABOO_STAGGER; } return stagger; } - public void getSettings() throws InterruptedException { - LOG("space_gcw", "battle_controller.getSettings: The space battle sequencer object is getting settings."); - - // check which zones are active - tatooineActive = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwTatooineActive")) > 0; - corelliaActive = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwCorelliaActive")) > 0; - dantooineActive = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwDantooineActive")) > 0; - lokActive = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwLokActive")) > 0; - nabooActive = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwNabooActive")) > 0; - - tatooineDelay = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwTatooineDelay")); - if(tatooineDelay < 0) tatooineDelay = DEFAULT_TATOOINE_DELAY; - corelliaDelay = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwCorelliaDelay")); - if(corelliaDelay < 0) corelliaDelay = DEFAULT_CORELLIA_DELAY; - dantooineDelay = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwDantooineDelay")); - if(dantooineDelay < 0) dantooineDelay = DEFAULT_DANTOOINE_DELAY; - lokDelay = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwLokDelay")); - if(lokDelay < 0) lokDelay = DEFAULT_LOK_DELAY; - nabooDelay = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwNabooDelay")); - if(nabooDelay < 0) nabooDelay = DEFAULT_NABOO_DELAY; - - tatooineStagger = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwTatooineStagger")); - if(tatooineStagger < 0) tatooineStagger = DEFAULT_TATOOINE_STAGGER; - corelliaStagger = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwCorelliaStagger")); - if(corelliaStagger < 0) corelliaStagger = DEFAULT_CORELLIA_STAGGER; - dantooineStagger = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwDantooineStagger")); - if(dantooineStagger < 0) dantooineStagger = DEFAULT_DANTOOINE_STAGGER; - lokStagger = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwLokStagger")); - if(lokStagger < 0) lokStagger = DEFAULT_LOK_STAGGER; - nabooStagger = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwNabooStagger")); - if(nabooStagger < 0) nabooStagger = DEFAULT_NABOO_STAGGER; - LOG("space_gcw", "battle_controller.getSettings: The space battle sequencer object has finished getting settings."); - - } /* * Helper method for command: * /spaceBattleStatus diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_spawner.java b/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_spawner.java index 1b3649f09..6bbf97b43 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_spawner.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/space/battle_spawner.java @@ -9,27 +9,28 @@ import java.util.List; import java.util.Vector; public class battle_spawner extends script.base_class { + public static final String CONTROLLER_SCRIPT = "systems.gcw.space.battle_controller"; public static final String IMPERIAL_SHIP_TEMPLATE = "imperial_lancer"; public static final String REBEL_SHIP_TEMPLATE = "nebulon_frigate"; private static final String HERO_PILOT_DATA = "datatables/npc/space/space_gcw_hero.iff"; - public static float DEFAULT_BATTLE_TIME_PREPATORY = 900.0f; // 900 == 15 minutes - public static float DEFAULT_BATTLE_TIME_LENGTH = 3600.0f; // 3600 == 60 minutes - public static int DEFAULT_MAX_SUPPORT_CRAFT = 30; - public static int DEFAULT_MAX_SUPPORT_SPAWN = 60; public static final double HERO_SPAWN_CHANCE = 0.20d; // 0.20d == 20% chance a hero will spawn - public static final float DEFAULT_PVP_POINT_MULTIPLIER = 2.0f; - public static final float DEFAULT_PVE_POINT_MULTIPLIER = 1.0f; - public static final float DEFAULT_PVP_TOKEN_MULTIPLIER = 2.0f; - public static final float DEFAULT_PVE_TOKEN_MULTIPLIER = 1.0f; - public static final float DEFAULT_WIN_POINT_MULTIPLIER = 2.0f; - public static final float DEFAULT_LOSS_POINT_MULTIPLIER = 1.0f; - public static final float DEFAULT_WIN_TOKEN_MULTIPLIER = 2.0f; - public static final float DEFAULT_LOSS_TOKEN_MULTIPLIER = 1.0f; - public static final int DEFAULT_POB_PLAYER_CEILING = 4; - public static final int DEFAULT_GUNSHIP_PLAYER_CEILING = 10; - public static final int DEFAULT_TOKEN_AWARD = 25; - public static final int DEFAULT_POINT_AWARD = 2500; + public static final int DEFAULT_POINT_AWARD = utils.getIntConfigSetting("GameServer", "spaceGcwPointAward", 2500); + public static final int DEFAULT_TOKEN_AWARD = utils.getIntConfigSetting("GameServer", "spaceGcwTokenAward", 25); + public static final float PVP_POINT_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwPvPPointModifier", 2.0f); + public static final float PVE_POINT_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwPvEPointModifier", 1.0f); + public static final float WIN_POINT_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwWinPointModifier", 2.0f); + public static final float LOSS_POINT_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwLossPointModifier", 1.0f); + public static final float PVP_TOKEN_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwPvPTokenModifier", 2.0f); + public static final float PVE_TOKEN_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwPvETokenModifier", 1.0f); + public static final float WIN_TOKEN_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwWinTokenModifier", 2.0f); + public static final float LOSS_TOKEN_MULTIPLIER = utils.getFloatConfigSetting("GameServer", "spaceGcwLossTokenModifier", 1.0f); + public static final int POB_PLAYER_CEILING = utils.getIntConfigSetting("GameServer", "spaceGcwPobPlayerCeiling", 4); + public static final int GUNSHIP_PLAYER_CEILING = utils.getIntConfigSetting("GameServer", "spaceGcwGunshipPlayerCeiling", 10); + public static final float PREP_TIME = utils.getFloatConfigSetting("GameServer", "spaceGcwPrepatoryTime", 900.0f); // 15 mins in seconds + public static final float BATTLE_TIME = utils.getFloatConfigSetting("GameServer", "spaceGcwLengthOfBattle", 3600.0f); // 60 mins in seconds + public static final int MAX_SUPPORT_SHIPS = utils.getIntConfigSetting("GameServer", "spaceGcwMaxSupportShips", 30); + public static final int MAX_SUPPORT_SPAWNS = utils.getIntConfigSetting("GameServer", "spaceGcwTotalSupportSpawn", 60); public static final String[] IMPERIAL_SUPPORT_CRAFT = { "tieaggressor_tier7", @@ -78,23 +79,6 @@ public class battle_spawner extends script.base_class { BATTLE_TYPE_PVP }; - public float customPveBattleModifier; - public float customPvpBattleModifier; - public float customPvePointModifier; - public float customPvpPointModifier; - public float customWinTokenModifier; - public float customLossTokenModifier; - public float customWinPointModifier; - public float customLossPointModifier; - public int pobPlayerCeiling; - public int gunshipPlayerCeiling; - public int customTokenAward; - public int customPointAward; - public float battleTimeLength; - public float prepatoryTimeLength; - public static int maxSupportShips; - public static int maxSupportSpawn; - // This script is the spawner for the Space GCW (GCW 2) battles. // It uses Tatooine to track battles (the controller) and places the following object vars // on the planet object to keep track of various aspects: @@ -115,7 +99,6 @@ public class battle_spawner extends script.base_class { setObjVar(self, "controller", controller); setObjVar(controller, "space_gcw." + battleLocation.area + ".spawner", self); spaceLog( "--- Registering battle spawner (" + self + ") in zone: " + battleLocation.area); - getSettings(); return SCRIPT_CONTINUE; } public int startSpaceGCWBattle(obj_id self, dictionary params) throws InterruptedException { @@ -178,8 +161,8 @@ public class battle_spawner extends script.base_class { params.put("defendingShip", defendingShip); // spawn attacking capital ship - spaceLog( "In startSpaceGCWBattle... starting battle in " + prepatoryTimeLength / 60.0f + " minutes."); - messageTo(self, "spawnAttack", params, prepatoryTimeLength, false); + spaceLog( "In startSpaceGCWBattle... starting battle in " + PREP_TIME / 60.0f + " minutes."); + messageTo(self, "spawnAttack", params, PREP_TIME, false); return SCRIPT_CONTINUE; } @@ -234,7 +217,7 @@ public class battle_spawner extends script.base_class { messageTo(self, "spawnSupportCraft", params, 20.0f, false); // set timer to keep track of battle time - set config value for length of battle - messageTo(self, "endBattle", params, battleTimeLength, false); + messageTo(self, "endBattle", params, BATTLE_TIME, false); return SCRIPT_CONTINUE; } @@ -271,7 +254,7 @@ public class battle_spawner extends script.base_class { int totalSpawnedThisFight = 0; if(hasObjVar(motherShip, "totalSpawnedSupportCraft")){ totalSpawnedThisFight = getIntObjVar(motherShip, "totalSpawnedSupportCraft"); - if(totalSpawnedThisFight >= maxSupportSpawn) + if(totalSpawnedThisFight >= MAX_SUPPORT_SPAWNS) return getResizeableObjIdArrayObjVar(motherShip, "supportCraft"); } Vector shipList = getResizeableObjIdArrayObjVar(motherShip, "supportCraft"); @@ -283,14 +266,14 @@ public class battle_spawner extends script.base_class { } obj_id ship; - for (int i = shipList.size(); i < maxSupportShips; i++) { + for (int i = shipList.size(); i < MAX_SUPPORT_SHIPS; i++) { if (heroSpawned || Math.random() > HERO_SPAWN_CHANCE) { ship = spawnStandardShip(motherShip); - spaceLog( "In spawnSupportShips... just spawned a regular ship (" + ship + ":" + getTemplateName(ship) + ") #" + (i+1) + " / " + maxSupportShips + " ships."); + spaceLog( "In spawnSupportShips... just spawned a regular ship (" + ship + ":" + getTemplateName(ship) + ") #" + (i+1) + " / " + MAX_SUPPORT_SHIPS + " ships."); } else { ship = spawnAcePilot(motherShip); heroSpawned = true; - spaceLog( "In spawnSupportShips... just spawned a hero ship (" + ship + ":" + getName(ship) + ") #" + (i+1) + " / " + maxSupportShips + " ships."); + spaceLog( "In spawnSupportShips... just spawned a hero ship (" + ship + ":" + getName(ship) + ") #" + (i+1) + " / " + MAX_SUPPORT_SHIPS + " ships."); } if(isValidId(ship)) { totalSpawnedThisFight++; @@ -305,7 +288,7 @@ public class battle_spawner extends script.base_class { int totalSpawnedThisFight = 0; if(hasObjVar(motherShip, "totalSpawnedSupportCraft")){ totalSpawnedThisFight = getIntObjVar(motherShip, "totalSpawnedSupportCraft"); - if(totalSpawnedThisFight >= maxSupportSpawn) + if(totalSpawnedThisFight >= MAX_SUPPORT_SPAWNS) return null; } obj_id ship = createUnit(motherShip, support_ship_types[rand(0, support_ship_types.length - 1)], 200.0f); @@ -320,7 +303,7 @@ public class battle_spawner extends script.base_class { int totalSpawnedThisFight = 0; if(hasObjVar(motherShip, "totalSpawnedSupportCraft")){ totalSpawnedThisFight = getIntObjVar(motherShip, "totalSpawnedSupportCraft"); - if(totalSpawnedThisFight >= maxSupportSpawn) + if(totalSpawnedThisFight >= MAX_SUPPORT_SPAWNS) return null; } dictionary pilot = choosePilot(getAcePilotList(motherShip)); @@ -434,7 +417,7 @@ public class battle_spawner extends script.base_class { pointAwardedPlayers.addAll( processShip( getObjVarList(self, "space_gcw.participant." + battleId), - pobPlayerCeiling, + POB_PLAYER_CEILING, self, pointAwardedPlayers, attackingFaction, @@ -450,7 +433,7 @@ public class battle_spawner extends script.base_class { pointAwardedPlayers.addAll( processShip( getObjVarList(self, "space_gcw.gunship.participant." + battleId), - gunshipPlayerCeiling, + GUNSHIP_PLAYER_CEILING, self, pointAwardedPlayers, attackingFaction, @@ -465,7 +448,7 @@ public class battle_spawner extends script.base_class { // distribute to pob qualifiers processShip( getObjVarList(self, "space_gcw.pob.participant." + battleId), - pobPlayerCeiling, + POB_PLAYER_CEILING, self, pointAwardedPlayers, attackingFaction, @@ -621,18 +604,18 @@ public class battle_spawner extends script.base_class { public int calculateAwardedPoints(boolean wonBattle, String battleType) { if(!wonBattle){ if(battleType.equals(BATTLE_TYPE_PVE)){ - return Float.valueOf(customPointAward * customPvePointModifier * customLossPointModifier).intValue(); + return Float.valueOf(DEFAULT_POINT_AWARD * PVE_POINT_MULTIPLIER * LOSS_POINT_MULTIPLIER).intValue(); } else{ - return Float.valueOf(customPointAward * customPvpPointModifier * customLossPointModifier).intValue(); + return Float.valueOf(DEFAULT_POINT_AWARD * PVP_POINT_MULTIPLIER * LOSS_POINT_MULTIPLIER).intValue(); } } else{ if(battleType.equals(BATTLE_TYPE_PVE)){ - return Float.valueOf(customPointAward * customPvePointModifier * customWinPointModifier).intValue(); + return Float.valueOf(DEFAULT_POINT_AWARD * PVE_POINT_MULTIPLIER * WIN_POINT_MULTIPLIER).intValue(); } else{ - return Float.valueOf(customPointAward * customPvpPointModifier * customWinPointModifier).intValue(); + return Float.valueOf(DEFAULT_POINT_AWARD * PVP_POINT_MULTIPLIER * WIN_POINT_MULTIPLIER).intValue(); } } @@ -640,18 +623,18 @@ public class battle_spawner extends script.base_class { public int calculateAwardedTokens(boolean wonBattle, String battleType, String faction) { if(!wonBattle){ if(battleType.equals(BATTLE_TYPE_PVE)){ - return Float.valueOf(customTokenAward * customPveBattleModifier * customLossTokenModifier).intValue(); + return Float.valueOf(DEFAULT_TOKEN_AWARD * PVE_TOKEN_MULTIPLIER * LOSS_TOKEN_MULTIPLIER).intValue(); } else{ - return Float.valueOf(customTokenAward * customPvpBattleModifier * customLossTokenModifier).intValue(); + return Float.valueOf(DEFAULT_TOKEN_AWARD * PVP_TOKEN_MULTIPLIER * LOSS_TOKEN_MULTIPLIER).intValue(); } } else{ if(battleType.equals(BATTLE_TYPE_PVE)){ - return Float.valueOf(customTokenAward * customPveBattleModifier * customWinTokenModifier).intValue(); + return Float.valueOf(DEFAULT_TOKEN_AWARD * PVE_TOKEN_MULTIPLIER * WIN_TOKEN_MULTIPLIER).intValue(); } else{ - return Float.valueOf(customTokenAward * customPvpBattleModifier * customWinTokenModifier).intValue(); + return Float.valueOf(DEFAULT_TOKEN_AWARD * PVP_TOKEN_MULTIPLIER * WIN_TOKEN_MULTIPLIER).intValue(); } } @@ -769,56 +752,4 @@ public class battle_spawner extends script.base_class { LOG("space_gcw", "Zone " + zone + ": " + message); } - public void getSettings() throws InterruptedException { - spaceLog( "Getting Settings..."); - // get customized settings - customPveBattleModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwPvETokenModifier")); - if (customPveBattleModifier < 0) customPveBattleModifier = DEFAULT_PVE_TOKEN_MULTIPLIER; - - customPvpBattleModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwPvPTokenModifier")); - if (customPvpBattleModifier < 0) customPvpBattleModifier = DEFAULT_PVP_TOKEN_MULTIPLIER; - - customWinTokenModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwWinTokenModifier")); - if (customWinTokenModifier < 0) customWinTokenModifier = DEFAULT_WIN_TOKEN_MULTIPLIER; - - customLossTokenModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwLossTokenModifier")); - if (customLossTokenModifier < 0) customLossTokenModifier = DEFAULT_LOSS_TOKEN_MULTIPLIER; - - customTokenAward = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwTokenAward")); - if (customTokenAward < 0) customTokenAward = DEFAULT_TOKEN_AWARD; - - customPointAward = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwPointAward")); - if (customPointAward < 0) customPointAward = DEFAULT_POINT_AWARD; - - customPvePointModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwPvEPointModifier")); - if (customPvePointModifier < 0) customPvePointModifier = DEFAULT_PVE_POINT_MULTIPLIER; - - customPvpPointModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwPvPPointModifier")); - if (customPvpPointModifier < 0) customPvpPointModifier = DEFAULT_PVP_POINT_MULTIPLIER; - - customWinPointModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwWinPointModifier")); - if (customWinPointModifier < 0) customWinPointModifier = DEFAULT_WIN_POINT_MULTIPLIER; - - customLossPointModifier = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwLossPointModifier")); - if (customLossPointModifier < 0) customLossPointModifier = DEFAULT_LOSS_POINT_MULTIPLIER; - - pobPlayerCeiling = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwPobPlayerCeiling")); - if (pobPlayerCeiling < 0) pobPlayerCeiling = DEFAULT_POB_PLAYER_CEILING; - - gunshipPlayerCeiling = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwGunshipPlayerCeiling")); - if (gunshipPlayerCeiling < 0) gunshipPlayerCeiling = DEFAULT_GUNSHIP_PLAYER_CEILING; - - battleTimeLength = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwLengthOfBattle")); - if (battleTimeLength <= 0) battleTimeLength = DEFAULT_BATTLE_TIME_LENGTH; - - prepatoryTimeLength = utils.stringToFloat(getConfigSetting("GameServer", "spaceGcwPrepatoryTime")); - if (prepatoryTimeLength <= 0) prepatoryTimeLength = DEFAULT_BATTLE_TIME_PREPATORY; - - maxSupportShips = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwMaxSupportShips")); - if (maxSupportShips <= 0) maxSupportShips = DEFAULT_MAX_SUPPORT_CRAFT; - - maxSupportSpawn = utils.stringToInt(getConfigSetting("GameServer", "spaceGcwTotalSupportSpawn")); - if (maxSupportSpawn <= 0) maxSupportSpawn = DEFAULT_MAX_SUPPORT_SPAWN; - spaceLog( "Done getting settings..."); - } } diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_spawner.java b/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_spawner.java index 7e648b7a4..da0e33ead 100755 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_spawner.java +++ b/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_spawner.java @@ -3,6 +3,7 @@ package script.systems.gcw.static_base; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.spawning; import script.library.utils; import script.location; import script.obj_id; @@ -223,15 +224,6 @@ public class base_spawner extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableGenericSpawner"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.GENERIC_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java index 80cc033d8..d9f8ee619 100755 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java +++ b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java @@ -1,6 +1,7 @@ package script.systems.missions.dynamic; import script.library.create; +import script.library.events; import script.library.locations; import script.location; import script.obj_id; @@ -12,23 +13,19 @@ public class deliver_npc_spawner extends script.base_script } public int OnAttach(obj_id self) throws InterruptedException { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null) + if (events.isEventActive(events.EMPIRE_DAY)) { - if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) + location here = getLocation(self); + String city = locations.getCityName(here); + if (city == null) { - location here = getLocation(self); - String city = locations.getCityName(here); - if (city == null) + city = locations.getGuardSpawnerRegionName(here); + } + if (city != null && city.length() > 0) + { + if (city.equals("theed")) { - city = locations.getGuardSpawnerRegionName(here); - } - if (city != null && city.length() > 0) - { - if (city.equals("theed")) - { - return SCRIPT_CONTINUE; - } + return SCRIPT_CONTINUE; } } } diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.java index fce55397f..8d0ecd696 100755 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.java +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_base.java @@ -13,21 +13,21 @@ public class spawn_base extends script.base_script } public static final int SPAWN_HEARBEAT_SPAWN_EVENT = 5; public static final int SPAWN_PLAYER_DELAY_MIN = 30; - public static final int SPAWN_PLAYER_DELAY_MAX = 60; + public static final int SPAWN_PLAYER_DELAY_MAX = 60; // delay for spawn_player spawn events public static final int SPAWN_DISTANCE_MIN = 12; - public static final int SPAWN_DISTANCE_MAX = 32; - public static final int SPAWN_CHECK_DISTANCE = 64; - public static final int SPAWN_CHECK_LIMIT = 15; + public static final int SPAWN_DISTANCE_MAX = 32; // for use until we get findvalidlocation + public static final int SPAWN_CHECK_DISTANCE = 64; // you must move X meters before you get more spawns after the limit + public static final int SPAWN_CHECK_LIMIT = 15; // you get X creatures! public static final int SPAWN_TEMPLATE_CHECK_DISTANCE = 128; - public static final int SPAWN_CHECK_TEMPLATE_LIMIT = 14; + public static final int SPAWN_CHECK_TEMPLATE_LIMIT = 14; // 14 templates allowed in an area public static final int SPAWN_THEATER_CHECK_DISTANCE = 200; public static final int SPAWN_CHECK_THEATER_LIMIT = 1; - public static final int EXTERIOR_SPAWN_CHANCE = 50; + public static final int EXTERIOR_SPAWN_CHANCE = 50; // chance of spawning something outside of a structure public static final int EXTERIOR_MAX_NPC = 10; public static final int INTERIOR_MAX_NPC = 10; public static final int EXTERIOR_MIN_NPC = 4; public static final int INTERIOR_MIN_NPC = 4; - public static final int PLAYER_TO_NPC_RATIO = 1; + public static final int PLAYER_TO_NPC_RATIO = 1; // for every 1 player, we decrease our max and min by 1 public static final boolean boolFastSpawnEnabled = false; public static final int MAXIMUM_SPAWNING_RUN_TIME_RULES = 200; public static final float CREATURES_TO_PLAYERS_RATIO = 20; @@ -35,6 +35,14 @@ public class spawn_base extends script.base_script { "tutorial" }; + + /** + this function takes the obj_id of the player, and the obj_id of the master spawn object. It will eventually take a region object id, which will contain the necessary + spawn list information. Using this information, it culls out any templates at their max, as well as checks against the global spawn count. It then returns a dictionary with two elements + The first is an array of template id's, and the second element is the number of elements in the array. This is because we don't have any sort of dynamically resizable arrays + Eventually this function will also handle all culling based on player difficulty and factional data. + @return dictionary Contains string array strSpawnTypes, and intSpawnListSize + */ public int[] getValidSpawn(dictionary dctPlayerStats) throws InterruptedException { if (dctPlayerStats == null) @@ -466,8 +474,7 @@ public class spawn_base extends script.base_script { } public boolean checkSpawnLogFailures() throws InterruptedException { - String strConfigSetting = getConfigSetting("GameServer", "fastSpawn"); - return strConfigSetting != null && strConfigSetting.equals("true"); + return spawning.FAST_SPAWN; } public boolean isSpawningAllowed(location locTest) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_master.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_master.java index 6665f125f..5701ce05d 100755 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_master.java +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_master.java @@ -1,5 +1,6 @@ package script.systems.spawning; +import script.library.spawning; import script.obj_id; public class spawn_master extends script.systems.spawning.spawn_base @@ -7,12 +8,12 @@ public class spawn_master extends script.systems.spawning.spawn_base public spawn_master() { } + + /** + Bootstrap function for trigger volume creation. This will be moved to OnInitialization once it comes online. + */ public int OnUniverseComplete(obj_id self) throws InterruptedException { - if (!hasObjVar(self, "boolSpawnerIsOn")) - { - setObjVar(self, "boolSpawnerIsOn", true); - } if (!hasObjVar(self, "intMaxPlanetSpawnCount")) { setObjVar(self, "intMaxPlanetSpawnCount", 10000); @@ -29,26 +30,21 @@ public class spawn_master extends script.systems.spawning.spawn_base setObjVar(self, "intCurrentPlanetSpawnCount", 0); setObjVar(self, "intMinSpawnDelay", SPAWN_PLAYER_DELAY_MIN); setObjVar(self, "intMaxSpawnDelay", SPAWN_PLAYER_DELAY_MAX); - String strConfigSetting = getConfigSetting("GameServer", "spawningInitialState"); - if (strConfigSetting != null) - { - if (strConfigSetting.equals("on")) - { - setObjVar(self, "boolSpawnerIsOn", true); - } - else if (strConfigSetting.equals("off")) - { - setObjVar(self, "boolSpawnerIsOn", false); - } + if (spawning.SPAWNER_INITIAL_STATE_OFF) { + setObjVar(self, "boolSpawnerIsOn", false); + } else { + setObjVar(self, "boolSpawnerIsOn", true); } return SCRIPT_CONTINUE; } + + /** + * This is the initialization routine for the entire spawn system. This creates the master trigger volumes, + * and initializes all necessary spawn values. The values are derived from spawn_base + * These will be moved once we get a more concrete idea of spawn listings. + */ public int OnAttach(obj_id self) throws InterruptedException { - if (!hasObjVar(self, "boolSpawnerIsOn")) - { - setObjVar(self, "boolSpawnerIsOn", true); - } if (!hasObjVar(self, "intMaxPlanetSpawnCount")) { setObjVar(self, "intMaxPlanetSpawnCount", 10000); @@ -65,17 +61,10 @@ public class spawn_master extends script.systems.spawning.spawn_base setObjVar(self, "intCurrentPlanetSpawnCount", 0); setObjVar(self, "intMinSpawnDelay", SPAWN_PLAYER_DELAY_MIN); setObjVar(self, "intMaxSpawnDelay", SPAWN_PLAYER_DELAY_MAX); - String strConfigSetting = getConfigSetting("GameServer", "spawningInitialState"); - if (strConfigSetting != null) - { - if (strConfigSetting.equals("on")) - { - setObjVar(self, "boolSpawnerIsOn", true); - } - else if (strConfigSetting.equals("off")) - { - setObjVar(self, "boolSpawnerIsOn", false); - } + if (spawning.SPAWNER_INITIAL_STATE_OFF) { + setObjVar(self, "boolSpawnerIsOn", false); + } else { + setObjVar(self, "boolSpawnerIsOn", true); } return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_area.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_area.java index b124fefd2..aa2875d8d 100755 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_area.java +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_area.java @@ -226,16 +226,7 @@ public class spawner_area extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } public int OnDestroy(obj_id self) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_patrol.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_patrol.java index 703e35c8c..2217ef017 100755 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_patrol.java +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_patrol.java @@ -370,8 +370,7 @@ public class spawner_patrol extends script.base_script return SCRIPT_CONTINUE; } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disablePatrolSpawners"); - return disableSpawners == null || !(disableSpawners.equals("true") || disableSpawners.equals("1")); + return !spawning.PATROL_SPAWNERS_DISABLED; } public int OnDestroy(obj_id self) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random.java index 2b0116498..84578f4bb 100755 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random.java +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random.java @@ -284,8 +284,7 @@ public class spawner_random extends script.base_script return SCRIPT_CONTINUE; } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - return disableSpawners == null || !(disableSpawners.equals("true") || disableSpawners.equals("1")); + return !spawning.AREA_SPAWNERS_DISABLED; } public int OnDestroy(obj_id self) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random_proxy.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random_proxy.java index 9e20dbce4..48f9e423b 100755 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random_proxy.java +++ b/sku.0/sys.server/compiled/game/script/systems/spawning/spawner_random_proxy.java @@ -357,8 +357,7 @@ public class spawner_random_proxy extends script.base_script return SCRIPT_CONTINUE; } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - return disableSpawners == null || !(disableSpawners.equals("true") || disableSpawners.equals("1")); + return !spawning.AREA_SPAWNERS_DISABLED; } public int OnDestroy(obj_id self) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/systems/storyteller/events/anniversary_event_nyms.java b/sku.0/sys.server/compiled/game/script/systems/storyteller/events/anniversary_event_nyms.java index cf4ad8f04..288a3ca89 100755 --- a/sku.0/sys.server/compiled/game/script/systems/storyteller/events/anniversary_event_nyms.java +++ b/sku.0/sys.server/compiled/game/script/systems/storyteller/events/anniversary_event_nyms.java @@ -5,28 +5,31 @@ import script.obj_id; public class anniversary_event_nyms extends script.base_script { + /** + * deprecated script + */ public anniversary_event_nyms() { } public int OnInitialize(obj_id self) throws InterruptedException { - if (!isObjectPersisted(self)) - { - messageTo(self, "handlePersistEventProp", null, 1, false); - } - String deleteEventProps = getConfigSetting("GameServer", "deleteEventProps"); - if (deleteEventProps != null && deleteEventProps.length() > 0) - { - if (deleteEventProps.equals("true") || deleteEventProps.equals("1")) - { - messageTo(self, "handleDeleteEventProps", null, 2, false); - } - } + //if (!isObjectPersisted(self)) + //{ + // messageTo(self, "handlePersistEventProp", null, 1, false); + //} + //String deleteEventProps = getConfigSetting("GameServer", "deleteEventProps"); + //if (deleteEventProps != null && deleteEventProps.length() > 0) + //{ + // if (deleteEventProps.equals("true") || deleteEventProps.equals("1")) + // { + // messageTo(self, "handleDeleteEventProps", null, 2, false); + // } + //} return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { - messageTo(self, "handlePersistEventProp", null, 1, false); + //messageTo(self, "handlePersistEventProp", null, 1, false); return SCRIPT_CONTINUE; } public int handlePersistEventProp(obj_id self, dictionary params) throws InterruptedException diff --git a/sku.0/sys.server/compiled/game/script/systems/turret/generic_turret_ai.java b/sku.0/sys.server/compiled/game/script/systems/turret/generic_turret_ai.java index b03b8fc50..1022dc123 100755 --- a/sku.0/sys.server/compiled/game/script/systems/turret/generic_turret_ai.java +++ b/sku.0/sys.server/compiled/game/script/systems/turret/generic_turret_ai.java @@ -1,5 +1,6 @@ package script.systems.turret; +import script.ai.ai; import script.combat_engine.attacker_data; import script.combat_engine.defender_data; import script.combat_engine.hit_result; @@ -216,7 +217,7 @@ public class generic_turret_ai extends script.systems.combat.combat_base_old } public int OnSawAttack(obj_id self, obj_id defender, obj_id[] attackers) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAICombat") != null) + if (ai.AI_COMBAT_DISABLED) { setWantSawAttackTriggers(self, false); return SCRIPT_CONTINUE; diff --git a/sku.0/sys.server/compiled/game/script/systems/turret/turret_ai.java b/sku.0/sys.server/compiled/game/script/systems/turret/turret_ai.java index ce36930e2..c31a51660 100755 --- a/sku.0/sys.server/compiled/game/script/systems/turret/turret_ai.java +++ b/sku.0/sys.server/compiled/game/script/systems/turret/turret_ai.java @@ -1,5 +1,6 @@ package script.systems.turret; +import script.ai.ai; import script.combat_engine.attacker_data; import script.combat_engine.defender_data; import script.combat_engine.hit_result; @@ -187,7 +188,7 @@ public class turret_ai extends script.systems.combat.combat_base_old } public int OnSawAttack(obj_id self, obj_id defender, obj_id[] attackers) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAICombat") != null) + if (ai.AI_COMBAT_DISABLED) { setWantSawAttackTriggers(self, false); return SCRIPT_CONTINUE; diff --git a/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java b/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java index 2862ad6ee..14dc66960 100755 --- a/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java +++ b/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java @@ -19,17 +19,9 @@ public class instant_travel_terminal_deed extends script.base_script } public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException { - // get the setting for minimum ITV level (if its not set, make it the max player level) - String minLevelSetting = getConfigSetting("GameServer", "itvMinUsageLevel"); - if(minLevelSetting == null) minLevelSetting = "0"; - int minimumLevel = Integer.parseInt(minLevelSetting); if (item == menu_info_types.ITEM_USE) { - if(getLevel(player) < minimumLevel){ - sendSystemMessage(player, "Instant Travel vehicles may not be used until you have reached level " + minLevelSetting + ". Please use this deed again when you reach level " + minLevelSetting + " or higher.", null); - return SCRIPT_CONTINUE; - } // Make sure the default_itv is always at the bottom of the table else you will get false hits int rows = dataTableGetNumRows(ITV_COMMAND_TABLE); for (int i=0;i 1) { @@ -120,7 +120,7 @@ public class gcw_supply_terminal extends script.base_script if (factions.isRebelorRebelHelper(player)) { sendSystemMessage(player, "You have recived an Rebel Token for your effort", null); - float multiplier = utils.stringToFloat(getConfigSetting("GameServer", "gcwTokenBonus")); + float multiplier = gcw.GCW_TOKEN_BONUS; int count = 1; if (multiplier > 1) { diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java index ad17b66d3..c08c000ed 100755 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java +++ b/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java @@ -2077,16 +2077,7 @@ public class terminal_character_builder extends script.base_script }; public boolean checkConfigSetting(String configString) throws InterruptedException { - String enabled = toLower(getConfigSetting("CharacterBuilder", configString)); - if (enabled == null) - { - return false; - } - if (enabled.equals("true") || enabled.equals("1")) - { - return true; - } - return false; + return utils.checkConfigFlag("CharacterBuilder", configString); } public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_kashyyyk_content.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_kashyyyk_content.java index 96950336a..2ec126d0a 100755 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_kashyyyk_content.java +++ b/sku.0/sys.server/compiled/game/script/terminal/terminal_kashyyyk_content.java @@ -665,16 +665,7 @@ public class terminal_kashyyyk_content extends script.base_script }; public boolean checkConfigSetting(String configString) throws InterruptedException { - String enabled = toLower(getConfigSetting("CharacterBuilder", configString)); - if (enabled == null) - { - return false; - } - if (enabled.equals("true") || enabled.equals("1")) - { - return true; - } - return false; + return utils.checkConfigFlag("CharacterBuilder", configString); } public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_travel.java index 72981c474..bcde337f7 100755 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel.java +++ b/sku.0/sys.server/compiled/game/script/terminal/terminal_travel.java @@ -49,13 +49,9 @@ public class terminal_travel extends script.base_script } } LOG("LOG_CHANNEL", "player ->" + player + " planet ->" + planet + " travel_point ->" + travel_point); - String config = getConfigSetting("GameServer", "disableTravelSystem"); - if (config != null) - { - if (config.equals("on")) - { - return SCRIPT_CONTINUE; - } + if(travel.TRAVEL_SYSTEM_DISABLED) { + sendSystemMessageTestingOnly(player, "The Travel System is currently unavailable. Please try again later."); + return SCRIPT_CONTINUE; } utils.setScriptVar(player, travel.SCRIPT_VAR_TERMINAL, self); enterClientTicketPurchaseMode(player, planet, travel_point, false); diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java index 5ade36370..228acef43 100755 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java +++ b/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java @@ -92,11 +92,9 @@ public class terminal_travel_instant extends script.base_script debugLogging("//***// OnObjectMenuSelect: ", "////>>>> city name at player's location is: " + travel_point); } LOG("LOG_CHANNEL", "player ->" + player + " planet ->" + planet + " travel_point ->" + travel_point); - String config = getConfigSetting("GameServer", "disableTravelSystem"); - if (config != null) { - if (config.equals("on")) { - return SCRIPT_CONTINUE; - } + if(travel.TRAVEL_SYSTEM_DISABLED) { + sendSystemMessageTestingOnly(player, "The Travel System is currently unavailable. Please try again later."); + return SCRIPT_CONTINUE; } utils.setScriptVar(player, travel.SCRIPT_VAR_TERMINAL, self); utils.setScriptVar(player, "instantTravel", true); diff --git a/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/kazic_pendre_area_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/kazic_pendre_area_spawner.java index 5ec14cd05..aab51c7c4 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/kazic_pendre_area_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/kazic_pendre_area_spawner.java @@ -3,6 +3,7 @@ package script.theme_park.corellia.content; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.spawning; import script.location; import script.obj_id; @@ -61,15 +62,6 @@ public class kazic_pendre_area_spawner extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/u13_ponda_gungan_statue_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/u13_ponda_gungan_statue_spawner.java index 708e33372..63ef03382 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/u13_ponda_gungan_statue_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/corellia/content/u13_ponda_gungan_statue_spawner.java @@ -1,6 +1,7 @@ package script.theme_park.corellia.content; import script.dictionary; +import script.library.spawning; import script.library.utils; import script.location; import script.obj_id; @@ -43,15 +44,6 @@ public class u13_ponda_gungan_statue_spawner extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_armorsmith_droid.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_armorsmith_droid.java index c27e4610a..49993a32e 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_armorsmith_droid.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_armorsmith_droid.java @@ -3,6 +3,7 @@ package script.theme_park.dungeon.death_watch_bunker; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.instance; import script.library.utils; import script.location; import script.obj_id; @@ -31,9 +32,7 @@ public class craft_armorsmith_droid extends script.base_script public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException { CustomerServiceLog("DUNGEON_DeathWatchBunker", "*Mandalorian Armor: Player %TU has put an item in the armorsmith droid"); - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } if (!hasSkill(giver, "class_munitions_phase4_master")) diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_droidengineer_droid.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_droidengineer_droid.java index 1e8adc37b..a145a41d0 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_droidengineer_droid.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_droidengineer_droid.java @@ -3,6 +3,7 @@ package script.theme_park.dungeon.death_watch_bunker; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.instance; import script.library.utils; import script.location; import script.obj_id; @@ -31,9 +32,7 @@ public class craft_droidengineer_droid extends script.base_script public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException { CustomerServiceLog("DUNGEON_DeathWatchBunker", "*Mandalorian Armor: Player %TU has put an item in the droidengineer droid"); - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } if (!hasSkill(giver, "class_engineering_phase4_master")) diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_jetpack_droid.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_jetpack_droid.java index f871a12af..dfe7ba007 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_jetpack_droid.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_jetpack_droid.java @@ -3,6 +3,7 @@ package script.theme_park.dungeon.death_watch_bunker; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.instance; import script.library.utils; import script.location; import script.obj_id; @@ -32,9 +33,7 @@ public class craft_jetpack_droid extends script.base_script public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException { CustomerServiceLog("DUNGEON_DeathWatchBunker", "*Mandalorian Armor: Player %TU has put an item in the jetpack droid"); - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } if (!hasSkill(giver, "class_engineering_phase1_master")) diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_tailor_droid.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_tailor_droid.java index abb086035..cf989f913 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_tailor_droid.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/craft_tailor_droid.java @@ -3,6 +3,7 @@ package script.theme_park.dungeon.death_watch_bunker; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.instance; import script.library.utils; import script.location; import script.obj_id; @@ -31,9 +32,7 @@ public class craft_tailor_droid extends script.base_script public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException { CustomerServiceLog("DUNGEON_DeathWatchBunker", "*Mandalorian Armor: Player %TU has put an item in the tailor droid", giver); - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } if (!hasSkill(giver, "class_domestics_phase4_master")) diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/leaving.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/leaving.java index 996b13048..0637816a3 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/leaving.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/leaving.java @@ -1,6 +1,7 @@ package script.theme_park.dungeon.death_watch_bunker; import script.dictionary; +import script.library.instance; import script.obj_id; import script.string_id; @@ -19,9 +20,7 @@ public class leaving extends script.base_script } if (!hasObjVar(item, "gm")) { - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { string_id locked = new string_id(MSGS, "no_entry"); sendSystemMessage(item, locked); return SCRIPT_OVERRIDE; diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/loot_chest.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/loot_chest.java index 7f0b27dfb..f06431362 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/loot_chest.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/death_watch_bunker/loot_chest.java @@ -2,6 +2,7 @@ package script.theme_park.dungeon.death_watch_bunker; import script.*; import script.library.create; +import script.library.instance; import script.library.permissions; import script.library.utils; @@ -175,9 +176,7 @@ public class loot_chest extends script.base_script } public obj_id spawnLoot(obj_id self) throws InterruptedException { - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return obj_id.NULL_ID; } String newLoot = pickNewLoot(); diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/empire_day_interior_npc_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/empire_day_interior_npc_spawner.java index 39fde0e31..132eedcea 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/empire_day_interior_npc_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/empire_day_interior_npc_spawner.java @@ -1,10 +1,7 @@ package script.theme_park.dungeon; import script.dictionary; -import script.library.ai_lib; -import script.library.create; -import script.library.holiday; -import script.library.utils; +import script.library.*; import script.location; import script.obj_id; @@ -308,8 +305,7 @@ public class empire_day_interior_npc_spawner extends script.base_script public boolean isEmpireDayRunning() throws InterruptedException { CustomerServiceLog("holidayEvent", "empire_day_interior_npc_spawner.isEmpireDayRunning: Initializing check for building."); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if(empiredayRunning == null || empiredayRunning.equals("0") || empiredayRunning.equals("false")){ + if(!events.isEventActive(events.EMPIRE_DAY)) { return false; } String empiredayString = getCurrentUniverseWideEvents(); @@ -317,16 +313,12 @@ public class empire_day_interior_npc_spawner extends script.base_script if (empireday < 0) { CustomerServiceLog("holidayEvent", "empire_day_interior_npc_spawner.isEmpireDayRunning: event is NOT runing or starting."); - if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) + if (events.isEventActive(events.EMPIRE_DAY)) { obj_id self = getSelf(); CustomerServiceLog("holidayEvent", "empire_day_interior_npc_spawner.isEmpireDayRunning: There is a config that shows the event is running. Sending a message to later to see if we tried to spawn too soon."); messageTo(self, "beginEmpireDaySpawning", null, (holiday.EMPIRE_DAY_EVENT_START_DELAY + 300), false); } - else - { - CustomerServiceLog("holidayEvent", "empire_day_interior_npc_spawner.isEmpireDayRunning: There is a config that shows the event is NOT running."); - } return false; } CustomerServiceLog("holidayEvent", "empire_day_interior_npc_spawner.isEmpireDayRunning: event is runing or starting."); diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/ep3_clone_relics_generic_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/ep3_clone_relics_generic_spawner.java index 6ad720b8d..142f309ad 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/ep3_clone_relics_generic_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/ep3_clone_relics_generic_spawner.java @@ -3,6 +3,7 @@ package script.theme_park.dungeon; import script.dictionary; import script.library.ai_lib; import script.library.create; +import script.library.instance; import script.library.utils; import script.location; import script.obj_id; @@ -17,9 +18,7 @@ public class ep3_clone_relics_generic_spawner extends script.base_script String name = getTemplateName(self); if (name.equals("object/building/general/bunker_allum_mine.iff")) { - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } } @@ -34,9 +33,7 @@ public class ep3_clone_relics_generic_spawner extends script.base_script String name = getTemplateName(self); if (name.equals("object/building/general/bunker_allum_mine.iff")) { - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/generic_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/generic_spawner.java index 9ada53efc..e82894293 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/generic_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/generic_spawner.java @@ -18,9 +18,7 @@ public class generic_spawner extends script.base_script { if (getTemplateName(self).equals("object/building/general/bunker_allum_mine.iff")) { - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } } @@ -38,9 +36,7 @@ public class generic_spawner extends script.base_script { if (getTemplateName(self).equals("object/building/general/bunker_allum_mine.iff")) { - String setting = getConfigSetting("Dungeon", "Death_Watch"); - if (setting == null || setting.equals("false") || setting.equals("0")) - { + if(!instance.DEATH_WATCH_DUNGEON_ENABLED) { return SCRIPT_CONTINUE; } } @@ -388,8 +384,7 @@ public class generic_spawner extends script.base_script } } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableGenericSpawner"); - return disableSpawners == null || !(disableSpawners.equals("true") || disableSpawners.equals("1")); + return !spawning.GENERIC_SPAWNERS_DISABLED; } public int getRandomPlanetCreatureLevel(obj_id spawner, String npcType, location here) throws InterruptedException { diff --git a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/geonosian_madbio_bunker/leaving.java b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/geonosian_madbio_bunker/leaving.java index 344d69c29..da1dae586 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/dungeon/geonosian_madbio_bunker/leaving.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/dungeon/geonosian_madbio_bunker/leaving.java @@ -1,6 +1,7 @@ package script.theme_park.dungeon.geonosian_madbio_bunker; import script.dictionary; +import script.library.instance; import script.obj_id; import script.string_id; @@ -19,8 +20,7 @@ public class leaving extends script.base_script } if (!hasObjVar(item, "gm")) { - String setting = getConfigSetting("Dungeon", "Geonosian"); - if (setting == null || setting.equals("false") || setting.equals("0")) + if (!instance.GEONOSIAN_BUNKER_ENABLED) { string_id locked = new string_id(MSGS, "no_entry"); sendSystemMessage(item, locked); diff --git a/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/bocctyyy_bet_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/bocctyyy_bet_spawner.java index d68554ea9..d565834f5 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/bocctyyy_bet_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/bocctyyy_bet_spawner.java @@ -150,15 +150,6 @@ public class bocctyyy_bet_spawner extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/hracca_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/hracca_spawner.java index ee0ad2472..04e75fe48 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/hracca_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/kashyyyk/hracca_spawner.java @@ -1,10 +1,7 @@ package script.theme_park.kashyyyk; import script.dictionary; -import script.library.ai_lib; -import script.library.create; -import script.library.space_dungeon; -import script.library.utils; +import script.library.*; import script.location; import script.obj_id; @@ -219,15 +216,6 @@ public class hracca_spawner extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_han_solo_banners.java b/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_han_solo_banners.java index aa440f4a7..ded51f91e 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_han_solo_banners.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_han_solo_banners.java @@ -1,6 +1,7 @@ package script.theme_park.rebel; import script.dictionary; +import script.library.spawning; import script.location; import script.obj_id; @@ -85,15 +86,6 @@ public class rtp_han_solo_banners extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_leia_crime_scene.java b/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_leia_crime_scene.java index 50fcf769d..14d09360d 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_leia_crime_scene.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_leia_crime_scene.java @@ -1,6 +1,7 @@ package script.theme_park.rebel; import script.dictionary; +import script.library.spawning; import script.location; import script.obj_id; @@ -83,15 +84,6 @@ public class rtp_leia_crime_scene extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_luke_plants.java b/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_luke_plants.java index b7cb83910..1fc92dfc7 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_luke_plants.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/rebel/rtp_luke_plants.java @@ -1,6 +1,7 @@ package script.theme_park.rebel; import script.dictionary; +import script.library.spawning; import script.location; import script.obj_id; @@ -81,15 +82,6 @@ public class rtp_luke_plants extends script.base_script } public boolean canSpawnByConfigSetting() throws InterruptedException { - String disableSpawners = getConfigSetting("GameServer", "disableAreaSpawners"); - if (disableSpawners == null) - { - return true; - } - if (disableSpawners.equals("true") || disableSpawners.equals("1")) - { - return false; - } - return true; + return !spawning.AREA_SPAWNERS_DISABLED; } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/script_spawner/spawner_methods/gcw_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/script_spawner/spawner_methods/gcw_spawner.java index 46d364e4c..3ba3614bb 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/script_spawner/spawner_methods/gcw_spawner.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/script_spawner/spawner_methods/gcw_spawner.java @@ -299,29 +299,25 @@ public class gcw_spawner extends script.base_script hard = true; } } - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null) + if (events.isEventActive(events.EMPIRE_DAY)) { - if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) + location here = getLocation(self); + String city = locations.getCityName(here); + if (city == null) { - location here = getLocation(self); - String city = locations.getCityName(here); - if (city == null) + city = locations.getGuardSpawnerRegionName(here); + } + if (city != null && city.length() > 0) + { + if (city.equals("coronet")) { - city = locations.getGuardSpawnerRegionName(here); + faction = "rebel"; + hard = false; } - if (city != null && city.length() > 0) + else if (city.equals("theed")) { - if (city.equals("coronet")) - { - faction = "rebel"; - hard = false; - } - else if (city.equals("theed")) - { - faction = "imperial"; - hard = false; - } + faction = "imperial"; + hard = false; } } } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/warren/cell_guard.java b/sku.0/sys.server/compiled/game/script/theme_park/warren/cell_guard.java index 9b522e0c4..d0f08243e 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/warren/cell_guard.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/warren/cell_guard.java @@ -1,5 +1,6 @@ package script.theme_park.warren; +import script.ai.ai; import script.library.ai_lib; import script.library.chat; import script.obj_id; @@ -21,7 +22,7 @@ public class cell_guard extends script.base_script { setObjVar(self, "ai.diction", "military"); } - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ALERT_VOLUME_NAME, 15.0f, true); createTriggerVolume(AGGRO_VOLUME_NAME, 8.0f, true); @@ -37,7 +38,7 @@ public class cell_guard extends script.base_script } public int OnInitialize(obj_id self) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ALERT_VOLUME_NAME, 15.0f, true); createTriggerVolume(AGGRO_VOLUME_NAME, 8.0f, true); diff --git a/sku.0/sys.server/compiled/game/script/theme_park/warren/doctor_knag.java b/sku.0/sys.server/compiled/game/script/theme_park/warren/doctor_knag.java index 2e79e04d9..2e19e736f 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/warren/doctor_knag.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/warren/doctor_knag.java @@ -1,5 +1,6 @@ package script.theme_park.warren; +import script.ai.ai; import script.library.ai_lib; import script.library.chat; import script.obj_id; @@ -16,7 +17,7 @@ public class doctor_knag extends script.base_script public static final String ACTION_THREATEN = "threaten"; public int OnAttach(obj_id self) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ALERT_VOLUME_NAME, 15.0f, true); } diff --git a/sku.0/sys.server/compiled/game/script/theme_park/warren/trooper.java b/sku.0/sys.server/compiled/game/script/theme_park/warren/trooper.java index 705936bc1..46b891047 100755 --- a/sku.0/sys.server/compiled/game/script/theme_park/warren/trooper.java +++ b/sku.0/sys.server/compiled/game/script/theme_park/warren/trooper.java @@ -1,5 +1,6 @@ package script.theme_park.warren; +import script.ai.ai; import script.library.ai_lib; import script.library.chat; import script.library.utils; @@ -22,7 +23,7 @@ public class trooper extends script.base_script { setObjVar(self, "ai.diction", "military"); } - if (getConfigSetting("GameServer", "disableAITriggerVolumes") == null) + if (!ai.AI_TRIGGER_VOLUMES_DISABLED) { createTriggerVolume(ALERT_VOLUME_NAME, 15.0f, true); } @@ -80,7 +81,7 @@ public class trooper extends script.base_script } public int OnSawAttack(obj_id self, obj_id defender, obj_id[] attackers) throws InterruptedException { - if (getConfigSetting("GameServer", "disableAICombat") != null) + if (ai.AI_COMBAT_DISABLED) { setWantSawAttackTriggers(self, false); return SCRIPT_OVERRIDE;