mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
fix(Scripts/Spells): Mind Control should put both caster and target in combat. (#9301)
Fixes #8938
This commit is contained in:
@@ -807,6 +807,33 @@ class spell_pri_vampiric_touch : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 605 - Mind Control
|
||||
class spell_pri_mind_control : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pri_mind_control);
|
||||
|
||||
void OnHit()
|
||||
{
|
||||
if (Aura const* aura = GetHitAura())
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
uint32 duration = static_cast<uint32>(aura->GetMaxDuration());
|
||||
caster->SetInCombatWith(target, duration);
|
||||
target->SetInCombatWith(caster, duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_pri_mind_control::OnHit);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_priest_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_pri_shadowfiend_scaling);
|
||||
@@ -828,4 +855,5 @@ void AddSC_priest_spell_scripts()
|
||||
RegisterSpellScript(spell_pri_renew);
|
||||
RegisterSpellScript(spell_pri_shadow_word_death);
|
||||
RegisterSpellScript(spell_pri_vampiric_touch);
|
||||
RegisterSpellScript(spell_pri_mind_control);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user