diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index 54f88a90..3a535e75 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -436,6 +436,44 @@ public enum NPCManager { } } + + if (mob.isNecroPet()) + applyNecroPetStats(mob); + } + + // No client data grants NECROPETSTATS, yet NEC-018 and DRU-066 require it on the target; the server adds it to necro pets + private static void applyNecroPetStats(Mob mob) { + + EffectsBase necroPetStats = PowersManager.getEffectByIDString("NECROPETSTATS"); + String effectKey; + Effect currentEffect; + int rank = -1; + + if (necroPetStats == null) { + Logger.error("NECROPETSTATS effect not loaded"); + return; + } + + // GUESS: rank follows the pet's own level ladder (PET_NECRO / PET_NECRO_HARDHIT, from reqLvl 9), as the old DB rows did + for (MobBaseEffects mbe : mob.mobBase.effectsList) + if (mbe.getReqLvl() > 0 && mbe.getReqLvl() <= (int) mob.level) + rank = Math.max(rank, mbe.getRank()); + + if (rank < 0) + return; + + effectKey = Integer.toString(necroPetStats.getUUID()); + currentEffect = mob.effects.get(effectKey); + + if (currentEffect != null) { + + if (currentEffect.getTrains() >= rank) + return; + + currentEffect.cancelJob(); + } + + mob.addEffectNoTimer(effectKey, necroPetStats, rank, true); } public static void applyEquipmentResists(Mob mob) {