Core/Auras: Implemented using all aura interrupt flag fields
This commit is contained in:
@@ -3058,7 +3058,7 @@ namespace Game.Spells
|
||||
|
||||
// when removing flag aura, handle flag drop
|
||||
Player player = target.ToPlayer();
|
||||
if (!apply && player != null && (GetSpellInfo().AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.ImmuneOrLostSelection)))
|
||||
if (!apply && player != null && GetSpellInfo().HasAuraInterruptFlag(SpellAuraInterruptFlags.ImmuneOrLostSelection))
|
||||
{
|
||||
if (player.InBattleground())
|
||||
{
|
||||
|
||||
@@ -2987,13 +2987,13 @@ namespace Game.Spells
|
||||
m_caster.ModSpellDurationTime(m_spellInfo, ref duration, this);
|
||||
|
||||
m_spellState = SpellState.Casting;
|
||||
m_caster.AddInterruptMask((uint)m_spellInfo.ChannelInterruptFlags);
|
||||
m_caster.AddInterruptMask(m_spellInfo.ChannelInterruptFlags);
|
||||
SendChannelStart((uint)duration);
|
||||
}
|
||||
else if (duration == -1)
|
||||
{
|
||||
m_spellState = SpellState.Casting;
|
||||
m_caster.AddInterruptMask((uint)m_spellInfo.ChannelInterruptFlags);
|
||||
m_caster.AddInterruptMask(m_spellInfo.ChannelInterruptFlags);
|
||||
SendChannelStart((uint)duration);
|
||||
}
|
||||
}
|
||||
@@ -4484,7 +4484,7 @@ namespace Game.Spells
|
||||
// skip stuck spell to allow use it in falling case and apply spell limitations at movement
|
||||
SpellEffectInfo effect = GetEffect(0);
|
||||
if ((!m_caster.HasUnitMovementFlag(MovementFlag.FallingFar) || (effect != null && effect.Effect != SpellEffectName.Stuck)) &&
|
||||
(IsAutoRepeat() || (m_spellInfo.AuraInterruptFlags & SpellAuraInterruptFlags.NotSeated) != 0))
|
||||
(IsAutoRepeat() || m_spellInfo.HasAuraInterruptFlag(SpellAuraInterruptFlags.NotSeated)))
|
||||
return SpellCastResult.Moving;
|
||||
}
|
||||
|
||||
|
||||
@@ -2849,7 +2849,7 @@ namespace Game.Spells
|
||||
|| (spell.getState() == SpellState.Preparing && spell.GetCastTime() > 0.0f))
|
||||
&& (curSpellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence))
|
||||
&& ((i == CurrentSpellTypes.Generic && curSpellInfo.InterruptFlags.HasAnyFlag(SpellInterruptFlags.Interrupt))
|
||||
|| (i == CurrentSpellTypes.Channeled && curSpellInfo.ChannelInterruptFlags.HasAnyFlag(SpellChannelInterruptFlags.Interrupt))))
|
||||
|| (i == CurrentSpellTypes.Channeled && curSpellInfo.HasChannelInterruptFlag(SpellChannelInterruptFlags.Interrupt))))
|
||||
{
|
||||
if (m_originalCaster != null)
|
||||
{
|
||||
|
||||
@@ -191,8 +191,8 @@ namespace Game.Spells
|
||||
{
|
||||
InterruptFlags = (SpellInterruptFlags)_interrupt.InterruptFlags;
|
||||
// TODO: 6.x these flags have 2 parts
|
||||
AuraInterruptFlags = (SpellAuraInterruptFlags)_interrupt.AuraInterruptFlags[0];
|
||||
ChannelInterruptFlags = (SpellChannelInterruptFlags)_interrupt.ChannelInterruptFlags[0];
|
||||
AuraInterruptFlags = _interrupt.AuraInterruptFlags;
|
||||
ChannelInterruptFlags = _interrupt.ChannelInterruptFlags;
|
||||
}
|
||||
|
||||
// SpellLevelsEntry
|
||||
@@ -1367,7 +1367,7 @@ namespace Game.Spells
|
||||
case SpellFamilyNames.Generic:
|
||||
{
|
||||
// Food / Drinks (mostly)
|
||||
if (AuraInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.NotSeated))
|
||||
if (HasAuraInterruptFlag(SpellAuraInterruptFlags.NotSeated))
|
||||
{
|
||||
bool food = false;
|
||||
bool drink = false;
|
||||
@@ -3051,6 +3051,13 @@ namespace Game.Spells
|
||||
public bool HasAttribute(SpellAttr13 attribute) { return Convert.ToBoolean(AttributesEx13 & attribute); }
|
||||
public bool HasAttribute(SpellCustomAttributes attribute) { return Convert.ToBoolean(AttributesCu & attribute); }
|
||||
|
||||
public bool HasAnyAuraInterruptFlag() { return AuraInterruptFlags.Any(flag => { return flag != 0; }); }
|
||||
public bool HasAuraInterruptFlag(SpellAuraInterruptFlags flag) { return (AuraInterruptFlags[0] & (uint)flag) != 0; }
|
||||
public bool HasAuraInterruptFlag(SpellAuraInterruptFlags2 flag) { return (AuraInterruptFlags[1] & (uint)flag) != 0; }
|
||||
|
||||
public bool HasChannelInterruptFlag(SpellChannelInterruptFlags flag) { return (ChannelInterruptFlags[0] & (uint)flag) != 0; }
|
||||
|
||||
|
||||
#region Fields
|
||||
public uint Id;
|
||||
uint CategoryId;
|
||||
@@ -3091,8 +3098,8 @@ namespace Game.Spells
|
||||
public uint StartRecoveryCategory { get; set; }
|
||||
public uint StartRecoveryTime { get; set; }
|
||||
public SpellInterruptFlags InterruptFlags { get; set; }
|
||||
public SpellAuraInterruptFlags AuraInterruptFlags { get; set; }
|
||||
public SpellChannelInterruptFlags ChannelInterruptFlags { get; set; }
|
||||
public uint[] AuraInterruptFlags { get; set; } = new uint[2];
|
||||
public uint[] ChannelInterruptFlags { get; set; } = new uint[2];
|
||||
public ProcFlags ProcFlags { get; set; }
|
||||
public uint ProcChance { get; set; }
|
||||
public uint ProcCharges { get; set; }
|
||||
|
||||
@@ -2389,7 +2389,7 @@ namespace Game.Entities
|
||||
spellInfo.GetEffect(0).BasePoints = 0;// force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)"
|
||||
break;
|
||||
case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with
|
||||
spellInfo.AuraInterruptFlags = SpellAuraInterruptFlags.Hitbyspell | SpellAuraInterruptFlags.TakeDamage;
|
||||
spellInfo.AuraInterruptFlags[0] = (uint)(SpellAuraInterruptFlags.Hitbyspell | SpellAuraInterruptFlags.TakeDamage);
|
||||
break;
|
||||
case 71838: // Drain Life - Bryntroll Normal
|
||||
case 71839: // Drain Life - Bryntroll Heroic
|
||||
@@ -2488,7 +2488,7 @@ namespace Game.Entities
|
||||
break;
|
||||
case 63414: // Spinning Up (Mimiron)
|
||||
spellInfo.GetEffect(0).TargetB = new SpellImplicitTargetInfo(Targets.UnitCaster);
|
||||
spellInfo.ChannelInterruptFlags = 0;
|
||||
spellInfo.ChannelInterruptFlags.Initialize();
|
||||
break;
|
||||
case 63036: // Rocket Strike (Mimiron)
|
||||
spellInfo.Speed = 0;
|
||||
@@ -2698,7 +2698,7 @@ namespace Game.Entities
|
||||
spellInfo.GetEffect(0).MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(EffectRadiusIndex.Yards45);
|
||||
break;
|
||||
case 24314: // Threatening Gaze
|
||||
spellInfo.AuraInterruptFlags |= SpellAuraInterruptFlags.Cast | SpellAuraInterruptFlags.Move | SpellAuraInterruptFlags.Jump;
|
||||
spellInfo.AuraInterruptFlags[0] |= (uint)(SpellAuraInterruptFlags.Cast | SpellAuraInterruptFlags.Move | SpellAuraInterruptFlags.Jump);
|
||||
break;
|
||||
case 5420: // Tree of Life (Passive)
|
||||
spellInfo.Stances = 1 << ((int)ShapeShiftForm.TreeOfLife - 1);
|
||||
@@ -2722,12 +2722,53 @@ namespace Game.Entities
|
||||
break;
|
||||
// ENDOF ISLE OF CONQUEST SPELLS
|
||||
//
|
||||
// FIRELANDS SPELLS
|
||||
// Torment Searcher
|
||||
case 99253:
|
||||
spellInfo.GetEffect(0).MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(EffectRadiusIndex.Yards15);
|
||||
break;
|
||||
// Torment Damage
|
||||
case 99256:
|
||||
spellInfo.Attributes |= SpellAttr0.Negative1;
|
||||
break;
|
||||
// Blaze of Glory
|
||||
case 99252:
|
||||
spellInfo.AuraInterruptFlags[0] |= (uint)SpellAuraInterruptFlags.ChangeMap;
|
||||
break;
|
||||
// ENDOF FIRELANDS SPELLS
|
||||
case 102445: // Summon Master Li Fei
|
||||
spellInfo.GetEffect(0).TargetA = new SpellImplicitTargetInfo(Targets.DestDb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var spellInfo in mSpellInfoMap.Values)
|
||||
{
|
||||
foreach (SpellEffectInfo effect in spellInfo.GetEffectsForDifficulty(Difficulty.None))
|
||||
{
|
||||
if (effect == null)
|
||||
continue;
|
||||
switch (effect.Effect)
|
||||
{
|
||||
case SpellEffectName.Charge:
|
||||
case SpellEffectName.ChargeDest:
|
||||
case SpellEffectName.Jump:
|
||||
case SpellEffectName.JumpDest:
|
||||
case SpellEffectName.LeapBack:
|
||||
if (spellInfo.Speed == 0 && spellInfo.SpellFamilyName == 0)
|
||||
spellInfo.Speed = MotionMaster.SPEED_CHARGE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (effect.TargetA.GetSelectionCategory() == SpellTargetSelectionCategories.Cone || effect.TargetB.GetSelectionCategory() == SpellTargetSelectionCategories.Cone)
|
||||
if (MathFunctions.fuzzyEq(spellInfo.ConeAngle, 0.0f))
|
||||
spellInfo.ConeAngle = 90.0f;
|
||||
}
|
||||
|
||||
if (spellInfo.ActiveIconFileDataId == 135754) // flight
|
||||
spellInfo.Attributes |= SpellAttr0.Passive;
|
||||
}
|
||||
|
||||
SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(121);
|
||||
if (properties != null)
|
||||
properties.Type = SummonType.Totem;
|
||||
|
||||
Reference in New Issue
Block a user