Browse Source

adjusted global drop rates

lakebane2
FatBoy-DOTC 3 weeks ago
parent
commit
26eda324dc
  1. 58
      src/engine/gameManager/LootManager.java

58
src/engine/gameManager/LootManager.java

@ -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) {
if(allow) { int dif = 50 - mob.level;
// Roll within the adjusted range contractAdjust = (int)(400 * (dif * 0.02f));
int specialCaseRoll = ThreadLocalRandom.current().nextInt(1, 100000 + 1); runeAdjust = (int)(400 * (dif * 0.02f));
resourceAdjust = (int)(100 * (dif * 0.02f));
// Special Case Contract Drop glassAdjust = (int)(10 * (dif * 0.02f));
if (specialCaseRoll <= 400) { // 0.4% of the range guardAdjust = (int)(10 * (dif * 0.02f));
SpecialCaseResourceDrop(mob, entries); }
} else if (specialCaseRoll <= 800) { // Next 0.4% of the range
// Generate a single random roll
int specialCaseRoll = ThreadLocalRandom.current().nextInt(1, 100001);
// Calculate adjusted high values once
int contractHighAdjusted = contractHigh - contractAdjust;
int runeHighAdjusted = runeHigh - runeAdjust;
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) {

Loading…
Cancel
Save