From 4adf0a89fb0305784cab347c078eb358e2da8be4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 19 Jul 2023 17:50:03 -0500 Subject: [PATCH] hotfix mob roll chance --- src/engine/loot/LootManager.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/engine/loot/LootManager.java b/src/engine/loot/LootManager.java index 93ffe22d..63855d35 100644 --- a/src/engine/loot/LootManager.java +++ b/src/engine/loot/LootManager.java @@ -94,9 +94,10 @@ public class LootManager { return; } for (BootySetEntry bse : entries) { - int roll = ThreadLocalRandom.current().nextInt(101); + int roll; switch (bse.bootyType) { case "GOLD": + roll = ThreadLocalRandom.current().nextInt(101); if (roll > (bse.dropChance * multiplier)) { //early exit, failed to hit minimum chance roll OR booty was generated from mob's death break; @@ -109,8 +110,10 @@ public class LootManager { } break; case "LOOT": + roll = ThreadLocalRandom.current().nextInt(101); + float dropChance = bse.dropChance * multiplier; if (roll > (bse.dropChance * multiplier)) { - //early exit, failed to hit minimum chance roll OR booty was generated from mob's death + //early exit, failed to hit minimum chance roll break; } //iterate the booty tables and add items to mob inventory @@ -119,14 +122,12 @@ public class LootManager { mob.getCharItemManager().addItemToInventory(toAdd); } if (inHotzone) { - int lootTableID = bse.lootTable; if (generalItemTables.containsKey(bse.lootTable + 1)) { - lootTableID = bse.lootTable + 1; + int lootTableID = bse.lootTable + 1; + MobLoot toAddHZ = getGenTableItem(lootTableID, mob); + if (toAddHZ != null) + mob.getCharItemManager().addItemToInventory(toAddHZ); } - MobLoot toAddHZ = getGenTableItem(lootTableID, mob); - if (toAddHZ != null) - mob.getCharItemManager().addItemToInventory(toAddHZ); - } break; case "ITEM":