Browse Source

audit command for drop rates

lakebane2
FatBoy-DOTC 3 weeks ago
parent
commit
d031f1be01
  1. 63
      src/engine/gameManager/LootManager.java

63
src/engine/gameManager/LootManager.java

@ -127,38 +127,43 @@ public enum LootManager {
float dropRate; float dropRate;
if (!mob.getSafeZone()) { if (!mob.getSafeZone()) {
int baseBound = 100000; boolean allow = false;
int levelPenalty = (int) (Math.max(0, Math.abs(50 - mob.level)) * 0.01 * 100000);
int totalRange = baseBound + levelPenalty;
if(mob.level >= 50){ if(mob.level >= 50){
totalRange = baseBound; //totalRange = baseBound;
allow = true;
}else{
if((50 - mob.level) < ThreadLocalRandom.current().nextInt(0,101)){
allow = true;
}
} }
// Roll within the adjusted range if(allow) {
int specialCaseRoll = ThreadLocalRandom.current().nextInt(1, totalRange + 1); // Roll within the adjusted range
int specialCaseRoll = ThreadLocalRandom.current().nextInt(1, 100000 + 1);
// Special Case Contract Drop
if (specialCaseRoll <= 400) { // 0.4% of the range // Special Case Contract Drop
SpecialCaseResourceDrop(mob, entries); if (specialCaseRoll <= 400) { // 0.4% of the range
} else if (specialCaseRoll <= 800) { // Next 0.4% of the range SpecialCaseResourceDrop(mob, entries);
SpecialCaseContractDrop(mob, entries); } else if (specialCaseRoll <= 800) { // Next 0.4% of the range
} else if (specialCaseRoll <= 1200) { // Next 0.4% of the range SpecialCaseContractDrop(mob, entries);
SpecialCaseRuneDrop(mob, entries); } else if (specialCaseRoll <= 1200) { // Next 0.4% of the range
} else if (specialCaseRoll <= 1210) { // Next 0.01% of the range SpecialCaseRuneDrop(mob, entries);
int glassID = rollRandomItem(126); } else if (specialCaseRoll <= 1210) { // Next 0.01% of the range
ItemBase glassItem = ItemBase.getItemBase(glassID); int glassID = rollRandomItem(126);
if (glassItem != null) { ItemBase glassItem = ItemBase.getItemBase(glassID);
MobLoot toAddGlass = new MobLoot(mob, glassItem, false); if (glassItem != null) {
if (toAddGlass != null) MobLoot toAddGlass = new MobLoot(mob, glassItem, false);
mob.getCharItemManager().addItemToInventory(toAddGlass); if (toAddGlass != null)
} mob.getCharItemManager().addItemToInventory(toAddGlass);
} else if (specialCaseRoll <= 1220) { // Next 0.01% of the range }
int guardContractID = racial_guard_uuids.get(new java.util.Random().nextInt(racial_guard_uuids.size())); } else if (specialCaseRoll <= 1220) { // Next 0.01% of the range
ItemBase guardContract = ItemBase.getItemBase(guardContractID); int guardContractID = racial_guard_uuids.get(new java.util.Random().nextInt(racial_guard_uuids.size()));
if (guardContract != null) { ItemBase guardContract = ItemBase.getItemBase(guardContractID);
MobLoot toAddContract = new MobLoot(mob, guardContract, false); if (guardContract != null) {
if (toAddContract != null) MobLoot toAddContract = new MobLoot(mob, guardContract, false);
mob.getCharItemManager().addItemToInventory(toAddContract); if (toAddContract != null)
mob.getCharItemManager().addItemToInventory(toAddContract);
}
} }
} }
} }

Loading…
Cancel
Save