From 45e2b93724866e554163aea343558a9eff91c629 Mon Sep 17 00:00:00 2001 From: P0nk Date: Wed, 15 Mar 2023 23:26:15 +0100 Subject: [PATCH] Remove "multiple same equip drop" feature --- config.yaml | 1 - src/main/java/config/ServerConfig.java | 1 - .../life/MonsterInformationProvider.java | 51 +------------------ 3 files changed, 2 insertions(+), 51 deletions(-) diff --git a/config.yaml b/config.yaml index 8f84d933f3..a67f67f4ce 100644 --- a/config.yaml +++ b/config.yaml @@ -264,7 +264,6 @@ server: USE_ERASE_PET_ON_EXPIRATION: false #Forces pets to be removed from inventory when expire time comes, rather than converting it to a doll. USE_BUFF_MOST_SIGNIFICANT: true #When applying buffs, the player will stick with the highest stat boost among the listed, rather than overwriting stats. USE_BUFF_EVERLASTING: false #Every applied buff on players holds expiration time so high it'd be considered permanent. Suggestion thanks to Vcoc. - USE_MULTIPLE_SAME_EQUIP_DROP: true #Enables multiple drops by mobs of the same equipment, number of possible drops based on the quantities provided at the drop data. USE_BANISHABLE_TOWN_SCROLL: false #Enables town scrolls to act as if it's a "player banish", rendering the antibanish scroll effect available. USE_ENABLE_FULL_RESPAWN: false #At respawn task, always respawn missing mobs when they're available. Spawn count doesn't depend on how many players are currently there. USE_ENABLE_CHAT_LOG: false #Write in-game chat to log diff --git a/src/main/java/config/ServerConfig.java b/src/main/java/config/ServerConfig.java index 8a07d5109e..9aae6876aa 100644 --- a/src/main/java/config/ServerConfig.java +++ b/src/main/java/config/ServerConfig.java @@ -113,7 +113,6 @@ public class ServerConfig { public boolean USE_ERASE_PET_ON_EXPIRATION; public boolean USE_BUFF_MOST_SIGNIFICANT; public boolean USE_BUFF_EVERLASTING; - public boolean USE_MULTIPLE_SAME_EQUIP_DROP; public boolean USE_BANISHABLE_TOWN_SCROLL; public boolean USE_ENABLE_FULL_RESPAWN; public boolean USE_ENABLE_CHAT_LOG; diff --git a/src/main/java/server/life/MonsterInformationProvider.java b/src/main/java/server/life/MonsterInformationProvider.java index e2153312ef..03ee8e02e5 100644 --- a/src/main/java/server/life/MonsterInformationProvider.java +++ b/src/main/java/server/life/MonsterInformationProvider.java @@ -20,8 +20,6 @@ */ package server.life; -import config.YamlConfig; -import constants.inventory.ItemConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import provider.Data; @@ -31,7 +29,6 @@ import provider.DataTool; import provider.wz.WZFiles; import tools.DatabaseConnection; import tools.Pair; -import tools.Randomizer; import java.sql.Connection; import java.sql.PreparedStatement; @@ -53,9 +50,6 @@ public class MonsterInformationProvider { private final List globaldrops = new ArrayList<>(); private final Map> continentdrops = new HashMap<>(); - private final Set hasNoMultiEquipDrops = new HashSet<>(); - private final Map> extraMultiEquipDrops = new HashMap<>(); - private final Map, Integer> mobAttackAnimationTime = new HashMap<>(); private final Map mobSkillAnimationTime = new HashMap<>(); @@ -106,49 +100,10 @@ public class MonsterInformationProvider { } public List retrieveEffectiveDrop(final int monsterId) { - // this reads the drop entries searching for multi-equip, properly processing them - - List list = retrieveDrop(monsterId); - if (hasNoMultiEquipDrops.contains(monsterId) || !YamlConfig.config.server.USE_MULTIPLE_SAME_EQUIP_DROP) { - return list; - } - - List multiDrops = extraMultiEquipDrops.get(monsterId), extra = new LinkedList<>(); - if (multiDrops == null) { - multiDrops = new LinkedList<>(); - - for (MonsterDropEntry mde : list) { - if (ItemConstants.isEquipment(mde.itemId) && mde.Maximum > 1) { - multiDrops.add(mde); - - int rnd = Randomizer.rand(mde.Minimum, mde.Maximum); - for (int i = 0; i < rnd - 1; i++) { - extra.add(mde); // this passes copies of the equips' MDE with min/max quantity > 1, but idc on equips they are unused anyways - } - } - } - - if (!multiDrops.isEmpty()) { - extraMultiEquipDrops.put(monsterId, multiDrops); - } else { - hasNoMultiEquipDrops.add(monsterId); - } - } else { - for (MonsterDropEntry mde : multiDrops) { - int rnd = Randomizer.rand(mde.Minimum, mde.Maximum); - for (int i = 0; i < rnd - 1; i++) { - extra.add(mde); - } - } - } - - List ret = new LinkedList<>(list); - ret.addAll(extra); - - return ret; + return retrieveDrop(monsterId); } - public final List retrieveDrop(final int monsterId) { + private List retrieveDrop(final int monsterId) { if (drops.containsKey(monsterId)) { return drops.get(monsterId); } @@ -253,8 +208,6 @@ public class MonsterInformationProvider { public final void clearDrops() { drops.clear(); - hasNoMultiEquipDrops.clear(); - extraMultiEquipDrops.clear(); globaldrops.clear(); continentdrops.clear(); retrieveGlobal();