From 30175be56acffa76062a5034426e86ade7bb623e Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 9 Apr 2023 13:43:12 -0400 Subject: [PATCH] MonsterTypes loaded into Mob. --- src/engine/gameManager/NPCManager.java | 8 ++++---- src/engine/objects/Mob.java | 12 +++++++++--- src/engine/objects/MobBase.java | 2 -- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index 2e4239c8..7262f2d8 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -38,12 +38,12 @@ public enum NPCManager { // Early exit - if (mob.runeSetID == 0) + if (mob.runeSet == 0) return; //Apply all rune effects. - if (NPCManager._runeSetMap.get(mob.runeSetID).contains(252623)) { + if (NPCManager._runeSetMap.get(mob.runeSet).contains(252623)) { mob.isPlayerGuard = true; mob.setNoAggro(true); } @@ -56,8 +56,8 @@ public enum NPCManager { // Apply effects from RuneSet - if (mob.runeSetID != 0) - for (int runeID : _runeSetMap.get(mob.runeSetID)) + if (mob.runeSet != 0) + for (int runeID : _runeSetMap.get(mob.runeSet)) applyEffectsForRune(mob, runeID); // Not sure why but apply Warrior effects for some reason? diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index cb371dcb..aa5e6f76 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -9,6 +9,7 @@ package engine.objects; +import ch.claude_martin.enumbitset.EnumBitSet; import engine.Enum; import engine.Enum.*; import engine.InterestManagement.WorldGrid; @@ -31,7 +32,6 @@ import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ManageCityAssetsMsg; import engine.net.client.msg.PetMsg; import engine.net.client.msg.PlaceAssetMsg; -import engine.net.client.msg.chat.ChatSystemMsg; import engine.server.MBServerStatics; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -105,9 +105,12 @@ public class Mob extends AbstractIntelligenceAgent { private DateTime upgradeDateTime = null; private boolean lootSync = false; public int equipmentSetID = 0; - public int runeSetID = 0; + public int runeSet = 0; public int bootySet = 0; + public EnumBitSet notEnemy = EnumBitSet.just(MonsterType.NONE); + public EnumBitSet enemy = EnumBitSet.just(MonsterType.NONE);; + /** * No Id Constructor */ @@ -285,9 +288,12 @@ public class Mob extends AbstractIntelligenceAgent { this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID)); this.equipmentSetID = rs.getInt("equipmentSet"); - this.runeSetID = rs.getInt("runeSet"); + this.runeSet = rs.getInt("runeSet"); this.bootySet = rs.getInt("bootySet"); + this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class); + this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class); + if (this.contract != null) this.equipmentSetID = this.contract.getEquipmentSet(); diff --git a/src/engine/objects/MobBase.java b/src/engine/objects/MobBase.java index f231af21..f8683db0 100644 --- a/src/engine/objects/MobBase.java +++ b/src/engine/objects/MobBase.java @@ -112,8 +112,6 @@ public class MobBase extends AbstractGameObject { this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), Enum.MobFlagType.class); this.noAggro = EnumBitSet.asEnumBitSet(rs.getLong("noaggro"), Enum.AggroType.class); - // From cache data - this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class); this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class);