mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
fix(Scripts/Spells): Mind Control should put both caster and target in combat. (#9301)
Fixes #8938
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1637699382534407800');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=605;
|
||||
INSERT INTO `spell_script_names` VALUES
|
||||
(605,'spell_pri_mind_control');
|
||||
@@ -12988,7 +12988,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration)
|
||||
if (controlled->GetTypeId() == TYPEID_UNIT && controlled->ToCreature()->HasReactState(REACT_PASSIVE))
|
||||
continue;
|
||||
|
||||
controlled->SetInCombatState(PvP, enemy);
|
||||
controlled->SetInCombatState(PvP, enemy, duration);
|
||||
}
|
||||
#ifdef ELUNA
|
||||
if (Player* player = this->ToPlayer())
|
||||
|
||||
@@ -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