From c2e0979dc359ac28ef4927f53ec4c4962113159b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 13 Mar 2024 21:51:55 -0500 Subject: [PATCH] drop rate work --- src/engine/devcmd/cmds/SimulateBootyCmd.java | 8 ++++++-- src/engine/gameManager/LootManager.java | 8 ++++++-- src/engine/mobileAI/MobAI.java | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/engine/devcmd/cmds/SimulateBootyCmd.java b/src/engine/devcmd/cmds/SimulateBootyCmd.java index 0701df3b..c80ef070 100644 --- a/src/engine/devcmd/cmds/SimulateBootyCmd.java +++ b/src/engine/devcmd/cmds/SimulateBootyCmd.java @@ -55,7 +55,7 @@ public class SimulateBootyCmd extends AbstractDevCmd { int failures = 0; int goldAmount = 0; - for (int i = 0; i < 1000; ++i) { + for (int i = 0; i < 10000; ++i) { try { mob.loadInventory(); @@ -83,7 +83,11 @@ public class SimulateBootyCmd extends AbstractDevCmd { goldAmount += lootItem.getNumOfItems(); break; default: - OtherDrops.add(lootItem); + if(Warehouse.maxResources.containsKey(lootItem.getItemBaseID())){ + Resources.add(lootItem); + } else { + OtherDrops.add(lootItem); + } break; } } diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index dd56b1e9..c122420d 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -200,9 +200,13 @@ public enum LootManager { if (ItemBase.getItemBase(itemUUID).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) { int chance = ThreadLocalRandom.current().nextInt(1,101); - if(chance > 5) + if(chance > 10) return null; - int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1); + int amount = ThreadLocalRandom.current().nextInt((int)(tableRow.minSpawn * 0.5f), (int)((tableRow.maxSpawn + 1) * 0.5f)); + ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " HAS FOUND " + amount + " " + ItemBase.getItemBase(itemUUID).getName() + ". "); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); return new MobLoot(mob, ItemBase.getItemBase(itemUUID), amount, false); } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index c4ccb590..7c70235f 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -249,6 +249,9 @@ public class MobAI { if(target.isPet() && target.isAlive() == false && target.guardCaptain.isAlive() == true){ mob.setCombatTarget(target.guardCaptain); } + if(target.level > 75){ + AttackMob(target,mob); + } } catch (Exception e) { Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage()); }