From 8fb6c43c667609b75287d13c82c708ee6adb9d44 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 21 Aug 2023 19:21:50 -0500 Subject: [PATCH 1/5] alternative loot drop limitation --- src/engine/gameManager/LootManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 1e2da274..4162f94f 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -338,7 +338,7 @@ public enum LootManager { public static void GenerateEquipmentDrop(Mob mob) { //do equipment here - + int dropCount = 0; if (mob.getEquip() != null) for (MobEquipment me : mob.getEquip().values()) { @@ -353,11 +353,12 @@ public enum LootManager { MobLoot ml = new MobLoot(mob, me.getItemBase(), false); - if (ml != null) { + if (ml != null && dropCount < 1) { ml.setIsID(true); ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); mob.getCharItemManager().addItemToInventory(ml); - break; // Exit on first successful roll. + dropCount = 1; + //break; // Exit on first successful roll. } } } From f636f4d2ec0bbd6ca15962b66ad1a97cdaa07499 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 21 Aug 2023 19:36:46 -0500 Subject: [PATCH 2/5] optimized equipment dropping system --- src/engine/gameManager/LootManager.java | 19 ++++++------------- src/engine/objects/Mob.java | 4 ++-- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 4162f94f..a569324d 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -66,27 +66,25 @@ public enum LootManager { } - public static void GenerateMobLoot(Mob mob, boolean fromDeath) { + public static void GenerateMobLoot(Mob mob) { //determine if mob is in hotzone - boolean inHotzone = ZoneManager.inHotZone(mob.getLoc()); //iterate the booty sets if (mob.getMobBase().bootySet != 0 && _bootySetMap.containsKey(mob.getMobBase().bootySet) == true) - RunBootySet(_bootySetMap.get(mob.getMobBase().bootySet), mob, inHotzone, fromDeath); + RunBootySet(_bootySetMap.get(mob.getMobBase().bootySet), mob, inHotzone); if (mob.bootySet != 0 && _bootySetMap.containsKey(mob.bootySet) == true) - RunBootySet(_bootySetMap.get(mob.bootySet), mob, inHotzone, fromDeath); + RunBootySet(_bootySetMap.get(mob.bootySet), mob, inHotzone); //lastly, check mobs inventory for godly or disc runes to send a server announcement - - if (!fromDeath) for (Item it : mob.getInventory()) { ItemBase ib = it.getItemBase(); - + if(ib == null) + break; if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) { ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?"); chatMsg.setMessageType(10); @@ -97,16 +95,11 @@ public enum LootManager { } - private static void RunBootySet(ArrayList entries, Mob mob, boolean inHotzone, boolean fromDeath) { + private static void RunBootySet(ArrayList entries, Mob mob, boolean inHotzone) { boolean hotzoneWasRan = false; float dropRate = 1.0f; - if (fromDeath) { - GenerateEquipmentDrop(mob); - return; - } - // Iterate all entries in this bootySet and process accordingly for (BootySetEntry bse : entries) { diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index a7e26c1b..74cf0f8c 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1347,7 +1347,7 @@ public class Mob extends AbstractIntelligenceAgent { playerAgroMap.clear(); if (!this.isPlayerGuard && this.equip != null) - LootManager.GenerateMobLoot(this, true); + LootManager.GenerateEquipmentDrop(this); } try { @@ -1437,7 +1437,7 @@ public class Mob extends AbstractIntelligenceAgent { if (isPlayerGuard) return; - LootManager.GenerateMobLoot(this, false); + LootManager.GenerateMobLoot(this); } @Override From 2b83db7bba5c19df35a6a2fcdc3684775f621d46 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 21 Aug 2023 19:48:44 -0500 Subject: [PATCH 3/5] moved initial loadInventory call to runAfterLoad --- src/engine/objects/Mob.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 74cf0f8c..3328caa3 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -980,9 +980,6 @@ public class Mob extends AbstractIntelligenceAgent { else this.currentID = this.dbID; - if (!isPet && !isSiege && !this.isPlayerGuard) - loadInventory(); - //store mobs by Database ID if (!isPet && !isSiege) @@ -1931,7 +1928,7 @@ public class Mob extends AbstractIntelligenceAgent { // Initialize inventory this.charItemManager = new CharacterItemManager(this); - + this.loadInventory(); try { if (this.equipmentSetID != 0) this.equip = MobBase.loadEquipmentSet(this.equipmentSetID); From ea2241732a9b49bc13921b7d11f8df97127feb68 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 21 Aug 2023 20:02:26 -0500 Subject: [PATCH 4/5] fixed bug where pet persisted through dismissal --- src/engine/objects/Mob.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 3328caa3..70602b02 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -2231,7 +2231,7 @@ public class Mob extends AbstractIntelligenceAgent { if (this.isPet()) { if ((this.agentType.equals(AIAgentType.PET))) { //delete summoned pet - + this.despawn(); WorldGrid.RemoveWorldObject(this); DbManager.removeFromCache(this); From e5fba340fbd7e022eb0530bd230f36a119269093 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 21 Aug 2023 20:24:49 -0500 Subject: [PATCH 5/5] guard minion AI restored to follow captain attack commands --- src/engine/mobileAI/MobAI.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 751ffc0e..676a8c4a 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -1074,12 +1074,10 @@ public class MobAI { } }else { if (mob.npcOwner.getCombatTarget() != null) - if(mob.getCombatTarget() != null && mob.getCombatTarget().equals(mob.npcOwner.getCombatTarget()) == false) mob.setCombatTarget(mob.npcOwner.getCombatTarget()); else - if(mob.getCombatTarget() != null) { + if (mob.getCombatTarget() != null) mob.setCombatTarget(null); - } } CheckMobMovement(mob); CheckForAttack(mob);