From 92cb7418223e71b472847092174c40d683c7ff95 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 3 Aug 2023 19:34:42 -0500 Subject: [PATCH] equipment drops added to simulate booty command --- src/engine/devcmd/cmds/simulateBootyCmd.java | 50 +++++++++----------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/src/engine/devcmd/cmds/simulateBootyCmd.java b/src/engine/devcmd/cmds/simulateBootyCmd.java index 2f6a520c..9c84322c 100644 --- a/src/engine/devcmd/cmds/simulateBootyCmd.java +++ b/src/engine/devcmd/cmds/simulateBootyCmd.java @@ -9,6 +9,7 @@ import engine.gameManager.ZoneManager; import engine.objects.*; import java.util.ArrayList; +import java.util.concurrent.ThreadLocalRandom; public class simulateBootyCmd extends AbstractDevCmd { public simulateBootyCmd() { @@ -50,32 +51,14 @@ public class simulateBootyCmd extends AbstractDevCmd { Enum.GameObjectType objType = target.getObjectType(); - int objectUUID = target.getObjectUUID(); String output; output = "Booty Simulation:" + newline; switch (objType) { - case Building: - - break; - case PlayerCharacter: - - break; - - case NPC: - - break; - case Mob: Mob mob = (Mob) target; output += "Name: " + mob.getName() + newline; - int max = (int)(4.882 * mob.level + 127.0); - if(max > 320){ - max = 320; - } - int min = (int)(4.469 * mob.level - 3.469); - output += "Roll Range: " + min + " - " + max + newline; output += "Special Loot:" + newline; if (mob.bootySet != 0) { for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.bootySet)) { @@ -91,6 +74,7 @@ public class simulateBootyCmd extends AbstractDevCmd { ArrayList Contracts = new ArrayList(); ArrayList Offerings = new ArrayList(); ArrayList OtherDrops = new ArrayList(); + ArrayList EquipmentDrops = new ArrayList(); int failures = 0; int goldAmount = 0; for (int i = 0; i < 100; ++i) { @@ -128,10 +112,22 @@ public class simulateBootyCmd extends AbstractDevCmd { } catch (Exception ex) { failures++; } - } - int respawnTime = mob.getMobBase().getSpawnTime(); - if (mob.spawnTime > 0) { - respawnTime = mob.spawnTime; + if (mob.getEquip() != null) { + for (MobEquipment me : mob.getEquip().values()) { + + if (me.getDropChance() == 0) + continue; + + float equipmentRoll = ThreadLocalRandom.current().nextInt(99) + 1; + float dropChance = me.getDropChance() * 100; + + if (equipmentRoll > (dropChance)) + continue; + MobLoot ml = new MobLoot(mob, me.getItemBase(), false); + if (ml != null) + EquipmentDrops.add(ml); + } + } } output += "MobBase BootySet: " + mob.getMobBase().bootySet + newline; output += "Mob BootySet: " + mob.bootySet + newline; @@ -145,18 +141,18 @@ public class simulateBootyCmd extends AbstractDevCmd { output += "HOTZONE TABLE [" + entry.bootyType + "] " + entry.lootTable + 1 + newline; } } - output += "Time Required To Gain Simulated Booty: " + respawnTime * 100 + " Seconds" + newline; output += "GLASS DROPS: " + GlassItems.size() + newline; output += "RUNE DROPS: " + Runes.size() + newline; output += "CONTRACTS DROPS: " + Contracts.size() + newline; - for (Item contract : Contracts){ - output += contract.getName() + newline; - } output += "RESOURCE DROPS: " + Resources.size() + newline; output += "OFFERINGS DROPPED: " + Offerings.size() + newline; - output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline; + output += "ENCHANTED ITEMS DROPPED: " + OtherDrops.size() + newline; + output += "TOTAL GOLD DROPPED: " + goldAmount + newline; + output += "EQUIPMENT DROPPED: " + EquipmentDrops.size() + newline; output += "FAILED ROLLS: " + failures + newline; break; + default: + break; } throwbackInfo(pc, output); }