From 769b84b9da5b186da048bc7ba4c620183085e926 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 22 Aug 2024 18:56:56 -0500 Subject: [PATCH] Enchant Value derived form parser instead of database --- src/engine/db/handlers/dbLootHandler.java | 16 ---------------- src/engine/powers/EffectsBase.java | 6 ++---- src/engine/server/world/WorldServer.java | 3 --- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/engine/db/handlers/dbLootHandler.java b/src/engine/db/handlers/dbLootHandler.java index 14c4bb99..3b3bec94 100644 --- a/src/engine/db/handlers/dbLootHandler.java +++ b/src/engine/db/handlers/dbLootHandler.java @@ -221,20 +221,4 @@ public class dbLootHandler extends dbHandlerBase { return bootySets; } - public void LOAD_ENCHANT_VALUES() { - - try (Connection connection = DbManager.getConnection(); - PreparedStatement preparedStatement = connection.prepareStatement("SELECT `IDString`, `minMod` FROM `static_power_effectmod` WHERE `modType` = ?")) { - - preparedStatement.setString(1, "Value"); - ResultSet rs = preparedStatement.executeQuery(); - - while (rs.next()) - Item.addEnchantValue(rs.getString("IDString"), rs.getInt("minMod")); - - } catch (SQLException e) { - Logger.error(e); - } - } - } diff --git a/src/engine/powers/EffectsBase.java b/src/engine/powers/EffectsBase.java index bf903a2c..92e81565 100644 --- a/src/engine/powers/EffectsBase.java +++ b/src/engine/powers/EffectsBase.java @@ -23,10 +23,7 @@ import engine.mbEnums.PowerFailCondition; import engine.net.Dispatch; import engine.net.client.ClientConnection; import engine.net.client.msg.ApplyEffectMsg; -import engine.objects.AbstractCharacter; -import engine.objects.AbstractWorldObject; -import engine.objects.Effect; -import engine.objects.PlayerCharacter; +import engine.objects.*; import engine.powers.effectmodifiers.*; import engine.server.MBServerStatics; import engine.util.Hasher; @@ -858,6 +855,7 @@ public class EffectsBase { if (effectBase != null) { ValueEffectModifier valueEffect = (ValueEffectModifier) abstractEffectModifier; effectBase.value = valueEffect.minMod; + Item.addEnchantValue(effectBase.getIDString(), (int)valueEffect.minMod); } break; case WeaponProc: diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 8e6530e6..4a406896 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -330,9 +330,6 @@ public class WorldServer { Logger.info("Loading Rune Skill Adjusts"); PowersManager._allRuneSkillAdjusts = dbRuneBaseHandler.LOAD_RUNE_SKILL_ADJUSTS(); - Logger.info("Loading item enchants"); - DbManager.LootQueries.LOAD_ENCHANT_VALUES(); - Logger.info("Loading Realms"); Realm.loadAllRealms();