From 67bcb9aeea7007103af0d8af22940fdcd0d877fd Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 6 Aug 2023 07:21:49 -0400 Subject: [PATCH] Refactor lootTable/itemtable for client alignment. --- src/engine/devcmd/cmds/SimulateBootyCmd.java | 8 ++++---- src/engine/gameManager/LootManager.java | 6 +++--- src/engine/objects/BootySetEntry.java | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engine/devcmd/cmds/SimulateBootyCmd.java b/src/engine/devcmd/cmds/SimulateBootyCmd.java index 2638e60a..23f07547 100644 --- a/src/engine/devcmd/cmds/SimulateBootyCmd.java +++ b/src/engine/devcmd/cmds/SimulateBootyCmd.java @@ -120,12 +120,12 @@ public class SimulateBootyCmd extends AbstractDevCmd { for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)) { if (entry.bootyType.equals("GOLD")) - output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.lootTable + ": " + entry.dropChance + newline; + output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.itemTable + ": " + entry.dropChance + newline; else - output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.lootTable + ": " + entry.dropChance * dropRate + newline; + output += "NORMAL TABLE [" + entry.bootyType + "] " + entry.itemTable + ": " + entry.dropChance * dropRate + newline; - if (hotZoneRan == false && ZoneManager.inHotZone(mob.getLoc()) && LootManager.generalItemTables.containsKey(entry.lootTable + 1)) { - output += "HOTZONE TABLE [" + entry.bootyType + "] " + (entry.lootTable + 1) + ": " + entry.dropChance * dropRate + newline; + if (hotZoneRan == false && ZoneManager.inHotZone(mob.getLoc()) && LootManager.generalItemTables.containsKey(entry.itemTable + 1)) { + output += "HOTZONE TABLE [" + entry.bootyType + "] " + (entry.itemTable + 1) + ": " + entry.dropChance * dropRate + newline; hotZoneRan = true; } } diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 26ba7853..0cff9f05 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -120,14 +120,14 @@ public enum LootManager { dropRate = LootManager.NORMAL_DROP_RATE; if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) - GenerateLootDrop(mob, bse.lootTable, false); //generate normal loot drop + GenerateLootDrop(mob, bse.itemTable, false); //generate normal loot drop // Generate hotzone loot if in hotzone // Only one bite at the hotzone apple per bootyset. if (inHotzone == true && hotzoneWasRan == false) - if (generalItemTables.containsKey(bse.lootTable + 1) && ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) { - GenerateLootDrop(mob, bse.lootTable + 1, true); //generate loot drop from hotzone table + if (generalItemTables.containsKey(bse.itemTable + 1) && ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) { + GenerateLootDrop(mob, bse.itemTable + 1, true); //generate loot drop from hotzone table hotzoneWasRan = true; } diff --git a/src/engine/objects/BootySetEntry.java b/src/engine/objects/BootySetEntry.java index ff22bbaf..90b04d14 100644 --- a/src/engine/objects/BootySetEntry.java +++ b/src/engine/objects/BootySetEntry.java @@ -18,7 +18,7 @@ public class BootySetEntry { public int lowGold; public int highGold; public int itemBase; - public int lootTable; + public int itemTable; public float dropChance; /** @@ -30,7 +30,7 @@ public class BootySetEntry { this.lowGold = (rs.getInt("lowGold")); this.highGold = (rs.getInt("highGold")); this.itemBase = (rs.getInt("itemBase")); - this.lootTable = (rs.getInt("lootTable")); + this.itemTable = (rs.getInt("itemTable")); this.dropChance = (rs.getFloat("dropChance")); }