diff options
| author | linencloth <none@none> | 2010-12-19 05:15:47 +0100 |
|---|---|---|
| committer | linencloth <none@none> | 2010-12-19 05:15:47 +0100 |
| commit | 59da698189cccb65b94f7b14690ce87ef226cef7 (patch) | |
| tree | c3fcb0a008e964c619d3b275caffa1765b369262 /src/server/game/Spells | |
| parent | 22928e23bd94cb744d2593996fad2de72a8eaece (diff) | |
Core: Rename spell attributes, use more general names
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Spells')
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 28 | ||||
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 10 | ||||
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.h | 2 | ||||
| -rwxr-xr-x | src/server/game/Spells/Spell.cpp | 118 | ||||
| -rwxr-xr-x | src/server/game/Spells/Spell.h | 2 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 10 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellMgr.cpp | 116 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellMgr.h | 50 |
8 files changed, 168 insertions, 168 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 823d8b7f031..4f8ddd423fa 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -848,14 +848,14 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create) if (create) { // Start periodic on next tick or at aura apply - if (m_amplitude && !(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY)) + if (m_amplitude && !(m_spellProto->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY)) m_periodicTimer += m_amplitude; } else if (m_amplitude) // load aura from character_aura { m_tickNumber = GetBase()->GetDuration() / m_amplitude; m_periodicTimer = GetBase()->GetDuration() % m_amplitude; - if (m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY) + if (m_spellProto->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY) ++m_tickNumber; } } @@ -1025,7 +1025,7 @@ void AuraEffect::ApplySpellMod(Unit * target, bool apply) Aura * aura = iter->second->GetBase(); // only passive auras-active auras should have amount set on spellcast and not be affected // if aura is casted by others, it will not be affected - if ((aura->IsPassive() || aura->GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_ALWAYS_APPLY_MODIFIERS) && aura->GetCasterGUID() == guid && sSpellMgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod)) + if ((aura->IsPassive() || aura->GetSpellProto()->AttributesEx2 & SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS) && aura->GetCasterGUID() == guid && sSpellMgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod)) { if (GetMiscValue() == SPELLMOD_ALL_EFFECTS) { @@ -1538,7 +1538,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const } // heal for caster damage (must be alive) - if (target != caster && GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_HEALTH_FUNNEL && !caster->isAlive()) + if (target != caster && GetSpellProto()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL && !caster->isAlive()) break; if (GetBase()->GetDuration() == -1 && target->IsFullHealth()) @@ -1611,7 +1611,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const // Health Funnel // damage caster for heal amount - if (target != caster && GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_HEALTH_FUNNEL) + if (target != caster && GetSpellProto()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL) { uint32 damage = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), 0); // damage is not affected by spell power if ((int32)damage > gain) @@ -2584,7 +2584,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue; if (itr->first == spellId || itr->first == spellId2) continue; SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); - if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7))) continue; + if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_UNK7))) continue; if (spellInfo->Stances & (1<<(GetMiscValue()-1))) target->CastSpell(target, itr->first, true, NULL, this); } @@ -4352,7 +4352,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const * aurApp, uint target->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); } - if (apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) + if (apply && GetSpellProto()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end(); ++iter) target->RemoveAurasByType(*iter); @@ -4397,7 +4397,7 @@ void AuraEffect::HandleModMechanicImmunity(AuraApplication const * aurApp, uint8 break; } - if (apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) + if (apply && GetSpellProto()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) target->RemoveAurasWithMechanic(mechanic, AURA_REMOVE_BY_DEFAULT, GetId()); } @@ -4434,7 +4434,7 @@ void AuraEffect::HandleAuraModStateImmunity(AuraApplication const * aurApp, uint Unit * target = aurApp->GetTarget(); - if ((apply) && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) + if ((apply) && GetSpellProto()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) { target->RemoveAurasByType(AuraType(GetMiscValue()), NULL , GetBase()); } @@ -4455,13 +4455,13 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin target->ApplySpellImmune(GetId(),IMMUNITY_SCHOOL,GetMiscValue(),(apply)); // remove all flag auras (they are positive, but they must be removed when you are immune) - if (GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY - && GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD) + if (GetSpellProto()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY + && GetSpellProto()->AttributesEx2 & SPELL_ATTR2_DAMAGE_REDUCED_SHIELD) target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION); // TODO: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else if ((apply) - && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY + && GetSpellProto()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY && IsPositiveSpell(GetId())) //Only positive immunity removes auras { uint32 school_mask = GetMiscValue(); @@ -4808,8 +4808,8 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const * aurApp, uint8 } } - //recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR_UNK4 0x00000010 flag) - if ((GetMiscValue() == STAT_STAMINA) && (maxHPValue > 0) && (m_spellProto->Attributes & SPELL_ATTR_UNK4)) + //recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag) + if ((GetMiscValue() == STAT_STAMINA) && (maxHPValue > 0) && (m_spellProto->Attributes & SPELL_ATTR0_UNK4)) { uint32 newHPValue = target->CountPctFromMaxHealth(int32(100.0f * curHPValue / maxHPValue)); target->SetHealth(newHPValue); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index fdedea53aa4..01138aea7f3 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -408,7 +408,7 @@ void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraA // set infinity cooldown state for spells if (caster && caster->GetTypeId() == TYPEID_PLAYER) { - if (m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + if (m_spellProto->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE) { Item* castItem = m_castItemGuid ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL; caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true); @@ -439,7 +439,7 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur // reset cooldown state for spells if (caster && caster->GetTypeId() == TYPEID_PLAYER) { - if (GetSpellProto()->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + if (GetSpellProto()->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE) // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases) caster->ToPlayer()->SendCooldownEvent(GetSpellProto()); } @@ -884,7 +884,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (apply) { // Apply linked auras (On first aura apply) - if (sSpellMgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR_CU_LINK_AURA) + if (sSpellMgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR0_CU_LINK_AURA) { if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA)) for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) @@ -1090,7 +1090,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, { if (uint32 customAttr = sSpellMgr.GetSpellCustomAttr(GetId())) { - if (customAttr & SPELL_ATTR_CU_LINK_REMOVE) + if (customAttr & SPELL_ATTR0_CU_LINK_REMOVE) { if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(-(int32)GetId())) for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) @@ -1101,7 +1101,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, target->CastSpell(target, *itr, true, NULL, NULL, GetCasterGUID()); } } - if (customAttr & SPELL_ATTR_CU_LINK_AURA) + if (customAttr & SPELL_ATTR0_CU_LINK_AURA) { if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA)) for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 84f593a4c66..6b619ef2e9a 100755 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -135,7 +135,7 @@ class Aura bool IsPassive() const; bool IsDeathPersistent() const; - bool IsRemovedOnShapeLost(Unit * target) const { return (GetCasterGUID() == target->GetGUID() && m_spellProto->Stances && !(m_spellProto->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && !(m_spellProto->Attributes & SPELL_ATTR_NOT_SHAPESHIFT)); } + bool IsRemovedOnShapeLost(Unit * target) const { return (GetCasterGUID() == target->GetGUID() && m_spellProto->Stances && !(m_spellProto->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && !(m_spellProto->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)); } bool CanBeSaved() const; bool IsRemoved() const { return m_isRemoved; } bool IsVisible() const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index bd9f466fb86..5bafca4c376 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -441,7 +441,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) switch (m_spellInfo->DmgClass) { case SPELL_DAMAGE_CLASS_MELEE: - if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND) + if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_REQ_OFFHAND) m_attackType = OFF_ATTACK; else m_attackType = BASE_ATTACK; @@ -451,7 +451,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) break; default: // Wands - if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) + if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG) m_attackType = RANGED_ATTACK; else m_attackType = BASE_ATTACK; @@ -485,7 +485,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) m_spellState = SPELL_STATE_NULL; - m_IsTriggeredSpell = bool(triggered || (info->AttributesEx4 & SPELL_ATTR_EX4_TRIGGERED)); + m_IsTriggeredSpell = bool(triggered || (info->AttributesEx4 & SPELL_ATTR4_TRIGGERED)); m_CastItem = NULL; unitTarget = NULL; @@ -511,7 +511,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) // determine reflection m_canReflect = false; - if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !IsAreaOfEffectSpell(m_spellInfo) && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED)) + if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !IsAreaOfEffectSpell(m_spellInfo) && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CANT_REFLECTED)) { for (int j = 0; j < MAX_SPELL_EFFECTS; ++j) { @@ -521,7 +521,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) if (!IsPositiveTarget(m_spellInfo->EffectImplicitTargetA[j], m_spellInfo->EffectImplicitTargetB[j])) m_canReflect = true; else - m_canReflect = (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NEGATIVE) ? true : false; + m_canReflect = (m_spellInfo->AttributesEx & SPELL_ATTR1_NEGATIVE) ? true : false; if (m_canReflect) continue; @@ -758,7 +758,7 @@ void Spell::SelectSpellTargets() break; case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: // AreaAura - if (m_spellInfo->Attributes & (SPELL_ATTR_CASTABLE_WHILE_SITTING | SPELL_ATTR_CASTABLE_WHILE_MOUNTED | SPELL_ATTR_UNK18 | SPELL_ATTR_NOT_SHAPESHIFT) || m_spellInfo->Attributes == SPELL_ATTR_NOT_SHAPESHIFT) + if (m_spellInfo->Attributes & (SPELL_ATTR0_CASTABLE_WHILE_SITTING | SPELL_ATTR0_CASTABLE_WHILE_MOUNTED | SPELL_ATTR0_UNK18 | SPELL_ATTR0_NOT_SHAPESHIFT) || m_spellInfo->Attributes == SPELL_ATTR0_NOT_SHAPESHIFT) SelectEffectTargets(i, TARGET_UNIT_PARTY_TARGET); break; case SPELL_EFFECT_SKIN_PLAYER_CORPSE: @@ -857,7 +857,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/) break; case SPELL_DAMAGE_CLASS_RANGED: // Auto attack - if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) + if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG) { m_procAttacker = PROC_FLAG_DONE_RANGED_AUTO_ATTACK; m_procVictim = PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK; @@ -871,7 +871,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/) default: if (m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && m_spellInfo->EquippedItemSubClassMask & (1<<ITEM_SUBCLASS_WEAPON_WAND) - && m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack + && m_spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG) // Wands auto attack { m_procAttacker = PROC_FLAG_DONE_RANGED_AUTO_ATTACK; m_procVictim = PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK; @@ -905,8 +905,8 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/) if (!(m_procAttacker & PROC_FLAG_DONE_RANGED_AUTO_ATTACK)) { if (m_IsTriggeredSpell && - (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER || - m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2)) + (m_spellInfo->AttributesEx2 & SPELL_ATTR2_TRIGGERED_CAN_TRIGGER || + m_spellInfo->AttributesEx3 & SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_2)) m_procEx |= PROC_EX_INTERNAL_CANT_PROC; else if (m_IsTriggeredSpell) m_procEx |= PROC_EX_INTERNAL_TRIGGERED; @@ -1168,7 +1168,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) //Spells with this flag cannot trigger if effect is casted on self // Slice and Dice, relentless strikes, eviscerate - bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) ? m_caster != unitTarget : true); + bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR4_CANT_PROC_FROM_SELFCAST) ? m_caster != unitTarget : true); Unit * spellHitTarget = NULL; if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target @@ -1296,7 +1296,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) { caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell); - if (caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET) == 0 && + if (caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR0_STOP_ATTACK_TARGET) == 0 && (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)) caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx); } @@ -1322,7 +1322,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Failed Pickpocket, reveal rogue if (missInfo == SPELL_MISS_RESIST - && m_customAttr & SPELL_ATTR_CU_PICKPOCKET + && m_customAttr & SPELL_ATTR0_CU_PICKPOCKET && unitTarget->GetTypeId() == TYPEID_UNIT) { m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); @@ -1333,9 +1333,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id)) { - m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO)); + m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO)); - if (m_customAttr & SPELL_ATTR_CU_AURA_CC) + if (m_customAttr & SPELL_ATTR0_CU_AURA_CC) if (!unit->IsStandState()) unit->SetStandState(UNIT_STAND_STATE_STAND); } @@ -1411,7 +1411,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool { unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); //TODO: This is a hack. But we do not know what types of stealth should be interrupted by CC - if ((m_customAttr & SPELL_ATTR_CU_AURA_CC) && unit->IsControlledByPlayer()) + if ((m_customAttr & SPELL_ATTR0_CU_AURA_CC) && unit->IsControlledByPlayer()) unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); } else @@ -1430,7 +1430,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->UpdatePvP(true); } - if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO)) + if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO)) { m_caster->SetInCombatState(unit->GetCombatTimer() > 0, unit); unit->getHostileRefManager().threatAssist(m_caster, 0.0f); @@ -1554,7 +1554,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) } // spells with this flag can trigger only if not selfcast (eviscerate for example) - if (m_ChanceTriggerSpells.size() && (!((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) && unit == m_caster))) + if (m_ChanceTriggerSpells.size() && (!((m_spellInfo->AttributesEx4 & SPELL_ATTR4_CANT_PROC_FROM_SELFCAST) && unit == m_caster))) { int _duration=0; for (ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i) @@ -1582,7 +1582,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) } } - if (m_customAttr & SPELL_ATTR_CU_LINK_HIT) + if (m_customAttr & SPELL_ATTR0_CU_LINK_HIT) { if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) @@ -1840,15 +1840,15 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNo break; } - bool requireDeadTarget = bool(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQUIRE_DEAD_TARGET); + bool requireDeadTarget = bool(m_spellInfo->AttributesEx3 & SPELL_ATTR3_REQUIRE_DEAD_TARGET); Trinity::SpellNotifierCreatureAndPlayer notifier(m_caster, TagUnitMap, radius, type, TargetType, pos, entry, requireDeadTarget); - if ((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY) + if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_PLAYERS_ONLY) || (TargetType == SPELL_TARGETS_ENTRY && !entry)) m_caster->GetMap()->VisitWorld(pos->m_positionX, pos->m_positionY, radius, notifier); else m_caster->GetMap()->VisitAll(pos->m_positionX, pos->m_positionY, radius, notifier); - if (m_customAttr & SPELL_ATTR_CU_EXCLUDE_SELF) + if (m_customAttr & SPELL_ATTR0_CU_EXCLUDE_SELF) TagUnitMap.remove(m_caster); } @@ -2131,9 +2131,9 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) break; case TARGET_TYPE_AREA_CONE: - if (m_customAttr & SPELL_ATTR_CU_CONE_BACK) + if (m_customAttr & SPELL_ATTR0_CU_CONE_BACK) pushType = PUSH_IN_BACK; - else if (m_customAttr & SPELL_ATTR_CU_CONE_LINE) + else if (m_customAttr & SPELL_ATTR0_CU_CONE_LINE) pushType = PUSH_IN_LINE; else pushType = PUSH_IN_FRONT; @@ -2155,7 +2155,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) float angle, dist; float objSize = m_caster->GetObjectSize(); - if (m_spellInfo->AttributesEx & SPELL_ATTR_EX_USE_RADIUS_AS_MAX_DISTANCE) + if (m_spellInfo->AttributesEx & SPELL_ATTR1_USE_RADIUS_AS_MAX_DISTANCE) dist = 0.0f; else dist = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); @@ -3327,7 +3327,7 @@ void Spell::cast(bool skipCheck) } } - if (m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE) + if (m_customAttr & SPELL_ATTR0_CU_DIRECT_DAMAGE) CalculateDamageDoneForAllTargets(); // CAST SPELL @@ -3375,7 +3375,7 @@ void Spell::cast(bool skipCheck) handle_immediate(); } - if (m_customAttr & SPELL_ATTR_CU_LINK_CAST) + if (m_customAttr & SPELL_ATTR0_CU_LINK_CAST) { if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id)) { @@ -3621,7 +3621,7 @@ void Spell::SendSpellCooldown() } // have infinity cooldown but set at aura apply // do not set cooldown for triggered spells (needed by reincarnation) - if (m_spellInfo->Attributes & (SPELL_ATTR_DISABLED_WHILE_ACTIVE | SPELL_ATTR_PASSIVE) || m_IsTriggeredSpell) + if (m_spellInfo->Attributes & (SPELL_ATTR0_DISABLED_WHILE_ACTIVE | SPELL_ATTR0_PASSIVE) || m_IsTriggeredSpell) return; _player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this); @@ -3781,7 +3781,7 @@ void Spell::finish(bool ok) break; } } - if (!found && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS)) + if (!found && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) { m_caster->resetAttackTimer(BASE_ATTACK); if (m_caster->haveOffhandWeapon()) @@ -3810,7 +3810,7 @@ void Spell::finish(bool ok) } // Stop Attack for some spells - if (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET) + if (m_spellInfo->Attributes & SPELL_ATTR0_STOP_ATTACK_TARGET) m_caster->AttackStop(); } @@ -3904,7 +3904,7 @@ void Spell::SendSpellStart() //sLog.outDebug("Sending SMSG_SPELL_START id=%u", m_spellInfo->Id); uint32 castFlags = CAST_FLAG_UNKNOWN_2; - if (m_spellInfo->Attributes & SPELL_ATTR_REQ_AMMO) + if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) castFlags |= CAST_FLAG_AMMO; if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) @@ -3957,7 +3957,7 @@ void Spell::SendSpellGo() if ((m_IsTriggeredSpell && !IsAutoRepeatRangedSpell(m_spellInfo)) || m_triggeredByAuraSpell) castFlags |= CAST_FLAG_PENDING; - if (m_spellInfo->Attributes & SPELL_ATTR_REQ_AMMO) + if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) @@ -4743,11 +4743,11 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar SpellCastResult Spell::CheckCast(bool strict) { // check death state - if (!m_IsTriggeredSpell && !m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD)) + if (!m_IsTriggeredSpell && !m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD)) return SPELL_FAILED_CASTER_DEAD; // check cooldowns to prevent cheating - if (m_caster->GetTypeId() == TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE)) + if (m_caster->GetTypeId() == TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE)) { //can cast triggered (by aura only?) spells while have this flag if (!m_IsTriggeredSpell && m_caster->ToPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY)) @@ -4771,11 +4771,11 @@ SpellCastResult Spell::CheckCast(bool strict) if(m_caster->GetTypeId() == TYPEID_PLAYER && VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled()) { - if(m_spellInfo->Attributes & SPELL_ATTR_OUTDOORS_ONLY && + if(m_spellInfo->Attributes & SPELL_ATTR0_OUTDOORS_ONLY && !m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ())) return SPELL_FAILED_ONLY_OUTDOORS; - if(m_spellInfo->Attributes & SPELL_ATTR_INDOORS_ONLY && + if(m_spellInfo->Attributes & SPELL_ATTR0_INDOORS_ONLY && m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ())) return SPELL_FAILED_ONLY_INDOORS; } @@ -4801,7 +4801,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (shapeError != SPELL_CAST_OK) return shapeError; - if ((m_spellInfo->Attributes & SPELL_ATTR_ONLY_STEALTHED) && !(m_caster->HasStealthAura())) + if ((m_spellInfo->Attributes & SPELL_ATTR0_ONLY_STEALTHED) && !(m_caster->HasStealthAura())) return SPELL_FAILED_ONLY_STEALTHED; } } @@ -4868,7 +4868,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell)) return SPELL_FAILED_TARGET_AURASTATE; - if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR_EX_CANT_TARGET_SELF) + if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_TARGET_SELF) return SPELL_FAILED_BAD_TARGETS; bool non_caster_target = target != m_caster && !sSpellMgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo); @@ -4894,7 +4894,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(m_caster->ToPlayer())) return SPELL_FAILED_CANT_CAST_ON_TAPPED; - if (m_customAttr & SPELL_ATTR_CU_PICKPOCKET) + if (m_customAttr & SPELL_ATTR0_CU_PICKPOCKET) { if (target->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_BAD_TARGETS; @@ -5001,7 +5001,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_TARGET_AURASTATE; //Must be behind the target. - if (m_spellInfo->AttributesEx2 == SPELL_ATTR_EX2_UNK20 && m_spellInfo->AttributesEx & SPELL_ATTR_EX_UNK9 && target->HasInArc(static_cast<float>(M_PI), m_caster) + if (m_spellInfo->AttributesEx2 == SPELL_ATTR2_UNK20 && m_spellInfo->AttributesEx & SPELL_ATTR1_UNK9 && target->HasInArc(static_cast<float>(M_PI), m_caster) //Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags && (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags.IsEqual(0x20000,0,0))) //Mutilate no longer requires you be behind the target as of patch 3.0.3 @@ -5014,27 +5014,27 @@ SpellCastResult Spell::CheckCast(bool strict) } //Target must be facing you. - if ((m_spellInfo->Attributes == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(static_cast<float>(M_PI), m_caster)) + if ((m_spellInfo->Attributes == (SPELL_ATTR0_UNK4 | SPELL_ATTR0_NOT_SHAPESHIFT | SPELL_ATTR0_UNK18 | SPELL_ATTR0_STOP_ATTACK_TARGET)) && !target->HasInArc(static_cast<float>(M_PI), m_caster)) { SendInterrupted(2); return SPELL_FAILED_NOT_INFRONT; } // check if target is in combat - if (non_caster_target && (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat()) + if (non_caster_target && (m_spellInfo->AttributesEx & SPELL_ATTR1_NOT_IN_COMBAT_TARGET) && target->isInCombat()) return SPELL_FAILED_TARGET_AFFECTING_COMBAT; } // Spell casted only on battleground - if ((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER) + if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER) if (!m_caster->ToPlayer()->InBattleground()) return SPELL_FAILED_ONLY_BATTLEGROUNDS; // do not allow spells to be cast in arenas - // - with greater than 10 min CD without SPELL_ATTR_EX4_USABLE_IN_ARENA flag - // - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag - if ((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) || - (GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA))) + // - with greater than 10 min CD without SPELL_ATTR4_USABLE_IN_ARENA flag + // - with SPELL_ATTR4_NOT_USABLE_IN_ARENA flag + if ((m_spellInfo->AttributesEx4 & SPELL_ATTR4_NOT_USABLE_IN_ARENA) || + (GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR4_USABLE_IN_ARENA))) if (MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId())) if (mapEntry->IsBattleArena()) return SPELL_FAILED_NOT_IN_ARENA; @@ -5053,7 +5053,7 @@ SpellCastResult Spell::CheckCast(bool strict) // not let players cast spells at mount (and let do it to creatures) if (m_caster->IsMounted() && m_caster->GetTypeId() == TYPEID_PLAYER && !m_IsTriggeredSpell && - !IsPassiveSpell(m_spellInfo->Id) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_MOUNTED)) + !IsPassiveSpell(m_spellInfo->Id) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED)) { if (m_caster->isInFlight()) return SPELL_FAILED_NOT_ON_TAXI; @@ -5658,7 +5658,7 @@ SpellCastResult Spell::CheckCast(bool strict) SpellCastResult Spell::CheckPetCast(Unit* target) { - if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD)) + if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD)) return SPELL_FAILED_CASTER_DEAD; if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast @@ -5706,7 +5706,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) SpellCastResult Spell::CheckCasterAuras() const { // spells totally immuned to caster auras (wsg flag drop, give marks etc) - if (m_spellInfo->AttributesEx6& SPELL_ATTR_EX6_IGNORE_CASTER_AURAS) + if (m_spellInfo->AttributesEx6& SPELL_ATTR6_IGNORE_CASTER_AURAS) return SPELL_CAST_OK; uint8 school_immune = 0; @@ -5715,7 +5715,7 @@ SpellCastResult Spell::CheckCasterAuras() const // Check if the spell grants school or mechanic immunity. // We use bitmasks so the loop is done only once and not on every aura check below. - if (m_spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) + if (m_spellInfo->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) { for (int i = 0; i < MAX_SPELL_EFFECTS; ++i) { @@ -5735,11 +5735,11 @@ SpellCastResult Spell::CheckCasterAuras() const SpellCastResult prevented_reason = SPELL_CAST_OK; // Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state - if (unitflag & UNIT_FLAG_STUNNED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED)) + if (unitflag & UNIT_FLAG_STUNNED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_STUNNED)) prevented_reason = SPELL_FAILED_STUNNED; - else if (unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED)) + else if (unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_CONFUSED)) prevented_reason = SPELL_FAILED_CONFUSED; - else if (unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED)) + else if (unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_FEARED)) prevented_reason = SPELL_FAILED_FLEEING; else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE) prevented_reason = SPELL_FAILED_SILENCED; @@ -5772,15 +5772,15 @@ SpellCastResult Spell::CheckCasterAuras() const switch(part->GetAuraType()) { case SPELL_AURA_MOD_STUN: - if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED)) + if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_STUNNED)) return SPELL_FAILED_STUNNED; break; case SPELL_AURA_MOD_CONFUSE: - if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED)) + if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_CONFUSED)) return SPELL_FAILED_CONFUSED; break; case SPELL_AURA_MOD_FEAR: - if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED)) + if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_FEARED)) return SPELL_FAILED_FLEEING; break; case SPELL_AURA_MOD_SILENCE: @@ -6405,7 +6405,7 @@ SpellCastResult Spell::CheckItems() if (m_spellInfo->EquippedItemClass >=0) { // main hand weapon required - if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_MAIN_HAND) + if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_MAIN_HAND) { Item* item = m_caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK); @@ -6419,7 +6419,7 @@ SpellCastResult Spell::CheckItems() } // offhand hand weapon required - if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND) + if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_REQ_OFFHAND) { Item* item = m_caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index cb4660b3637..688a661e055 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -511,7 +511,7 @@ class Spell void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } bool IsNextMeleeSwingSpell() const { - return m_spellInfo->Attributes & SPELL_ATTR_ON_NEXT_SWING; + return m_spellInfo->Attributes & SPELL_ATTR0_ON_NEXT_SWING; } bool IsTriggered() const {return m_IsTriggeredSpell;}; bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 380771a4061..1f4f61b193b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -333,7 +333,7 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex) case SPELLFAMILY_GENERIC: { // Meteor like spells (divided damage to targets) - if (m_customAttr & SPELL_ATTR_CU_SHARE_DAMAGE) + if (m_customAttr & SPELL_ATTR0_CU_SHARE_DAMAGE) { uint32 count = 0; for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) @@ -3126,7 +3126,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex) { if (aura->GetSpellProto()->Dispel == DISPEL_MAGIC) { - bool positive = aurApp->IsPositive() ? (!(aura->GetSpellProto()->AttributesEx & SPELL_ATTR_EX_NEGATIVE)) : false; + bool positive = aurApp->IsPositive() ? (!(aura->GetSpellProto()->AttributesEx & SPELL_ATTR1_NEGATIVE)) : false; // do not remove positive auras if friendly target // negative auras if non-friendly target @@ -3137,7 +3137,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex) // 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->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES; + bool dispel_charges = aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES; uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount(); if (charges > 0) dispel_list.push_back(std::make_pair(aura, charges)); @@ -6515,13 +6515,13 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) if ((1<<aura->GetSpellProto()->Dispel) & dispelMask) { // Need check for passive? this - if (!aurApp->IsPositive() || aura->IsPassive() || aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_NOT_STEALABLE) + if (!aurApp->IsPositive() || aura->IsPassive() || aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR4_NOT_STEALABLE) 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->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES; + bool dispel_charges = aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES; uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount(); if (charges > 0) steal_list.push_back(std::make_pair(aura, charges)); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9a27d4ea2b6..233e97d06f1 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -330,7 +330,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell * spell) if (spell && spell->GetCaster()) spell->GetCaster()->ModSpellCastTime(spellInfo, castTime, spell); - if (spellInfo->Attributes & SPELL_ATTR_REQ_AMMO && (!spell || !(spell->IsAutoRepeat()))) + if (spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO && (!spell || !(spell->IsAutoRepeat()))) castTime += 500; return (castTime > 0) ? uint32(castTime) : 0; @@ -346,7 +346,7 @@ bool IsPassiveSpell(uint32 spellId) bool IsPassiveSpell(SpellEntry const * spellInfo) { - if (spellInfo->Attributes & SPELL_ATTR_PASSIVE) + if (spellInfo->Attributes & SPELL_ATTR0_PASSIVE) return true; return false; } @@ -356,9 +356,9 @@ bool IsAutocastableSpell(uint32 spellId) SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) return false; - if (spellInfo->Attributes & SPELL_ATTR_PASSIVE) + if (spellInfo->Attributes & SPELL_ATTR0_PASSIVE) return false; - if (spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET) + if (spellInfo->AttributesEx & SPELL_ATTR1_UNAUTOCASTABLE_BY_PET) return false; return true; } @@ -371,7 +371,7 @@ bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2) uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, SpellSchoolMask schoolMask) { // Spell drain all exist power on cast (Only paladin lay of Hands) - if (spellInfo->AttributesEx & SPELL_ATTR_EX_DRAIN_ALL_POWER) + if (spellInfo->AttributesEx & SPELL_ATTR1_DRAIN_ALL_POWER) { // If power type - health drain all if (spellInfo->powerType == POWER_HEALTH) @@ -416,13 +416,13 @@ uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, Spe // Flat mod from caster auras by spell school powerCost += caster->GetInt32Value(UNIT_FIELD_POWER_COST_MODIFIER + school); // Shiv - costs 20 + weaponSpeed*10 energy (apply only to non-triggered spell with energy cost) - if (spellInfo->AttributesEx4 & SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST) + if (spellInfo->AttributesEx4 & SPELL_ATTR4_SPELL_VS_EXTEND_COST) powerCost += caster->GetAttackTime(OFF_ATTACK)/100; // Apply cost mod by spell if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, powerCost); - if (spellInfo->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION) + if (spellInfo->Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION) powerCost = int32(powerCost/ (1.117f* spellInfo->spellLevel / caster->getLevel() -0.1327f)); // PCT mod from user auras by school @@ -750,7 +750,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con if (!spellproto) return false; // not found a single positive spell with this attribute - if (spellproto->Attributes & SPELL_ATTR_NEGATIVE_1) + if (spellproto->Attributes & SPELL_ATTR0_NEGATIVE_1) return false; switch (spellproto->SpellFamilyName) @@ -854,7 +854,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con case SPELL_AURA_MOD_CRIT_PCT: case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: if (SpellMgr::CalculateSpellEffectAmount(spellproto, effIndex) > 0) - return true; // some expected positive spells have SPELL_ATTR_EX_NEGATIVE + return true; // some expected positive spells have SPELL_ATTR1_NEGATIVE break; case SPELL_AURA_ADD_TARGET_TRIGGER: return true; @@ -908,7 +908,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con if (spellproto->EffectImplicitTargetA[effIndex] != TARGET_UNIT_CASTER) return false; // but not this if this first effect (didn't find better check) - if (spellproto->Attributes & SPELL_ATTR_NEGATIVE_1 && effIndex == 0) + if (spellproto->Attributes & SPELL_ATTR0_NEGATIVE_1 && effIndex == 0) return false; break; case SPELL_AURA_MECHANIC_IMMUNITY: @@ -969,7 +969,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con return false; // AttributesEx check - if (spellproto->AttributesEx & SPELL_ATTR_EX_NEGATIVE) + if (spellproto->AttributesEx & SPELL_ATTR1_NEGATIVE) return false; if (!deep && spellproto->EffectTriggerSpell[effIndex] @@ -986,7 +986,7 @@ bool IsPositiveSpell(uint32 spellId) { if (!sSpellStore.LookupEntry(spellId)) // non-existing spells return false; - return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE); + return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE); } bool IsPositiveEffect(uint32 spellId, uint32 effIndex) @@ -996,9 +996,9 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex) switch(effIndex) { default: - case 0: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0); - case 1: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1); - case 2: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2); + case 0: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF0); + case 1: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF1); + case 2: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR0_CU_NEGATIVE_EFF2); } } @@ -1018,7 +1018,7 @@ bool SpellMgr::_isPositiveSpell(uint32 spellId, bool deep) const bool IsSingleTargetSpell(SpellEntry const *spellInfo) { // all other single target spells have if it has AttributesEx5 - if (spellInfo->AttributesEx5 & SPELL_ATTR_EX5_SINGLE_TARGET_SPELL) + if (spellInfo->AttributesEx5 & SPELL_ATTR5_SINGLE_TARGET_SPELL) return true; switch(GetSpellSpecific(spellInfo)) @@ -1088,7 +1088,7 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 if (actAsShifted) { - if (spellInfo->Attributes & SPELL_ATTR_NOT_SHAPESHIFT) // not while shapeshifted + if (spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT) // not while shapeshifted return SPELL_FAILED_NOT_SHAPESHIFT; else if (spellInfo->Stances != 0) // needs other shapeshift return SPELL_FAILED_ONLY_SHAPESHIFT; @@ -1096,7 +1096,7 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 else { // needs shapeshift - if (!(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && spellInfo->Stances != 0) + if (!(spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && spellInfo->Stances != 0) return SPELL_FAILED_ONLY_SHAPESHIFT; } @@ -1876,7 +1876,7 @@ int32 SpellMgr::CalculateSpellEffectAmount(SpellEntry const * spellEntry, uint8 value = caster->ApplyEffectModifiers(spellEntry, effIndex, value); // amount multiplication based on caster's level - if (!basePointsPerLevel && (spellEntry->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellEntry->spellLevel) && + if (!basePointsPerLevel && (spellEntry->Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION && spellEntry->spellLevel) && spellEntry->Effect[effIndex] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && spellEntry->Effect[effIndex] != SPELL_EFFECT_KNOCK_BACK && spellEntry->EffectApplyAuraName[effIndex] != SPELL_AURA_MOD_SPEED_ALWAYS && @@ -2504,7 +2504,7 @@ void SpellMgr::LoadSpellAreas() if (const SpellEntry* spellInfo = sSpellStore.LookupEntry(spell)) { if (spellArea.autocast) - const_cast<SpellEntry*>(spellInfo)->Attributes |= SPELL_ATTR_CANT_CANCEL; + const_cast<SpellEntry*>(spellInfo)->Attributes |= SPELL_ATTR0_CANT_CANCEL; } else { @@ -2687,7 +2687,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell } // continent limitation (virtual continent) - if (spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND) + if (spellInfo->AttributesEx4 & SPELL_ATTR4_CAST_ONLY_IN_OUTLAND) { uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id); MapEntry const *mapEntry = sMapStore.LookupEntry(v_map); @@ -2696,7 +2696,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell } // raid instance limitation - if (spellInfo->AttributesEx6 & SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE) + if (spellInfo->AttributesEx6 & SPELL_ATTR6_NOT_IN_RAID_INSTANCE) { MapEntry const *mapEntry = sMapStore.LookupEntry(map_id); if (!mapEntry || mapEntry->IsRaid()) @@ -3142,8 +3142,8 @@ bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *sp if (!sameCaster) { - if (spellInfo_1->AttributesEx & SPELL_ATTR_EX_STACK_FOR_DIFF_CASTERS - || spellInfo_1->AttributesEx3 & SPELL_ATTR_EX3_STACK_FOR_DIFF_CASTERS) + if (spellInfo_1->AttributesEx & SPELL_ATTR1_STACK_FOR_DIFF_CASTERS + || spellInfo_1->AttributesEx3 & SPELL_ATTR3_STACK_FOR_DIFF_CASTERS) return true; // check same periodic auras @@ -3192,19 +3192,19 @@ bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *sp bool CanSpellDispelAura(SpellEntry const * dispelSpell, SpellEntry const * aura) { // These auras (like ressurection sickness) can't be dispelled - if (aura->Attributes & SPELL_ATTR_NEGATIVE_1) + if (aura->Attributes & SPELL_ATTR0_NEGATIVE_1) return false; // These spells (like Mass Dispel) can dispell all auras - if (dispelSpell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) + if (dispelSpell->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) return true; // These auras (like Divine Shield) can't be dispelled - if (aura->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) + if (aura->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) return false; // These auras (Cyclone for example) are not dispelable - if (aura->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) + if (aura->AttributesEx & SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) return false; return true; @@ -3213,11 +3213,11 @@ bool CanSpellDispelAura(SpellEntry const * dispelSpell, SpellEntry const * aura) bool CanSpellPierceImmuneAura(SpellEntry const * pierceSpell, SpellEntry const * aura) { // these spells pierce all avalible spells (Resurrection Sickness for example) - if (pierceSpell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) + if (pierceSpell->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) return true; // these spells (Cyclone for example) can pierce all... - if ((pierceSpell->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) + if ((pierceSpell->AttributesEx & SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) // ...but not these (Divine shield for example) && !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY))) return true; @@ -3478,7 +3478,7 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_EFFECT_NORMALIZED_WEAPON_DMG: case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE: case SPELL_EFFECT_HEAL: - mSpellCustomAttr[i] |= SPELL_ATTR_CU_DIRECT_DAMAGE; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_DIRECT_DAMAGE; count++; break; case SPELL_EFFECT_CHARGE: @@ -3488,11 +3488,11 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_EFFECT_LEAP_BACK: if (!spellInfo->speed && !spellInfo->SpellFamilyName) spellInfo->speed = SPEED_CHARGE; - mSpellCustomAttr[i] |= SPELL_ATTR_CU_CHARGE; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_CHARGE; count++; break; case SPELL_EFFECT_PICKPOCKET: - mSpellCustomAttr[i] |= SPELL_ATTR_CU_PICKPOCKET; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_PICKPOCKET; break; case SPELL_EFFECT_TRIGGER_SPELL: if (IsPositionTarget(spellInfo->EffectImplicitTargetA[j]) || @@ -3524,7 +3524,7 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_AURA_AOE_CHARM: case SPELL_AURA_MOD_FEAR: case SPELL_AURA_MOD_STUN: - mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_AURA_CC; count++; break; } @@ -3532,29 +3532,29 @@ void SpellMgr::LoadSpellCustomAttr() if (!_isPositiveEffect(i, 0, false)) { - mSpellCustomAttr[i] |= SPELL_ATTR_CU_NEGATIVE_EFF0; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_NEGATIVE_EFF0; count++; } if (!_isPositiveEffect(i, 1, false)) { - mSpellCustomAttr[i] |= SPELL_ATTR_CU_NEGATIVE_EFF1; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_NEGATIVE_EFF1; count++; } if (!_isPositiveEffect(i, 2, false)) { - mSpellCustomAttr[i] |= SPELL_ATTR_CU_NEGATIVE_EFF2; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_NEGATIVE_EFF2; count++; } if (spellInfo->SpellVisual[0] == 3879) { - mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_BACK; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_CONE_BACK; count++; } if (spellInfo->activeIconID == 2158) // flight { - spellInfo->Attributes |= SPELL_ATTR_PASSIVE; + spellInfo->Attributes |= SPELL_ATTR0_PASSIVE; count++; } @@ -3588,7 +3588,7 @@ void SpellMgr::LoadSpellCustomAttr() // Glyph of Life Tap case 63320: // Entries were not updated after spell effect change, we have to do that manually :/ - spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_CAN_PROC_TRIGGERED; + spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_TRIGGERED; count++; break; case 16007: // Draco-Incarcinatrix 900 @@ -3600,7 +3600,7 @@ void SpellMgr::LoadSpellCustomAttr() case 26029: // dark glare case 37433: // spout case 43140: case 43215: // flame breath - mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_LINE; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_CONE_LINE; count++; break; case 24340: case 26558: case 28884: // Meteor @@ -3618,7 +3618,7 @@ void SpellMgr::LoadSpellCustomAttr() case 70492: case 72505: // Ooze Eruption case 72624: case 72625: // Ooze Eruption // ONLY SPELLS WITH SPELLFAMILY_GENERIC and EFFECT_SCHOOL_DAMAGE - mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_SHARE_DAMAGE; count++; break; case 59725: // Improved Spell Reflection - aoe aura @@ -3635,7 +3635,7 @@ void SpellMgr::LoadSpellCustomAttr() case 69538: case 69553: case 69610: // Ooze Combine case 71447: case 71481: // Bloodbolt Splash case 71482: case 71483: // Bloodbolt Splash - mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_EXCLUDE_SELF; count++; break; case 44978: case 45001: case 45002: // Wild Magic @@ -3801,7 +3801,7 @@ void SpellMgr::LoadSpellCustomAttr() case 51735: // Ebon Plague case 51734: case 51726: - spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_STACK_FOR_DIFF_CASTERS; + spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; spellInfo->SpellFamilyFlags[2] = 0x10; count++; break; @@ -3819,7 +3819,7 @@ void SpellMgr::LoadSpellCustomAttr() count++; break; case 48743: // Death Pact - spellInfo->AttributesEx &= ~SPELL_ATTR_EX_CANT_TARGET_SELF; + spellInfo->AttributesEx &= ~SPELL_ATTR1_CANT_TARGET_SELF; count++; break; // target allys instead of enemies, target A is src_caster, spells with effect like that have ally target @@ -3843,7 +3843,7 @@ void SpellMgr::LoadSpellCustomAttr() // spell should dispel area aura, but doesn't have the attribute // may be db data bug, or blizz may keep reapplying area auras every update with checking immunity // that will be clear if we get more spells with problem like this - spellInfo->AttributesEx |= SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY; + spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY; count++; break; case 69055: // Saber Lash @@ -3873,7 +3873,7 @@ void SpellMgr::LoadSpellCustomAttr() case 67860: // Impale case 69293: // Wing Buffet case 74439: // Machine Gun - mSpellCustomAttr[i] |= SPELL_ATTR_CU_IGNORE_ARMOR; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_IGNORE_ARMOR; count++; break; // Strength of the Pack @@ -3895,7 +3895,7 @@ void SpellMgr::LoadSpellCustomAttr() count++; break; case 63675: // Improved Devouring Plague - spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_NO_DONE_BONUS; + spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; count++; break; case 53241: // Marked for Death (Rank 1) @@ -3965,7 +3965,7 @@ void SpellMgr::LoadSpellCustomAttr() case 72785: // Empowered Flare case 72786: // Empowered Flare case 72787: // Empowered Flare - spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_NO_DONE_BONUS; + spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; count++; break; case 71340: // Pact of the Darkfallen @@ -3981,7 +3981,7 @@ void SpellMgr::LoadSpellCustomAttr() case SPELLFAMILY_WARRIOR: // Shout if (spellInfo->SpellFamilyFlags[0] & 0x20000 || spellInfo->SpellFamilyFlags[1] & 0x20) - mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_AURA_CC; else break; count++; @@ -3992,10 +3992,10 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->MaxAffectedTargets = 2; // Starfall AOE Damage else if (spellInfo->SpellFamilyFlags[2] & 0x800000) - mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_EXCLUDE_SELF; // Roar else if (spellInfo->SpellFamilyFlags[0] & 0x8) - mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC; + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_AURA_CC; else break; count++; @@ -4003,7 +4003,7 @@ void SpellMgr::LoadSpellCustomAttr() // Do not allow Deadly throw and Slice and Dice to proc twice case SPELLFAMILY_ROGUE: if (spellInfo->SpellFamilyFlags[1] & 0x1 || spellInfo->SpellFamilyFlags[0] & 0x40000) - spellInfo->AttributesEx4 |= SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST; + spellInfo->AttributesEx4 |= SPELL_ATTR4_CANT_PROC_FROM_SELFCAST; else break; count++; @@ -4044,7 +4044,7 @@ void SpellMgr::LoadEnchantCustomAttr() continue; // TODO: find a better check - if (!(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_UNK13) || !(spellInfo->Attributes & SPELL_ATTR_NOT_SHAPESHIFT)) + if (!(spellInfo->AttributesEx2 & SPELL_ATTR2_UNK13) || !(spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)) continue; for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) @@ -4111,14 +4111,14 @@ void SpellMgr::LoadSpellLinked() { switch(type) { - case 0: mSpellCustomAttr[trigger] |= SPELL_ATTR_CU_LINK_CAST; break; - case 1: mSpellCustomAttr[trigger] |= SPELL_ATTR_CU_LINK_HIT; break; - case 2: mSpellCustomAttr[trigger] |= SPELL_ATTR_CU_LINK_AURA; break; + case 0: mSpellCustomAttr[trigger] |= SPELL_ATTR0_CU_LINK_CAST; break; + case 1: mSpellCustomAttr[trigger] |= SPELL_ATTR0_CU_LINK_HIT; break; + case 2: mSpellCustomAttr[trigger] |= SPELL_ATTR0_CU_LINK_AURA; break; } } else { - mSpellCustomAttr[-trigger] |= SPELL_ATTR_CU_LINK_REMOVE; + mSpellCustomAttr[-trigger] |= SPELL_ATTR0_CU_LINK_REMOVE; } if (type) //we will find a better way when more types are needed diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index e2069cb143f..acea5e068e7 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -309,17 +309,17 @@ inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto) inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo) { - return spellInfo->AttributesEx3 & SPELL_ATTR_EX3_DEATH_PERSISTENT; + return spellInfo->AttributesEx3 & SPELL_ATTR3_DEATH_PERSISTENT; } inline bool IsRequiringDeadTargetSpell(SpellEntry const *spellInfo) { - return spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQUIRE_DEAD_TARGET; + return spellInfo->AttributesEx3 & SPELL_ATTR3_REQUIRE_DEAD_TARGET; } inline bool IsAllowingDeadTargetSpell(SpellEntry const *spellInfo) { - return spellInfo->AttributesEx2 & SPELL_ATTR_EX2_ALLOW_DEAD_TARGET; + return spellInfo->AttributesEx2 & SPELL_ATTR2_ALLOW_DEAD_TARGET; } inline bool IsDeadTargetSpell(SpellEntry const *spellInfo) @@ -329,7 +329,7 @@ inline bool IsDeadTargetSpell(SpellEntry const *spellInfo) inline bool IsNonCombatSpell(SpellEntry const *spellInfo) { - return (spellInfo->Attributes & SPELL_ATTR_CANT_USED_IN_COMBAT) != 0; + return (spellInfo->Attributes & SPELL_ATTR0_CANT_USED_IN_COMBAT) != 0; } bool IsPositiveSpell(uint32 spellId); @@ -468,12 +468,12 @@ inline bool IsDispelSpell(SpellEntry const *spellInfo) inline bool isSpellBreakStealth(SpellEntry const* spellInfo) { - return !(spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH); + return !(spellInfo->AttributesEx & SPELL_ATTR1_NOT_BREAK_STEALTH); } inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo) { - return spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG; + return spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG; } inline bool IsRangedWeaponSpell(SpellEntry const* spellInfo) @@ -487,12 +487,12 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 inline bool IsChanneledSpell(SpellEntry const* spellInfo) { - return (spellInfo->AttributesEx & (SPELL_ATTR_EX_CHANNELED_1 | SPELL_ATTR_EX_CHANNELED_2)); + return (spellInfo->AttributesEx & (SPELL_ATTR1_CHANNELED_1 | SPELL_ATTR1_CHANNELED_2)); } inline bool NeedsComboPoints(SpellEntry const* spellInfo) { - return (spellInfo->AttributesEx & (SPELL_ATTR_EX_REQ_COMBO_POINTS1 | SPELL_ATTR_EX_REQ_COMBO_POINTS2)); + return (spellInfo->AttributesEx & (SPELL_ATTR1_REQ_COMBO_POINTS1 | SPELL_ATTR1_REQ_COMBO_POINTS2)); } inline SpellSchoolMask GetSpellSchoolMask(SpellEntry const* spellInfo) @@ -876,23 +876,23 @@ inline bool IsProfessionSkill(uint32 skill) return IsPrimaryProfessionSkill(skill) || skill == SKILL_FISHING || skill == SKILL_COOKING || skill == SKILL_FIRST_AID; } -#define SPELL_ATTR_CU_CONE_BACK 0x00000002 -#define SPELL_ATTR_CU_CONE_LINE 0x00000004 -#define SPELL_ATTR_CU_SHARE_DAMAGE 0x00000008 -#define SPELL_ATTR_CU_AURA_CC 0x00000040 -#define SPELL_ATTR_CU_DIRECT_DAMAGE 0x00000100 -#define SPELL_ATTR_CU_CHARGE 0x00000200 -#define SPELL_ATTR_CU_LINK_CAST 0x00000400 -#define SPELL_ATTR_CU_LINK_HIT 0x00000800 -#define SPELL_ATTR_CU_LINK_AURA 0x00001000 -#define SPELL_ATTR_CU_LINK_REMOVE 0x00002000 -#define SPELL_ATTR_CU_PICKPOCKET 0x00004000 -#define SPELL_ATTR_CU_EXCLUDE_SELF 0x00008000 -#define SPELL_ATTR_CU_NEGATIVE_EFF0 0x00010000 -#define SPELL_ATTR_CU_NEGATIVE_EFF1 0x00020000 -#define SPELL_ATTR_CU_NEGATIVE_EFF2 0x00040000 -#define SPELL_ATTR_CU_NEGATIVE 0x00070000 -#define SPELL_ATTR_CU_IGNORE_ARMOR 0x00080000 +#define SPELL_ATTR0_CU_CONE_BACK 0x00000002 +#define SPELL_ATTR0_CU_CONE_LINE 0x00000004 +#define SPELL_ATTR0_CU_SHARE_DAMAGE 0x00000008 +#define SPELL_ATTR0_CU_AURA_CC 0x00000040 +#define SPELL_ATTR0_CU_DIRECT_DAMAGE 0x00000100 +#define SPELL_ATTR0_CU_CHARGE 0x00000200 +#define SPELL_ATTR0_CU_LINK_CAST 0x00000400 +#define SPELL_ATTR0_CU_LINK_HIT 0x00000800 +#define SPELL_ATTR0_CU_LINK_AURA 0x00001000 +#define SPELL_ATTR0_CU_LINK_REMOVE 0x00002000 +#define SPELL_ATTR0_CU_PICKPOCKET 0x00004000 +#define SPELL_ATTR0_CU_EXCLUDE_SELF 0x00008000 +#define SPELL_ATTR0_CU_NEGATIVE_EFF0 0x00010000 +#define SPELL_ATTR0_CU_NEGATIVE_EFF1 0x00020000 +#define SPELL_ATTR0_CU_NEGATIVE_EFF2 0x00040000 +#define SPELL_ATTR0_CU_NEGATIVE 0x00070000 +#define SPELL_ATTR0_CU_IGNORE_ARMOR 0x00080000 typedef std::vector<uint32> SpellCustomAttribute; typedef std::vector<bool> EnchantCustomAttribute; |
