From fec0a05c46fbf65792970714f2fd4febcd04f29b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 5 Mar 2024 18:53:07 -0600 Subject: [PATCH] random disc runes --- src/engine/gameManager/LootManager.java | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index d74bdfe4..6fb47ecc 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -98,15 +98,10 @@ public enum LootManager { DispatchMessage.dispatchMsgToAll(chatMsg); } if(ib.isDiscRune()){ - ItemBase newDisc = ItemBase.getItemBase(ThreadLocalRandom.current().nextInt(3001,3049)); - if(newDisc != null){ - mob.getInventory().remove(it); - mob.getInventory().add(new MobLoot(mob,newDisc,true)); - ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + newDisc.getName() + ". Are you tough enough to take it?"); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?"); chatMsg.setMessageType(10); chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); DispatchMessage.dispatchMsgToAll(chatMsg); - } } } @@ -401,18 +396,23 @@ public enum LootManager { if (chanceRoll > bse.dropChance) return; + ItemBase ib = ItemBase.getItemBase(bse.itemBase); + if (ib == null) + return; + + if (ib.isDiscRune()) { + ItemBase newDisc = ItemBase.getItemBase(ThreadLocalRandom.current().nextInt(3001, 3049 + 1)); + if (newDisc != null) { + //mob.getInventory().add(new MobLoot(mob, newDisc, true)); + mob.getCharItemManager().addItemToInventory(new MobLoot(mob, newDisc, true)); + return; + } + } MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); if (lootItem != null) mob.getCharItemManager().addItemToInventory(lootItem); - if(inHotzone){ - MobLoot lootItem2 = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true); - - if (lootItem != null) - mob.getCharItemManager().addItemToInventory(lootItem2); - } } - public static void peddleFate(PlayerCharacter playerCharacter, Item gift) { //get table ID for the itembase ID