Core/Spells: Rename SpellAttr1 to use official attribute names

* Implemented SPELL_ATTR1_NO_SKILL_INCREASE, SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT, SPELL_ATTR1_DISPEL_ALL_STACKS
This commit is contained in:
Shauren authored and Ovahlord committed 2022-09-12 09:15:31 +02:00
1 parent cbc2234f1b
commit ca7d36873f
15 files changed
+184 -143

No files matched your search

+16 -16
View File
@@ -1319,7 +1319,7 @@ bool SpellInfo::IsAutocastable() const
{
if (IsPassive())
return false;
if (HasAttribute(SPELL_ATTR1_UNAUTOCASTABLE_BY_PET))
if (HasAttribute(SPELL_ATTR1_NO_AUTOCAST_AI))
return false;
return true;
}
@@ -1460,7 +1460,7 @@ bool SpellInfo::IsPositiveEffect(uint8 effIndex) const
bool SpellInfo::IsChanneled() const
{
return HasAttribute(SpellAttr1(SPELL_ATTR1_CHANNELED | SPELL_ATTR1_SELF_CHANNELED));
return HasAttribute(SpellAttr1(SPELL_ATTR1_IS_CHANNELLED | SPELL_ATTR1_IS_SELF_CHANNELLED));
}
bool SpellInfo::IsMoveAllowedChannel() const
@@ -1480,7 +1480,7 @@ bool SpellInfo::IsNextMeleeSwingSpell() const
bool SpellInfo::IsBreakingStealth() const
{
return !HasAttribute(SPELL_ATTR1_NOT_BREAK_STEALTH);
return !HasAttribute(SPELL_ATTR1_ALLOW_WHILE_STEALTHED);
}
bool SpellInfo::IsRangedWeaponSpell() const
@@ -1568,7 +1568,7 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const
return true;
// these spells (Cyclone for example) can pierce all...
if (HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
if (HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) || HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
{
// ...but not these (Divine shield, Ice block, Cyclone and Banish for example)
if (auraSpellInfo->Mechanic != MECHANIC_IMMUNE_SHIELD &&
@@ -1578,7 +1578,7 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const
}
// Dispels other auras on immunity, check if this spell makes the unit immune to aura
if (HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) && CanSpellProvideImmunityAgainstAura(auraSpellInfo))
if (HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT) && CanSpellProvideImmunityAgainstAura(auraSpellInfo))
return true;
return false;
@@ -1595,7 +1595,7 @@ bool SpellInfo::CanDispelAura(SpellInfo const* auraSpellInfo) const
return true;
// These auras (Cyclone for example) are not dispelable
if ((auraSpellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && auraSpellInfo->Mechanic != MECHANIC_NONE)
if ((auraSpellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) && auraSpellInfo->Mechanic != MECHANIC_NONE)
|| auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
return false;
@@ -1876,7 +1876,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
SpellCastResult SpellInfo::CheckTarget(WorldObject const* caster, WorldObject const* target, bool implicit /*= true*/) const
{
if (HasAttribute(SPELL_ATTR1_CANT_TARGET_SELF) && caster == target)
if (HasAttribute(SPELL_ATTR1_EXCLUDE_CASTER) && caster == target)
return SPELL_FAILED_BAD_TARGETS;
// check visibility - ignore stealth for implicit (area) targets
@@ -1889,7 +1889,7 @@ SpellCastResult SpellInfo::CheckTarget(WorldObject const* caster, WorldObject co
if (unitTarget)
{
// spells cannot be cast if target has a pet in combat either
if (HasAttribute(SPELL_ATTR1_CANT_TARGET_IN_COMBAT) && (unitTarget->IsInCombat() || unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT)))
if (HasAttribute(SPELL_ATTR1_ONLY_PEACEFUL_TARGETS) && (unitTarget->IsInCombat() || unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT)))
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
// only spells with SPELL_ATTR3_ONLY_TARGET_GHOSTS can target ghosts
@@ -3105,7 +3105,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool app
{
target->ApplySpellImmune(Id, IMMUNITY_SCHOOL, schoolImmunity, apply);
if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
if (apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
{
target->RemoveAppliedAuras([this, schoolImmunity](AuraApplication const* aurApp) -> bool
{
@@ -3127,7 +3127,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool app
if (mechanicImmunity & (1 << i))
target->ApplySpellImmune(Id, IMMUNITY_MECHANIC, i, apply);
if(apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
if(apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
target->RemoveAurasWithMechanic(mechanicImmunity, AuraRemoveFlags::ByDefault, Id);
}
@@ -3135,7 +3135,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool app
{
target->ApplySpellImmune(Id, IMMUNITY_DISPEL, dispelImmunity, apply);
if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
if (apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
{
target->RemoveAppliedAuras([dispelImmunity](AuraApplication const* aurApp) -> bool
{
@@ -3159,7 +3159,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool app
for (AuraType auraType : immuneInfo->AuraTypeImmune)
{
target->ApplySpellImmune(Id, IMMUNITY_STATE, auraType, apply);
if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
if (apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
target->RemoveAurasByType(auraType);
}
@@ -3176,7 +3176,7 @@ bool SpellInfo::CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInf
{
ImmunityInfo const* immuneInfo = _immunityInfo + i;
if (!auraSpellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
if (!auraSpellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) && !auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
{
if (uint32 schoolImmunity = immuneInfo->SchoolImmuneMask)
if ((auraSpellInfo->SchoolMask & schoolImmunity) != 0)
@@ -3249,7 +3249,7 @@ bool SpellInfo::CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInf
// based on client Spell_C::CancelsAuraEffect
bool SpellInfo::SpellCancelsAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const
{
if (!HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
if (!HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
return false;
if (auraSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
@@ -3534,7 +3534,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school
return 0;
// Spell drain all exist power on cast (Only paladin lay of Hands)
if (HasAttribute(SPELL_ATTR1_DRAIN_ALL_POWER))
if (HasAttribute(SPELL_ATTR1_USE_ALL_MANA))
{
// If power type - health drain all
if (PowerType == POWER_HEALTH)
@@ -3923,7 +3923,7 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, uint8 effIndex, std::unor
}
// Special case: effects which determine positivity of whole spell
if (spellInfo->HasAttribute(SPELL_ATTR1_DONT_REFRESH_DURATION_ON_RECAST)) // @todo: rename to and handle SPELL_ATTR1_AURA_UNIQUE
if (spellInfo->HasAttribute(SPELL_ATTR1_AURA_UNIQUE)) // @todo: rename to and handle SPELL_ATTR1_AURA_UNIQUE
{
// check for targets, there seems to be an assortment of dummy triggering spells that should be negative
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)