From 9eaf8af32861e4d774ccd7eb4c9592124d577725 Mon Sep 17 00:00:00 2001 From: Elour Date: Sat, 30 Mar 2019 10:31:42 -0700 Subject: [PATCH 1/5] Prevent players from receiving tokens from another instance Using client side modifications could allow players to move between instances, being in "range" of the next instance would provide the reward without ending the exploting player's timer --- .../compiled/game/script/player/player_instance.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sku.0/sys.server/compiled/game/script/player/player_instance.java b/sku.0/sys.server/compiled/game/script/player/player_instance.java index a4ef083fb..4b4f45474 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_instance.java +++ b/sku.0/sys.server/compiled/game/script/player/player_instance.java @@ -705,6 +705,15 @@ public class player_instance extends script.base_script } public int handleAwardtoken(obj_id self, dictionary params) throws InterruptedException { + obj_id instanceController = instance.getAreaInstanceController(self); + if (!isIdValid(instanceController)) + { + return SCRIPT_CONTINUE; + } + if (!instance.isPlayerInPlayerList(self, instance.getPlayerList(instanceController))) + { + return SCRIPT_CONTINUE; + } int tokenIndex = params.getInt("tokenIndex"); int count = 1; if (params.containsKey("tokenCount")) From dcdb80f8ff639aa9bb685983f35d3d0260a46d77 Mon Sep 17 00:00:00 2001 From: Elour Date: Sat, 30 Mar 2019 10:39:11 -0700 Subject: [PATCH 2/5] Prevents picking up storyteller objects placed in houses Players were able to pick up storyteller objects, which broke the timer and prevented them from being automatically destroyed. This prevents the initial pickup. --- .../game/script/systems/storyteller/prop_controller.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sku.0/sys.server/compiled/game/script/systems/storyteller/prop_controller.java b/sku.0/sys.server/compiled/game/script/systems/storyteller/prop_controller.java index 7f39faa15..79ac6a6d6 100755 --- a/sku.0/sys.server/compiled/game/script/systems/storyteller/prop_controller.java +++ b/sku.0/sys.server/compiled/game/script/systems/storyteller/prop_controller.java @@ -23,6 +23,14 @@ public class prop_controller extends script.base_script messageTo(self, "handleStorytellerPropInitialize", null, 5, false); return SCRIPT_CONTINUE; } + public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException + { + if (isPlayer(getContainedBy(destContainer))) + { + return SCRIPT_OVERRIDE; + } + return SCRIPT_CONTINUE; + } public int handleStorytellerPropInitialize(obj_id self, dictionary params) throws InterruptedException { if (!hasObjVar(self, "eventTeamCleaupOverride") && !utils.hasScriptVar(self, "storytellerOnAttachFired")) From b358dfe3565e556734eb60c36d4f4d53ed13396c Mon Sep 17 00:00:00 2001 From: Elour Date: Sat, 30 Mar 2019 10:44:35 -0700 Subject: [PATCH 3/5] Prevent over-capped powerups Higher than possible RE chance can lead to powerups created outside the possible realm. With the formula: ( ( (skillMod * rand(randomRollMin, 1.25f) ) / 100) + rand(1.0f, 1.25f)) * power; skillMod is a possible max of 169: 100 level 90 10 expertise 5 arm 11 pup 11 pup 11 pup 4 wep 4 chest 3 shirt 10 tool 169 total rolling the max for both randoms (1.25 and 1.25), we end up with ( ( (169 * 1.25) / 100) + 1.25) * 35 (where power = the power bit = 35 max) = a max of 117.6875 power --- .../game/script/item/tool/reverse_engineering_tool.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java b/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java index 0888825ff..3e89dbbce 100755 --- a/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java +++ b/sku.0/sys.server/compiled/game/script/item/tool/reverse_engineering_tool.java @@ -491,6 +491,8 @@ public class reverse_engineering_tool extends script.base_script obj_id powerup = static_item.createNewItemFunction(getGemTemplateByClass(player, ratio, 1), inventory); if (isIdValid(powerup)) { + if(power > 117) + power = 117; setObjVar(powerup, "reverse_engineering.reverse_engineering_power", power); setObjVar(powerup, "reverse_engineering.reverse_engineering_modifier", mod); setObjVar(powerup, "reverse_engineering.reverse_engineering_ratio", ratio); From 0a902bff72319cabe279e765792b79919edbf4a2 Mon Sep 17 00:00:00 2001 From: Elour Date: Sat, 30 Mar 2019 10:53:58 -0700 Subject: [PATCH 4/5] Prevent duplicating subcomponents via Chronicles Items could be dropped in to a chronicle quest reward box while also being used as a crafting subcomponent. Finishing the craft and also creating the reward cube would result in the component being duplicated inside the reward box. --- .../compiled/game/script/player/player_saga_quest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java b/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java index 9e66764d4..234a4dc3c 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java +++ b/sku.0/sys.server/compiled/game/script/player/player_saga_quest.java @@ -510,7 +510,14 @@ public class player_saga_quest extends script.base_script { name = new string_id("saga_system", "holocron_reward_unknown"); } - if (utils.isNestedWithin(rewardItem, self)) + final obj_id itemContainer = getContainedBy(rewardItem); + if (!isValidId(itemContainer) || !isValidId(playerInventory)) + { + pp = prose.getPackage(new string_id("saga_system", "holocron_reward_not_in_inventory"), name); + sendSystemMessageProse(self, pp); + pgc_quests.logReward(self, questHolocron, "Player attempted to donate a reward item but it was not in their inventory: " + name + "(" + rewardItem + ")"); + } + else if (itemContainer == playerInventory) { if (pgc_quests.isEligiblePgcReward(rewardItem)) { From 80b6fe8f3acdaef7d85a88584f3d44f2e61df720 Mon Sep 17 00:00:00 2001 From: TyroneSWG Date: Tue, 2 Apr 2019 16:22:35 -0700 Subject: [PATCH 5/5] Chronicler Skills to the frog --- .../terminal/terminal_character_builder.java | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java index d6c93316d..7f23d99c6 100755 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java +++ b/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java @@ -77,6 +77,27 @@ public class terminal_character_builder extends script.base_script public static final String[] BUFF_OPTIONS = { "Apply GOD Buffs" }; + public static final String[] CHRONICLER_SKILLS = { + "class_chronicles", + "class_chronicles_novice", + "class_chronicles_1", + "class_chronicles_2", + "class_chronicles_3", + "class_chronicles_4", + "class_chronicles_5", + "class_chronicles_6", + "class_chronicles_7", + "class_chronicles_8", + "class_chronicles_9", + "class_chronicles_10", + "class_chronicles_11", + "class_chronicles_12", + "class_chronicles_13", + "class_chronicles_14", + "class_chronicles_15", + "class_chronicles_16", + "class_chronicles_master" + }; public static final String[] DEV_TESTING_OPTIONS = { "Halloween tokens", "Lifeday rebel tokens", @@ -1363,7 +1384,8 @@ public class terminal_character_builder extends script.base_script "Select Roadmap", "Earn Current Skill", "Set Level", - "Reset Respec" + "Reset Respec", + "Master Chronicles" }; public static final String[] JEDI_OPTIONS = { @@ -9971,6 +9993,10 @@ public class terminal_character_builder extends script.base_script sendSystemMessageTestingOnly(player, "Respecced to level 90 and respecs cleared."); cleanScriptVars(player); break; + case 4: + grantChronicleSkills(player, CHRONICLER_SKILLS); + sendSystemMessageTestingOnly(player, "Skills granted"); + break; default: cleanScriptVars(player); return SCRIPT_CONTINUE; @@ -11456,4 +11482,11 @@ public class terminal_character_builder extends script.base_script sendSystemMessageTestingOnly(player, "Weapon Issued!"); } } + public void grantChronicleSkills(obj_id objPlayer, String[] strSkillList) throws InterruptedException + { + for (int intI = 0; intI < strSkillList.length; intI++) + { + grantSkill(objPlayer, strSkillList[intI]); + } + } } \ No newline at end of file