adjusted global drop rates

This commit is contained in:
2024-12-29 15:38:59 -06:00
parent 16951d36a2
commit 26eda324dc
+32 -20
View File
@@ -127,45 +127,57 @@ public enum LootManager {
float dropRate; float dropRate;
if (!mob.getSafeZone()) { if (!mob.getSafeZone()) {
boolean allow = false; int contractLow = 1, contractHigh = 400;
if(mob.level >= 50){ int runeLow = 401, runeHigh = 800;
allow = true; int resourceLow = 801, resourceHigh = 900;
}else{ int glassLow = 901, glassHigh = 910;
if((50 - mob.level) > ThreadLocalRandom.current().nextInt(0,101)){ int guardLow = 911, guardHigh = 920;
allow = true;
} // Pre-compute adjusted high values
int contractAdjust = 0, runeAdjust = 0, resourceAdjust = 0, glassAdjust = 0, guardAdjust = 0;
if (mob.level < 50) {
int dif = 50 - mob.level;
contractAdjust = (int)(400 * (dif * 0.02f));
runeAdjust = (int)(400 * (dif * 0.02f));
resourceAdjust = (int)(100 * (dif * 0.02f));
glassAdjust = (int)(10 * (dif * 0.02f));
guardAdjust = (int)(10 * (dif * 0.02f));
} }
if(allow) { // Generate a single random roll
// Roll within the adjusted range int specialCaseRoll = ThreadLocalRandom.current().nextInt(1, 100001);
int specialCaseRoll = ThreadLocalRandom.current().nextInt(1, 100000 + 1);
// Special Case Contract Drop // Calculate adjusted high values once
if (specialCaseRoll <= 400) { // 0.4% of the range int contractHighAdjusted = contractHigh - contractAdjust;
SpecialCaseResourceDrop(mob, entries); int runeHighAdjusted = runeHigh - runeAdjust;
} else if (specialCaseRoll <= 800) { // Next 0.4% of the range int resourceHighAdjusted = resourceHigh - resourceAdjust;
int glassHighAdjusted = glassHigh - glassAdjust;
int guardHighAdjusted = guardHigh - guardAdjust;
// Check the roll range and handle accordingly
if (specialCaseRoll >= contractLow && specialCaseRoll <= contractHighAdjusted) {
SpecialCaseContractDrop(mob, entries); SpecialCaseContractDrop(mob, entries);
} else if (specialCaseRoll <= 1200) { // Next 0.4% of the range } else if (specialCaseRoll >= runeLow && specialCaseRoll <= runeHighAdjusted) {
SpecialCaseRuneDrop(mob, entries); SpecialCaseRuneDrop(mob, entries);
} else if (specialCaseRoll <= 1210) { // Next 0.01% of the range } else if (specialCaseRoll >= resourceLow && specialCaseRoll <= resourceHighAdjusted) {
SpecialCaseResourceDrop(mob, entries);
} else if (specialCaseRoll >= glassLow && specialCaseRoll <= glassHighAdjusted) {
int glassID = rollRandomItem(126); int glassID = rollRandomItem(126);
ItemBase glassItem = ItemBase.getItemBase(glassID); ItemBase glassItem = ItemBase.getItemBase(glassID);
if (glassItem != null) { if (glassItem != null) {
MobLoot toAddGlass = new MobLoot(mob, glassItem, false); MobLoot toAddGlass = new MobLoot(mob, glassItem, false);
if (toAddGlass != null)
mob.getCharItemManager().addItemToInventory(toAddGlass); mob.getCharItemManager().addItemToInventory(toAddGlass);
} }
} else if (specialCaseRoll <= 1220) { // Next 0.01% of the range } else if (specialCaseRoll >= guardLow && specialCaseRoll <= guardHighAdjusted) {
int guardContractID = racial_guard_uuids.get(new java.util.Random().nextInt(racial_guard_uuids.size())); int guardContractID = racial_guard_uuids.get(new java.util.Random().nextInt(racial_guard_uuids.size()));
ItemBase guardContract = ItemBase.getItemBase(guardContractID); ItemBase guardContract = ItemBase.getItemBase(guardContractID);
if (guardContract != null) { if (guardContract != null) {
MobLoot toAddContract = new MobLoot(mob, guardContract, false); MobLoot toAddContract = new MobLoot(mob, guardContract, false);
if (toAddContract != null)
mob.getCharItemManager().addItemToInventory(toAddContract); mob.getCharItemManager().addItemToInventory(toAddContract);
} }
} }
} }
}
// Iterate all entries in this bootySet and process accordingly // Iterate all entries in this bootySet and process accordingly
for (BootySetEntry bse : entries) { for (BootySetEntry bse : entries) {