mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-13 04:13:01 -04:00
3.1 Config Refactor
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-10
@@ -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
|
||||
|
||||
@@ -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(""))
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
+1
-6
@@ -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
|
||||
{
|
||||
|
||||
+1
-6
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
+1
-6
@@ -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
|
||||
{
|
||||
|
||||
+1
-6
@@ -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
|
||||
{
|
||||
|
||||
+2
-10
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-10
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 <months>");
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 = "<unknown>";
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<String> 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
+2
-10
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-10
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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(""))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user