Core/Spells: Rename SpellAttr5 to use official attribute names

Port From (https://github.com/TrinityCore/TrinityCore/commit/738f285432b1ef6109d1c54ab7f40d743a994631)
This commit is contained in:
hondacrx
2022-06-01 13:45:46 -04:00
parent 62c2d34f1a
commit 13701dac7c
9 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -3020,7 +3020,7 @@ namespace Game.Entities
_spellFocusInfo.Spell = focusSpell;
bool noTurnDuringCast = spellInfo.HasAttribute(SpellAttr5.DontTurnDuringCast);
bool noTurnDuringCast = spellInfo.HasAttribute(SpellAttr5.AiDoesntFaceTarget);
bool turnDisabled = HasUnitFlag2(UnitFlags2.CannotTurn);
// set target, then force send update packet to players if it changed to provide appropriate facing
ObjectGuid newTarget = (target != null && !noTurnDuringCast && !turnDisabled) ? target.GetGUID() : ObjectGuid.Empty;
@@ -3060,7 +3060,7 @@ namespace Game.Entities
if (focusSpell && focusSpell != _spellFocusInfo.Spell)
return;
if (_spellFocusInfo.Spell.GetSpellInfo().HasAttribute(SpellAttr5.DontTurnDuringCast))
if (_spellFocusInfo.Spell.GetSpellInfo().HasAttribute(SpellAttr5.AiDoesntFaceTarget))
ClearUnitState(UnitState.Focusing);
if (IsPet()) // player pets do not use delay system
+1 -1
View File
@@ -1928,7 +1928,7 @@ namespace Game.Entities
if (spellInfo == null || duration < 0)
return;
if (spellInfo.IsChanneled() && !spellInfo.HasAttribute(SpellAttr5.HasteAffectDuration))
if (spellInfo.IsChanneled() && !spellInfo.HasAttribute(SpellAttr5.SpellHasteAffectsPeriodic))
return;
// called from caster
+1 -1
View File
@@ -3214,7 +3214,7 @@ namespace Game.Entities
public bool CanNoReagentCast(SpellInfo spellInfo)
{
// don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
if (spellInfo.HasAttribute(SpellAttr5.NoReagentWhilePrep) &&
if (spellInfo.HasAttribute(SpellAttr5.NoReagentCostWithAura) &&
HasUnitFlag(UnitFlags.Preparation))
return true;
+2 -2
View File
@@ -246,7 +246,7 @@ namespace Game.Spells
auraData.SpellID = (int)aura.GetId();
auraData.Visual = aura.GetSpellVisual();
auraData.Flags = GetFlags();
if (aura.GetAuraType() != AuraObjectType.DynObj && aura.GetMaxDuration() > 0 && !aura.GetSpellInfo().HasAttribute(SpellAttr5.HideDuration))
if (aura.GetAuraType() != AuraObjectType.DynObj && aura.GetMaxDuration() > 0 && !aura.GetSpellInfo().HasAttribute(SpellAttr5.DoNotDisplayDuration))
auraData.Flags |= AuraFlags.Duration;
auraData.ActiveFlags = GetEffectMask();
@@ -788,7 +788,7 @@ namespace Game.Spells
{
int duration = m_spellInfo.GetMaxDuration();
// Calculate duration of periodics affected by haste.
if (m_spellInfo.HasAttribute(SpellAttr5.HasteAffectDuration))
if (m_spellInfo.HasAttribute(SpellAttr8.HasteAffectsDuration))
duration = (int)(duration * caster.m_unitData.ModCastingSpeed);
SetMaxDuration(duration);
+4 -4
View File
@@ -158,7 +158,7 @@ namespace Game.Spells
if (_period != 0 && !GetBase().IsPermanent())
{
totalTicks = (uint)(GetBase().GetMaxDuration() / _period);
if (m_spellInfo.HasAttribute(SpellAttr5.StartPeriodicAtApply))
if (m_spellInfo.HasAttribute(SpellAttr5.ExtraInitialPeriod))
++totalTicks;
}
@@ -172,7 +172,7 @@ namespace Game.Spells
{
_periodicTimer = 0;
// Start periodic on next tick or at aura apply
if (m_spellInfo.HasAttribute(SpellAttr5.StartPeriodicAtApply))
if (m_spellInfo.HasAttribute(SpellAttr5.ExtraInitialPeriod))
_periodicTimer = _period;
}
}
@@ -222,7 +222,7 @@ namespace Game.Spells
// Haste modifies periodic time of channeled spells
if (m_spellInfo.IsChanneled())
caster.ModSpellDurationTime(m_spellInfo, ref _period);
else if (m_spellInfo.HasAttribute(SpellAttr5.HasteAffectDuration))
else if (m_spellInfo.HasAttribute(SpellAttr5.SpellHasteAffectsPeriodic))
_period = (int)(_period * caster.m_unitData.ModCastingSpeed);
}
}
@@ -238,7 +238,7 @@ namespace Game.Spells
_periodicTimer = (int)(elapsedTime % _period);
}
if (m_spellInfo.HasAttribute(SpellAttr5.StartPeriodicAtApply))
if (m_spellInfo.HasAttribute(SpellAttr5.ExtraInitialPeriod))
++_ticksDone;
}
else // aura just created or reapplied
+5 -5
View File
@@ -2236,7 +2236,7 @@ namespace Game.Spells
// Haste modifies duration of channeled spells
if (m_spellInfo.IsChanneled())
caster.ModSpellDurationTime(m_spellInfo, ref hitInfo.AuraDuration, this);
else if (m_spellInfo.HasAttribute(SpellAttr5.HasteAffectDuration))
else if (m_spellInfo.HasAttribute(SpellAttr8.HasteAffectsDuration))
{
int origDuration = hitInfo.AuraDuration;
hitInfo.AuraDuration = 0;
@@ -2510,7 +2510,7 @@ namespace Game.Spells
m_casttime = m_spellInfo.CalcCastTime(this);
// don't allow channeled spells / spells with cast time to be casted while moving
// exception are only channeled spells that have no casttime and SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
// exception are only channeled spells that have no casttime and dont have movement interrupt flag
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
// don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect
if (((m_spellInfo.IsChanneled() || m_casttime != 0) && m_caster.IsPlayer() && !(m_caster.ToUnit().IsCharmed() && m_caster.ToUnit().GetCharmerGUID().IsCreature()) && m_caster.ToUnit().IsMoving() &&
@@ -5866,13 +5866,13 @@ namespace Game.Spells
// still they need to be checked against certain mechanics
// SPELL_ATTR5_USABLE_WHILE_STUNNED by default only MECHANIC_STUN (ie no sleep, knockout, freeze, etc.)
bool usableWhileStunned = m_spellInfo.HasAttribute(SpellAttr5.UsableWhileStunned);
bool usableWhileStunned = m_spellInfo.HasAttribute(SpellAttr5.AllowWhileStunned);
// SPELL_ATTR5_USABLE_WHILE_FEARED by default only fear (ie no horror)
bool usableWhileFeared = m_spellInfo.HasAttribute(SpellAttr5.UsableWhileFeared);
bool usableWhileFeared = m_spellInfo.HasAttribute(SpellAttr5.AllowWhileFleeing);
// SPELL_ATTR5_USABLE_WHILE_CONFUSED by default only disorient (ie no polymorph)
bool usableWhileConfused = m_spellInfo.HasAttribute(SpellAttr5.UsableWhileConfused);
bool usableWhileConfused = m_spellInfo.HasAttribute(SpellAttr5.AllowWhileConfused);
// Check whether the cast should be prevented by any state you might have.
SpellCastResult result = SpellCastResult.SpellCastOk;
+6 -6
View File
@@ -553,7 +553,7 @@ namespace Game.Spells
public bool IsMoveAllowedChannel()
{
return IsChanneled() && (HasAttribute(SpellAttr5.CanChannelWhenMoving) || !ChannelInterruptFlags.HasAnyFlag(SpellAuraInterruptFlags.Moving | SpellAuraInterruptFlags.Turning));
return IsChanneled() && !ChannelInterruptFlags.HasFlag(SpellAuraInterruptFlags.Moving | SpellAuraInterruptFlags.Turning);
}
public bool NeedsComboPoints()
@@ -721,7 +721,7 @@ namespace Game.Spells
public bool IsSingleTarget()
{
// all other single target spells have if it has AttributesEx5
if (HasAttribute(SpellAttr5.SingleTargetSpell))
if (HasAttribute(SpellAttr5.LimitN))
return true;
switch (GetSpellSpecific())
@@ -2373,7 +2373,7 @@ namespace Game.Spells
_allowedMechanicMask |= immuneInfo.MechanicImmuneMask;
}
if (HasAttribute(SpellAttr5.UsableWhileStunned))
if (HasAttribute(SpellAttr5.AllowWhileStunned))
{
switch (Id)
{
@@ -2393,10 +2393,10 @@ namespace Game.Spells
}
}
if (HasAttribute(SpellAttr5.UsableWhileConfused))
if (HasAttribute(SpellAttr5.AllowWhileConfused))
_allowedMechanicMask |= (1 << (int)Mechanics.Disoriented);
if (HasAttribute(SpellAttr5.UsableWhileFeared))
if (HasAttribute(SpellAttr5.AllowWhileFleeing))
{
switch (Id)
{
@@ -2746,7 +2746,7 @@ namespace Game.Spells
if (effectInfo.ApplyAuraPeriod > 0 && DotDuration > 0)
{
totalTicks = (uint)DotDuration / effectInfo.ApplyAuraPeriod;
if (HasAttribute(SpellAttr5.StartPeriodicAtApply))
if (HasAttribute(SpellAttr5.ExtraInitialPeriod))
++totalTicks;
}
break;
+2 -2
View File
@@ -3394,7 +3394,7 @@ namespace Game.Entities
// Earthbind Totem (instant pulse)
ApplySpellFix(new[] { 6474 }, spellInfo =>
{
spellInfo.AttributesEx5 |= SpellAttr5.StartPeriodicAtApply;
spellInfo.AttributesEx5 |= SpellAttr5.ExtraInitialPeriod;
});
ApplySpellFix(new[] {
@@ -4374,7 +4374,7 @@ namespace Game.Entities
// due to the way spell system works, unit would change orientation in Spell::_cast
if (spellInfo.HasAura(AuraType.ControlVehicle))
spellInfo.AttributesEx5 |= SpellAttr5.DontTurnDuringCast;
spellInfo.AttributesEx5 |= SpellAttr5.AiDoesntFaceTarget;
if (spellInfo.ActiveIconFileDataId == 135754) // flight
spellInfo.Attributes |= SpellAttr0.Passive;