24 #include <ace/Singleton.h> 84 #define SPELLFAMILYFLAG_ROGUE_VANISH 0x000000800LL 85 #define SPELLFAMILYFLAG_ROGUE_STEALTH 0x000400000LL 86 #define SPELLFAMILYFLAG_ROGUE_BACKSTAB 0x000800004LL 87 #define SPELLFAMILYFLAG_ROGUE_SAP 0x000000080LL 88 #define SPELLFAMILYFLAG_ROGUE_FEINT 0x008000000LL 89 #define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT 0x000200000LL 90 #define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE 0x9003E0000LL 91 #define SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR 0x000004000LL 92 #define SPELLFAMILYFLAG_SHAMAN_FROST_SHOCK 0x080000000LL 117 #define SPELL_LINKED_MAX_SPELLS 200000 141 return (range ? range->
minRange : 0);
145 return (range ? range->
maxRange : 0);
149 return (range ? range->
type : 0);
196 if (!spellInfo)
return 0;
203 if (!spellInfo)
return 0;
209 for (
int i = 0; i < 3; ++i)
210 if (spellInfo->
Effect[i] == effect)
234 switch (entry->
Effect[eff_idx])
250 switch (entry->
Effect[index])
290 || spellInfo->
Id == 2584;
301 switch (spellInfo->
Id)
340 effectmask |= (1 << i);
346 switch (spellInfo->
Effect[i])
362 nondmgmask |= (1 << i);
364 mechmask |= (1 << i);
368 if (!effectmask || !nondmgmask)
371 if (nondmgmask == effectmask)
380 const uint32 effect = (1 << i);
381 if ((effectmask & effect) && !(nondmgmask & effect))
387 if ((mechmask & (1 << e)) &&
511 return (1 << dispel);
602 #define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_DONE_MELEE_AUTO_ATTACK | \ 603 PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK | \ 604 PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | \ 605 PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS | \ 606 PROC_FLAG_DONE_RANGED_AUTO_ATTACK | \ 607 PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK | \ 608 PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | \ 609 PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS) 668 #define SPELL_GROUP_DB_RANGE_MIN 1000 685 #define SPELL_GROUP_STACK_RULE_MAX 3 706 #define MAX_SPELL_TARGET_TYPE 3 734 removeOnChangePet(_removeOnChangePet), damage(_damage)
736 auras[petEntry] = aura;
741 std::map<uint32, uint32>::const_iterator itr = auras.find(petEntry);
742 if (itr != auras.end())
746 std::map<uint32, uint32>::const_iterator itr = auras.find(0);
747 if (itr != auras.end())
756 auras[petEntry] = aura;
761 return removeOnChangePet;
936 SpellAffectMap::const_iterator itr = mSpellAffectMap.find((spellId << 8) + effectId);
937 if (itr != mSpellAffectMap.end())
946 switch (SpellTargetType[target])
960 SpellThreatMap::const_iterator itr = mSpellThreatMap.find(spellID);
961 if (itr != mSpellThreatMap.end())
965 uint32 firstSpell = GetFirstSpellInChain(spellID);
966 SpellThreatMap::const_iterator itr = mSpellThreatMap.find(firstSpell);
967 if (itr != mSpellThreatMap.end())
976 SpellProcEventMap::const_iterator itr = mSpellProcEventMap.find(spellId);
977 if (itr != mSpellProcEventMap.end())
986 SpellEnchantProcEventMap::const_iterator itr = mSpellEnchantProcEventMap.find(enchId);
987 if (itr != mSpellEnchantProcEventMap.end())
995 SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find(spell_id);
996 if (itr != mSpellTargetPositions.end())
1004 SpellChainMap::const_iterator itr = mSpellChains.find(spell_id);
1005 if (itr == mSpellChains.end())
1008 return &itr->second;
1013 SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id);
1014 if (itr == mSpellReq.end())
1048 return mSpellsReqSpell;
1071 SpellChainMap::const_iterator itr1 = mSpellChains.find(spell1);
1072 SpellChainMap::const_iterator itr2 = mSpellChains.find(spell2);
1073 if (itr1 == mSpellChains.end() || itr2 == mSpellChains.end())
1076 if (itr1->second.first == itr2->second.first)
1077 if (itr1->second.rank > itr2->second.rank)
1083 bool IsRankSpellDueToSpell(
SpellEntry const* spellInfo_1,
uint32 spellId_2)
const;
1084 static bool canStackSpellRanks(
SpellEntry const* spellInfo);
1085 bool IsNoStackSpellDueToSpell(
uint32 spellId_1,
uint32 spellId_2,
bool sameCaster)
const;
1092 SpellLearnSkillMap::const_iterator itr = mSpellLearnSkills.find(spell_id);
1093 if (itr != mSpellLearnSkills.end())
1094 return &itr->second;
1101 return mSpellLearnSpells.count(spell_id) != 0;
1106 return mSpellLearnSpells.lower_bound(spell_id);
1111 return mSpellLearnSpells.upper_bound(spell_id);
1116 SpellLearnSpellMap::const_iterator b = GetBeginSpellLearnSpell(spell_id1);
1117 SpellLearnSpellMap::const_iterator e = GetEndSpellLearnSpell(spell_id1);
1118 for (SpellLearnSpellMap::const_iterator i = b; i != e; ++i)
1119 if (i->second.spell == spell_id2)
1124 static bool IsProfessionSpell(
uint32 spellId);
1125 static bool IsPrimaryProfessionSpell(
uint32 spellId);
1126 bool IsPrimaryProfessionFirstRankSpell(
uint32 spellId)
const;
1129 static bool IsSpellValid(
SpellEntry const* spellInfo,
Player* pl = NULL,
bool msg =
true);
1136 void GetSetOfSpellsInSpellGroup(
SpellGroup group_id, std::set<uint32>& foundSpells)
const;
1137 void GetSetOfSpellsInSpellGroup(
SpellGroup group_id, std::set<uint32>& foundSpells, std::set<SpellGroup>& usedGroups)
const;
1144 return mSkillLineAbilityMap.lower_bound(spell_id);
1149 return mSkillLineAbilityMap.upper_bound(spell_id);
1154 SpellPetAuraMap::const_iterator itr = mSpellPetAuraMap.find(spell_id);
1155 if (itr != mSpellPetAuraMap.end())
1156 return &itr->second;
1163 if (spell_id >= mSpellCustomAttr.size())
1166 return mSpellCustomAttr[spell_id];
1176 SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id);
1177 return itr != mSpellLinkedMap.end() ? &(itr->second) : NULL;
1185 typedef SpellDummyConditionMap::const_iterator Iterator;
1186 std::pair<Iterator, Iterator> range = mSpellDummyConditionMap.equal_range(spellId);
1188 for (Iterator it = range.first; it != range.second; it++)
1189 if (it->second.effIndex == effIndex)
1190 return &(it->second);
1200 void LoadSpellChains();
1201 void LoadSpellRequired();
1202 void LoadSpellLearnSkills();
1203 void LoadSpellLearnSpells();
1204 void LoadSpellAffects();
1205 void LoadSpellGroups();
1206 void LoadSpellProcEvents();
1207 void LoadSpellTargetPositions();
1208 void LoadSpellThreats();
1209 void LoadSkillLineAbilityMap();
1210 void LoadSpellPetAuras();
1211 void LoadSpellCustomAttr();
1212 void LoadSpellCustomCooldowns();
1213 void LoadSpellLinked();
1214 void LoadSpellEnchantProcData();
1215 void LoadSpellDummyCondition();
1216 void LoadSpellGroupStackRules();
1239 #define sSpellMgr SpellMgr::Instance()
bool IsProfessionSkill(uint32 skill)
std::map< uint32, PetAura > SpellPetAuraMap
SpellPetAuraMap mSpellPetAuraMap
uint32 GetLastSpellInChain(uint32 spell_id) const
uint32 GetSpellRangeType(SpellRangeEntry const *range)
std::map< uint32, uint32 > auras
uint32 EffectMechanic[MAX_SPELL_EFFECTS]
DBCStorage< SpellEntry > const * GetSpellStore()
SpellLearnSkillNode const * GetSpellLearnSkill(uint32 spell_id) const
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
PetAura const * GetPetAura(uint32 spell_id)
bool IsPassiveSpell(uint32 spellId)
DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const *spellproto, bool triggered)
bool IsBinarySpell(SpellEntry const *spellInfo)
SkillLineAbilityMap::const_iterator GetEndSkillLineAbilityMap(uint32 spell_id) const
SpellProcEventMap mSpellProcEventMap
uint32 GetPrevSpellInChain(uint32 spell_id) const
bool IsPositiveTarget(uint32 targetA, uint32 targetB)
UNORDERED_MAP< uint32, SpellChainNode > SpellChainMap
bool IsDispelSpell(SpellEntry const *spellInfo)
bool IsDispel(SpellEntry const *spellInfo)
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
bool IsAreaAuraEffect(uint32 effect)
std::map< SpellGroup, SpellGroupStackRule > SpellGroupStackMap
SpellSpellGroupMap mSpellSpellGroup
Mechanics GetEffectMechanic(SpellEntry const *spellInfo, int32 effect)
bool IsAutoRepeatRangedSpell(SpellEntry const *spellInfo)
float GetSpellRadiusForHostile(SpellRadiusEntry const *radius)
SpellRequiredMap mSpellReq
bool NeedsComboPoints(SpellEntry const *spellInfo)
std::vector< uint32 > SpellCustomAttribute
uint32 GetAura(uint32 petEntry) const
uint8 IsHighRankOfSpell(uint32 spell1, uint32 spell2) const
UNORDERED_MAP< uint32, uint32 > SpellRequiredMap
bool IsSpellLearnSpell(uint32 spell_id) const
SpellEnchantProcEventMap mSpellEnchantProcEventMap
std::map< int32, std::vector< int32 > > SpellLinkedMap
bool IsSpellLearnToSpell(uint32 spell_id1, uint32 spell_id2) const
uint32 GetSpellCustomAttr(uint32 spell_id) const
SpellLearnSpellMap::const_iterator GetBeginSpellLearnSpell(uint32 spell_id) const
int32 GetSpellDuration(SpellEntry const *spellInfo)
std::pair< SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator > SpellGroupSpellMapBounds
NULL Dbg ErrDB Arena Chat Char Map MMap false
uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]
SkillLineAbilityMap mSkillLineAbilityMap
SpellTargetPositionMap mSpellTargetPositions
bool IsFarDestTargetEffect(uint32 effect)
uint32 Effect[MAX_SPELL_EFFECTS]
int32 GetSpellMaxDuration(SpellEntry const *spellInfo)
bool IsAutocastableSpell(uint32 spellId)
std::map< uint32, uint64 > SpellAffectMap
std::multimap< uint32, uint32 > SpellsRequiringSpellMap
bool IsPositiveSpell(uint32 spellId)
uint32 EffectApplyAuraName[MAX_SPELL_EFFECTS]
SpellTargetEntry(SpellScriptTargetType type_, uint32 targetEntry_)
bool IsSpellEffectTriggerSpell(const SpellEntry *entry, SpellEffIndex eff_idx)
SpellSchoolMask GetSpellSchoolMask(SpellEntry const *spellInfo)
static bool checkSpellForLoS(unsigned int pSpellId)
bool IsDeathOnlySpell(SpellEntry const *spellInfo)
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
bool IsRemovedOnChangePet() const
bool HasAttribute(SpellAttributes attribute) const
uint32 GetDispelMask(DispelType dispel)
std::map< uint32, SpellLearnSkillNode > SpellLearnSkillMap
bool IsDeathPersistentSpell(SpellEntry const *spellInfo)
uint32 GetSpellRequired(uint32 spell_id) const
bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS]
UNORDERED_MAP< uint32, SpellTargetPosition > SpellTargetPositionMap
bool IsPrimaryProfessionSkill(uint32 skill)
std::pair< SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator > SpellSpellGroupMapBounds
bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId)
SpellTargetPosition const * GetSpellTargetPosition(uint32 spell_id) const
#define TOTAL_SPELL_TARGETS
std::multimap< SpellGroup, int32 > SpellGroupSpellMap
uint32 CalculatePowerCost(SpellEntry const *spellInfo, Unit const *caster, SpellSchoolMask schoolMask)
SpellDummyConditionMap mSpellDummyConditionMap
uint8 GetSpellRank(uint32 spell_id) const
uint32 GetFirstSpellInChain(uint32 spell_id) const
void AddAura(uint32 petEntry, uint32 aura)
uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]
bool IsSpellEffectAbleToCrit(const SpellEntry *entry, SpellEffIndex index)
bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group)
SpellCustomAttribute mSpellCustomAttr
SpellLinkedMap mSpellLinkedMap
uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]
bool IsSpellRemoveAllMovementAndControlLossEffects(SpellEntry const *spellProto)
SpellAffectMap mSpellAffectMap
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, int _damage)
float GetSpellMinRange(SpellRangeEntry const *range)
SkillLineAbilityMap::const_iterator GetBeginSkillLineAbilityMap(uint32 spell_id) const
UNORDERED_MAP< uint32, SpellEnchantProcEntry > SpellEnchantProcEventMap
SpellLearnSpellMap mSpellLearnSpells
SpellLearnSkillMap mSpellLearnSkills
bool IsChanneledSpell(SpellEntry const *spellInfo)
bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
SpellLearnSpellMap::const_iterator GetEndSpellLearnSpell(uint32 spell_id) const
std::multimap< uint32, SkillLineAbilityEntry const * > SkillLineAbilityMap
int32 EffectMiscValue[MAX_SPELL_EFFECTS]
bool IsSpellIgnoringLOS(SpellEntry const *spellInfo)
SpellDummyConditionBitmask
uint64 GetSpellAffectMask(uint16 spellId, uint8 effectId) const
bool IsSealSpell(SpellEntry const *spellInfo)
SpellGroupStackMap mSpellGroupStack
SpellCastResult GetErrorAtShapeshiftedCast(SpellEntry const *spellInfo, uint32 form)
approves cast on any target, even when its non-attackable
SpellGroupSpellMap mSpellGroupSpell
std::map< uint32, SpellThreatEntry > SpellThreatMap
uint32 CategoryRecoveryTime
float GetSpellRadius(SpellEntry const *spellInfo, uint32 effectIdx, bool positive)
float GetSpellRadiusForFriend(SpellRadiusEntry const *radius)
bool isSpellBreakStealth(SpellEntry const *spellInfo)
SpellScriptTargetType type
SpellThreatMap mSpellThreatMap
SpellsRequiringSpellMap mSpellsReqSpell
uint32 GetSpellCastTime(SpellEntry const *spellInfo, Spell const *spell=NULL)
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
bool IsFarUnitTargetEffect(uint32 effect)
bool IsElementalShield(SpellEntry const *spellInfo)
SpellsRequiringSpellMap const & GetSpellsRequiringSpell() const
uint32 GetSpellMechanicMask(SpellEntry const *spellInfo, int32 effect)
SpellThreatEntry const * GetSpellThreatEntry(uint32 spellID) const
SpellEnchantProcEntry const * GetSpellEnchantProcEvent(uint32 enchId) const
std::multimap< uint32, SpellGroup > SpellSpellGroupMap
const SpellDummyConditionEntry * GetSpellDummyCondition(uint32 spellId, uint32 effIndex) const
ignore bonus healing/damage
bool IsNonCombatSpell(SpellEntry const *spellInfo)
bool IsSingleTargetSpell(SpellEntry const *spellInfo)
bool IsSpellAbleToCrit(const SpellEntry *entry)
uint32 GetNextSpellInChain(uint32 spell_id) const
bool IsAreaOfEffectSpell(SpellEntry const *spellInfo)
bool IsPositionTarget(uint32 target)
UNORDERED_MAP< uint32, SpellProcEventEntry > SpellProcEventMap
SpellChainMap mSpellChains
#define MAX_SPELL_EFFECTS
const std::vector< int32 > * GetSpellLinked(int32 spell_id) const
SpellCastResult IsSpellAllowedInLocation(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id)
related to movement impiaring effects
SpellChainNode const * GetSpellChainNode(uint32 spell_id) const
must be cast from item, never directly
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2)
std::multimap< uint32, SpellDummyConditionEntry > SpellDummyConditionMap
SpellSpecific GetSpellSpecific(uint32 spellId)
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
std::multimap< uint32, SpellLearnSpellNode > SpellLearnSpellMap
SpellDummyCondition condition
SpellProcEventEntry const * GetSpellProcEvent(uint32 spellId) const
uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo)
float GetSpellMaxRange(SpellRangeEntry const *range)