From 071eb26e48c79cd84e0334e6ae23c1aea6663e4f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 8 Aug 2023 08:31:11 -0400 Subject: [PATCH] Powers also loaded from contract. --- src/engine/objects/Mob.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index fc3b508c..43eca335 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -60,7 +60,7 @@ public class Mob extends AbstractIntelligenceAgent { public boolean despawned = false; public Vector3fImmutable destination = Vector3fImmutable.ZERO; public Vector3fImmutable localLoc = Vector3fImmutable.ZERO; - public HashMap mobPowers; + public HashMap mobPowers = new HashMap<>(); public MobBase mobBase; public int spawnTime; public Zone parentZone; @@ -1947,8 +1947,15 @@ public class Mob extends AbstractIntelligenceAgent { } mobPowers = new HashMap<>(); + // Powers from mobbase + if (PowersManager.AllMobPowers.containsKey(this.getMobBaseID())) - mobPowers = PowersManager.AllMobPowers.get(this.getMobBaseID()); + mobPowers.putAll(PowersManager.AllMobPowers.get(this.getMobBaseID())); + + // Powers from contract + + if (PowersManager.AllMobPowers.containsKey(this.contract.getContractID())) + mobPowers.putAll(PowersManager.AllMobPowers.get(this.contract.getContractID())); if (this.equip == null) { Logger.error("Null equipset returned for uuid " + currentID); @@ -1956,7 +1963,7 @@ public class Mob extends AbstractIntelligenceAgent { } // Combine mobbase and mob aggro arrays into one bitvector //skip for pets - if(this.isPet() == false && this.isSummonedPet() == false && this.isNecroPet() == false) { + if (this.isPet() == false && this.isSummonedPet() == false && this.isNecroPet() == false) { if (this.getMobBase().notEnemy.size() > 0) this.notEnemy.addAll(this.getMobBase().notEnemy);