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
+33 -33
View File
@@ -1758,38 +1758,38 @@ namespace Framework.Constants
}
public enum SpellAttr5 : uint
{
CanChannelWhenMoving = 0x01, // 0 available casting channel spell when moving
NoReagentWhilePrep = 0x02, // 1 Not Need Reagents If UnitFlagPreparation
RemoveEnteringArena = 0x04, // 2 remove this aura on arena enter
UsableWhileStunned = 0x08, // 3 Usable While Stunned
Unk4 = 0x10, // 4
SingleTargetSpell = 0x20, // 5 Only One Target Can Be Apply At A Time
Unk6 = 0x40, // 6
Unk7 = 0x80, // 7
CantTargetPlayerControlled = 0x100, // 8 cannot target player controlled units but can target players
StartPeriodicAtApply = 0x200, // 9 Begin Periodic Tick At Aura Apply
HideDuration = 0x400, // 10 Do Not Send Duration To Client
AllowTargetOfTargetAsTarget = 0x800, // 11 (Nyi) Uses Target'S Target As Target If Original Target Not Valid (Intervene For Example)
MeleeChainTargeting = 0x1000, // 12 Cleave Related?
HasteAffectDuration = 0x2000, // 13 Haste Effects Decrease Duration Of This
NotUsableWhileCharmed = 0x4000, // 14 Charmed units cannot cast this spell
Unk15 = 0x8000, // 15 Inflits On Multiple Targets?
Unk16 = 0x10000, // 16
UsableWhileFeared = 0x20000, // 17 Usable While Feared
UsableWhileConfused = 0x40000, // 18 Usable While Confused
DontTurnDuringCast = 0x80000, // 19 Blocks Caster'S Turning When Casting (Client Does Not Automatically Turn Caster'S Model To Face UnitFieldTarget)
Unk20 = 0x100000, // 20
Unk21 = 0x200000, // 21
Unk22 = 0x400000, // 22
Unk23 = 0x800000, // 23
Unk24 = 0x1000000, // 24
Unk25 = 0x2000000, // 25
AlwaysAoeLineOfSight = 0x4000000, // 26 Aoe Related - Boulder, Cannon, Corpse Explosion, Fire Nova, Flames, Frost Bomb, Living Bomb, Seed Of Corruption, Starfall, Thunder Clap, Volley
DontShowAuraIfSelfCast = 0x8000000, // 27
DontShowAuraIfNotSelfCast = 0x10000000, // 28
Unk29 = 0x20000000, // 29
Unk30 = 0x40000000, // 30
Unk31 = 0x80000000 // 31 Forces All Nearby Enemies To Focus Attacks Caster
AllowActionsDuringChannel = 0x01, // Allow Actions During Channel
NoReagentCostWithAura = 0x02, // No Reagent Cost With Aura
RemoveEnteringArena = 0x04, // Remove Entering Arena Description Force This Aura To Be Removed On Entering Arena, Regardless Of Other Properties
AllowWhileStunned = 0x08, // Allow While Stunned
TriggersChanneling = 0x10, // Triggers Channeling
LimitN = 0x20, /*Incomplete Impl*/ // Limit N Description Remove Previous Application To Another Unit If Applied
IgnoreAreaEffectPvpCheck = 0x40, /*Nyi*/ // Ignore Area Effect Pvp Check
NotOnPlayer = 0x80, /*Nyi*/ // Not On Player
NotOnPlayerControlledNpc = 0x100, /*Nyi*/ // Not On Player Controlled Npc
ExtraInitialPeriod = 0x200, // Extra Initial Period Description Immediately Do Periodic Tick On Apply
DoNotDisplayDuration = 0x400, // Do Not Display Duration
ImpliedTargeting = 0x800, // Implied Targeting (Client Only)
MeleeChainTargeting = 0x1000, // Melee Chain Targeting
SpellHasteAffectsPeriodic = 0x2000, // Spell Haste Affects Periodic
NotAvailableWhileCharmed = 0x4000, /*Nyi*/ // Not Available While Charmed
TreatAsAreaEffect = 0x8000, /*Nyi*/ // Treat As Area Effect
AuraAffectsNotJustReqEquippedItem = 0x10000, // Aura Affects Not Just Req. Equipped Item
AllowWhileFleeing = 0x20000, // Allow While Fleeing
AllowWhileConfused = 0x40000, // Allow While Confused
AiDoesntFaceTarget = 0x80000, // Ai Doesn'T Face Target
DoNotAttemptAPetResummonWhenDismounting = 0x100000, /*Nyi*/ // Do Not Attempt A Pet Resummon When Dismounting
IgnoreTargetRequirements = 0x200000, /*Nyi*/ // Ignore Target Requirements
NotOnTrivial = 0x400000, /*Nyi*/ // Not On Trivial
NoPartialResists = 0x800000, /*Nyi*/ // No Partial Resists
IgnoreCasterRequirements = 0x1000000, /*Nyi*/ // Ignore Caster Requirements
AlwaysLineOfSight = 0x2000000, /*Nyi*/ // Always Line Of Sight
AlwaysAoeLineOfSight = 0x4000000, /*Wrong Impl*/ // Always Aoe Line Of Sight Description Requires Line Of Sight Between Caster And Target In Addition To Between Dest And Target
NoCasterAuraIcon = 0x8000000, // No Caster Aura Icon (Client Only)
NoTargetAuraIcon = 0x10000000, // No Target Aura Icon (Client Only)
AuraUniquePerCaster = 0x20000000, /*Nyi*/ // Aura Unique Per Caster
AlwaysShowGroundTexture = 0x40000000, // Always Show Ground Texture
AddMeleeHitRating = 0x80000000 /*Nyi*/ // Add Melee Hit Rating
}
public enum SpellAttr6 : uint
{
@@ -1880,7 +1880,7 @@ namespace Framework.Constants
Unk14 = 0x4000, // 14
WaterMount = 0x8000, // 15
Unk16 = 0x10000, // 16
Unk17 = 0x20000, // 17
HasteAffectsDuration = 0x20000, // 17 Haste Affects Duration
RememberSpells = 0x40000, // 18
UseComboPointsOnAnyTarget = 0x80000, // 19
ArmorSpecialization = 0x100000, // 20
+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;