adjusted global drop rates

This commit is contained in:
2024-12-29 15:38:59 -06:00
parent 16951d36a2
commit 26eda324dc
+45 -33
View File
@@ -127,46 +127,58 @@ 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;
SpecialCaseContractDrop(mob, entries); int glassHighAdjusted = glassHigh - glassAdjust;
} else if (specialCaseRoll <= 1200) { // Next 0.4% of the range int guardHighAdjusted = guardHigh - guardAdjust;
SpecialCaseRuneDrop(mob, entries);
} else if (specialCaseRoll <= 1210) { // Next 0.01% of the range // Check the roll range and handle accordingly
int glassID = rollRandomItem(126); if (specialCaseRoll >= contractLow && specialCaseRoll <= contractHighAdjusted) {
ItemBase glassItem = ItemBase.getItemBase(glassID); SpecialCaseContractDrop(mob, entries);
if (glassItem != null) { } else if (specialCaseRoll >= runeLow && specialCaseRoll <= runeHighAdjusted) {
MobLoot toAddGlass = new MobLoot(mob, glassItem, false); SpecialCaseRuneDrop(mob, entries);
if (toAddGlass != null) } else if (specialCaseRoll >= resourceLow && specialCaseRoll <= resourceHighAdjusted) {
mob.getCharItemManager().addItemToInventory(toAddGlass); SpecialCaseResourceDrop(mob, entries);
} } else if (specialCaseRoll >= glassLow && specialCaseRoll <= glassHighAdjusted) {
} else if (specialCaseRoll <= 1220) { // Next 0.01% of the range int glassID = rollRandomItem(126);
int guardContractID = racial_guard_uuids.get(new java.util.Random().nextInt(racial_guard_uuids.size())); ItemBase glassItem = ItemBase.getItemBase(glassID);
ItemBase guardContract = ItemBase.getItemBase(guardContractID); if (glassItem != null) {
if (guardContract != null) { MobLoot toAddGlass = new MobLoot(mob, glassItem, false);
MobLoot toAddContract = new MobLoot(mob, guardContract, false); mob.getCharItemManager().addItemToInventory(toAddGlass);
if (toAddContract != null) }
mob.getCharItemManager().addItemToInventory(toAddContract); } else if (specialCaseRoll >= guardLow && specialCaseRoll <= guardHighAdjusted) {
} int guardContractID = racial_guard_uuids.get(new java.util.Random().nextInt(racial_guard_uuids.size()));
ItemBase guardContract = ItemBase.getItemBase(guardContractID);
if (guardContract != null) {
MobLoot toAddContract = new MobLoot(mob, guardContract, false);
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) {
switch (bse.bootyType) { switch (bse.bootyType) {