mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
refactor(Core/Misc): Define & Rename Attributes (#5311)
This commit is contained in:
@@ -904,7 +904,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
||||
// ignore positive and passive auras
|
||||
!iter->second->IsPositive() && !iter->second->GetBase()->IsPassive() &&
|
||||
// Xinef: Ignore NPC spells having INVULNERABILITY attribute
|
||||
(!spell->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) || spell->SpellFamilyName != SPELLFAMILY_GENERIC))
|
||||
(!spell->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || spell->SpellFamilyName != SPELLFAMILY_GENERIC))
|
||||
{
|
||||
m_caster->RemoveAura(iter);
|
||||
}
|
||||
@@ -1895,7 +1895,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
|
||||
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->getPowerType() != power && m_spellInfo->SpellFamilyName != SPELLFAMILY_POTION
|
||||
&& !m_spellInfo->HasAttribute(SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
&& !m_spellInfo->HasAttribute(SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED))
|
||||
return;
|
||||
|
||||
if (unitTarget->GetMaxPower(power) == 0)
|
||||
@@ -2006,7 +2006,7 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
|
||||
|
||||
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->getPowerType() != power && !m_spellInfo->HasAttribute(SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->getPowerType() != power && !m_spellInfo->HasAttribute(SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED))
|
||||
return;
|
||||
|
||||
uint32 maxPower = unitTarget->GetMaxPower(power);
|
||||
@@ -4287,7 +4287,7 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
|
||||
if ((*iter)->GetCurrentSpell(i) && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == unitTarget->GetGUID())
|
||||
{
|
||||
const SpellInfo* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
|
||||
if (si->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE) && (*iter)->GetTypeId() == TYPEID_UNIT)
|
||||
if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Creature* c = (*iter)->ToCreature();
|
||||
if ((!c->IsPet() && c->GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS) || c->isWorldBoss() || c->IsDungeonBoss())
|
||||
@@ -4958,7 +4958,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
|
||||
if (spell->m_targets.GetUnitTargetGUID() == m_caster->GetGUID())
|
||||
{
|
||||
const SpellInfo* si = spell->GetSpellInfo();
|
||||
if (si->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE) && (*iter)->GetTypeId() == TYPEID_UNIT)
|
||||
if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Creature* c = (*iter)->ToCreature();
|
||||
if ((!c->IsPet() && c->GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS) || c->isWorldBoss() || c->IsDungeonBoss())
|
||||
@@ -5705,13 +5705,13 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex)
|
||||
if ((aura->GetSpellInfo()->GetDispelMask()) & dispelMask)
|
||||
{
|
||||
// Need check for passive? this
|
||||
if (!aurApp->IsPositive() || aura->IsPassive() || aura->GetSpellInfo()->HasAttribute(SPELL_ATTR4_NOT_STEALABLE))
|
||||
if (!aurApp->IsPositive() || aura->IsPassive() || aura->GetSpellInfo()->HasAttribute(SPELL_ATTR4_CANNOT_BE_STOLEN))
|
||||
continue;
|
||||
|
||||
// The charges / stack amounts don't count towards the total number of auras that can be dispelled.
|
||||
// Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell
|
||||
// Polymorph instead of 1 / (5 + 1) -> 16%.
|
||||
bool dispel_charges = aura->GetSpellInfo()->HasAttribute(SPELL_ATTR7_DISPEL_CHARGES);
|
||||
bool dispel_charges = aura->GetSpellInfo()->HasAttribute(SPELL_ATTR7_DISPEL_REMOVES_CHARGES);
|
||||
uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount();
|
||||
if (charges > 0)
|
||||
steal_list.push_back(std::make_pair(aura, charges));
|
||||
@@ -6266,7 +6266,7 @@ void Spell::EffectCastButtons(SpellEffIndex effIndex)
|
||||
if (!p_caster->HasSpell(spell_id) || p_caster->HasSpellCooldown(spell_id))
|
||||
continue;
|
||||
|
||||
if (!spellInfo->HasAttribute(SPELL_ATTR7_SUMMON_PLAYER_TOTEM))
|
||||
if (!spellInfo->HasAttribute(SPELL_ATTR7_CAN_BE_MULTI_CAST))
|
||||
continue;
|
||||
|
||||
uint32 cost = spellInfo->CalcPowerCost(m_caster, spellInfo->GetSchoolMask(), this);
|
||||
|
||||
Reference in New Issue
Block a user