Remove "multiple same equip drop" feature

This commit is contained in:
P0nk
2023-03-15 23:26:15 +01:00
parent fa3481fa99
commit 45e2b93724
3 changed files with 2 additions and 51 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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<MonsterGlobalDropEntry> globaldrops = new ArrayList<>();
private final Map<Integer, List<MonsterGlobalDropEntry>> continentdrops = new HashMap<>();
private final Set<Integer> hasNoMultiEquipDrops = new HashSet<>();
private final Map<Integer, List<MonsterDropEntry>> extraMultiEquipDrops = new HashMap<>();
private final Map<Pair<Integer, Integer>, Integer> mobAttackAnimationTime = new HashMap<>();
private final Map<MobSkill, Integer> mobSkillAnimationTime = new HashMap<>();
@@ -106,49 +100,10 @@ public class MonsterInformationProvider {
}
public List<MonsterDropEntry> retrieveEffectiveDrop(final int monsterId) {
// this reads the drop entries searching for multi-equip, properly processing them
List<MonsterDropEntry> list = retrieveDrop(monsterId);
if (hasNoMultiEquipDrops.contains(monsterId) || !YamlConfig.config.server.USE_MULTIPLE_SAME_EQUIP_DROP) {
return list;
}
List<MonsterDropEntry> 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<MonsterDropEntry> ret = new LinkedList<>(list);
ret.addAll(extra);
return ret;
return retrieveDrop(monsterId);
}
public final List<MonsterDropEntry> retrieveDrop(final int monsterId) {
private List<MonsterDropEntry> 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();