From 7fd1f64319b4ef4980d1d44c1d54f3d97f47e91f Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Sat, 21 Apr 2012 02:02:23 +0200 Subject: [PATCH] [11971] Add wrapper HasAttribute to check if a spell has an attribute Signed-off-by: Schmoozerd --- src/game/DBCStores.cpp | 3 +- src/game/DBCStructure.h | 11 +- src/game/LootMgr.cpp | 2 +- src/game/ObjectMgr.cpp | 2 +- src/game/Player.cpp | 11 +- src/game/SharedDefines.h | 537 +++++++++++++++++++------------------ src/game/Spell.cpp | 70 ++--- src/game/SpellMgr.cpp | 40 +-- src/game/SpellMgr.h | 14 +- src/game/ThreatManager.cpp | 2 +- src/game/Unit.cpp | 40 +-- src/shared/revision_nr.h | 2 +- 12 files changed, 382 insertions(+), 352 deletions(-) diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 154f34940..20e699392 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -506,8 +506,7 @@ void LoadDBCStores(const std::string& dataPath) continue; SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); - - if(spellInfo && (spellInfo->Attributes & 0x1D0) == 0x1D0) + if (spellInfo && (spellInfo->Attributes & (SPELL_ATTR_UNK4 | SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 | SPELL_ATTR_UNK8)) == (SPELL_ATTR_UNK4 | SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 | SPELL_ATTR_UNK8)) { for (unsigned int i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i) { diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index f3b45abce..66e5f3ff6 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -23,6 +23,7 @@ #include "DBCEnums.h" #include "Path.h" #include "Platform/Define.h" +#include "SharedDefines.h" #include #include @@ -1521,7 +1522,6 @@ struct SoundEntriesEntry // 29 m_soundEntriesAdvancedID }; - struct ClassFamilyMask { uint64 Flags; @@ -1700,6 +1700,15 @@ struct SpellEntry return SpellFamily(SpellFamilyName) == family && IsFitToFamilyMask(mask); } + inline bool HasAttribute(SpellAttributes attribute) const { return Attributes & attribute; } + inline bool HasAttribute(SpellAttributesEx attribute) const { return AttributesEx & attribute; } + inline bool HasAttribute(SpellAttributesEx2 attribute) const { return AttributesEx2 & attribute; } + inline bool HasAttribute(SpellAttributesEx3 attribute) const { return AttributesEx3 & attribute; } + inline bool HasAttribute(SpellAttributesEx4 attribute) const { return AttributesEx4 & attribute; } + inline bool HasAttribute(SpellAttributesEx5 attribute) const { return AttributesEx5 & attribute; } + inline bool HasAttribute(SpellAttributesEx6 attribute) const { return AttributesEx6 & attribute; } + inline bool HasAttribute(SpellAttributesEx7 attribute) const { return AttributesEx7 & attribute; } + private: // prevent creating custom entries (copy data from original in fact) SpellEntry(SpellEntry const&); // DON'T must have implementation diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index bc28059b2..faf43ec15 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -1375,7 +1375,7 @@ void LoadLootTemplates_Spell() { // not report about not trainable spells (optionally supported by DB) // ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example - if (!(spellInfo->Attributes & SPELL_ATTR_NOT_SHAPESHIFT) || (spellInfo->Attributes & SPELL_ATTR_TRADESPELL)) + if (!spellInfo->HasAttribute(SPELL_ATTR_NOT_SHAPESHIFT) || spellInfo->HasAttribute(SPELL_ATTR_TRADESPELL)) { LootTemplates_Spell.ReportNotExistedId(spell_id); } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index a0e656eb0..933516903 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7526,7 +7526,7 @@ bool PlayerCondition::Meets(Player const * player) const { Unit::SpellAuraHolderMap const& auras = player->GetSpellAuraHolderMap(); for (Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - if ((itr->second->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetSpellProto()->SpellVisual[0]==3580) + if ((itr->second->GetSpellProto()->HasAttribute(SPELL_ATTR_CASTABLE_WHILE_MOUNTED) || itr->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNK4)) && itr->second->GetSpellProto()->SpellVisual[0]==3580) return true; return false; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f7746e228..4cf65573a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3262,12 +3262,12 @@ bool Player::IsNeedCastPassiveLikeSpellAtLearn(SpellEntry const* spellInfo) cons if (IsNeedCastSpellAtFormApply(spellInfo, form)) // SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 spells return true; // all stance req. cases, not have auarastate cases - if (!(spellInfo->Attributes & SPELL_ATTR_PASSIVE)) + if (!spellInfo->HasAttribute(SPELL_ATTR_PASSIVE)) return false; // note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell // talent dependent passives activated at form apply have proper stance data - bool need_cast = (!spellInfo->Stances || !form && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)); + bool need_cast = !spellInfo->Stances || !form && spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT); // Check CasterAuraStates return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState))); @@ -5918,7 +5918,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Pl } // current range for button of totem bar is from ACTION_BUTTON_SHAMAN_TOTEMS_BAR to (but not including) ACTION_BUTTON_SHAMAN_TOTEMS_BAR + 12 else if(button >= ACTION_BUTTON_SHAMAN_TOTEMS_BAR && button < (ACTION_BUTTON_SHAMAN_TOTEMS_BAR + 12) - && !(spellProto->AttributesEx7 & SPELL_ATTR_EX7_TOTEM_SPELL)) + && !spellProto->HasAttribute(SPELL_ATTR_EX7_TOTEM_SPELL)) { if (msg) sLog.outError( "Spell action %u not added into button %u for player %s: attempt to add non totem spell to totem bar", action, button, player->GetName() ); @@ -19091,7 +19091,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs ) } // Not send cooldown for this spells - if (spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + if (spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE)) continue; if((idSchoolMask & GetSpellSchoolMask(spellInfo)) && GetSpellCooldownDelay(unSpellId) < unTimeMs ) @@ -20869,8 +20869,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const { // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP - if (spellInfo->AttributesEx5 & SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP && - HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION)) + if (spellInfo->HasAttribute(SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION)) return true; // Check no reagent use mask diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 0400b1884..24563bc46 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -226,274 +226,297 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { 0xffe6cc80 //LIGHT YELLOW }; - // *********************************** // Spell Attributes definitions // *********************************** -#define SPELL_ATTR_UNK0 0x00000001 // 0 -#define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilites have this flag -#define SPELL_ATTR_ON_NEXT_SWING_1 0x00000004 // 2 on next swing -#define SPELL_ATTR_UNK3 0x00000008 // 3 not set in 3.0.3 -#define SPELL_ATTR_UNK4 0x00000010 // 4 isAbility -#define SPELL_ATTR_TRADESPELL 0x00000020 // 5 trade spells, will be added by client to a sublist of profession spell -#define SPELL_ATTR_PASSIVE 0x00000040 // 6 Passive spell -#define SPELL_ATTR_UNK7 0x00000080 // 7 can't be linked in chat? -#define SPELL_ATTR_UNK8 0x00000100 // 8 hide created item in tooltip (for effect=24) -#define SPELL_ATTR_UNK9 0x00000200 // 9 -#define SPELL_ATTR_ON_NEXT_SWING_2 0x00000400 // 10 on next swing 2 -#define SPELL_ATTR_UNK11 0x00000800 // 11 -#define SPELL_ATTR_DAYTIME_ONLY 0x00001000 // 12 only useable at daytime, not set in 2.4.2 -#define SPELL_ATTR_NIGHT_ONLY 0x00002000 // 13 only useable at night, not set in 2.4.2 -#define SPELL_ATTR_INDOORS_ONLY 0x00004000 // 14 only useable indoors, not set in 2.4.2 -#define SPELL_ATTR_OUTDOORS_ONLY 0x00008000 // 15 Only useable outdoors. -#define SPELL_ATTR_NOT_SHAPESHIFT 0x00010000 // 16 Not while shapeshifted -#define SPELL_ATTR_ONLY_STEALTHED 0x00020000 // 17 Must be in stealth -#define SPELL_ATTR_UNK18 0x00040000 // 18 -#define SPELL_ATTR_LEVEL_DAMAGE_CALCULATION 0x00080000 // 19 spelldamage depends on caster level -#define SPELL_ATTR_STOP_ATTACK_TARGET 0x00100000 // 20 Stop attack after use this spell (and not begin attack if use) -#define SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK 0x00200000 // 21 Cannot be dodged/parried/blocked -#define SPELL_ATTR_SET_TRACKING_TARGET 0x00400000 // 22 SetTrackingTarget -#define SPELL_ATTR_UNK23 0x00800000 // 23 castable while dead? -#define SPELL_ATTR_CASTABLE_WHILE_MOUNTED 0x01000000 // 24 castable while mounted -#define SPELL_ATTR_DISABLED_WHILE_ACTIVE 0x02000000 // 25 Activate and start cooldown after aura fade or remove summoned creature or go -#define SPELL_ATTR_UNK26 0x04000000 // 26 -#define SPELL_ATTR_CASTABLE_WHILE_SITTING 0x08000000 // 27 castable while sitting -#define SPELL_ATTR_CANT_USED_IN_COMBAT 0x10000000 // 28 Cannot be used in combat -#define SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY 0x20000000 // 29 unaffected by invulnerability (hmm possible not...) -#define SPELL_ATTR_UNK30 0x40000000 // 30 breakable by damage? -#define SPELL_ATTR_CANT_CANCEL 0x80000000 // 31 positive aura can't be canceled +enum SpellAttributes +{ + SPELL_ATTR_UNK0 = 0x00000001, // 0 + SPELL_ATTR_RANGED = 0x00000002, // 1 All ranged abilites have this flag + SPELL_ATTR_ON_NEXT_SWING_1 = 0x00000004, // 2 on next swing + SPELL_ATTR_UNK3 = 0x00000008, // 3 not set in 3.0.3 + SPELL_ATTR_UNK4 = 0x00000010, // 4 isAbility + SPELL_ATTR_TRADESPELL = 0x00000020, // 5 trade spells, will be added by client to a sublist of profession spell + SPELL_ATTR_PASSIVE = 0x00000040, // 6 Passive spell + SPELL_ATTR_UNK7 = 0x00000080, // 7 can't be linked in chat? + SPELL_ATTR_UNK8 = 0x00000100, // 8 hide created item in tooltip (for effect=24) + SPELL_ATTR_UNK9 = 0x00000200, // 9 + SPELL_ATTR_ON_NEXT_SWING_2 = 0x00000400, // 10 on next swing 2 + SPELL_ATTR_UNK11 = 0x00000800, // 11 + SPELL_ATTR_DAYTIME_ONLY = 0x00001000, // 12 only useable at daytime, not set in 2.4.2 + SPELL_ATTR_NIGHT_ONLY = 0x00002000, // 13 only useable at night, not set in 2.4.2 + SPELL_ATTR_INDOORS_ONLY = 0x00004000, // 14 only useable indoors, not set in 2.4.2 + SPELL_ATTR_OUTDOORS_ONLY = 0x00008000, // 15 Only useable outdoors. + SPELL_ATTR_NOT_SHAPESHIFT = 0x00010000, // 16 Not while shapeshifted + SPELL_ATTR_ONLY_STEALTHED = 0x00020000, // 17 Must be in stealth + SPELL_ATTR_UNK18 = 0x00040000, // 18 + SPELL_ATTR_LEVEL_DAMAGE_CALCULATION = 0x00080000, // 19 spelldamage depends on caster level + SPELL_ATTR_STOP_ATTACK_TARGET = 0x00100000, // 20 Stop attack after use this spell (and not begin attack if use) + SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK = 0x00200000, // 21 Cannot be dodged/parried/blocked + SPELL_ATTR_SET_TRACKING_TARGET = 0x00400000, // 22 SetTrackingTarget + SPELL_ATTR_UNK23 = 0x00800000, // 23 castable while dead? + SPELL_ATTR_CASTABLE_WHILE_MOUNTED = 0x01000000, // 24 castable while mounted + SPELL_ATTR_DISABLED_WHILE_ACTIVE = 0x02000000, // 25 Activate and start cooldown after aura fade or remove summoned creature or go + SPELL_ATTR_UNK26 = 0x04000000, // 26 + SPELL_ATTR_CASTABLE_WHILE_SITTING = 0x08000000, // 27 castable while sitting + SPELL_ATTR_CANT_USED_IN_COMBAT = 0x10000000, // 28 Cannot be used in combat + SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY = 0x20000000, // 29 unaffected by invulnerability (hmm possible not...) + SPELL_ATTR_UNK30 = 0x40000000, // 30 breakable by damage? + SPELL_ATTR_CANT_CANCEL = 0x80000000, // 31 positive aura can't be canceled +}; -#define SPELL_ATTR_EX_UNK0 0x00000001 // 0 -#define SPELL_ATTR_EX_DRAIN_ALL_POWER 0x00000002 // 1 use all power (Only paladin Lay of Hands and Bunyanize) -#define SPELL_ATTR_EX_CHANNELED_1 0x00000004 // 2 channeled 1 -#define SPELL_ATTR_EX_UNK3 0x00000008 // 3 -#define SPELL_ATTR_EX_UNK4 0x00000010 // 4 -#define SPELL_ATTR_EX_NOT_BREAK_STEALTH 0x00000020 // 5 Not break stealth -#define SPELL_ATTR_EX_CHANNELED_2 0x00000040 // 6 channeled 2 -#define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7 -#define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state -#define SPELL_ATTR_EX_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX_NO_THREAT 0x00000400 // 10 no generates threat on cast 100% -#define SPELL_ATTR_EX_UNK11 0x00000800 // 11 -#define SPELL_ATTR_EX_UNK12 0x00001000 // 12 -#define SPELL_ATTR_EX_UNK13 0x00002000 // 13 -#define SPELL_ATTR_EX_UNK14 0x00004000 // 14 -#define SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY 0x00008000 // 15 remove auras on immunity -#define SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE 0x00010000 // 16 unaffected by school immunity -#define SPELL_ATTR_EX_UNK17 0x00020000 // 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells -#define SPELL_ATTR_EX_UNK18 0x00040000 // 18 -#define SPELL_ATTR_EX_UNK19 0x00080000 // 19 -#define SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS 0x00100000 // 20 Req combo points on target -#define SPELL_ATTR_EX_UNK21 0x00200000 // 21 -#define SPELL_ATTR_EX_REQ_COMBO_POINTS 0x00400000 // 22 Use combo points (in 4.x not required combo point target selected) -#define SPELL_ATTR_EX_UNK23 0x00800000 // 23 -#define SPELL_ATTR_EX_UNK24 0x01000000 // 24 Req fishing pole?? -#define SPELL_ATTR_EX_UNK25 0x02000000 // 25 -#define SPELL_ATTR_EX_UNK26 0x04000000 // 26 -#define SPELL_ATTR_EX_UNK27 0x08000000 // 27 -#define SPELL_ATTR_EX_UNK28 0x10000000 // 28 -#define SPELL_ATTR_EX_UNK29 0x20000000 // 29 -#define SPELL_ATTR_EX_UNK30 0x40000000 // 30 overpower -#define SPELL_ATTR_EX_UNK31 0x80000000 // 31 +enum SpellAttributesEx +{ + SPELL_ATTR_EX_UNK0 = 0x00000001, // 0 + SPELL_ATTR_EX_DRAIN_ALL_POWER = 0x00000002, // 1 use all power (Only paladin Lay of Hands and Bunyanize) + SPELL_ATTR_EX_CHANNELED_1 = 0x00000004, // 2 channeled 1 + SPELL_ATTR_EX_UNK3 = 0x00000008, // 3 + SPELL_ATTR_EX_UNK4 = 0x00000010, // 4 + SPELL_ATTR_EX_NOT_BREAK_STEALTH = 0x00000020, // 5 Not break stealth + SPELL_ATTR_EX_CHANNELED_2 = 0x00000040, // 6 channeled 2 + SPELL_ATTR_EX_NEGATIVE = 0x00000080, // 7 + SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET = 0x00000100, // 8 Spell req target not to be in combat state + SPELL_ATTR_EX_UNK9 = 0x00000200, // 9 + SPELL_ATTR_EX_NO_THREAT = 0x00000400, // 10 no generates threat on cast 100% + SPELL_ATTR_EX_UNK11 = 0x00000800, // 11 + SPELL_ATTR_EX_UNK12 = 0x00001000, // 12 + SPELL_ATTR_EX_UNK13 = 0x00002000, // 13 + SPELL_ATTR_EX_UNK14 = 0x00004000, // 14 + SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY = 0x00008000, // 15 remove auras on immunity + SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000, // 16 unaffected by school immunity + SPELL_ATTR_EX_UNK17 = 0x00020000, // 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells + SPELL_ATTR_EX_UNK18 = 0x00040000, // 18 + SPELL_ATTR_EX_UNK19 = 0x00080000, // 19 + SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000, // 20 Req combo points on target + SPELL_ATTR_EX_UNK21 = 0x00200000, // 21 + SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000, // 22 Use combo points (in 4.x not required combo point target selected) + SPELL_ATTR_EX_UNK23 = 0x00800000, // 23 + SPELL_ATTR_EX_UNK24 = 0x01000000, // 24 Req fishing pole?? + SPELL_ATTR_EX_UNK25 = 0x02000000, // 25 + SPELL_ATTR_EX_UNK26 = 0x04000000, // 26 + SPELL_ATTR_EX_UNK27 = 0x08000000, // 27 + SPELL_ATTR_EX_UNK28 = 0x10000000, // 28 + SPELL_ATTR_EX_UNK29 = 0x20000000, // 29 + SPELL_ATTR_EX_UNK30 = 0x40000000, // 30 overpower + SPELL_ATTR_EX_UNK31 = 0x80000000, // 31 +}; -#define SPELL_ATTR_EX2_UNK0 0x00000001 // 0 -#define SPELL_ATTR_EX2_UNK1 0x00000002 // 1 -#define SPELL_ATTR_EX2_CANT_REFLECTED 0x00000004 // 2 ? used for detect can or not spell reflected // do not need LOS (e.g. 18220 since 3.3.3) -#define SPELL_ATTR_EX2_UNK3 0x00000008 // 3 auto targeting? (e.g. fishing skill enhancement items since 3.3.3) -#define SPELL_ATTR_EX2_UNK4 0x00000010 // 4 -#define SPELL_ATTR_EX2_AUTOREPEAT_FLAG 0x00000020 // 5 -#define SPELL_ATTR_EX2_UNK6 0x00000040 // 6 only usable on tabbed by yourself -#define SPELL_ATTR_EX2_UNK7 0x00000080 // 7 -#define SPELL_ATTR_EX2_UNK8 0x00000100 // 8 not set in 3.0.3 -#define SPELL_ATTR_EX2_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX2_UNK10 0x00000400 // 10 -#define SPELL_ATTR_EX2_HEALTH_FUNNEL 0x00000800 // 11 -#define SPELL_ATTR_EX2_UNK12 0x00001000 // 12 -#define SPELL_ATTR_EX2_UNK13 0x00002000 // 13 -#define SPELL_ATTR_EX2_UNK14 0x00004000 // 14 -#define SPELL_ATTR_EX2_UNK15 0x00008000 // 15 not set in 3.0.3 -#define SPELL_ATTR_EX2_UNK16 0x00010000 // 16 -#define SPELL_ATTR_EX2_UNK17 0x00020000 // 17 suspend weapon timer instead of resetting it, (?Hunters Shot and Stings only have this flag?) -#define SPELL_ATTR_EX2_UNK18 0x00040000 // 18 Only Revive pet - possible req dead pet -#define SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT 0x00080000 // 19 does not necessarly need shapeshift -#define SPELL_ATTR_EX2_UNK20 0x00100000 // 20 -#define SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD 0x00200000 // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! -#define SPELL_ATTR_EX2_UNK22 0x00400000 // 22 -#define SPELL_ATTR_EX2_UNK23 0x00800000 // 23 Only mage Arcane Concentration have this flag -#define SPELL_ATTR_EX2_UNK24 0x01000000 // 24 -#define SPELL_ATTR_EX2_UNK25 0x02000000 // 25 -#define SPELL_ATTR_EX2_UNK26 0x04000000 // 26 unaffected by school immunity -#define SPELL_ATTR_EX2_UNK27 0x08000000 // 27 -#define SPELL_ATTR_EX2_UNK28 0x10000000 // 28 no breaks stealth if it fails?? -#define SPELL_ATTR_EX2_CANT_CRIT 0x20000000 // 29 Spell can't crit -#define SPELL_ATTR_EX2_UNK30 0x40000000 // 30 -#define SPELL_ATTR_EX2_FOOD_BUFF 0x80000000 // 31 Food or Drink Buff (like Well Fed) +enum SpellAttributesEx2 +{ + SPELL_ATTR_EX2_UNK0 = 0x00000001, // 0 + SPELL_ATTR_EX2_UNK1 = 0x00000002, // 1 + SPELL_ATTR_EX2_CANT_REFLECTED = 0x00000004, // 2 ? used for detect can or not spell reflected // do not need LOS (e.g. 18220 since 3.3.3) + SPELL_ATTR_EX2_UNK3 = 0x00000008, // 3 auto targeting? (e.g. fishing skill enhancement items since 3.3.3) + SPELL_ATTR_EX2_UNK4 = 0x00000010, // 4 + SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 0x00000020, // 5 + SPELL_ATTR_EX2_UNK6 = 0x00000040, // 6 only usable on tabbed by yourself + SPELL_ATTR_EX2_UNK7 = 0x00000080, // 7 + SPELL_ATTR_EX2_UNK8 = 0x00000100, // 8 not set in 3.0.3 + SPELL_ATTR_EX2_UNK9 = 0x00000200, // 9 + SPELL_ATTR_EX2_UNK10 = 0x00000400, // 10 + SPELL_ATTR_EX2_HEALTH_FUNNEL = 0x00000800, // 11 + SPELL_ATTR_EX2_UNK12 = 0x00001000, // 12 + SPELL_ATTR_EX2_UNK13 = 0x00002000, // 13 + SPELL_ATTR_EX2_UNK14 = 0x00004000, // 14 + SPELL_ATTR_EX2_UNK15 = 0x00008000, // 15 not set in 3.0.3 + SPELL_ATTR_EX2_UNK16 = 0x00010000, // 16 + SPELL_ATTR_EX2_UNK17 = 0x00020000, // 17 suspend weapon timer instead of resetting it, (?Hunters Shot and Stings only have this flag?) + SPELL_ATTR_EX2_UNK18 = 0x00040000, // 18 Only Revive pet - possible req dead pet + SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT = 0x00080000, // 19 does not necessarly need shapeshift + SPELL_ATTR_EX2_UNK20 = 0x00100000, // 20 + SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD = 0x00200000, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! + SPELL_ATTR_EX2_UNK22 = 0x00400000, // 22 + SPELL_ATTR_EX2_UNK23 = 0x00800000, // 23 Only mage Arcane Concentration have this flag + SPELL_ATTR_EX2_UNK24 = 0x01000000, // 24 + SPELL_ATTR_EX2_UNK25 = 0x02000000, // 25 + SPELL_ATTR_EX2_UNK26 = 0x04000000, // 26 unaffected by school immunity + SPELL_ATTR_EX2_UNK27 = 0x08000000, // 27 + SPELL_ATTR_EX2_UNK28 = 0x10000000, // 28 no breaks stealth if it fails?? + SPELL_ATTR_EX2_CANT_CRIT = 0x20000000, // 29 Spell can't crit + SPELL_ATTR_EX2_UNK30 = 0x40000000, // 30 + SPELL_ATTR_EX2_FOOD_BUFF = 0x80000000, // 31 Food or Drink Buff (like Well Fed) +}; -#define SPELL_ATTR_EX3_UNK0 0x00000001 // 0 -#define SPELL_ATTR_EX3_UNK1 0x00000002 // 1 -#define SPELL_ATTR_EX3_UNK2 0x00000004 // 2 -#define SPELL_ATTR_EX3_UNK3 0x00000008 // 3 -#define SPELL_ATTR_EX3_UNK4 0x00000010 // 4 Druid Rebirth only this spell have this flag -#define SPELL_ATTR_EX3_UNK5 0x00000020 // 5 -#define SPELL_ATTR_EX3_UNK6 0x00000040 // 6 -#define SPELL_ATTR_EX3_UNK7 0x00000080 // 7 create a separate (de)buff stack for each caster -#define SPELL_ATTR_EX3_UNK8 0x00000100 // 8 -#define SPELL_ATTR_EX3_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX3_MAIN_HAND 0x00000400 // 10 Main hand weapon required -#define SPELL_ATTR_EX3_BATTLEGROUND 0x00000800 // 11 Can casted only on battleground -#define SPELL_ATTR_EX3_CAST_ON_DEAD 0x00001000 // 12 target is a dead player (not every spell has this flag) -#define SPELL_ATTR_EX3_UNK13 0x00002000 // 13 -#define SPELL_ATTR_EX3_UNK14 0x00004000 // 14 "Honorless Target" only this spells have this flag -#define SPELL_ATTR_EX3_UNK15 0x00008000 // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag -#define SPELL_ATTR_EX3_UNK16 0x00010000 // 16 no triggers effects that trigger on casting a spell?? -#define SPELL_ATTR_EX3_NO_INITIAL_AGGRO 0x00020000 // 17 Causes no aggro if not missed -#define SPELL_ATTR_EX3_CANT_MISS 0x00040000 // 18 Spell should always hit its target -#define SPELL_ATTR_EX3_UNK19 0x00080000 // 19 -#define SPELL_ATTR_EX3_DEATH_PERSISTENT 0x00100000 // 20 Death persistent spells -#define SPELL_ATTR_EX3_UNK21 0x00200000 // 21 -#define SPELL_ATTR_EX3_REQ_WAND 0x00400000 // 22 Req wand -#define SPELL_ATTR_EX3_UNK23 0x00800000 // 23 -#define SPELL_ATTR_EX3_REQ_OFFHAND 0x01000000 // 24 Req offhand weapon -#define SPELL_ATTR_EX3_UNK25 0x02000000 // 25 no cause spell pushback ? -#define SPELL_ATTR_EX3_UNK26 0x04000000 // 26 -#define SPELL_ATTR_EX3_UNK27 0x08000000 // 27 -#define SPELL_ATTR_EX3_UNK28 0x10000000 // 28 -#define SPELL_ATTR_EX3_UNK29 0x20000000 // 29 -#define SPELL_ATTR_EX3_UNK30 0x40000000 // 30 -#define SPELL_ATTR_EX3_UNK31 0x80000000 // 31 +enum SpellAttributesEx3 +{ + SPELL_ATTR_EX3_UNK0 = 0x00000001, // 0 + SPELL_ATTR_EX3_UNK1 = 0x00000002, // 1 + SPELL_ATTR_EX3_UNK2 = 0x00000004, // 2 + SPELL_ATTR_EX3_UNK3 = 0x00000008, // 3 + SPELL_ATTR_EX3_UNK4 = 0x00000010, // 4 Druid Rebirth only this spell have this flag + SPELL_ATTR_EX3_UNK5 = 0x00000020, // 5 + SPELL_ATTR_EX3_UNK6 = 0x00000040, // 6 + SPELL_ATTR_EX3_UNK7 = 0x00000080, // 7 create a separate (de)buff stack for each caster + SPELL_ATTR_EX3_UNK8 = 0x00000100, // 8 + SPELL_ATTR_EX3_UNK9 = 0x00000200, // 9 + SPELL_ATTR_EX3_MAIN_HAND = 0x00000400, // 10 Main hand weapon required + SPELL_ATTR_EX3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground + SPELL_ATTR_EX3_CAST_ON_DEAD = 0x00001000, // 12 target is a dead player (not every spell has this flag) + SPELL_ATTR_EX3_UNK13 = 0x00002000, // 13 + SPELL_ATTR_EX3_UNK14 = 0x00004000, // 14 "Honorless Target" only this spells have this flag + SPELL_ATTR_EX3_UNK15 = 0x00008000, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag + SPELL_ATTR_EX3_UNK16 = 0x00010000, // 16 no triggers effects that trigger on casting a spell?? + SPELL_ATTR_EX3_NO_INITIAL_AGGRO = 0x00020000, // 17 Causes no aggro if not missed + SPELL_ATTR_EX3_CANT_MISS = 0x00040000, // 18 Spell should always hit its target + SPELL_ATTR_EX3_UNK19 = 0x00080000, // 19 + SPELL_ATTR_EX3_DEATH_PERSISTENT = 0x00100000, // 20 Death persistent spells + SPELL_ATTR_EX3_UNK21 = 0x00200000, // 21 + SPELL_ATTR_EX3_REQ_WAND = 0x00400000, // 22 Req wand + SPELL_ATTR_EX3_UNK23 = 0x00800000, // 23 + SPELL_ATTR_EX3_REQ_OFFHAND = 0x01000000, // 24 Req offhand weapon + SPELL_ATTR_EX3_UNK25 = 0x02000000, // 25 no cause spell pushback ? + SPELL_ATTR_EX3_UNK26 = 0x04000000, // 26 + SPELL_ATTR_EX3_UNK27 = 0x08000000, // 27 + SPELL_ATTR_EX3_UNK28 = 0x10000000, // 28 + SPELL_ATTR_EX3_UNK29 = 0x20000000, // 29 + SPELL_ATTR_EX3_UNK30 = 0x40000000, // 30 + SPELL_ATTR_EX3_UNK31 = 0x80000000, // 31 +}; -#define SPELL_ATTR_EX4_UNK0 0x00000001 // 0 -#define SPELL_ATTR_EX4_UNK1 0x00000002 // 1 proc on finishing move? -#define SPELL_ATTR_EX4_UNK2 0x00000004 // 2 -#define SPELL_ATTR_EX4_UNK3 0x00000008 // 3 -#define SPELL_ATTR_EX4_UNK4 0x00000010 // 4 This will no longer cause guards to attack on use?? -#define SPELL_ATTR_EX4_UNK5 0x00000020 // 5 -#define SPELL_ATTR_EX4_NOT_STEALABLE 0x00000040 // 6 although such auras might be dispellable, they cannot be stolen -#define SPELL_ATTR_EX4_UNK7 0x00000080 // 7 -#define SPELL_ATTR_EX4_STACK_DOT_MODIFIER 0x00000100 // 8 no effect on non DoTs? -#define SPELL_ATTR_EX4_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST 0x00000400 // 10 Rogue Shiv have this flag -#define SPELL_ATTR_EX4_UNK11 0x00000800 // 11 -#define SPELL_ATTR_EX4_UNK12 0x00001000 // 12 -#define SPELL_ATTR_EX4_UNK13 0x00002000 // 13 -#define SPELL_ATTR_EX4_UNK14 0x00004000 // 14 -#define SPELL_ATTR_EX4_UNK15 0x00008000 // 15 -#define SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA 0x00010000 // 16 not usable in arena -#define SPELL_ATTR_EX4_USABLE_IN_ARENA 0x00020000 // 17 usable in arena -#define SPELL_ATTR_EX4_UNK18 0x00040000 // 18 -#define SPELL_ATTR_EX4_UNK19 0x00080000 // 19 -#define SPELL_ATTR_EX4_UNK20 0x00100000 // 20 do not give "more powerful spell" error message -#define SPELL_ATTR_EX4_UNK21 0x00200000 // 21 -#define SPELL_ATTR_EX4_UNK22 0x00400000 // 22 -#define SPELL_ATTR_EX4_UNK23 0x00800000 // 23 -#define SPELL_ATTR_EX4_UNK24 0x01000000 // 24 -#define SPELL_ATTR_EX4_UNK25 0x02000000 // 25 pet scaling auras -#define SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND 0x04000000 // 26 Can only be used in Outland. -#define SPELL_ATTR_EX4_UNK27 0x08000000 // 27 -#define SPELL_ATTR_EX4_UNK28 0x10000000 // 28 -#define SPELL_ATTR_EX4_UNK29 0x20000000 // 29 -#define SPELL_ATTR_EX4_UNK30 0x40000000 // 30 -#define SPELL_ATTR_EX4_UNK31 0x80000000 // 31 +enum SpellAttributesEx4 +{ + SPELL_ATTR_EX4_UNK0 = 0x00000001, // 0 + SPELL_ATTR_EX4_UNK1 = 0x00000002, // 1 proc on finishing move? + SPELL_ATTR_EX4_UNK2 = 0x00000004, // 2 + SPELL_ATTR_EX4_UNK3 = 0x00000008, // 3 + SPELL_ATTR_EX4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use?? + SPELL_ATTR_EX4_UNK5 = 0x00000020, // 5 + SPELL_ATTR_EX4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen + SPELL_ATTR_EX4_UNK7 = 0x00000080, // 7 + SPELL_ATTR_EX4_STACK_DOT_MODIFIER = 0x00000100, // 8 no effect on non DoTs? + SPELL_ATTR_EX4_UNK9 = 0x00000200, // 9 + SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag + SPELL_ATTR_EX4_UNK11 = 0x00000800, // 11 + SPELL_ATTR_EX4_UNK12 = 0x00001000, // 12 + SPELL_ATTR_EX4_UNK13 = 0x00002000, // 13 + SPELL_ATTR_EX4_UNK14 = 0x00004000, // 14 + SPELL_ATTR_EX4_UNK15 = 0x00008000, // 15 + SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA = 0x00010000, // 16 not usable in arena + SPELL_ATTR_EX4_USABLE_IN_ARENA = 0x00020000, // 17 usable in arena + SPELL_ATTR_EX4_UNK18 = 0x00040000, // 18 + SPELL_ATTR_EX4_UNK19 = 0x00080000, // 19 + SPELL_ATTR_EX4_UNK20 = 0x00100000, // 20 do not give "more powerful spell" error message + SPELL_ATTR_EX4_UNK21 = 0x00200000, // 21 + SPELL_ATTR_EX4_UNK22 = 0x00400000, // 22 + SPELL_ATTR_EX4_UNK23 = 0x00800000, // 23 + SPELL_ATTR_EX4_UNK24 = 0x01000000, // 24 + SPELL_ATTR_EX4_UNK25 = 0x02000000, // 25 pet scaling auras + SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND = 0x04000000, // 26 Can only be used in Outland. + SPELL_ATTR_EX4_UNK27 = 0x08000000, // 27 + SPELL_ATTR_EX4_UNK28 = 0x10000000, // 28 + SPELL_ATTR_EX4_UNK29 = 0x20000000, // 29 + SPELL_ATTR_EX4_UNK30 = 0x40000000, // 30 + SPELL_ATTR_EX4_UNK31 = 0x80000000, // 31 +}; -#define SPELL_ATTR_EX5_UNK0 0x00000001 // 0 -#define SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP 0x00000002 // 1 not need reagents if UNIT_FLAG_PREPARATION -#define SPELL_ATTR_EX5_UNK2 0x00000004 // 2 removed at enter arena (e.g. 31850 since 3.3.3) -#define SPELL_ATTR_EX5_USABLE_WHILE_STUNNED 0x00000008 // 3 usable while stunned -#define SPELL_ATTR_EX5_UNK4 0x00000010 // 4 -#define SPELL_ATTR_EX5_SINGLE_TARGET_SPELL 0x00000020 // 5 Only one target can be apply at a time -#define SPELL_ATTR_EX5_UNK6 0x00000040 // 6 -#define SPELL_ATTR_EX5_UNK7 0x00000080 // 7 -#define SPELL_ATTR_EX5_UNK8 0x00000100 // 8 -#define SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY 0x00000200 // 9 begin periodic tick at aura apply -#define SPELL_ATTR_EX5_UNK10 0x00000400 // 10 -#define SPELL_ATTR_EX5_UNK11 0x00000800 // 11 -#define SPELL_ATTR_EX5_UNK12 0x00001000 // 12 -#define SPELL_ATTR_EX5_UNK13 0x00002000 // 13 haste affects duration (e.g. 8050 since 3.3.3) -#define SPELL_ATTR_EX5_UNK14 0x00004000 // 14 -#define SPELL_ATTR_EX5_UNK15 0x00008000 // 15 -#define SPELL_ATTR_EX5_UNK16 0x00010000 // 16 -#define SPELL_ATTR_EX5_USABLE_WHILE_FEARED 0x00020000 // 17 usable while feared -#define SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED 0x00040000 // 18 usable while confused -#define SPELL_ATTR_EX5_UNK19 0x00080000 // 19 -#define SPELL_ATTR_EX5_UNK20 0x00100000 // 20 -#define SPELL_ATTR_EX5_UNK21 0x00200000 // 21 -#define SPELL_ATTR_EX5_UNK22 0x00400000 // 22 -#define SPELL_ATTR_EX5_UNK23 0x00800000 // 23 -#define SPELL_ATTR_EX5_UNK24 0x01000000 // 24 -#define SPELL_ATTR_EX5_UNK25 0x02000000 // 25 -#define SPELL_ATTR_EX5_UNK26 0x04000000 // 26 -#define SPELL_ATTR_EX5_UNK27 0x08000000 // 27 -#define SPELL_ATTR_EX5_UNK28 0x10000000 // 28 -#define SPELL_ATTR_EX5_UNK29 0x20000000 // 29 -#define SPELL_ATTR_EX5_UNK30 0x40000000 // 30 -#define SPELL_ATTR_EX5_UNK31 0x80000000 // 31 Forces all nearby enemies to focus attacks caster +enum SpellAttributesEx5 +{ + SPELL_ATTR_EX5_UNK0 = 0x00000001, // 0 + SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP = 0x00000002, // 1 not need reagents if UNIT_FLAG_PREPARATION + SPELL_ATTR_EX5_UNK2 = 0x00000004, // 2 removed at enter arena (e.g. 31850 since 3.3.3) + SPELL_ATTR_EX5_USABLE_WHILE_STUNNED = 0x00000008, // 3 usable while stunned + SPELL_ATTR_EX5_UNK4 = 0x00000010, // 4 + SPELL_ATTR_EX5_SINGLE_TARGET_SPELL = 0x00000020, // 5 Only one target can be apply at a time + SPELL_ATTR_EX5_UNK6 = 0x00000040, // 6 + SPELL_ATTR_EX5_UNK7 = 0x00000080, // 7 + SPELL_ATTR_EX5_UNK8 = 0x00000100, // 8 + SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY = 0x00000200, // 9 begin periodic tick at aura apply + SPELL_ATTR_EX5_UNK10 = 0x00000400, // 10 + SPELL_ATTR_EX5_UNK11 = 0x00000800, // 11 + SPELL_ATTR_EX5_UNK12 = 0x00001000, // 12 + SPELL_ATTR_EX5_UNK13 = 0x00002000, // 13 haste affects duration (e.g. 8050 since 3.3.3) + SPELL_ATTR_EX5_UNK14 = 0x00004000, // 14 + SPELL_ATTR_EX5_UNK15 = 0x00008000, // 15 + SPELL_ATTR_EX5_UNK16 = 0x00010000, // 16 + SPELL_ATTR_EX5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared + SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused + SPELL_ATTR_EX5_UNK19 = 0x00080000, // 19 + SPELL_ATTR_EX5_UNK20 = 0x00100000, // 20 + SPELL_ATTR_EX5_UNK21 = 0x00200000, // 21 + SPELL_ATTR_EX5_UNK22 = 0x00400000, // 22 + SPELL_ATTR_EX5_UNK23 = 0x00800000, // 23 + SPELL_ATTR_EX5_UNK24 = 0x01000000, // 24 + SPELL_ATTR_EX5_UNK25 = 0x02000000, // 25 + SPELL_ATTR_EX5_UNK26 = 0x04000000, // 26 + SPELL_ATTR_EX5_UNK27 = 0x08000000, // 27 + SPELL_ATTR_EX5_UNK28 = 0x10000000, // 28 + SPELL_ATTR_EX5_UNK29 = 0x20000000, // 29 + SPELL_ATTR_EX5_UNK30 = 0x40000000, // 30 + SPELL_ATTR_EX5_UNK31 = 0x80000000, // 31 Forces all nearby enemies to focus attacks caster +}; -#define SPELL_ATTR_EX6_UNK0 0x00000001 // 0 Only Move spell have this flag -#define SPELL_ATTR_EX6_ONLY_IN_ARENA 0x00000002 // 1 only usable in arena, not used in 3.2.0a and early -#define SPELL_ATTR_EX6_UNK2 0x00000004 // 2 -#define SPELL_ATTR_EX6_UNK3 0x00000008 // 3 -#define SPELL_ATTR_EX6_UNK4 0x00000010 // 4 -#define SPELL_ATTR_EX6_UNK5 0x00000020 // 5 -#define SPELL_ATTR_EX6_UNK6 0x00000040 // 6 -#define SPELL_ATTR_EX6_UNK7 0x00000080 // 7 -#define SPELL_ATTR_EX6_UNK8 0x00000100 // 8 -#define SPELL_ATTR_EX6_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX6_UNK10 0x00000400 // 10 -#define SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE 0x00000800 // 11 not usable in raid instance -#define SPELL_ATTR_EX6_UNK12 0x00001000 // 12 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells -#define SPELL_ATTR_EX6_UNK13 0x00002000 // 13 -#define SPELL_ATTR_EX6_UNK14 0x00004000 // 14 -#define SPELL_ATTR_EX6_UNK15 0x00008000 // 15 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK16 0x00010000 // 16 -#define SPELL_ATTR_EX6_UNK17 0x00020000 // 17 -#define SPELL_ATTR_EX6_UNK18 0x00040000 // 18 -#define SPELL_ATTR_EX6_UNK19 0x00080000 // 19 -#define SPELL_ATTR_EX6_UNK20 0x00100000 // 20 -#define SPELL_ATTR_EX6_UNK21 0x00200000 // 21 -#define SPELL_ATTR_EX6_UNK22 0x00400000 // 22 -#define SPELL_ATTR_EX6_UNK23 0x00800000 // 23 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK24 0x01000000 // 24 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK25 0x02000000 // 25 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK26 0x04000000 // 26 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK27 0x08000000 // 27 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK28 0x10000000 // 28 not set in 3.0.3 -#define SPELL_ATTR_EX6_NO_DMG_MODS 0x20000000 // 29 do not apply damage mods (usually in cases where it has already been applied) -#define SPELL_ATTR_EX6_UNK30 0x40000000 // 30 not set in 3.0.3 -#define SPELL_ATTR_EX6_UNK31 0x80000000 // 31 not set in 3.0.3 +enum SpellAttributesEx6 +{ + SPELL_ATTR_EX6_UNK0 = 0x00000001, // 0 Only Move spell have this flag + SPELL_ATTR_EX6_ONLY_IN_ARENA = 0x00000002, // 1 only usable in arena, not used in 3.2.0a and early + SPELL_ATTR_EX6_UNK2 = 0x00000004, // 2 + SPELL_ATTR_EX6_UNK3 = 0x00000008, // 3 + SPELL_ATTR_EX6_UNK4 = 0x00000010, // 4 + SPELL_ATTR_EX6_UNK5 = 0x00000020, // 5 + SPELL_ATTR_EX6_UNK6 = 0x00000040, // 6 + SPELL_ATTR_EX6_UNK7 = 0x00000080, // 7 + SPELL_ATTR_EX6_UNK8 = 0x00000100, // 8 + SPELL_ATTR_EX6_UNK9 = 0x00000200, // 9 + SPELL_ATTR_EX6_UNK10 = 0x00000400, // 10 + SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE = 0x00000800, // 11 not usable in raid instance + SPELL_ATTR_EX6_UNK12 = 0x00001000, // 12 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells + SPELL_ATTR_EX6_UNK13 = 0x00002000, // 13 + SPELL_ATTR_EX6_UNK14 = 0x00004000, // 14 + SPELL_ATTR_EX6_UNK15 = 0x00008000, // 15 not set in 3.0.3 + SPELL_ATTR_EX6_UNK16 = 0x00010000, // 16 + SPELL_ATTR_EX6_UNK17 = 0x00020000, // 17 + SPELL_ATTR_EX6_UNK18 = 0x00040000, // 18 + SPELL_ATTR_EX6_UNK19 = 0x00080000, // 19 + SPELL_ATTR_EX6_UNK20 = 0x00100000, // 20 + SPELL_ATTR_EX6_UNK21 = 0x00200000, // 21 + SPELL_ATTR_EX6_UNK22 = 0x00400000, // 22 + SPELL_ATTR_EX6_UNK23 = 0x00800000, // 23 not set in 3.0.3 + SPELL_ATTR_EX6_UNK24 = 0x01000000, // 24 not set in 3.0.3 + SPELL_ATTR_EX6_UNK25 = 0x02000000, // 25 not set in 3.0.3 + SPELL_ATTR_EX6_UNK26 = 0x04000000, // 26 not set in 3.0.3 + SPELL_ATTR_EX6_UNK27 = 0x08000000, // 27 not set in 3.0.3 + SPELL_ATTR_EX6_UNK28 = 0x10000000, // 28 not set in 3.0.3 + SPELL_ATTR_EX6_NO_DMG_MODS = 0x20000000, // 29 do not apply damage mods (usually in cases where it has already been applied) + SPELL_ATTR_EX6_UNK30 = 0x40000000, // 30 not set in 3.0.3 + SPELL_ATTR_EX6_UNK31 = 0x80000000, // 31 not set in 3.0.3 +}; -#define SPELL_ATTR_EX7_UNK0 0x00000001 // 0 -#define SPELL_ATTR_EX7_UNK1 0x00000002 // 1 -#define SPELL_ATTR_EX7_PALADIN_AURA 0x00000004 // 2 -#define SPELL_ATTR_EX7_UNK3 0x00000008 // 3 -#define SPELL_ATTR_EX7_UNK4 0x00000010 // 4 -#define SPELL_ATTR_EX7_TOTEM_SPELL 0x00000020 // 5 shaman summon totem spells -#define SPELL_ATTR_EX7_UNK6 0x00000040 // 6 -#define SPELL_ATTR_EX7_UNK7 0x00000080 // 7 -#define SPELL_ATTR_EX7_UNK8 0x00000100 // 8 -#define SPELL_ATTR_EX7_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX7_UNK10 0x00000400 // 10 -#define SPELL_ATTR_EX7_UNK11 0x00000800 // 11 -#define SPELL_ATTR_EX7_UNK12 0x00001000 // 12 -#define SPELL_ATTR_EX7_UNK13 0x00002000 // 13 -#define SPELL_ATTR_EX7_UNK14 0x00004000 // 14 -#define SPELL_ATTR_EX7_UNK15 0x00008000 // 15 -#define SPELL_ATTR_EX7_UNK16 0x00010000 // 16 -#define SPELL_ATTR_EX7_UNK17 0x00020000 // 17 -#define SPELL_ATTR_EX7_UNK18 0x00040000 // 18 -#define SPELL_ATTR_EX7_UNK19 0x00080000 // 19 -#define SPELL_ATTR_EX7_UNK20 0x00100000 // 20 -#define SPELL_ATTR_EX7_UNK21 0x00200000 // 21 -#define SPELL_ATTR_EX7_UNK22 0x00400000 // 22 -#define SPELL_ATTR_EX7_UNK23 0x00800000 // 23 -#define SPELL_ATTR_EX7_UNK24 0x01000000 // 24 -#define SPELL_ATTR_EX7_UNK25 0x02000000 // 25 -#define SPELL_ATTR_EX7_UNK26 0x04000000 // 26 -#define SPELL_ATTR_EX7_UNK27 0x08000000 // 27 -#define SPELL_ATTR_EX7_UNK28 0x10000000 // 28 -#define SPELL_ATTR_EX7_UNK29 0x20000000 // 29 -#define SPELL_ATTR_EX7_UNK30 0x40000000 // 30 -#define SPELL_ATTR_EX7_UNK31 0x80000000 // 31 +enum SpellAttributesEx7 +{ + SPELL_ATTR_EX7_UNK0 = 0x00000001, // 0 + SPELL_ATTR_EX7_UNK1 = 0x00000002, // 1 + SPELL_ATTR_EX7_PALADIN_AURA = 0x00000004, // 2 + SPELL_ATTR_EX7_UNK3 = 0x00000008, // 3 + SPELL_ATTR_EX7_UNK4 = 0x00000010, // 4 + SPELL_ATTR_EX7_TOTEM_SPELL = 0x00000020, // 5 shaman summon totem spells + SPELL_ATTR_EX7_UNK6 = 0x00000040, // 6 + SPELL_ATTR_EX7_UNK7 = 0x00000080, // 7 + SPELL_ATTR_EX7_UNK8 = 0x00000100, // 8 + SPELL_ATTR_EX7_UNK9 = 0x00000200, // 9 + SPELL_ATTR_EX7_UNK10 = 0x00000400, // 10 + SPELL_ATTR_EX7_UNK11 = 0x00000800, // 11 + SPELL_ATTR_EX7_UNK12 = 0x00001000, // 12 + SPELL_ATTR_EX7_UNK13 = 0x00002000, // 13 + SPELL_ATTR_EX7_UNK14 = 0x00004000, // 14 + SPELL_ATTR_EX7_UNK15 = 0x00008000, // 15 + SPELL_ATTR_EX7_UNK16 = 0x00010000, // 16 + SPELL_ATTR_EX7_UNK17 = 0x00020000, // 17 + SPELL_ATTR_EX7_UNK18 = 0x00040000, // 18 + SPELL_ATTR_EX7_UNK19 = 0x00080000, // 19 + SPELL_ATTR_EX7_UNK20 = 0x00100000, // 20 + SPELL_ATTR_EX7_UNK21 = 0x00200000, // 21 + SPELL_ATTR_EX7_UNK22 = 0x00400000, // 22 + SPELL_ATTR_EX7_UNK23 = 0x00800000, // 23 + SPELL_ATTR_EX7_UNK24 = 0x01000000, // 24 + SPELL_ATTR_EX7_UNK25 = 0x02000000, // 25 + SPELL_ATTR_EX7_UNK26 = 0x04000000, // 26 + SPELL_ATTR_EX7_UNK27 = 0x08000000, // 27 + SPELL_ATTR_EX7_UNK28 = 0x10000000, // 28 + SPELL_ATTR_EX7_UNK29 = 0x20000000, // 29 + SPELL_ATTR_EX7_UNK30 = 0x40000000, // 30 + SPELL_ATTR_EX7_UNK31 = 0x80000000, // 31 +}; #define MAX_TALENT_SPEC_COUNT 2 #define MAX_GLYPH_SLOT_INDEX 6 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index a5db748e2..2f6f20d67 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -392,7 +392,7 @@ Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid o m_spellFlags = SPELL_FLAG_NORMAL; - if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED)) + if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !m_spellInfo->HasAttribute(SPELL_ATTR_EX2_CANT_REFLECTED)) { for(int j = 0; j < MAX_EFFECT_INDEX; ++j) { @@ -402,7 +402,7 @@ Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid o 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->HasAttribute(SPELL_ATTR_EX_NEGATIVE); if(m_canReflect) continue; @@ -764,7 +764,7 @@ void Spell::prepareDataForTriggerSystem() break; case SPELL_DAMAGE_CLASS_RANGED: // Auto attack - if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) + if (m_spellInfo->HasAttribute(SPELL_ATTR_EX2_AUTOREPEAT_FLAG)) { m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT; m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT; @@ -781,7 +781,7 @@ void Spell::prepareDataForTriggerSystem() m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; } - else if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack + else if (m_spellInfo->HasAttribute(SPELL_ATTR_EX2_AUTOREPEAT_FLAG)) // Wands auto attack { m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT; m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT; @@ -1037,7 +1037,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if(real_caster && real_caster != unit) { // can cause back attack (if detected) - if (!(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) && + if (!m_spellInfo->HasAttribute(SPELL_ATTR_EX3_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) && m_caster->isVisibleForOrDetect(unit, unit, false)) { if (!unit->isInCombat() && unit->GetTypeId() != TYPEID_PLAYER && ((Creature*)unit)->AI()) @@ -1110,7 +1110,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // trigger weapon enchants for weapon based spells; exclude spells that stop attack, because may break CC if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && - !(m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET)) + !m_spellInfo->HasAttribute(SPELL_ATTR_STOP_ATTACK_TARGET)) ((Player*)m_caster)->CastItemCombatSpell(unitTarget, m_attackType); // Haunt (NOTE: for avoid use additional field damage stored in dummy value (replace unused 100%) @@ -1225,15 +1225,15 @@ void Spell::DoSpellHitOnUnit(Unit *unit, uint32 effectMask) } // not break stealth by cast targeting - if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH)) + if (!m_spellInfo->HasAttribute(SPELL_ATTR_EX_NOT_BREAK_STEALTH)) unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); // can cause back attack (if detected), stealth removed at Spell::cast if spell break it - if (!(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) && + if (!m_spellInfo->HasAttribute(SPELL_ATTR_EX3_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) && m_caster->isVisibleForOrDetect(unit, unit, false)) { // use speedup check to avoid re-remove after above lines - if (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH) + if (m_spellInfo->HasAttribute(SPELL_ATTR_EX_NOT_BREAK_STEALTH)) unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); // caster can be detected but have stealth aura @@ -1267,7 +1267,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, uint32 effectMask) if (unit->hasUnitState(UNIT_STAT_ATTACK_PLAYER)) realCaster->SetContestedPvP(); - if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO)) + if (unit->isInCombat() && !m_spellInfo->HasAttribute(SPELL_ATTR_EX3_NO_INITIAL_AGGRO)) { realCaster->SetInCombatState(unit->GetCombatTimer() > 0); unit->getHostileRefManager().threatAssist(realCaster, 0.0f, m_spellInfo); @@ -2140,7 +2140,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& // remove not targetable units if spell has no script targets for (UnitList::iterator itr = targetUnitMap.begin(); itr != targetUnitMap.end(); ) { - if (!(*itr)->isTargetableForAttack(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_CAST_ON_DEAD)) + if (!(*itr)->isTargetableForAttack(m_spellInfo->HasAttribute(SPELL_ATTR_EX3_CAST_ON_DEAD))) targetUnitMap.erase(itr++); else ++itr; @@ -2893,7 +2893,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& break; case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: // AreaAura - if(m_spellInfo->Attributes == 0x9050000 || m_spellInfo->Attributes == 0x10000) + if ((m_spellInfo->Attributes == (SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_CASTABLE_WHILE_MOUNTED | SPELL_ATTR_CASTABLE_WHILE_SITTING)) || (m_spellInfo->Attributes == SPELL_ATTR_NOT_SHAPESHIFT)) SetTargetMap(effIndex, TARGET_AREAEFFECT_PARTY, targetUnitMap); break; case SPELL_EFFECT_SKIN_PLAYER_CORPSE: @@ -3542,7 +3542,7 @@ void Spell::SendSpellCooldown() } // (1) have infinity cooldown but set at aura apply, (2) passive cooldown at triggering - if(m_spellInfo->Attributes & (SPELL_ATTR_DISABLED_WHILE_ACTIVE | SPELL_ATTR_PASSIVE)) + if (m_spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE) || m_spellInfo->HasAttribute(SPELL_ATTR_PASSIVE)) return; _player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0, this); @@ -3752,7 +3752,7 @@ void Spell::finish(bool ok) CastTriggerSpells(); // Stop Attack for some spells - if( m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET ) + if (m_spellInfo->HasAttribute(SPELL_ATTR_STOP_ATTACK_TARGET)) m_caster->AttackStop(); // update encounter state if needed @@ -4721,7 +4721,7 @@ void Spell::CastPreCastSpells(Unit* target) SpellCastResult Spell::CheckCast(bool strict) { // check cooldowns to prevent cheating (ignore passive spells, that client side visual only) - if (m_caster->GetTypeId()==TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE) && + if (m_caster->GetTypeId()==TYPEID_PLAYER && !m_spellInfo->HasAttribute(SPELL_ATTR_PASSIVE) && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id)) { if(m_triggeredByAuraSpell) @@ -4748,11 +4748,11 @@ SpellCastResult Spell::CheckCast(bool strict) sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled()) { - if (m_spellInfo->Attributes & SPELL_ATTR_OUTDOORS_ONLY && + if (m_spellInfo->HasAttribute(SPELL_ATTR_OUTDOORS_ONLY) && !m_caster->GetTerrain()->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->HasAttribute(SPELL_ATTR_INDOORS_ONLY) && m_caster->GetTerrain()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ())) return SPELL_FAILED_ONLY_INDOORS; } @@ -4768,7 +4768,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->HasAttribute(SPELL_ATTR_ONLY_STEALTHED) && !(m_caster->HasStealthAura())) return SPELL_FAILED_ONLY_STEALTHED; } } @@ -4841,8 +4841,8 @@ SpellCastResult Spell::CheckCast(bool strict) // totem immunity for channeled spells(needs to be before spell cast) // spell attribs for player channeled spells - if ((m_spellInfo->AttributesEx & SPELL_ATTR_EX_UNK14) - && (m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_UNK13) + if (m_spellInfo->HasAttribute(SPELL_ATTR_EX_UNK14) + && m_spellInfo->HasAttribute(SPELL_ATTR_EX5_UNK13) && target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsTotem()) return SPELL_FAILED_IMMUNE; @@ -5010,7 +5010,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_TARGET_AURASTATE; //Must be behind the target. - if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI_F, m_caster) ) + if (m_spellInfo->AttributesEx2 == SPELL_ATTR_EX2_UNK20 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_UNK9) && target->HasInArc(M_PI_F, m_caster)) { // Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags // Exclusion for Mutilate:Facing Limitation was removed in 2.0.1 and 3.0.3, but they still use the same, old Ex-Flags @@ -5025,14 +5025,14 @@ SpellCastResult Spell::CheckCast(bool strict) } //Target must be facing you. - if((m_spellInfo->Attributes == 0x150010) && !target->HasInArc(M_PI_F, m_caster) ) + if ((m_spellInfo->Attributes == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(M_PI_F, 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->HasAttribute(SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat()) return SPELL_FAILED_TARGET_AFFECTING_COMBAT; } // zone check @@ -5046,7 +5046,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) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_MOUNTED)) + !IsPassiveSpell(m_spellInfo) && !m_spellInfo->HasAttribute(SPELL_ATTR_CASTABLE_WHILE_MOUNTED)) { if (m_caster->IsTaxiFlying()) return SPELL_FAILED_NOT_ON_TAXI; @@ -5951,7 +5951,7 @@ SpellCastResult Spell::CheckCasterAuras() const { // Flag drop spells totally immuned to caster auras // FIXME: find more nice check for all totally immuned spells - // AttributesEx3 & 0x10000000? + // HasAttribute(SPELL_ATTR_EX3_UNK28) ? if (m_spellInfo->Id == 23336 || // Alliance Flag Drop m_spellInfo->Id == 23334 || // Horde Flag Drop m_spellInfo->Id == 34991) // Summon Netherstorm Flag @@ -5963,7 +5963,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->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) { for(int i = 0; i < MAX_EFFECT_INDEX; ++i) { @@ -5984,7 +5984,7 @@ SpellCastResult Spell::CheckCasterAuras() const // Check whether the cast should be prevented by any state you might have. SpellCastResult prevented_reason = SPELL_CAST_OK; - bool spellUsableWhileStunned = m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED; + bool spellUsableWhileStunned = m_spellInfo->HasAttribute(SPELL_ATTR_EX5_USABLE_WHILE_STUNNED); // 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 @@ -6014,9 +6014,9 @@ SpellCastResult Spell::CheckCasterAuras() const else 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->HasAttribute(SPELL_ATTR_EX5_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->HasAttribute(SPELL_ATTR_EX5_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; @@ -6047,7 +6047,7 @@ SpellCastResult Spell::CheckCasterAuras() const SpellAuraHolder *holder = itr->second; SpellEntry const * pEntry = holder->GetSpellProto(); - if ((GetSpellSchoolMask(pEntry) & school_immune) && !(pEntry->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE)) + if ((GetSpellSchoolMask(pEntry) & school_immune) && !pEntry->HasAttribute(SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE)) continue; if ((1<<(pEntry->Dispel)) & dispel_immune) continue; @@ -6069,11 +6069,11 @@ SpellCastResult Spell::CheckCasterAuras() const return SPELL_FAILED_STUNNED; break; case SPELL_AURA_MOD_CONFUSE: - if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED)) + if (!m_spellInfo->HasAttribute(SPELL_ATTR_EX5_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->HasAttribute(SPELL_ATTR_EX5_USABLE_WHILE_FEARED)) return SPELL_FAILED_FLEEING; break; case SPELL_AURA_MOD_SILENCE: @@ -6212,7 +6212,7 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel return 0; // Spell drain all exist power on cast (Only paladin lay of Hands) - if (spellInfo->AttributesEx & SPELL_ATTR_EX_DRAIN_ALL_POWER) + if (spellInfo->HasAttribute(SPELL_ATTR_EX_DRAIN_ALL_POWER)) { // If power type - health drain all if (spellInfo->powerType == POWER_HEALTH) @@ -6257,14 +6257,14 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel // 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->HasAttribute(SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST)) powerCost += caster->GetAttackTime(OFF_ATTACK) / 100; // Apply cost mod by spell if (spell) if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, powerCost, spell); - if (spellInfo->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION) + if (spellInfo->HasAttribute(SPELL_ATTR_LEVEL_DAMAGE_CALCULATION)) powerCost = int32(powerCost/ (1.117f * spellInfo->spellLevel / caster->getLevel() -0.1327f)); // PCT mod from user auras by school diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index c43c845f9..1d13b7a80 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -114,7 +114,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell) if (Player* modOwner = spell->GetCaster()->GetSpellModOwner()) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell); - if (!(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_TRADESPELL))) + if (!spellInfo->HasAttribute(SPELL_ATTR_UNK4) && !spellInfo->HasAttribute(SPELL_ATTR_TRADESPELL)) castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED)); else { @@ -123,7 +123,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell) } } - if (spellInfo->Attributes & SPELL_ATTR_RANGED && (!spell || !spell->IsAutoRepeat())) + if (spellInfo->HasAttribute(SPELL_ATTR_RANGED) && (!spell || !spell->IsAutoRepeat())) castTime += 500; return (castTime > 0) ? uint32(castTime) : 0; @@ -296,7 +296,7 @@ WeaponAttackType GetWeaponAttackType(SpellEntry const *spellInfo) switch (spellInfo->DmgClass) { case SPELL_DAMAGE_CLASS_MELEE: - if (spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND) + if (spellInfo->HasAttribute(SPELL_ATTR_EX3_REQ_OFFHAND)) return OFF_ATTACK; else return BASE_ATTACK; @@ -306,7 +306,7 @@ WeaponAttackType GetWeaponAttackType(SpellEntry const *spellInfo) break; default: // Wands - if (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) + if (spellInfo->HasAttribute(SPELL_ATTR_EX2_AUTOREPEAT_FLAG)) return RANGED_ATTACK; else return BASE_ATTACK; @@ -324,7 +324,7 @@ bool IsPassiveSpell(uint32 spellId) bool IsPassiveSpell(SpellEntry const *spellInfo) { - return (spellInfo->Attributes & SPELL_ATTR_PASSIVE) != 0; + return spellInfo->HasAttribute(SPELL_ATTR_PASSIVE); } bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 spellId_2) @@ -416,7 +416,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) { // Well Fed buffs (must be exclusive with Food / Drink replenishment effects, or else Well Fed will cause them to be removed) // SpellIcon 2560 is Spell 46687, does not have this flag - if ((spellInfo->AttributesEx2 & SPELL_ATTR_EX2_FOOD_BUFF) || spellInfo->SpellIconID == 2560) + if (spellInfo->HasAttribute(SPELL_ATTR_EX2_FOOD_BUFF) || spellInfo->SpellIconID == 2560) return SPELL_WELL_FED; } break; @@ -457,7 +457,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) case SPELLFAMILY_PRIEST: { // "Well Fed" buff from Blessed Sunfruit, Blessed Sunfruit Juice, Alterac Spring Water - if ((spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_SITTING) && + if (spellInfo->HasAttribute(SPELL_ATTR_CASTABLE_WHILE_SITTING) && (spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK) && (spellInfo->SpellIconID == 52 || spellInfo->SpellIconID == 79)) return SPELL_WELL_FED; @@ -487,7 +487,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) return SPELL_HAND; // skip Heart of the Crusader that have also same spell family mask - if (spellInfo->IsFitToFamilyMask(UI64LIT(0x00000820180400)) && (spellInfo->AttributesEx3 & 0x200) && (spellInfo->SpellIconID != 237)) + if (spellInfo->IsFitToFamilyMask(UI64LIT(0x00000820180400)) && spellInfo->HasAttribute(SPELL_ATTR_EX3_UNK9) && (spellInfo->SpellIconID != 237)) return SPELL_JUDGEMENT; // only paladin auras have this (for palaldin class family) @@ -517,7 +517,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) if ((IsSpellHaveAura(spellInfo, SPELL_AURA_TRACK_CREATURES) || IsSpellHaveAura(spellInfo, SPELL_AURA_TRACK_RESOURCES) || IsSpellHaveAura(spellInfo, SPELL_AURA_TRACK_STEALTHED)) && - ((spellInfo->AttributesEx & SPELL_ATTR_EX_UNK17) || (spellInfo->AttributesEx6 & SPELL_ATTR_EX6_UNK12))) + (spellInfo->HasAttribute(SPELL_ATTR_EX_UNK17) || spellInfo->HasAttribute(SPELL_ATTR_EX6_UNK12))) return SPELL_TRACKER; // elixirs can have different families, but potion most ofc. @@ -803,7 +803,7 @@ bool IsPositiveEffect(SpellEntry const *spellproto, SpellEffectIndex effIndex) spellproto->SpellFamilyName == SPELLFAMILY_GENERIC) return false; // but not this if this first effect (don't found better check) - if (spellproto->Attributes & 0x4000000 && effIndex == EFFECT_INDEX_0) + if (spellproto->HasAttribute(SPELL_ATTR_UNK26) && effIndex == EFFECT_INDEX_0) return false; break; case SPELL_AURA_TRANSFORM: @@ -882,7 +882,7 @@ bool IsPositiveEffect(SpellEntry const *spellproto, SpellEffectIndex effIndex) return false; // AttributesEx check - if(spellproto->AttributesEx & SPELL_ATTR_EX_NEGATIVE) + if (spellproto->HasAttribute(SPELL_ATTR_EX_NEGATIVE)) return false; // ok, positive @@ -911,7 +911,7 @@ bool IsPositiveSpell(SpellEntry const *spellproto) 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->HasAttribute(SPELL_ATTR_EX5_SINGLE_TARGET_SPELL)) return true; // TODO - need found Judgements rule @@ -987,7 +987,7 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 if(actAsShifted) { - if (spellInfo->Attributes & SPELL_ATTR_NOT_SHAPESHIFT) // not while shapeshifted + if (spellInfo->HasAttribute(SPELL_ATTR_NOT_SHAPESHIFT)) // not while shapeshifted return SPELL_FAILED_NOT_SHAPESHIFT; else if (spellInfo->Stances != 0) // needs other shapeshift return SPELL_FAILED_ONLY_SHAPESHIFT; @@ -995,7 +995,7 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 else { // needs shapeshift - if(!(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && spellInfo->Stances != 0) + if(!spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && spellInfo->Stances != 0) return SPELL_FAILED_ONLY_SHAPESHIFT; } @@ -1881,7 +1881,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Allow stack passive and not passive spells - if ((spellInfo_1->Attributes & SPELL_ATTR_PASSIVE)!=(spellInfo_2->Attributes & SPELL_ATTR_PASSIVE)) + if (spellInfo_1->HasAttribute(SPELL_ATTR_PASSIVE) != spellInfo_2->HasAttribute(SPELL_ATTR_PASSIVE)) return false; // Specific spell family spells @@ -3894,7 +3894,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell } // continent limitation (virtual continent), ignore for GM - if ((spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND) && !(player && player->isGameMaster())) + if (spellInfo->HasAttribute(SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND) && !(player && player->isGameMaster())) { uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id); MapEntry const* mapEntry = sMapStore.LookupEntry(v_map); @@ -3903,7 +3903,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell } // raid instance limitation - if (spellInfo->AttributesEx6 & SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE) + if (spellInfo->HasAttribute(SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE)) { MapEntry const* mapEntry = sMapStore.LookupEntry(map_id); if (!mapEntry || mapEntry->IsRaid()) @@ -3927,13 +3927,13 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell // do not allow spells to be cast in arenas // - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag // - with greater than 10 min CD - if ((spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) || - (GetSpellRecoveryTime(spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA))) + if (spellInfo->HasAttribute(SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) || + (GetSpellRecoveryTime(spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !spellInfo->HasAttribute(SPELL_ATTR_EX4_USABLE_IN_ARENA))) if (player && player->InArena()) return SPELL_FAILED_NOT_IN_ARENA; // Spell casted only on battleground - if ((spellInfo->AttributesEx3 & SPELL_ATTR_EX3_BATTLEGROUND)) + if (spellInfo->HasAttribute(SPELL_ATTR_EX3_BATTLEGROUND)) if (!player || !player->InBattleGround()) return SPELL_FAILED_ONLY_BATTLEGROUNDS; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 46d3b618d..1709773bc 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -238,7 +238,7 @@ inline bool IsSpellRemoveAllMovementAndControlLossEffects(SpellEntry const* spel spellProto->EffectMiscValue[EFFECT_INDEX_0] == 1 && spellProto->EffectApplyAuraName[EFFECT_INDEX_1] == 0 && spellProto->EffectApplyAuraName[EFFECT_INDEX_2] == 0 && - (spellProto->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)/* && -- all above selected spells have SPELL_ATTR_EX5_* mask + spellProto->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)/* && -- all above selected spells have SPELL_ATTR_EX5_* mask ((spellProto->AttributesEx5 & (SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED|SPELL_ATTR_EX5_USABLE_WHILE_FEARED|SPELL_ATTR_EX5_USABLE_WHILE_STUNNED)) == (SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED|SPELL_ATTR_EX5_USABLE_WHILE_FEARED|SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))*/; @@ -257,7 +257,7 @@ inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo) inline bool IsNonCombatSpell(SpellEntry const *spellInfo) { - return (spellInfo->Attributes & SPELL_ATTR_CANT_USED_IN_COMBAT) != 0; + return spellInfo->HasAttribute(SPELL_ATTR_CANT_USED_IN_COMBAT); } bool IsPositiveSpell(uint32 spellId); @@ -445,12 +445,12 @@ inline bool IsDispelSpell(SpellEntry const *spellInfo) inline bool isSpellBreakStealth(SpellEntry const* spellInfo) { - return !(spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH); + return !spellInfo->HasAttribute(SPELL_ATTR_EX_NOT_BREAK_STEALTH); } inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo) { - return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG); + return spellInfo->HasAttribute(SPELL_ATTR_RANGED) && spellInfo->HasAttribute(SPELL_ATTR_EX2_AUTOREPEAT_FLAG); } inline bool IsSpellRequiresRangedAP(SpellEntry const* spellInfo) @@ -462,12 +462,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->HasAttribute(SPELL_ATTR_EX_CHANNELED_1) || spellInfo->HasAttribute(SPELL_ATTR_EX_CHANNELED_2); } inline bool IsNeedCastSpellAtFormApply(SpellEntry const* spellInfo, ShapeshiftForm form) { - if (!(spellInfo->Attributes & (SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7)) || !form) + if ((!spellInfo->HasAttribute(SPELL_ATTR_PASSIVE) && spellInfo->HasAttribute(SPELL_ATTR_UNK7)) || !form) return false; // passive spells with SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT are already active without shapeshift, do no recast! @@ -477,7 +477,7 @@ inline bool IsNeedCastSpellAtFormApply(SpellEntry const* spellInfo, ShapeshiftFo inline bool NeedsComboPoints(SpellEntry const* spellInfo) { - return (spellInfo->AttributesEx & (SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS | SPELL_ATTR_EX_REQ_COMBO_POINTS)); + return spellInfo->HasAttribute(SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS) || spellInfo->HasAttribute(SPELL_ATTR_EX_REQ_COMBO_POINTS); } inline SpellSchoolMask GetSpellSchoolMask(SpellEntry const* spellInfo) diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 72b9cff2f..b2516913f 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -38,7 +38,7 @@ float ThreatCalcHelper::CalcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, floa if (pThreatSpell) { - if (pThreatSpell->AttributesEx & SPELL_ATTR_EX_NO_THREAT) + if (pThreatSpell->HasAttribute(SPELL_ATTR_EX_NO_THREAT)) return 0.0f; if (Player* modOwner = pHatedUnit->GetSpellModOwner()) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 4ded6aa11..73117a0a3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2423,7 +2423,7 @@ void Unit::CalculateAbsorbResistBlock(Unit *pCaster, SpellNonMeleeDamage *damage } uint32 absorb_affected_damage = pCaster->CalcNotIgnoreAbsorbDamage(damageInfo->damage,GetSpellSchoolMask(spellProto),spellProto); - CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), SPELL_DIRECT_DAMAGE, absorb_affected_damage, &damageInfo->absorb, &damageInfo->resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED)); + CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), SPELL_DIRECT_DAMAGE, absorb_affected_damage, &damageInfo->absorb, &damageInfo->resist, !spellProto->HasAttribute(SPELL_ATTR_EX2_CANT_REFLECTED)); damageInfo->damage-= damageInfo->absorb + damageInfo->resist; } @@ -2838,7 +2838,7 @@ bool Unit::IsSpellBlocked(Unit *pCaster, SpellEntry const *spellEntry, WeaponAtt if (spellEntry) { // Some spells cannot be blocked - if (spellEntry->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK) + if (spellEntry->HasAttribute(SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)) return false; } @@ -2928,7 +2928,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) uint32 missChance = uint32(MeleeSpellMissChance(pVictim, attType, fullSkillDiff, spell)*100.0f); // Roll miss - uint32 tmp = spell->AttributesEx3 & SPELL_ATTR_EX3_CANT_MISS ? 0 : missChance; + uint32 tmp = spell->HasAttribute(SPELL_ATTR_EX3_CANT_MISS) ? 0 : missChance; if (roll < tmp) return SPELL_MISS_MISS; @@ -2954,7 +2954,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) bool canParry = true; // Same spells cannot be parry/dodge - if (spell->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK) + if (spell->HasAttribute(SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)) return SPELL_MISS_NONE; bool from_behind = !pVictim->HasInArc(M_PI_F,this); @@ -3115,7 +3115,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (HitChance < 100) HitChance = 100; if (HitChance > 10000) HitChance = 10000; - int32 tmp = spell->AttributesEx3 & SPELL_ATTR_EX3_CANT_MISS ? 0 : (10000 - HitChance); + int32 tmp = spell->HasAttribute(SPELL_ATTR_EX3_CANT_MISS) ? 0 : (10000 - HitChance); int32 rand = irand(0,10000); @@ -3987,7 +3987,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder) continue; // Carry over removed Aura's remaining damage if Aura still has ticks remaining - if (foundHolder->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_STACK_DOT_MODIFIER) + if (foundHolder->GetSpellProto()->HasAttribute(SPELL_ATTR_EX4_STACK_DOT_MODIFIER)) { for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) { @@ -4600,7 +4600,7 @@ void Unit::RemoveAurasWithAttribute(uint32 flags) { for (SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end(); ) { - if (iter->second->GetSpellProto()->Attributes & flags) + if (iter->second->GetSpellProto()->HasAttribute((SpellAttributes)flags)) { RemoveSpellAuraHolder(iter->second); iter = m_spellAuraHolders.begin(); @@ -4811,11 +4811,11 @@ void Unit::RemoveArenaAuras(bool onleave) // used to remove positive visible auras in arenas for(SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end();) { - if (!(iter->second->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_UNK21) && + if (!iter->second->GetSpellProto()->HasAttribute(SPELL_ATTR_EX4_UNK21) && // don't remove stances, shadowform, pally/hunter auras !iter->second->IsPassive() && // don't remove passive auras - (!(iter->second->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || - !(iter->second->GetSpellProto()->Attributes & SPELL_ATTR_UNK8)) && + (!iter->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || + !iter->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNK8)) && // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable) (iter->second->IsPositive() != onleave)) // remove positive buffs on enter, negative buffs on leave { @@ -5028,7 +5028,7 @@ void Unit::AddGameObject(GameObject* gameObj) { SpellEntry const* createBySpell = sSpellStore.LookupEntry(gameObj->GetSpellId()); // Need disable spell use for owner - if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + if (createBySpell && createBySpell->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE)) // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases) ((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell,0,NULL,true); } @@ -5049,7 +5049,7 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del) { SpellEntry const* createBySpell = sSpellStore.LookupEntry(spellid ); // Need activate spell use for owner - if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + if (createBySpell && createBySpell->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE)) // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases) ((Player*)this)->SendCooldownEvent(createBySpell); } @@ -6230,7 +6230,7 @@ int32 Unit::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int3 */ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) { - if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE || spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_MODS) + if (!spellProto || !pVictim || damagetype == DIRECT_DAMAGE || spellProto->HasAttribute(SPELL_ATTR_EX6_NO_DMG_MODS)) return pdamage; // For totems get damage bonus from owner (statue isn't totem in fact) @@ -6687,7 +6687,7 @@ int32 Unit::SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType) { // not critting spell - if((spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_CRIT)) + if (spellProto->HasAttribute(SPELL_ATTR_EX2_CANT_CRIT)) return false; float crit_chance = 0.0f; @@ -7198,8 +7198,8 @@ bool Unit::IsImmuneToSpell(SpellEntry const* spellInfo) if (itr->type == spellInfo->Dispel) return true; - if (!(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) && // unaffected by school immunity - !(spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) // can remove immune (by dispell or immune it) + if (!spellInfo->HasAttribute(SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) && // unaffected by school immunity + !spellInfo->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) // can remove immune (by dispell or immune it) { SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for(SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr) @@ -7276,7 +7276,7 @@ bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex i */ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType attType, SpellEntry const *spellProto, DamageEffectType damagetype, uint32 stack) { - if (!pVictim || pdamage == 0 || (spellProto && spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_MODS)) + if (!pVictim || pdamage == 0 || (spellProto && spellProto->HasAttribute(SPELL_ATTR_EX6_NO_DMG_MODS))) return pdamage; // differentiate for weapon damage based spells @@ -7660,7 +7660,7 @@ void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType ty { ApplySpellImmune(spellProto->Id,IMMUNITY_DISPEL, type, apply); - if (apply && spellProto->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) + if (apply && spellProto->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) RemoveAurasWithDispelType(type); } @@ -8782,7 +8782,7 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProt } } - if(spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel && + if (spellProto->HasAttribute(SPELL_ATTR_LEVEL_DAMAGE_CALCULATION) && spellProto->spellLevel && spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && spellProto->Effect[effect_index] != SPELL_EFFECT_KNOCK_BACK && (spellProto->Effect[effect_index] != SPELL_EFFECT_APPLY_AURA || spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_DECREASE_SPEED)) @@ -10476,7 +10476,7 @@ void Unit::RemoveAurasAtMechanicImmunity(uint32 mechMask, uint32 exceptSpellId, ++iter; else if (non_positive && iter->second->IsPositive()) ++iter; - else if (spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) + else if (spell->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)) ++iter; else if (iter->second->HasMechanicMask(mechMask)) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7271f4242..d6770b110 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11970" + #define REVISION_NR "11971" #endif // __REVISION_NR_H__