aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-06-28 16:19:14 +0200
committerShauren <shauren.trinity@gmail.com>2024-06-28 16:19:14 +0200
commit3365e6a4b84f59cca5f7ef5fca71fb3979697e52 (patch)
tree8318d3cb0a2b820a35ba3e4242d1b108d3c622db /src/server/game/Entities/Unit
parent270b53b26ad833314321a1d93a9415ee068b970d (diff)
Core/Spells: Implemented SPELL_ATTR9_ALLOW_CAST_WHILE_CHANNELING
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index d8e841dcbba..acbcac3d13c 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2980,7 +2980,9 @@ void Unit::SetCurrentCastSpell(Spell* pSpell)
InterruptSpell(CURRENT_GENERIC_SPELL, false);
// generic spells always break channeled not delayed spells
- if (m_currentSpells[CURRENT_CHANNELED_SPELL] && !m_currentSpells[CURRENT_CHANNELED_SPELL]->GetSpellInfo()->HasAttribute(SPELL_ATTR5_ALLOW_ACTIONS_DURING_CHANNEL))
+ if (m_currentSpells[CURRENT_CHANNELED_SPELL]
+ && !m_currentSpells[CURRENT_CHANNELED_SPELL]->GetSpellInfo()->HasAttribute(SPELL_ATTR5_ALLOW_ACTIONS_DURING_CHANNEL)
+ && !pSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR9_ALLOW_CAST_WHILE_CHANNELING))
InterruptSpell(CURRENT_CHANNELED_SPELL, false);
// autorepeat breaking
@@ -4095,13 +4097,13 @@ void Unit::RemoveNotOwnSingleTargetAuras(bool onPhaseChange /*= false*/)
}
template<typename InterruptFlag>
-bool IsInterruptFlagIgnoredForSpell(InterruptFlag /*flag*/, Unit const* /*unit*/, SpellInfo const* /*auraSpellInfo*/, SpellInfo const* /*interruptSource*/)
+bool IsInterruptFlagIgnoredForSpell(InterruptFlag /*flag*/, Unit const* /*unit*/, SpellInfo const* /*auraSpellInfo*/, bool /*isChannel*/, SpellInfo const* /*interruptSource*/)
{
return false;
}
template<>
-bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags flag, Unit const* unit, SpellInfo const* auraSpellInfo, SpellInfo const* interruptSource)
+bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags flag, Unit const* unit, SpellInfo const* auraSpellInfo, bool isChannel, SpellInfo const* interruptSource)
{
switch (flag)
{
@@ -4116,6 +4118,9 @@ bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags flag, Unit const* un
if (interruptSource->HasAttribute(SPELL_ATTR2_ALLOW_WHILE_INVISIBLE) && auraSpellInfo->Dispel == DISPEL_INVISIBILITY)
return true;
+
+ if (interruptSource->HasAttribute(SPELL_ATTR9_ALLOW_CAST_WHILE_CHANNELING) && isChannel)
+ return true;
}
break;
default:
@@ -4138,7 +4143,7 @@ void Unit::RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const* s
++iter;
if (aura->GetSpellInfo()->HasAuraInterruptFlag(flag)
&& (!source || aura->GetId() != source->Id)
- && !IsInterruptFlagIgnoredForSpell(flag, this, aura->GetSpellInfo(), source))
+ && !IsInterruptFlagIgnoredForSpell(flag, this, aura->GetSpellInfo(), false, source))
{
uint32 removedAuras = m_removedAurasCount;
RemoveAura(aura, AURA_REMOVE_BY_INTERRUPT);
@@ -4152,7 +4157,7 @@ void Unit::RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const* s
if (spell->getState() == SPELL_STATE_CASTING
&& spell->GetSpellInfo()->HasChannelInterruptFlag(flag)
&& (!source || spell->GetSpellInfo()->Id != source->Id)
- && !IsInterruptFlagIgnoredForSpell(flag, this, spell->GetSpellInfo(), source))
+ && !IsInterruptFlagIgnoredForSpell(flag, this, spell->GetSpellInfo(), true, source))
InterruptNonMeleeSpells(false);
UpdateInterruptMask();