Core/Spells: Rename SpellAttr0 to use official attribute names

This commit is contained in:
Shauren authored and Ovahlord committed 2022-09-12 09:15:04 +02:00
1 parent 24b84ba980
commit d448ea4370
15 files changed
+104 -104

No files matched your search

+15 -15
View File
@@ -552,7 +552,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
if (!caster->IsControlledByPlayer() &&
_spellInfo->SpellLevel && _spellInfo->SpellLevel != caster->getLevel() &&
!basePointsPerLevel && _spellInfo->HasAttribute(SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION))
!basePointsPerLevel && _spellInfo->HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL))
{
bool canEffectScale = false;
switch (Effect)
@@ -1394,7 +1394,7 @@ bool SpellInfo::IsStackableOnOneSlotWithDifferentCasters() const
bool SpellInfo::IsCooldownStartedOnEvent() const
{
if (HasAttribute(SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
if (HasAttribute(SPELL_ATTR0_COOLDOWN_ON_EVENT))
return true;
return CategoryEntry && CategoryEntry->GetFlags().HasFlag(SpellCategoryFlags::CooldownEventOnLeaveCombat);
@@ -1442,7 +1442,7 @@ bool SpellInfo::IsGroupBuff() const
bool SpellInfo::CanBeUsedInCombat() const
{
return !HasAttribute(SPELL_ATTR0_CANT_USED_IN_COMBAT);
return !HasAttribute(SPELL_ATTR0_NOT_IN_COMBAT_ONLY_PEACEFUL);
}
bool SpellInfo::IsPositive() const
@@ -1481,7 +1481,7 @@ bool SpellInfo::NeedsComboPoints() const
bool SpellInfo::IsNextMeleeSwingSpell() const
{
return HasAttribute(SpellAttr0(SPELL_ATTR0_ON_NEXT_SWING | SPELL_ATTR0_ON_NEXT_SWING_2));
return HasAttribute(SpellAttr0(SPELL_ATTR0_ON_NEXT_SWING_NO_DAMAGE | SPELL_ATTR0_ON_NEXT_SWING));
}
bool SpellInfo::IsBreakingStealth() const
@@ -1566,11 +1566,11 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const
{
// aura can't be pierced
if (!auraSpellInfo || auraSpellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
if (!auraSpellInfo || auraSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
return false;
// these spells pierce all available spells (Resurrection Sickness for example)
if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
if (HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
return true;
// these spells (Cyclone for example) can pierce all...
@@ -1593,11 +1593,11 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const
bool SpellInfo::CanDispelAura(SpellInfo const* auraSpellInfo) const
{
// These auras (like Divine Shield) can't be dispelled
if (auraSpellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
if (auraSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
return false;
// These spells (like Mass Dispel) can dispel all auras
if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
if (HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
return true;
// These auras (Cyclone for example) are not dispelable
@@ -1708,7 +1708,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
if (actAsShifted)
{
if (HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT) || (shapeInfo && shapeInfo->GetFlags().HasFlag(SpellShapeshiftFormFlags::CanOnlyCastShapeshiftSpells))) // not while shapeshifted
if (HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFTED) || (shapeInfo && shapeInfo->GetFlags().HasFlag(SpellShapeshiftFormFlags::CanOnlyCastShapeshiftSpells))) // not while shapeshifted
return SPELL_FAILED_NOT_SHAPESHIFT;
else if (Stances != 0) // needs other shapeshift
return SPELL_FAILED_ONLY_SHAPESHIFT;
@@ -2098,7 +2098,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
if (!vehicleSeat)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
if (!HasAttribute(SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_MOUNTED)
if (!HasAttribute(SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !HasAttribute(SPELL_ATTR0_ALLOW_WHILE_MOUNTED)
&& (vehicleSeat->Flags & checkMask) != checkMask)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
@@ -3254,7 +3254,7 @@ bool SpellInfo::SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 aur
if (!HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
return false;
if (auraSpellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
if (auraSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
return false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -3637,7 +3637,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, S
if (!caster->IsControlledByPlayer())
{
if (HasAttribute(SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION))
if (HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL))
{
GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(SpellLevel - 1);
GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(caster->getLevel() - 1);
@@ -3737,7 +3737,7 @@ SpellInfo const* SpellInfo::GetAuraRankForLevel(uint8 level) const
return this;
// Client ignores spell with these attributes (sub_53D9D0)
if (HasAttribute(SPELL_ATTR0_NEGATIVE_1) || HasAttribute(SPELL_ATTR2_UNK3))
if (HasAttribute(SPELL_ATTR0_AURA_IS_DEBUFF) || HasAttribute(SPELL_ATTR2_UNK3))
return this;
bool needRankSelection = false;
@@ -3828,7 +3828,7 @@ void SpellInfo::_InitializeExplicitTargetMask()
bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
{
// not found a single positive spell with this attribute
if (HasAttribute(SPELL_ATTR0_NEGATIVE_1))
if (HasAttribute(SPELL_ATTR0_AURA_IS_DEBUFF))
return false;
switch (SpellFamilyName)
@@ -4013,7 +4013,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
if (Effects[effIndex].TargetA.GetTarget() != TARGET_UNIT_CASTER)
return false;
// but not this if this first effect (didn't find better check)
if (HasAttribute(SPELL_ATTR0_NEGATIVE_1) && effIndex == 0)
if (HasAttribute(SPELL_ATTR0_AURA_IS_DEBUFF) && effIndex == 0)
return false;
break;
case SPELL_AURA_MECHANIC_IMMUNITY: