From e5a59e66a56ec952631ab5e5faf15a8e2f92c6a0 Mon Sep 17 00:00:00 2001 From: Heron <82552147+HeronAlexandria@users.noreply.github.com> Date: Mon, 14 Mar 2022 10:21:31 -0500 Subject: [PATCH 1/4] Fix for trade buffs in build a buff. This fix adds an effect map to build a buff, which allows multiple buffs to be applied to an effect. This fixes the trader assembly buff, which only applied food_assembly. The mapping table allows multiple assembly buffs to be applied without hard coding. This fix also makes a change to the experience buff. The trade buffs also apply an experience bonus, but were not limited to crafting. The XP buff provides an additional buff, to chronicler xp. I moved the xp application to a common function, and they no longer overwrite each other. The highest buff is applied. I did a partial refactor to make the code easier to follow. This refactor is limited to the build a buff handlers. --- .../systems/buff/buff_builder_effect_map.java | 53 ++ .../script/systems/buff/buff_handler.java | 480 ++++++++++++------ 2 files changed, 382 insertions(+), 151 deletions(-) create mode 100644 sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java diff --git a/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java b/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java new file mode 100644 index 000000000..146b19565 --- /dev/null +++ b/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java @@ -0,0 +1,53 @@ +package script.systems.buff; + +import script.*; +import script.library.*; + +import java.util.ArrayList; + +public class buff_builder_effect_map extends script.base_script +{ + public static final String DATATABLE_BUFF_BUILDER_EFFECT_MAP = "datatables/buff/buff_builder_effect_map.iff"; + + public buff_builder_effect_map() + { + } + + + public static String[] getEffectList(String affectName) throws InterruptedException + { + //get the effect from the list + + ArrayList effectList = new ArrayList(); + + + int rowIndex = dataTableSearchColumnForString(affectName, "BUFF_BUILDER_AFFECTS", DATATABLE_BUFF_BUILDER_EFFECT_MAP); + + if (rowIndex >= 0) + { + int rowCount = dataTableGetNumRows(DATATABLE_BUFF_BUILDER_EFFECT_MAP); + + for (int index = 0; index < rowCount; index++) + { + dictionary row = dataTableGetRow(DATATABLE_BUFF_BUILDER_EFFECT_MAP, index); + String affect = row.getString("BUFF_BUILDER_AFFECTS"); + + if (affect.equals(affectName)) + { + effectList.add(row.getString("AFFECT")); + } + } + } + + return effectList.toArray(new String[effectList.size()]); + } + + public static String[] getEffects() throws InterruptedException + { + return dataTableGetStringColumn(DATATABLE_BUFF_BUILDER_EFFECT_MAP, "AFFECT"); + } + + + + +} diff --git a/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java b/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java index 1175a3935..65bc0df60 100755 --- a/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java +++ b/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java @@ -1802,159 +1802,61 @@ public class buff_handler extends script.base_script { buffValue = (buffValue * 0.2f); } - switch (category) { - case "attributes": - case "resistances": - case "combat": - switch (category) { - case "attributes": - float attribModifier = 0.0f; - if (isIdValid(bufferId) && exists(bufferId)) { - attribModifier = (float) (getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_attrib_increase") / 100.0f); - } - if (internalDecay == true) { - if (utils.hasScriptVar(self, "decayAttribMod")) { - attribModifier = utils.getFloatScriptVar(self, "decayAttribMod"); - CustomerServiceLog("SuspectedCheaterChannel: ", "Using stored attribMod: " + attribModifier); - - } - } else { - - CustomerServiceLog("SuspectedCheaterChannel: ", "Storing attribMod: " + attribModifier); - - utils.setScriptVar(self, "decayAttribMod", attribModifier); - } - buffValue *= 1.0f + attribModifier; - break; - case "resistances": - float resistModifier = 0.0f; - if (isIdValid(bufferId) && exists(bufferId)) { - resistModifier = (float) (getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_resist_increase") / 100.0f); - } - if (internalDecay == true) { - if (utils.hasScriptVar(self, "decayResistMod")) { - resistModifier = utils.getFloatScriptVar(self, "decayResistMod"); - } - } else { - utils.setScriptVar(self, "decayResistMod", resistModifier); - } - buffValue *= 1.0f + resistModifier; - break; - case "combat": - float combatModifier = 0.0f; - if (isIdValid(bufferId) && exists(bufferId)) { - combatModifier = getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_combat_buff_increase"); - } - if (internalDecay == true) { - if (utils.hasScriptVar(self, "decayCombatMod")) { - combatModifier = utils.getFloatScriptVar(self, "decayCombatMod"); - } - } else { - utils.setScriptVar(self, "decayCombatMod", combatModifier); - } - buffValue += combatModifier; - break; - } - - - { - CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: " + "buildabuff_" + effect + " Value = " + buffValue + " Duration = " + duration); - } - - addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); - if ((effect.startsWith("constitution")) || (effect.startsWith("stamina"))) { - messageTo(self, "recalcPools", null, 0.25f, false); - } else if (effect.startsWith("expertise_innate_protection_") || effect.equals("elemental_resistance")) //ensure recalc for new elemental_resistance Modifier - { - messageTo(self, "recalcArmor", null, 0.25f, false); - } - break; - case "trade": - float tradeModifier = 0.0f; - if (isIdValid(bufferId) && exists(bufferId)) { - tradeModifier = (float) (getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_trader_increase") / 100.0f); - } - if (internalDecay == true) { - if (utils.hasScriptVar(self, "decayTradeMod")) { - tradeModifier = utils.getFloatScriptVar(self, "decayTradeMod"); - } - } else { - utils.setScriptVar(self, "decayTradeMod", tradeModifier); - } - buffValue *= 1.0f + tradeModifier; - String[] xpArray = - { - "crafting", - "combat_general", - "entertainer", - "space_combat_general" - }; - utils.setScriptVar(self, "buff.xpBonus.types", xpArray); - utils.setScriptVar(self, "buff.xpBonus.value", buffValue / 100); - - - { - CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: " + "buildabuff_" + effect + " Value = " + buffValue + " Duration = " + duration); - } - - addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); - break; - case "misc": - switch (effect) { - case "movement_speed": - if (value == 0) { - value = 1; - } - if (movement.hasMovementModifier(self, "buildabuff_movement_speed")) { - movement.removeMovementModifier(self, "buildabuff_movement_speed", false); - } - movement.applyMovementModifier(self, "buildabuff_movement_speed", buffValue); - break; - case "reactive_second_chance": - int playerLevel = getLevel(self); - float reactiveModifier = 0.0f; - if (isIdValid(bufferId) && exists(bufferId)) { - reactiveModifier = getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_proc_chance_increase"); - } - if (internalDecay == true) { - if (utils.hasScriptVar(self, "decayReactiveMod")) { - reactiveModifier = utils.getFloatScriptVar(self, "decayReactiveMod"); - } - } else { - utils.setScriptVar(self, "decayReactiveMod", reactiveModifier); - } - buffValue += reactiveModifier; - if (playerLevel > 69) { - addSkillModModifier(self, "expertise_buildabuff_heal_3_reac", "expertise_buildabuff_heal_3_reac", (int) buffValue, duration, false, true); - } else if (playerLevel > 39 && playerLevel < 70) { - addSkillModModifier(self, "expertise_buildabuff_heal_2_reac", "expertise_buildabuff_heal_2_reac", (int) buffValue, duration, false, true); - } else { - addSkillModModifier(self, "expertise_buildabuff_heal_1_reac", "expertise_buildabuff_heal_1_reac", (int) buffValue, duration, false, true); - } - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - break; - case "flush_with_success": - String[] xpa = - { - "crafting", - "combat_general", - "entertainer", - "space_combat_general", - "chronicles" - }; - utils.setScriptVar(self, "buff.xpBonus.types", xpa); - utils.setScriptVar(self, "buff.xpBonus.value", buffValue / 100.0f); - break; - default: { - CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: " + "buildabuff_" + effect + " Value = " + buffValue + " Duration = " + duration); - } - - addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); - break; - } - break; + String[] effectPackage = buff_builder_effect_map.getEffectList(effect); + + if (effectPackage == null || effectPackage.length == 0) + { + effectPackage = new String[1]; + effectPackage[0] = effect; } + + + for (String e : effectPackage) + { + + switch (category) + { + case "attributes": + ApplyBuildaBuffAttributeBuff(self, + bufferId, + internalDecay, + e, + buffValue, + duration); + break; + + case "resistances": + ApplyBuildaBuffResistanceBuff(self, + bufferId, internalDecay, e, + buffValue, duration); + break; + + case "combat": + ApplyBuildaBuffCombatBuff(self, bufferId, internalDecay, e, + buffValue, duration); + break; + + case "trade": + ApplyBuildaBuffTradeBuff(self, bufferId, + internalDecay, e, + buffValue, + duration); + break; + + + case "misc": + ApplyBuildaBuffMiscBuff(self, bufferId, + internalDecay, e, + value, + buffValue, + duration); + break; + + + } + } + } if (!buff.hasBuff(self, "col_ent_invis_buff_tracker")) { @@ -1973,6 +1875,269 @@ public class buff_handler extends script.base_script } return SCRIPT_CONTINUE; } + + + public void ApplyBuildaBuffAttributeBuff(obj_id self, + obj_id bufferId, + boolean internalDecay, String effect, + float buffValue, float duration) throws InterruptedException + { + + float attribModifier = 0.0f; + + if (isIdValid(bufferId) && exists(bufferId)) + { + attribModifier = (float) (getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_attrib_increase") / 100.0f); + } + + if (internalDecay == true) + { + + if (utils.hasScriptVar(self, "decayAttribMod")) + { + attribModifier = utils.getFloatScriptVar(self, "decayAttribMod"); + CustomerServiceLog("SuspectedCheaterChannel: ", "Using stored attribMod: " + attribModifier); + } + + } + else + { + CustomerServiceLog("SuspectedCheaterChannel: ", "Storing attribMod: " + attribModifier); + utils.setScriptVar(self, "decayAttribMod", attribModifier); + } + + + buffValue *= 1.0f + attribModifier; + + addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); + CheckForBuildABuffCombatRecalc(self, effect); + + } + + public void ApplyBuildaBuffResistanceBuff(obj_id self, + obj_id bufferId, boolean internalDecay, String effect, + float buffValue, float duration) throws InterruptedException + { + + float resistModifier = 0.0f; + + if (isIdValid(bufferId) && exists(bufferId)) + { + resistModifier = (float) (getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_resist_increase") / 100.0f); + } + + if (internalDecay == true) + { + if (utils.hasScriptVar(self, "decayResistMod")) { + + resistModifier = utils.getFloatScriptVar(self, "decayResistMod"); + } + } + else + { + utils.setScriptVar(self, "decayResistMod", resistModifier); + } + + buffValue *= 1.0f + resistModifier; + + addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); + CheckForBuildABuffCombatRecalc(self, effect); + } + + public void ApplyBuildaBuffCombatBuff(obj_id self, obj_id bufferId, boolean internalDecay, String effect, + float buffValue, float duration) throws InterruptedException + { + float combatModifier = 0.0f; + + if (isIdValid(bufferId) && exists(bufferId)) { + + combatModifier = getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_combat_buff_increase"); + + } + + if (internalDecay == true) { + + if (utils.hasScriptVar(self, "decayCombatMod")) + { + combatModifier = utils.getFloatScriptVar(self, "decayCombatMod"); + } + + } + else + { + utils.setScriptVar(self, "decayCombatMod", combatModifier); + } + + buffValue += combatModifier; + addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); + CheckForBuildABuffCombatRecalc(self, effect); + } + + public void ApplyBuildaBuffTradeBuff(obj_id self, obj_id bufferId, + boolean internalDecay, String effect, + float buffValue, + float duration) throws InterruptedException + { + float tradeModifier = 0.0f; + + if (isIdValid(bufferId) && exists(bufferId)) { + + tradeModifier = (float) (getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_trader_increase") / 100.0f); + } + + if (internalDecay == true) + { + + if (utils.hasScriptVar(self, "decayTradeMod")) { + + tradeModifier = utils.getFloatScriptVar(self, "decayTradeMod"); + + } + } + else + { + utils.setScriptVar(self, "decayTradeMod", tradeModifier); + } + + buffValue *= 1.0f + tradeModifier; + + ApplyBuildaBuffXpBuff(self, buffValue); + addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); + } + + public void ApplyBuildaBuffMiscBuff(obj_id self, obj_id bufferId, + boolean internalDecay, String effect, + float value, + float buffValue, + float duration) throws InterruptedException + { + switch (effect) + { + + case "movement_speed": + + if (value == 0) + { + value = 1; + } + + if (movement.hasMovementModifier(self, "buildabuff_movement_speed")) + { + + movement.removeMovementModifier(self, "buildabuff_movement_speed", false); + } + + movement.applyMovementModifier(self, "buildabuff_movement_speed", buffValue); + + break; + + case "reactive_second_chance": + + int playerLevel = getLevel(self); + + float reactiveModifier = 0.0f; + + if (isIdValid(bufferId) && exists(bufferId)) + { + reactiveModifier = getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_proc_chance_increase"); + } + + if (internalDecay == true) + { + + if (utils.hasScriptVar(self, "decayReactiveMod")) + { + reactiveModifier = utils.getFloatScriptVar(self, "decayReactiveMod"); + } + + } + else + { + utils.setScriptVar(self, "decayReactiveMod", reactiveModifier); + } + + buffValue += reactiveModifier; + + if (playerLevel > 69) + { + addSkillModModifier(self, "expertise_buildabuff_heal_3_reac", "expertise_buildabuff_heal_3_reac", (int) buffValue, duration, false, true); + } + else if (playerLevel > 39 && playerLevel < 70) + { + addSkillModModifier(self, "expertise_buildabuff_heal_2_reac", "expertise_buildabuff_heal_2_reac", (int) buffValue, duration, false, true); + + } + else + { + addSkillModModifier(self, "expertise_buildabuff_heal_1_reac", "expertise_buildabuff_heal_1_reac", (int) buffValue, duration, false, true); + } + + messageTo(self, "cacheExpertiseProcReacList", null, 2, false); + + break; + + case "flush_with_success": + + ApplyBuildaBuffXpBuff(self, buffValue); + + break; + + default: + CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: " + "buildabuff_" + effect + " Value = " + buffValue + " Duration = " + duration); + break; + + } + + addSkillModModifier(self, "buildabuff_" + effect, effect, (int) buffValue, duration, false, true); + } + + public void CheckForBuildABuffCombatRecalc(obj_id self, String effect) throws InterruptedException + { + if ((effect.startsWith("constitution")) || (effect.startsWith("stamina"))) + { + messageTo(self, "recalcPools", null, 0.25f, false); + } + else if (effect.startsWith("expertise_innate_protection_") || effect.equals("elemental_resistance")) //ensure recalc for new elemental_resistance Modifier + { + messageTo(self, "recalcArmor", null, 0.25f, false); + } + } + + public void ApplyBuildaBuffXpBuff(obj_id self, float buffValue) throws InterruptedException + { + float bonusXpValue = buffValue / 100; + + //add the bonus types if they do not exist + + if (!hasObjVar(self, "buff.xpBonus.types")) + { + String[] xpArray = + { + "crafting", + "combat_general", + "entertainer", + "space_combat_general", + "chronicles" + }; + + utils.setScriptVar(self, "buff.xpBonus.types", xpArray); + } + + if (hasObjVar(self, "buff.xpBonus.value")) + { + float currentBonus = getFloatObjVar(self, "buff.xpBonus.value"); + + if (bonusXpValue > currentBonus) + { + utils.setScriptVar(self, "buff.xpBonus.value", bonusXpValue); + } + } + else + { + utils.setScriptVar(self, "buff.xpBonus.value", bonusXpValue); + } + } + public int buildabuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException { String[] baseModList = dataTableGetStringColumn(DATATABLE_BUFF_BUILDER, "AFFECTS"); @@ -1981,6 +2146,19 @@ public class buff_handler extends script.base_script removeAttribOrSkillModModifier(self, "buildabuff_" + s); } } + + baseModList = buff_builder_effect_map.getEffects(); + + if (baseModList != null && baseModList.length > 0) + { + + for (String s : baseModList) { + if (hasSkillModModifier(self, "buildabuff_" + s)) { + removeAttribOrSkillModModifier(self, "buildabuff_" + s); + } + } + } + if (hasSkillModModifier(self, "expertise_buildabuff_heal_1_reac")) { removeAttribOrSkillModModifier(self, "expertise_buildabuff_heal_1_reac"); From f630c5adafd0a5a58df3864a8485e97e0595d316 Mon Sep 17 00:00:00 2001 From: Heron <82552147+HeronAlexandria@users.noreply.github.com> Date: Mon, 14 Mar 2022 10:31:26 -0500 Subject: [PATCH 2/4] Tables for the build a buff fix. These are the tables for the trader assembly fix in the build a buff system. --- .../game/datatables/buff/buff_builder.tab | 48 +++++++++---------- .../buff/buff_builder_effect_map.tab | 20 ++++++++ 2 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 sku.0/sys.shared/compiled/game/datatables/buff/buff_builder_effect_map.tab diff --git a/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder.tab b/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder.tab index 91a2832ea..266e9508e 100755 --- a/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder.tab +++ b/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder.tab @@ -1,24 +1,24 @@ -NAME CATEGORY AFFECTS MAX_TIMES_APPLIED COST AFFECT_AMOUNT REQUIRED_EXPERTISE -s s s i i i s -strength attributes strength_modified 10 1 10 -constitution attributes constitution_modified 10 1 10 -stamina attributes stamina_modified 10 1 10 -precision attributes precision_modified 10 1 10 -agility attributes agility_modified 10 1 10 -luck attributes luck_modified 10 1 10 -kinetic resistances expertise_innate_protection_kinetic 5 1 250 -energy resistances expertise_innate_protection_energy 5 1 250 -elemental resistances elemental_resistance 5 1 250 -crafting trade food_assembly 5 2 1 -crafting_success trade crafting_critical_success_bonus 2 5 1 -hand_sampling trade expertise_resource_sampling_increase 5 2 2 harvest_faire -critical_hit combat expertise_critical_niche_all 1 5 3 -critical_hit_defense combat expertise_critical_hit_reduction 1 5 3 -dodge combat expertise_glancing_blow_all 1 5 3 -action_cost_reduction combat expertise_action_all 1 5 5 -healing misc expertise_dot_absorption_all 5 2 4 holism -healer misc expertise_healing_all 5 2 3 holism -reactive_go_with_the_flow misc movement_speed 5 2 5 go_with_the_flow -reactive_second_chance misc reactive_second_chance 4 2 2 second_chance -harvest_faire misc expertise_harvester_collection_increase 5 2 1 harvest_faire -flush_with_success misc flush_with_success 5 2 3 flush_with_success +NAME CATEGORY AFFECTS MAX_TIMES_APPLIED COST AFFECT_AMOUNT REQUIRED_EXPERTISE +s s s i i i s +strength attributes strength_modified 10 1 10 +constitution attributes constitution_modified 10 1 10 +stamina attributes stamina_modified 10 1 10 +precision attributes precision_modified 10 1 10 +agility attributes agility_modified 10 1 10 +luck attributes luck_modified 10 1 10 +kinetic resistances expertise_innate_protection_kinetic 5 1 250 +energy resistances expertise_innate_protection_energy 5 1 250 +elemental resistances elemental_resistance 5 1 250 +crafting trade crafting_assembly 5 2 1 +crafting_success trade crafting_critical_success_bonus 2 5 1 +hand_sampling trade expertise_resource_sampling_increase 5 2 2 harvest_faire +critical_hit combat expertise_critical_niche_all 1 5 3 +critical_hit_defense combat expertise_critical_hit_reduction 1 5 3 +dodge combat expertise_glancing_blow_all 1 5 3 +action_cost_reduction combat expertise_action_all 1 5 5 +healing misc expertise_dot_absorption_all 5 2 4 holism +healer misc expertise_healing_all 5 2 3 holism +reactive_go_with_the_flow misc movement_speed 5 2 5 go_with_the_flow +reactive_second_chance misc reactive_second_chance 4 2 2 second_chance +harvest_faire misc expertise_harvester_collection_increase 5 2 1 harvest_faire +flush_with_success misc flush_with_success 5 2 3 flush_with_success diff --git a/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder_effect_map.tab b/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder_effect_map.tab new file mode 100644 index 000000000..87d561905 --- /dev/null +++ b/sku.0/sys.shared/compiled/game/datatables/buff/buff_builder_effect_map.tab @@ -0,0 +1,20 @@ +BUFF_BUILDER_AFFECTS AFFECT +s s +crafting_assembly armor_assembly +crafting_assembly advanced_assembly +crafting_assembly booster_assembly +crafting_assembly chassis_assembly +crafting_assembly clothing_assembly +crafting_assembly cybernetic_assembly +crafting_assembly droid_assembly +crafting_assembly engine_assembly +crafting_assembly food_assembly +crafting_assembly general_assembly +crafting_assembly instrument_assembly +crafting_assembly jedi_saber_assembly +crafting_assembly power_systems +crafting_assembly prop_assembly +crafting_assembly shields_assembly +crafting_assembly structure_assembly +crafting_assembly weapon_assembly +crafting_assembly weapon_systems From b6943fb901b7532c9f8051da6cfd29714c549a25 Mon Sep 17 00:00:00 2001 From: Heron <82552147+HeronAlexandria@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:59:28 -0500 Subject: [PATCH 3/4] Update reset.java --- .../compiled/game/script/item/goggles/reset.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sku.0/sys.server/compiled/game/script/item/goggles/reset.java b/sku.0/sys.server/compiled/game/script/item/goggles/reset.java index e4099d394..0f73c8f0a 100755 --- a/sku.0/sys.server/compiled/game/script/item/goggles/reset.java +++ b/sku.0/sys.server/compiled/game/script/item/goggles/reset.java @@ -24,6 +24,13 @@ public class reset extends script.base_script }; public int createNewGoggles(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException { + + String config = getConfigSetting("GameServer", "seGogglesReward"); + if (config == null || !config.equals("true")) + { + return SCRIPT_CONTINUE; + } + boolean createFailed = false; if (features.isCollectorEdition(self) || features.isJPCollectorEdition(self)) { From f0915d1fa387beb78bbbdd750cfbcf39d3675ec8 Mon Sep 17 00:00:00 2001 From: Heron <82552147+HeronAlexandria@users.noreply.github.com> Date: Fri, 25 Mar 2022 19:35:41 -0500 Subject: [PATCH 4/4] Updated per code review Moved declaration of row and affect outside of the loop. --- .../game/script/systems/buff/buff_builder_effect_map.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java b/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java index 146b19565..f462d51ca 100644 --- a/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java +++ b/sku.0/sys.server/compiled/game/script/systems/buff/buff_builder_effect_map.java @@ -26,11 +26,13 @@ public class buff_builder_effect_map extends script.base_script if (rowIndex >= 0) { int rowCount = dataTableGetNumRows(DATATABLE_BUFF_BUILDER_EFFECT_MAP); + dictionary row; + String affect; for (int index = 0; index < rowCount; index++) { - dictionary row = dataTableGetRow(DATATABLE_BUFF_BUILDER_EFFECT_MAP, index); - String affect = row.getString("BUFF_BUILDER_AFFECTS"); + row = dataTableGetRow(DATATABLE_BUFF_BUILDER_EFFECT_MAP, index); + affect = row.getString("BUFF_BUILDER_AFFECTS"); if (affect.equals(affectName)) {