fix(Scripts/TK): Kael'thas mind control should reset threat (#19264)

* fix(Scripts/TK): Kael'thas mind control should reset threat

* lol

* -2 lines

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
avarishd
2024-07-04 19:50:45 +03:00
committed by GitHub
parent 8180841163
commit f84a4f1408

View File

@@ -1143,9 +1143,19 @@ class spell_kaelthas_mind_control : public SpellScript
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
}
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (!GetCaster() || !GetHitPlayer())
return;
if (Player* player = GetHitPlayer())
GetCaster()->GetThreatMgr().ResetThreat(player);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kaelthas_mind_control::SelectTarget, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kaelthas_mind_control::HandleEffect, EFFECT_ALL, SPELL_AURA_ANY);
}
};