diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 558660b9..55bf409d 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -2117,6 +2117,7 @@ public class Mob extends AbstractIntelligenceAgent { try { NPCManager.applyRuneSetEffects(this); + MobBase.applyMobbaseEffects(this); recalculateStats(); this.setHealth(this.healthMax); diff --git a/src/engine/objects/MobBase.java b/src/engine/objects/MobBase.java index 80adffb0..0ea544eb 100644 --- a/src/engine/objects/MobBase.java +++ b/src/engine/objects/MobBase.java @@ -13,8 +13,11 @@ import ch.claude_martin.enumbitset.EnumBitSet; import engine.Enum; import engine.gameManager.DbManager; import engine.gameManager.LootManager; +import engine.gameManager.PowersManager; import engine.loot.BootySetEntry; +import engine.powers.EffectsBase; import engine.server.MBServerStatics; +import org.pmw.tinylog.Logger; import java.sql.ResultSet; import java.sql.SQLException; @@ -54,6 +57,8 @@ public class MobBase extends AbstractGameObject { private float walkCombat = 0; private float runCombat = 0; + public ArrayList mobbaseEffects; + /** * ResultSet Constructor */ @@ -108,6 +113,7 @@ public class MobBase extends AbstractGameObject { this.mobBaseStats = DbManager.MobBaseQueries.LOAD_STATS(this.loadID); DbManager.MobBaseQueries.LOAD_ALL_MOBBASE_SPEEDS(this); + this.mobbaseEffects = DbManager.MobBaseQueries.GET_RUNEBASE_EFFECTS(this.getObjectUUID()); } @@ -301,4 +307,19 @@ public class MobBase extends AbstractGameObject { return runCombat; } + public static void applyMobbaseEffects(Mob mob){ + for(MobBaseEffects mbe : mob.mobBase.mobbaseEffects){ + if(mob.level == mbe.getReqLvl()){ + try { + //PowersManager.applyPower(mob, mob, mob.loc, mbe.getToken(), mbe.getRank(), false); + EffectsBase effectsBase = PowersManager.getEffectByToken(mbe.getToken()); + if(effectsBase != null) + mob.addEffectNoTimer(Integer.toString(effectsBase.getUUID()), effectsBase, mbe.getRank(), true); + }catch(Exception e){ + Logger.error("NULL POWER FOR MOB: " + mob.getObjectUUID() + ", POWER TOKEN: " + mbe.getToken()); + } + } + } + } + }