fix(Core): Ritual animations (#19602)

Channel the same spell as the original caster when clicking on a ritual
portal, but ignore the effects of the spell.

Co-authored-by: killerwife <killerwife@gmail.com>
This commit is contained in:
Saqra1
2024-08-13 09:54:17 -05:00
committed by GitHub
parent cc2ef9d6dd
commit ed824de7b8
3 changed files with 48 additions and 27 deletions

View File

@@ -4104,6 +4104,9 @@ void Spell::handle_immediate()
if (m_spellInfo->IsChanneled())
{
int32 duration = m_spellInfo->GetDuration();
if (HasTriggeredCastFlag(TRIGGERED_IGNORE_EFFECTS))
duration = -1;
if (duration > 0)
{
// First mod_duration then haste - see Missile Barrage
@@ -4370,8 +4373,12 @@ void Spell::SendSpellCooldown()
return;
}
// have infinity cooldown but set at aura apply // do not set cooldown for triggered spells (needed by reincarnation)
if (m_spellInfo->IsCooldownStartedOnEvent() || m_spellInfo->IsPassive() || (HasTriggeredCastFlag(TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) && !m_CastItem))
// have infinity cooldown but set at aura apply
// do not set cooldown for triggered spells (needed by reincarnation)
if (m_spellInfo->IsCooldownStartedOnEvent()
|| m_spellInfo->IsPassive()
|| (HasTriggeredCastFlag(TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) && !m_CastItem)
|| HasTriggeredCastFlag(TRIGGERED_IGNORE_EFFECTS))
return;
_player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0, this);
@@ -5600,6 +5607,9 @@ void Spell::HandleThreatSpells()
void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode)
{
if (HasTriggeredCastFlag(TRIGGERED_IGNORE_EFFECTS))
return;
effectHandleMode = mode;
unitTarget = pUnitTarget;
itemTarget = pItemTarget;
@@ -6016,6 +6026,11 @@ SpellCastResult Spell::CheckCast(bool strict)
return castResult;
}
if (HasTriggeredCastFlag(TRIGGERED_IGNORE_EFFECTS))
{
return SPELL_CAST_OK;
}
// xinef: do not skip triggered spells if they posses prevention type (eg. Bladestorm vs Hand of Protection)
if (!HasTriggeredCastFlag(TRIGGERED_IGNORE_CASTER_AURAS) || (m_spellInfo->PreventionType > SPELL_PREVENTION_TYPE_NONE && m_triggeredByAuraSpell && m_triggeredByAuraSpell.spellInfo->IsPositive()))
{
@@ -8056,6 +8071,9 @@ bool Spell::IsAutoActionResetSpell() const
bool Spell::IsNeedSendToClient(bool go) const
{
if (HasTriggeredCastFlag(TRIGGERED_IGNORE_EFFECTS))
return false;
return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || m_spellInfo->IsChanneled() ||
m_spellInfo->Speed > 0.0f || (!m_triggeredByAuraSpell && !IsTriggered()) ||
(go && m_triggeredByAuraSpell && m_triggeredByAuraSpell.spellInfo->IsChanneled());