Browse Source

roll ranges fixed to allow all items to drop naturally

master
FatBoy-DOTC 1 year ago
parent
commit
428ded8728
  1. 19
      src/engine/loot/LootManager.java

19
src/engine/loot/LootManager.java

@ -147,13 +147,22 @@ public class LootManager {
return null; return null;
} }
int itemTableId = selectedRow.itemTableID; int itemTableId = selectedRow.itemTableID;
int minRollRange = (mob.getLevel() * 3) + mob.getParentZone().minLvl;
//add 20 to max roll range to make dwarven HA and Sage possible //add 20 to max roll range to make dwarven HA and Sage possible
int maxRollRange = (mob.getLevel() * 3) + (mob.getParentZone().maxLvl * 2); int zonemin = 25;
if (maxRollRange > 320) { int zonemax = 50;
maxRollRange = 320; if(mob.getParentZone().minLvl != 0){
zonemax += mob.getParentZone().minLvl;
}
if(mob.getParentZone().maxLvl != 0){
zonemax += mob.getParentZone().maxLvl;
}
int minRollRange = (mob.getLevel() * 3) + zonemin;
int maxRollRange = (mob.getLevel() * 3) + (zonemax * 2);
int roll2 = new Random().nextInt(maxRollRange) + minRollRange;
if (roll2 > 320) {
roll2 = 320;
} }
int roll2 = new Random().nextInt(maxRollRange - minRollRange) + minRollRange;
ItemTableRow tableRow = itemTables.get(itemTableId).getRowForRange(roll2); ItemTableRow tableRow = itemTables.get(itemTableId).getRowForRange(roll2);
if (tableRow == null) { if (tableRow == null) {
return null; return null;

Loading…
Cancel
Save