From fe953aa8c43c961a08d4a5b4746c7c03d90faca7 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 8 Apr 2023 18:05:46 -0500 Subject: [PATCH] simulatebooty command added data output --- src/engine/devcmd/cmds/simulateBootyCmd.java | 16 +-------- src/engine/loot/LootManager.java | 36 +++++++++++--------- 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index c7da0600..8888998c 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -83,8 +83,6 @@ public class simulateBootyCmd extends AbstractDevCmd { try { mob.loadInventory(); for (Item lootItem : mob.getCharItemManager().getInventory()) { - ItemBase ib = lootItem.getItemBase(); - int ordinal = ib.getType().ordinal(); switch (lootItem.getItemBase().getType()) { case CONTRACT: //CONTRACT Contracts.add(lootItem); @@ -121,25 +119,13 @@ public class simulateBootyCmd extends AbstractDevCmd { output += "BootySet: " + mob.getMobBase().bootySet + newline; output += "Tables Rolled On: " + newline; for(BootySetEntry entry : NPCManager._bootySetMap.get(mob.getMobBase().bootySet)){ - output += entry.lootTable + newline; + output += "[" + entry.bootyType + "] " + entry.lootTable + newline; } output += "Time Required To Gain Simulated Booty: " + respawnTime * 100 + " Seconds" + newline; output += "GLASS DROPS: " + GlassItems.size() + newline; - for(Item glassItem : GlassItems){ - output += glassItem.getName() + newline; - } output += "RUNE DROPS: " + Runes.size() + newline; - for(Item runeItem : Runes){ - output += runeItem.getName() + newline; - } output += "CONTRACTS DROPS: " + Contracts.size() + newline; - for(Item contractItem : Contracts){ - output += contractItem.getName() + newline; - } output += "RESOURCE DROPS: " + Resources.size() + newline; - for(Item resourceItem : Contracts){ - output += resourceItem.getName() + newline; - } output += "OFFERINGS DROPPED: " + Offerings.size() + newline; output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline; output += "FAILED ROLLS: " + failures + newline; diff --git a/src/engine/loot/LootManager.java b/src/engine/loot/LootManager.java index 445a6c8c..5beec32e 100644 --- a/src/engine/loot/LootManager.java +++ b/src/engine/loot/LootManager.java @@ -144,23 +144,25 @@ public class LootManager { } outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); Enum.ItemType outType = outItem.getItemBase().getType(); - if(outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal() && outItem.getItemBase().isGlass() == false) { - ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable); - ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable); - if (modTables.get(prefixTable.getRowForRange(100).modTableID) != null) { - ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(100).modTableID); - ModTableRow prefixMod = prefixModTable.getRowForRange(new Random().nextInt(maxRollRange) + minRollRange); - if (prefixMod != null && prefixMod.action.length() > 0) { - outItem.setPrefix(prefixMod.action); - } - } - if (modTables.get(suffixTable.getRowForRange(100).modTableID) != null) { - ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(100).modTableID); - ModTableRow suffixMod = suffixModTable.getRowForRange(new Random().nextInt(maxRollRange) + minRollRange); - if (suffixMod != null && suffixMod.action.length() > 0) { - outItem.setSuffix(suffixMod.action); - } - } + if(outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) { + if(outItem.getItemBase().isGlass() == false) { + ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable); + ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable); + if (modTables.get(prefixTable.getRowForRange(100).modTableID) != null) { + ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(100).modTableID); + ModTableRow prefixMod = prefixModTable.getRowForRange(new Random().nextInt(maxRollRange) + minRollRange); + if (prefixMod != null && prefixMod.action.length() > 0) { + outItem.setPrefix(prefixMod.action); + } + } + if (modTables.get(suffixTable.getRowForRange(100).modTableID) != null) { + ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(100).modTableID); + ModTableRow suffixMod = suffixModTable.getRowForRange(new Random().nextInt(maxRollRange) + minRollRange); + if (suffixMod != null && suffixMod.action.length() > 0) { + outItem.setSuffix(suffixMod.action); + } + } + } } return outItem; }