diff --git a/src/game/Combat/ThreatManager.cpp b/src/game/Combat/ThreatManager.cpp index dc45ab34001..03e5de5bf03 100644 --- a/src/game/Combat/ThreatManager.cpp +++ b/src/game/Combat/ThreatManager.cpp @@ -476,6 +476,8 @@ void ThreatManager::addThreat(Unit* victim, float threat, bool crit, SpellSchool auto& redirectionData = victim->getHostileRefManager().GetThreatRedirectionData(); for (auto& redirection : redirectionData) { + if (getOwner()->IsIgnoringMisdirect()) + break; float redirectedMod = redirection.second.mod; Unit* redirectedTarget = iOwner->GetMap()->GetUnit(redirection.second.target); if (!redirectedTarget) diff --git a/src/game/Entities/Creature.cpp b/src/game/Entities/Creature.cpp index 90114fd6a5f..54827765c87 100644 --- a/src/game/Entities/Creature.cpp +++ b/src/game/Entities/Creature.cpp @@ -2958,6 +2958,18 @@ void Creature::SetIgnoreSanctuary(bool state) m_settings.RemoveFlag(CreatureStaticFlags2::IGNORE_SANCTUARY); } +bool Creature::IsIgnoringMisdirect() const +{ + return m_settings.HasFlag(CreatureStaticFlags2::IGNORE_MISDIRECTION); +} + +void Creature::SetIgnoreMisdirect(bool state) +{ + if (state) + m_settings.SetFlag(CreatureStaticFlags2::IGNORE_MISDIRECTION); + else + m_settings.RemoveFlag(CreatureStaticFlags2::IGNORE_MISDIRECTION); +} void Creature::SetNoWoundedSlowdown(bool state) { diff --git a/src/game/Entities/Creature.h b/src/game/Entities/Creature.h index a2d453e863f..884051c737e 100644 --- a/src/game/Entities/Creature.h +++ b/src/game/Entities/Creature.h @@ -860,6 +860,9 @@ class Creature : public Unit void SetNoWeaponSkillGain(bool state); bool IsNoWeaponSkillGain() const override; + bool IsIgnoringMisdirect() const override; + void SetIgnoreMisdirect(bool state); + bool IsPreventingDeath() const override; virtual void AddCooldown(SpellEntry const& spellEntry, ItemPrototype const* itemProto = nullptr, bool permanent = false, uint32 forcedDuration = 0, bool ignoreCat = false) override; diff --git a/src/game/Entities/Unit.h b/src/game/Entities/Unit.h index 07518ba7d85..ba54d680077 100644 --- a/src/game/Entities/Unit.h +++ b/src/game/Entities/Unit.h @@ -2464,6 +2464,8 @@ class Unit : public WorldObject virtual bool IsIgnoringFeignDeath() const { return false; } virtual bool IsIgnoringSanctuary() const { return false; } + virtual bool IsIgnoringMisdirect() const { return false; } + virtual bool IsSlowedInCombat() const { return false; } void InterruptSpellsCastedOnMe(bool killDelayed = false);