Core/Spells: Implemented SPELL_ATTR9_ALLOW_CAST_WHILE_CHANNELING
Port From (https://github.com/TrinityCore/TrinityCore/commit/3365e6a4b84f59cca5f7ef5fca71fb3979697e52)
This commit is contained in:
@@ -1986,7 +1986,7 @@ namespace Framework.Constants
|
|||||||
AutocastOffByDefault = 0x20000, // AutoCast Off By Default
|
AutocastOffByDefault = 0x20000, // AutoCast Off By Default
|
||||||
IgnoreSchoolLockout = 0x40000, // Ignore School Lockout
|
IgnoreSchoolLockout = 0x40000, // Ignore School Lockout
|
||||||
AllowDarkSimulacrum = 0x80000, // Allow Dark Simulacrum
|
AllowDarkSimulacrum = 0x80000, // Allow Dark Simulacrum
|
||||||
Unk20 = 0x100000, // 20
|
AllowCastWhileChanneling = 0x100000, // Allow Cast While Channeling
|
||||||
Unk21 = 0x200000, // 21
|
Unk21 = 0x200000, // 21
|
||||||
Unk22 = 0x400000, // 22
|
Unk22 = 0x400000, // 22
|
||||||
Unk23 = 0x800000, // 23
|
Unk23 = 0x800000, // 23
|
||||||
|
|||||||
@@ -1814,7 +1814,8 @@ namespace Game.Entities
|
|||||||
InterruptSpell(CurrentSpellTypes.Generic, false);
|
InterruptSpell(CurrentSpellTypes.Generic, false);
|
||||||
|
|
||||||
// generic spells always break channeled not delayed spells
|
// generic spells always break channeled not delayed spells
|
||||||
if (GetCurrentSpell(CurrentSpellTypes.Channeled) != null && !GetCurrentSpell(CurrentSpellTypes.Channeled).GetSpellInfo().HasAttribute(SpellAttr5.AllowActionsDuringChannel))
|
if (GetCurrentSpell(CurrentSpellTypes.Channeled) != null && !GetCurrentSpell(CurrentSpellTypes.Channeled).GetSpellInfo().HasAttribute(SpellAttr5.AllowActionsDuringChannel)
|
||||||
|
&& !pSpell.GetSpellInfo().HasAttribute(SpellAttr9.AllowCastWhileChanneling))
|
||||||
InterruptSpell(CurrentSpellTypes.Channeled, false);
|
InterruptSpell(CurrentSpellTypes.Channeled, false);
|
||||||
|
|
||||||
// autorepeat breaking
|
// autorepeat breaking
|
||||||
@@ -2979,7 +2980,7 @@ namespace Game.Entities
|
|||||||
return dispelList;
|
return dispelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags flag, Unit unit, SpellInfo auraSpellInfo, SpellInfo interruptSource)
|
bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags flag, Unit unit, SpellInfo auraSpellInfo, bool isChannel, SpellInfo interruptSource)
|
||||||
{
|
{
|
||||||
switch (flag)
|
switch (flag)
|
||||||
{
|
{
|
||||||
@@ -2994,6 +2995,9 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (interruptSource.HasAttribute(SpellAttr2.AllowWhileInvisible) && auraSpellInfo.Dispel == DispelType.Invisibility)
|
if (interruptSource.HasAttribute(SpellAttr2.AllowWhileInvisible) && auraSpellInfo.Dispel == DispelType.Invisibility)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (interruptSource.HasAttribute(SpellAttr9.AllowCastWhileChanneling) && isChannel)
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -3003,7 +3007,7 @@ namespace Game.Entities
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags2 flag, Unit unit, SpellInfo auraSpellInfo, SpellInfo interruptSource)
|
bool IsInterruptFlagIgnoredForSpell(SpellAuraInterruptFlags2 flag, Unit unit, SpellInfo auraSpellInfo, bool isChannel, SpellInfo interruptSource)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3018,7 +3022,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
Aura aura = m_interruptableAuras[i].GetBase();
|
Aura aura = m_interruptableAuras[i].GetBase();
|
||||||
|
|
||||||
if (aura.GetSpellInfo().HasAuraInterruptFlag(flag) && (source == null || aura.GetId() != source.Id) && !IsInterruptFlagIgnoredForSpell(flag, this, aura.GetSpellInfo(), source))
|
if (aura.GetSpellInfo().HasAuraInterruptFlag(flag) && (source == null || aura.GetId() != source.Id) && !IsInterruptFlagIgnoredForSpell(flag, this, aura.GetSpellInfo(), false, source))
|
||||||
{
|
{
|
||||||
uint removedAuras = m_removedAurasCount;
|
uint removedAuras = m_removedAurasCount;
|
||||||
RemoveAura(aura, AuraRemoveMode.Interrupt);
|
RemoveAura(aura, AuraRemoveMode.Interrupt);
|
||||||
@@ -3034,7 +3038,7 @@ namespace Game.Entities
|
|||||||
if (spell.GetState() == SpellState.Casting
|
if (spell.GetState() == SpellState.Casting
|
||||||
&& spell.GetSpellInfo().HasChannelInterruptFlag(flag)
|
&& spell.GetSpellInfo().HasChannelInterruptFlag(flag)
|
||||||
&& (source == null || spell.GetSpellInfo().Id != source.Id)
|
&& (source == null || spell.GetSpellInfo().Id != source.Id)
|
||||||
&& !IsInterruptFlagIgnoredForSpell(flag, this, spell.GetSpellInfo(), source))
|
&& !IsInterruptFlagIgnoredForSpell(flag, this, spell.GetSpellInfo(), true, source))
|
||||||
InterruptNonMeleeSpells(false);
|
InterruptNonMeleeSpells(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3051,7 +3055,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
Aura aura = m_interruptableAuras[i].GetBase();
|
Aura aura = m_interruptableAuras[i].GetBase();
|
||||||
|
|
||||||
if (aura.GetSpellInfo().HasAuraInterruptFlag(flag) && (source == null || aura.GetId() != source.Id) && !IsInterruptFlagIgnoredForSpell(flag, this, aura.GetSpellInfo(), source))
|
if (aura.GetSpellInfo().HasAuraInterruptFlag(flag) && (source == null || aura.GetId() != source.Id) && !IsInterruptFlagIgnoredForSpell(flag, this, aura.GetSpellInfo(), false, source))
|
||||||
{
|
{
|
||||||
uint removedAuras = m_removedAurasCount;
|
uint removedAuras = m_removedAurasCount;
|
||||||
RemoveAura(aura, AuraRemoveMode.Interrupt);
|
RemoveAura(aura, AuraRemoveMode.Interrupt);
|
||||||
@@ -3067,7 +3071,7 @@ namespace Game.Entities
|
|||||||
if (spell.GetState() == SpellState.Casting
|
if (spell.GetState() == SpellState.Casting
|
||||||
&& spell.GetSpellInfo().HasChannelInterruptFlag(flag)
|
&& spell.GetSpellInfo().HasChannelInterruptFlag(flag)
|
||||||
&& (source == null || spell.GetSpellInfo().Id != source.Id)
|
&& (source == null || spell.GetSpellInfo().Id != source.Id)
|
||||||
&& !IsInterruptFlagIgnoredForSpell(flag, this, spell.GetSpellInfo(), source))
|
&& !IsInterruptFlagIgnoredForSpell(flag, this, spell.GetSpellInfo(), true, source))
|
||||||
InterruptNonMeleeSpells(false);
|
InterruptNonMeleeSpells(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2583,7 +2583,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prevent casting at cast another spell (ServerSide check)
|
// Prevent casting at cast another spell (ServerSide check)
|
||||||
if (!_triggeredCastFlags.HasFlag(TriggerCastFlags.IgnoreCastInProgress) && m_caster.ToUnit() != null && m_caster.ToUnit().IsNonMeleeSpellCast(false, true, true, m_spellInfo.Id == 75) && !m_castId.IsEmpty())
|
if (!_triggeredCastFlags.HasFlag(TriggerCastFlags.IgnoreCastInProgress) && m_caster.ToUnit() != null && m_caster.ToUnit().IsNonMeleeSpellCast(false, true, true, m_spellInfo.Id == 75))
|
||||||
{
|
{
|
||||||
SendCastResult(SpellCastResult.SpellInProgress);
|
SendCastResult(SpellCastResult.SpellInProgress);
|
||||||
Finish(SpellCastResult.SpellInProgress);
|
Finish(SpellCastResult.SpellInProgress);
|
||||||
|
|||||||
Reference in New Issue
Block a user