aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-30 17:16:56 +0200
committerQAston <none@none>2009-07-30 17:16:56 +0200
commit13758fcae186644b84837f4d28f9b72f101bdf5e (patch)
treee60a5446f5d6c0009b3d6a0815d132b7774474ce /src/game/SpellMgr.cpp
parent2095daca858d75348e3e111cf874bb3e9e4de9f3 (diff)
*Fix per-caster aura state based on [8218] (Author: VladimirMangos;almost nothing left from original patch):
*Fixes all per caster aurastates instead of only conflagrate *Adds a holder for aura state auras for speedup search *Save some memory space by removing m_auraStateMask from aura class. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r--src/game/SpellMgr.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index ae708153142..f1f43d57821 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -406,6 +406,63 @@ uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, Spe
return powerCost;
}
+AuraState GetSpellAuraState(SpellEntry const * spellInfo)
+{
+ // Seals
+ if (IsSealSpell(spellInfo))
+ return (AURA_STATE_JUDGEMENT);
+
+ // Conflagrate aura state on Immolate and Shadowflame
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
+ // Immolate
+ ((spellInfo->SpellFamilyFlags[0] & 4) ||
+ // Shadowflame
+ (spellInfo->SpellFamilyFlags[2] & 2)))
+ return (AURA_STATE_CONFLAGRATE);
+
+ // Faerie Fire (druid versions)
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && spellInfo->SpellFamilyFlags[0] & 0x400)
+ return (AURA_STATE_FAERIE_FIRE);
+
+ // Sting (hunter's pet ability)
+ if (spellInfo->Category == 1133)
+ return (AURA_STATE_FAERIE_FIRE);
+
+ // Victorious
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellFamilyFlags[1] & 0x00040000)
+ return (AURA_STATE_WARRIOR_VICTORY_RUSH);
+
+ // Swiftmend state on Regrowth & Rejuvenation
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && spellInfo->SpellFamilyFlags[0] & 0x50 )
+ return (AURA_STATE_SWIFTMEND);
+
+ // Deadly poison aura state
+ if(spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags[0] & 0x10000)
+ return (AURA_STATE_DEADLY_POISON);
+
+ // Enrage aura state
+ if(spellInfo->Dispel == DISPEL_ENRAGE)
+ return (AURA_STATE_ENRAGE);
+
+ // Bleeding aura state
+ if (GetAllSpellMechanicMask(spellInfo) & 1<<MECHANIC_BLEED)
+ return (AURA_STATE_BLEEDING);
+
+ if(GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_FROST)
+ {
+ for (uint8 i = 0;i<MAX_SPELL_EFFECTS;++i)
+ {
+ if (spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_STUN
+ || spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_ROOT)
+ {
+ return (AURA_STATE_FROZEN);
+ break;
+ }
+ }
+ }
+ return AURA_STATE_NONE;
+}
+
SpellSpecific GetSpellSpecific(uint32 spellId)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);