From d709080029acabc2a82af9bba23339314e40baf1 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sun, 12 May 2024 21:06:42 +0200 Subject: [PATCH] fix(Karazhan/Nightbane): no longer killable during flight (#18890) add unkillable during flight phase _flying: takeoff/landing, moving to location Phase 2: in the air and casting air spells --- .../EasternKingdoms/Karazhan/boss_nightbane.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 9393086c73d0ff..9ac6fe2450e585 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -109,6 +109,18 @@ struct boss_nightbane : public BossAI me->GetMotionMaster()->MoveTakeoff(POINT_DESPAWN, -11013.246f, -1770.5212f, 166.50139f); } + void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageEffectType, SpellSchoolMask spellSchoolMask) override + { + if (_flying || Phase == 2) + { + if (damage >= me->GetHealth()) + { + damage = me->GetHealth() - 1; + } + } + BossAI::DamageTaken(attacker, damage, damageEffectType, spellSchoolMask); + } + void JustEngagedWith(Unit* who) override { BossAI::JustEngagedWith(who);