diff options
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a0e1ec065cc..0cab2cd4540 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -763,7 +763,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = SpellInfo::SpellInfo(SpellEntry const* spellEntry) { Id = spellEntry->Id; - Category = spellEntry->Category; + CategoryEntry = spellEntry->Category ? sSpellCategoryStore.LookupEntry(spellEntry->Category) : NULL; Dispel = spellEntry->Dispel; Mechanic = spellEntry->Mechanic; Attributes = spellEntry->Attributes; @@ -859,6 +859,11 @@ SpellInfo::~SpellInfo() _UnloadImplicitTargetConditionLists(); } +uint32 SpellInfo::GetCategory() const +{ + return CategoryEntry ? CategoryEntry->Id : 0; +} + bool SpellInfo::HasEffect(SpellEffects effect) const { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -1103,6 +1108,11 @@ bool SpellInfo::IsStackableOnOneSlotWithDifferentCasters() const return StackAmount > 1 && !IsChanneled() && !(AttributesEx3 & SPELL_ATTR3_STACK_FOR_DIFF_CASTERS); } +bool SpellInfo::IsCooldownStartedOnEvent() const +{ + return Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE || (CategoryEntry && CategoryEntry->Flags & SPELL_CATEGORY_FLAG_COOLDOWN_STARTS_ON_EVENT); +} + bool SpellInfo::IsDeathPersistent() const { return AttributesEx3 & SPELL_ATTR3_DEATH_PERSISTENT; @@ -1712,7 +1722,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const bool SpellInfo::CheckTargetCreatureType(Unit const* target) const { // Curse of Doom & Exorcism: not find another way to fix spell target check :/ - if (SpellFamilyName == SPELLFAMILY_WARLOCK && Category == 1179) + if (SpellFamilyName == SPELLFAMILY_WARLOCK && GetCategory() == 1179) { // not allow cast at player if (target->GetTypeId() == TYPEID_PLAYER) @@ -1816,7 +1826,7 @@ AuraStateType SpellInfo::GetAuraState() const return AURA_STATE_FAERIE_FIRE; // Sting (hunter's pet ability) - if (Category == 1133) + if (GetCategory() == 1133) return AURA_STATE_FAERIE_FIRE; // Victorious |