From 0bb3c84fedbd4477a6fa76542ace5e8e2c1264aa Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 7 Apr 2023 19:50:49 -0500 Subject: [PATCH] enable simulateBooty command --- src/engine/devcmd/cmds/simulateBootyCmd.java | 31 +++++++++++--------- src/engine/gameManager/DevCmdManager.java | 1 + 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index fc8c4955..9b3692bb 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -129,20 +129,23 @@ public class simulateBootyCmd extends AbstractDevCmd { //if mob is inside hotzone, use the hotzone gold multiplier form the config instead multiplier = Float.parseFloat(ConfigManager.MB_HOTZONE_DROP_RATE.getValue()); } - //iterate the booty sets - ArrayList output1 = new ArrayList<>(); - ArrayList output2 = new ArrayList<>(); - if(mob.getMobBase().bootySet != 0 && NPCManager._bootySetMap.containsKey(mob.getMobBase().bootySet)) { - output1 = RunBootySet(NPCManager._bootySetMap.get(mob.getMobBase().bootySet), mob, multiplier, inHotzone); - } - if(mob.bootySet != 0) { - output2 =RunBootySet(NPCManager._bootySetMap.get(mob.bootySet), mob, multiplier, inHotzone); - } - for(MobLoot lootItem : output1){ - outList.add((lootItem)); - } - for(MobLoot lootItem : output2){ - outList.add((lootItem)); + //simulate loot 100 times + for(int i = 0; i < 100; ++i) { + //iterate the booty sets + ArrayList output1 = new ArrayList<>(); + ArrayList output2 = new ArrayList<>(); + if (mob.getMobBase().bootySet != 0 && NPCManager._bootySetMap.containsKey(mob.getMobBase().bootySet)) { + output1 = RunBootySet(NPCManager._bootySetMap.get(mob.getMobBase().bootySet), mob, multiplier, inHotzone); + } + if (mob.bootySet != 0) { + output2 = RunBootySet(NPCManager._bootySetMap.get(mob.bootySet), mob, multiplier, inHotzone); + } + for (MobLoot lootItem : output1) { + outList.add((lootItem)); + } + for (MobLoot lootItem : output2) { + outList.add((lootItem)); + } } return outList; } diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 66521d62..4232f38f 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -56,6 +56,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new PrintResistsCmd()); DevCmdManager.registerDevCmd(new PrintLocationCmd()); DevCmdManager.registerDevCmd(new InfoCmd()); + DevCmdManager.registerDevCmd(new simulateBootyCmd()); DevCmdManager.registerDevCmd(new GetHeightCmd()); // Tester