fix(Core/Spells): Enter combat at spell launch for delayed spells (#25167)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: Treeston <treeston.mmoc@gmail.com>
This commit is contained in:
parent
9e6fcb827f
commit
a5b0cee779
1 changed files with 10 additions and 0 deletions
|
|
@ -2593,6 +2593,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
|||
|
||||
m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
|
||||
|
||||
if (m_originalCaster && missInfo != SPELL_MISS_EVADE && !m_originalCaster->IsFriendlyTo(effectUnit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) && (m_spellInfo->HasInitialAggro() || effectUnit->IsEngaged()))
|
||||
effectUnit->SetInCombatWith(m_originalCaster);
|
||||
|
||||
PrepareScriptHitHandlers();
|
||||
CallScriptBeforeHitHandlers(missInfo);
|
||||
|
||||
|
|
@ -8289,6 +8292,13 @@ void Spell::HandleLaunchPhase()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_originalCaster && target.missCondition != SPELL_MISS_EVADE)
|
||||
{
|
||||
Unit* targetUnit = m_caster->GetGUID() == target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID);
|
||||
if (targetUnit && !m_originalCaster->IsFriendlyTo(targetUnit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) && (m_spellInfo->HasInitialAggro() || targetUnit->IsEngaged()))
|
||||
m_originalCaster->SetInCombatWith(targetUnit, true);
|
||||
}
|
||||
|
||||
DoAllEffectOnLaunchTarget(target, multiplier);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue