From 2b9067908757a012fc11aefa0cc9038e3441afdc Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 7 Apr 2023 11:22:14 -0500 Subject: [PATCH] new booty system update --- src/engine/db/handlers/dbLootTableHandler.java | 9 +++++++-- src/engine/loot/LootManager.java | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/engine/db/handlers/dbLootTableHandler.java b/src/engine/db/handlers/dbLootTableHandler.java index 6632c0d4..7f7d6f89 100644 --- a/src/engine/db/handlers/dbLootTableHandler.java +++ b/src/engine/db/handlers/dbLootTableHandler.java @@ -182,8 +182,13 @@ public class dbLootTableHandler extends dbHandlerBase { while (rs.next()) { recordsRead++; - LootManager.ModTypeTableRow mttr = new LootManager.ModTypeTableRow(rs); - LootManager.AddModTypeTableRow(rs.getInt("modGroup"),mttr); + try { + LootManager.ModTypeTableRow mttr = new LootManager.ModTypeTableRow(rs); + LootManager.AddModTypeTableRow(rs.getInt("modGroup"), mttr); + } + catch(Exception ex){ + Logger.info("MOD TABLE ERROR: " + rs.getInt("modGroup")); + } } Logger.info( "read: " + recordsRead); diff --git a/src/engine/loot/LootManager.java b/src/engine/loot/LootManager.java index e45bed6f..f01afb78 100644 --- a/src/engine/loot/LootManager.java +++ b/src/engine/loot/LootManager.java @@ -65,7 +65,7 @@ public class LootManager { MobLoot goldAmount = new MobLoot(mob, (int) (gold * multiplier)); mob.getCharItemManager().addItemToInventory(goldAmount); } - } else if (bse.bootyType.equals("BOOTYTABLE")) { + } else if (bse.bootyType.equals("LOOT")) { //iterate the booty tables and add items to mob inventory Item toAdd = getGenTableItem(bse.lootTable, mob); if(toAdd != null) { @@ -75,6 +75,10 @@ public class LootManager { Item toAddHZ = getGenTableItem(bse.lootTable + 1, mob); mob.getCharItemManager().addItemToInventory(toAddHZ); } + } else if(bse.bootyType.equals("ITEM")){ + if(Item.getItem(bse.itemBase) != null) { + mob.getCharItemManager().addItemToInventory(Item.getItem(bse.itemBase)); + } } } //lastly, check mobs inventory for godly or disc runes to send a server announcement