From b18994a7c0b92e213bfd6df9c3e80cb3c32e1409 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 7 Apr 2023 22:04:39 -0500 Subject: [PATCH] simulate booty command work --- src/engine/devcmd/cmds/simulateBootyCmd.java | 63 +++++++++++--------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index b4c1ad1f..91810521 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -73,43 +73,50 @@ public class simulateBootyCmd extends AbstractDevCmd { ArrayList Contracts = new ArrayList(); ArrayList Offerings = new ArrayList(); ArrayList OtherDrops = new ArrayList(); - ArrayListReturnedBootyList = new ArrayList(); + int failures = 0; for(int i = 0; i < 100; ++i) { - mob.loadInventory(); - for(Item lootItem : mob.getCharItemManager().getInventory()){ - ReturnedBootyList.add(lootItem); - } - } - for(Item ml : ReturnedBootyList){ - if(ml.getItemBase().isGlass() == true){ - GlassItems.add(ml); - break; - } - switch(ml.getItemBase().getType().ordinal()){ - case 20: //CONTRACT - Contracts.add(ml); - break; - case 33: //OFFERING - Offerings.add(ml); - break; - case 34: //RESOURCE - Resources.add(ml); - break; - case 5: //RUNE - Runes.add(ml); - break; - default: - OtherDrops.add(ml); - break; + + 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); + break; + case OFFERING: //OFFERING + Offerings.add(lootItem); + break; + case RESOURCE: //RESOURCE + Resources.add(lootItem); + break; + case RUNE: //RUNE + Runes.add(lootItem); + break; + case WEAPON: //WEAPON + if (lootItem.getItemBase().isGlass()) { + GlassItems.add(lootItem); + } else { + OtherDrops.add(lootItem); + } + break; + default: + OtherDrops.add(lootItem); + break; + } + } + } catch (Exception ex) { + failures++; } } - output += "TOTAL ITEMS DROPPED: " + ReturnedBootyList.size() + newline; output += "GLASS ITEMS DROPPED: " + GlassItems.size() + newline; output += "RESOURCE STACKS DROPPED: " + Resources.size() + newline; output += "RUNES DROPPED: " + Runes.size() + newline; output += "CONTRACTS DROPPED: " + Contracts.size() + newline; output += "OFFERINGS DROPPED: " + Offerings.size() + newline; output += "OTHERS DROPPED: " + OtherDrops.size() + newline; + output += "FAILED ROLLS: " + failures + newline; break; }