From 428ded87288a05620a2788ffd5f61ec12e12278a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 16 Jul 2023 09:04:21 -0500 Subject: [PATCH] roll ranges fixed to allow all items to drop naturally --- src/engine/loot/LootManager.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/engine/loot/LootManager.java b/src/engine/loot/LootManager.java index 883d11d8..a63931cb 100644 --- a/src/engine/loot/LootManager.java +++ b/src/engine/loot/LootManager.java @@ -147,13 +147,22 @@ public class LootManager { return null; } 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 - int maxRollRange = (mob.getLevel() * 3) + (mob.getParentZone().maxLvl * 2); - if (maxRollRange > 320) { - maxRollRange = 320; + int zonemin = 25; + int zonemax = 50; + 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); if (tableRow == null) { return null;