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:
@@ -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
|
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();
|
PrepareScriptHitHandlers();
|
||||||
CallScriptBeforeHitHandlers(missInfo);
|
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);
|
DoAllEffectOnLaunchTarget(target, multiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user