OregonCore  revision fb2a440-git
Your Favourite TBC server
SpellMgr.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _SPELLMGR_H
19 #define _SPELLMGR_H
20 
21 // For static or at-server-startup loaded spell data
22 // For more high level function for sSpellStore data
23 
24 #include <ace/Singleton.h>
25 #include "SharedDefines.h"
26 #include "DBCStructure.h"
27 #include "DBCStores.h"
28 #include "Database/SQLStorage.h"
29 #include "SpellAuraDefines.h"
30 #include "DisableMgr.h"
31 
32 #include "Utilities/UnorderedMap.h"
33 #include "VMapFactory.h"
34 #include <map>
35 
36 class Unit;
37 class Player;
38 class Spell;
39 
41 {
43  SPELLFAMILY_UNK1 = 1, // events, holidays
44  // 2 - unused
56 };
57 
59 {
65 };
66 
68 {
81 };
82 
83 //Some SpellFamilyFlags
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
93 
94 // Spell clasification
96 {
115 };
116 
117 #define SPELL_LINKED_MAX_SPELLS 200000
118 
120 {
121  SPELL_LINK_CAST = 0, // +: cast; -: remove
122  SPELL_LINK_HIT = 1 * 200000,
123  SPELL_LINK_AURA = 2 * 200000, // +: aura; -: immune
125 };
126 
128 
129 // Different spell properties
130 inline float GetSpellRadiusForHostile(SpellRadiusEntry const* radius)
131 {
132  return (radius ? radius->radiusHostile : 0);
133 }
134 inline float GetSpellRadiusForFriend(SpellRadiusEntry const* radius)
135 {
136  return (radius ? radius->radiusFriend : 0);
137 }
138 uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL);
139 inline float GetSpellMinRange(SpellRangeEntry const* range)
140 {
141  return (range ? range->minRange : 0);
142 }
143 inline float GetSpellMaxRange(SpellRangeEntry const* range)
144 {
145  return (range ? range->maxRange : 0);
146 }
148 {
149  return (range ? range->type : 0);
150 }
151 inline uint32 GetSpellRecoveryTime(SpellEntry const* spellInfo)
152 {
153  return spellInfo->RecoveryTime > spellInfo->CategoryRecoveryTime ? spellInfo->RecoveryTime : spellInfo->CategoryRecoveryTime;
154 }
155 int32 GetSpellDuration(SpellEntry const* spellInfo);
156 int32 GetSpellMaxDuration(SpellEntry const* spellInfo);
157 
158 inline bool IsSpellIgnoringLOS(SpellEntry const* spellInfo)
159 {
160  if (spellInfo->AttributesEx2 & SPELL_ATTR2_IGNORE_LOS)
161  return true;
162 
163  if (!VMAP::VMapFactory::checkSpellForLoS(spellInfo->Id))
164  return true;
165 
166  if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, spellInfo->Id, NULL, SPELL_DISABLE_LOS))
167  return true;
168 
169  // Spells with area destinations also belong here
171  return true;
172 
173  return false;
174 }
175 
176 inline float GetSpellRadius(SpellEntry const* spellInfo, uint32 effectIdx, bool positive)
177 {
178  return positive
179  ? GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(spellInfo->EffectRadiusIndex[effectIdx]))
180  : GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(spellInfo->EffectRadiusIndex[effectIdx]));
181 }
182 
183 inline float GetSpellMaxRange(SpellEntry const* spellInfo)
184 {
185  return GetSpellMaxRange(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex));
186 }
187 
188 inline float GetSpellMinRange(SpellEntry const* spellInfo)
189 {
190  return GetSpellMinRange(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex));
191 }
192 
193 inline float GetSpellMinRange(uint32 id)
194 {
195  SpellEntry const* spellInfo = GetSpellStore()->LookupEntry(id);
196  if (!spellInfo) return 0;
197  return GetSpellMinRange(spellInfo);
198 }
199 
200 inline float GetSpellMaxRange(uint32 id)
201 {
202  SpellEntry const* spellInfo = GetSpellStore()->LookupEntry(id);
203  if (!spellInfo) return 0;
204  return GetSpellMaxRange(spellInfo);
205 }
206 
207 inline bool IsSpellHaveEffect(SpellEntry const* spellInfo, SpellEffects effect)
208 {
209  for (int i = 0; i < 3; ++i)
210  if (spellInfo->Effect[i] == effect)
211  return true;
212  return false;
213 }
214 
215 inline bool IsSealSpell(SpellEntry const* spellInfo)
216 {
217  //Collection of all the seal family flags. No other paladin spell has any of those.
218  return spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN &&
219  (spellInfo->SpellFamilyFlags & 0x4000A000200LL) &&
220  spellInfo->EffectImplicitTargetA[0] == TARGET_UNIT_CASTER;
221 }
222 
223 inline bool IsElementalShield(SpellEntry const* spellInfo)
224 {
225  // family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus
226  return (spellInfo->SpellFamilyFlags & 0x42000000400LL) || spellInfo->Id == 23552;
227 }
228 
229 inline bool IsSpellEffectTriggerSpell(const SpellEntry* entry, SpellEffIndex eff_idx)
230 {
231  if (!entry)
232  return false;
233 
234  switch (entry->Effect[eff_idx])
235  {
240  return true;
241  }
242  return false;
243 }
244 
245 inline bool IsSpellEffectAbleToCrit(const SpellEntry* entry, SpellEffIndex index)
246 {
247  if (!entry || entry->HasAttribute(SPELL_ATTR2_CANT_CRIT))
248  return false;
249 
250  switch (entry->Effect[index])
251  {
253  case SPELL_EFFECT_HEAL:
258  return true;
259  case SPELL_EFFECT_ENERGIZE: // Mana Potion and similar spells, Lay on hands
260  return (entry->SpellFamilyName && entry->DmgClass);
261  }
262  return false;
263 }
264 
265 inline bool IsSpellAbleToCrit(const SpellEntry* entry)
266 {
267  if (!entry || entry->HasAttribute(SPELL_ATTR2_CANT_CRIT))
268  return false;
269 
270  for (uint32 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
271  {
272  if (entry->Effect[i] && IsSpellEffectAbleToCrit(entry, SpellEffIndex(i)))
273  return true;
274  }
275  return false;
276 }
277 
279 {
281  spellProto->EffectMiscValue[EFFECT_0] == 1 &&
282  spellProto->EffectApplyAuraName[EFFECT_1] == 0 &&
283  spellProto->EffectApplyAuraName[EFFECT_2] == 0 &&
285 }
286 
287 inline bool IsDeathOnlySpell(SpellEntry const* spellInfo)
288 {
289  return spellInfo->AttributesEx3 & SPELL_ATTR3_CAST_ON_DEAD
290  || spellInfo->Id == 2584;
291 }
292 
293 uint32 CalculatePowerCost(SpellEntry const* spellInfo, Unit const* caster, SpellSchoolMask schoolMask);
294 int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
295 bool IsPassiveSpell(uint32 spellId);
296 bool IsPassiveSpell(SpellEntry const* spellInfo);
297 bool IsAutocastableSpell(uint32 spellId);
298 
299 inline bool IsDeathPersistentSpell(SpellEntry const* spellInfo)
300 {
301  switch (spellInfo->Id)
302  {
303  case 40214: // Dragonmaw Illusion
304  case 35480:
305  case 35481:
306  case 35482: // Human Illusion
307  case 35483:
308  case 39824: // Human Illusion
309  return true;
310  }
311 
312  return spellInfo->AttributesEx3 & SPELL_ATTR3_DEATH_PERSISTENT;
313 }
314 
315 inline bool IsNonCombatSpell(SpellEntry const* spellInfo)
316 {
317  return (spellInfo->Attributes & SPELL_ATTR0_CANT_USED_IN_COMBAT) != 0;
318 }
319 
320 bool IsPositiveSpell(uint32 spellId);
321 bool IsPositiveEffect(uint32 spellId, uint32 effIndex);
322 bool IsPositiveTarget(uint32 targetA, uint32 targetB);
323 
324 bool IsSingleTargetSpell(SpellEntry const* spellInfo);
325 bool IsSingleTargetSpells(SpellEntry const* spellInfo1, SpellEntry const* spellInfo2);
326 
327 inline bool IsBinarySpell(SpellEntry const* spellInfo)
328 {
329  // Spell is considered binary if:
330  // * Its composed entirely out of non-damage and aura effects (Example: Mind Flay, Vampiric Embrace, DoTs, etc)
331  // * Has damage and non-damage effects with additional mechanics (Example: Death Coil, Frost Nova)
332  uint32 effectmask = 0; // A bitmask of effects: set bits are valid effects
333  uint32 nondmgmask = 0; // A bitmask of effects: set bits are non-damage effects
334  uint32 mechmask = 0; // A bitmask of effects: set bits are non-damage effects with additional mechanics
335  for (uint32 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
336  {
337  if (!spellInfo->Effect[i] || IsSpellEffectTriggerSpell(spellInfo, SpellEffIndex(i)))
338  continue;
339 
340  effectmask |= (1 << i);
341 
342  bool damage = false;
343  if (!spellInfo->EffectApplyAuraName[i])
344  {
345  // If its not an aura effect, check for damage effects
346  switch (spellInfo->Effect[i])
347  {
354  // SPELL_EFFECT_POWER_BURN: deals damage for power burned, but its either full damage or resist?
356  damage = true;
357  break;
358  }
359  }
360  if (!damage)
361  {
362  nondmgmask |= (1 << i);
363  if (spellInfo->EffectMechanic[i])
364  mechmask |= (1 << i);
365  }
366  }
367  // No non-damage involved at all: assumed all effects which should be rolled separately or no effects
368  if (!effectmask || !nondmgmask)
369  return false;
370  // All effects are non-damage
371  if (nondmgmask == effectmask)
372  return true;
373  // No non-damage effects with additional mechanics
374  if (!mechmask)
375  return false;
376  // Binary spells execution order detection
377  for (uint32 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
378  {
379  // If effect is present and not a non-damage effect
380  const uint32 effect = (1 << i);
381  if ((effectmask & effect) && !(nondmgmask & effect))
382  {
383  // Iterate over mechanics
384  for (uint32 e = EFFECT_0; e < MAX_SPELL_EFFECTS; ++e)
385  {
386  // If effect is extra mechanic on the same target as damage effect
387  if ((mechmask & (1 << e)) &&
388  spellInfo->EffectImplicitTargetA[i] == spellInfo->EffectImplicitTargetA[e] &&
389  spellInfo->EffectImplicitTargetB[i] == spellInfo->EffectImplicitTargetB[e])
390  {
391  return (e > i); // Post-2.3: checks the order of application
392  }
393  }
394  }
395  }
396  return false;
397 }
398 
399 bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId);
400 
401 SpellCastResult IsSpellAllowedInLocation(SpellEntry const* spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id);
402 
404 inline bool IsAreaOfEffectSpell(SpellEntry const* spellInfo)
405 {
407  return true;
409  return true;
411  return true;
412  return false;
413 }
414 
415 inline bool IsFarUnitTargetEffect(uint32 effect)
416 {
417  switch (effect)
418  {
421  return true;
422  }
423 
424  return false;
425 }
426 
427 inline bool IsFarDestTargetEffect(uint32 effect)
428 {
429  return (effect == SPELL_EFFECT_TELEPORT_UNITS);
430 }
431 
432 inline bool IsAreaAuraEffect(uint32 effect)
433 {
434  if (effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
439  return true;
440  return false;
441 }
442 inline bool IsDispel(SpellEntry const* spellInfo)
443 {
444  //spellsteal is also dispel
445  return IsSpellHaveEffect(spellInfo, SPELL_EFFECT_DISPEL) ||
447 }
448 inline bool IsDispelSpell(SpellEntry const* spellInfo)
449 {
450  //spellsteal is also dispel
451  if (spellInfo->Effect[0] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF ||
452  spellInfo->Effect[1] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF ||
454  || IsDispel(spellInfo))
455  return true;
456  return false;
457 }
458 
459 inline bool isSpellBreakStealth(SpellEntry const* spellInfo)
460 {
461  return !(spellInfo->AttributesEx & SPELL_ATTR1_NOT_BREAK_STEALTH);
462 }
463 
464 inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo)
465 {
466  return (spellInfo->Attributes & SPELL_ATTR0_RANGED) && (spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG);
467 }
468 
470 
471 inline bool IsChanneledSpell(SpellEntry const* spellInfo)
472 {
474 }
475 
476 inline bool NeedsComboPoints(SpellEntry const* spellInfo)
477 {
479 }
480 
482 {
483  return SpellSchoolMask(spellInfo->SchoolMask);
484 }
485 
486 inline uint32 GetSpellMechanicMask(SpellEntry const* spellInfo, int32 effect)
487 {
488  uint32 mask = 0;
489  if (spellInfo->Mechanic)
490  mask |= 1 << spellInfo->Mechanic;
491  if (spellInfo->EffectMechanic[effect])
492  mask |= 1 << spellInfo->EffectMechanic[effect];
493  return mask;
494 }
495 
496 inline Mechanics GetEffectMechanic(SpellEntry const* spellInfo, int32 effect)
497 {
498  if (spellInfo->EffectMechanic[effect])
499  return Mechanics(spellInfo->EffectMechanic[effect]);
500  if (spellInfo->Mechanic)
501  return Mechanics(spellInfo->Mechanic);
502  return MECHANIC_NONE;
503 }
504 
506 {
507  // If dispell all
508  if (dispel == DISPEL_ALL)
509  return DISPEL_ALL_MASK;
510  else
511  return (1 << dispel);
512 }
513 
514 // Diminishing Returns interaction with spells
515 DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto, bool triggered);
518 
519 // Spell affects related declarations (accessed using SpellMgr functions)
520 typedef std::map<uint32, uint64> SpellAffectMap;
521 
522 // Spell proc event related declarations (accessed using SpellMgr functions)
524 {
525  PROC_FLAG_NONE = 0x00000000,
526 
527  PROC_FLAG_KILLED = 0x00000001, // 00 Killed by agressor - not sure about this flag
528  PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward)
529 
530  PROC_FLAG_DONE_MELEE_AUTO_ATTACK = 0x00000004, // 02 Done melee auto attack
531  PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK = 0x00000008, // 03 Taken melee auto attack
532 
533  PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS = 0x00000010, // 04 Done attack by Spell that has dmg class melee
534  PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS = 0x00000020, // 05 Taken attack by Spell that has dmg class melee
535 
536  PROC_FLAG_DONE_RANGED_AUTO_ATTACK = 0x00000040, // 06 Done ranged auto attack
537  PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK = 0x00000080, // 07 Taken ranged auto attack
538 
539  PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS = 0x00000100, // 08 Done attack by Spell that has dmg class ranged
540  PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS = 0x00000200, // 09 Taken attack by Spell that has dmg class ranged
541 
542  PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS = 0x00000400, // 10 Done positive spell that has dmg class none
543  PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS = 0x00000800, // 11 Taken positive spell that has dmg class none
544 
545  PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG = 0x00001000, // 12 Done negative spell that has dmg class none
546  PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG = 0x00002000, // 13 Taken negative spell that has dmg class none
547 
548  PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS = 0x00004000, // 14 Done positive spell that has dmg class magic
549  PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS = 0x00008000, // 15 Taken positive spell that has dmg class magic
550 
551  PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG = 0x00010000, // 16 Done negative spell that has dmg class magic
552  PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG = 0x00020000, // 17 Taken negative spell that has dmg class magic
553 
554  PROC_FLAG_DONE_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing)
555  PROC_FLAG_TAKEN_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing)
556 
557  PROC_FLAG_TAKEN_DAMAGE = 0x00100000, // 20 Taken any damage
558  PROC_FLAG_DONE_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation (possibly needs name change to ON_GAMEOBJECT_CAST or USE)
559 
560  PROC_FLAG_DONE_MAINHAND_ATTACK = 0x00400000, // 22 Done main-hand melee attacks (spell and autoattack)
561  PROC_FLAG_DONE_OFFHAND_ATTACK = 0x00800000, // 23 Done off-hand melee attacks (spell and autoattack)
562 
563  PROC_FLAG_DEATH = 0x01000000, // 24 Died in any way
564 
565  // flag masks
568 
572 
575 
582 
584 
586 
592 
598 
600 };
601 
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)
610 
612 {
613  PROC_EX_NONE = 0x0000000, // If none can tigger on Hit/Crit only (passive spells MUST defined by SpellFamily flag)
614  PROC_EX_NORMAL_HIT = 0x0000001, // If set only from normal hit (only damage spells)
615  PROC_EX_CRITICAL_HIT = 0x0000002,
616  PROC_EX_MISS = 0x0000004,
617  PROC_EX_RESIST = 0x0000008,
618  PROC_EX_DODGE = 0x0000010,
619  PROC_EX_PARRY = 0x0000020,
620  PROC_EX_BLOCK = 0x0000040,
621  PROC_EX_EVADE = 0x0000080,
622  PROC_EX_IMMUNE = 0x0000100,
623  PROC_EX_DEFLECT = 0x0000200,
624  PROC_EX_ABSORB = 0x0000400,
625  PROC_EX_REFLECT = 0x0000800,
626  PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used)
627  PROC_EX_RESERVED1 = 0x0002000,
628  PROC_EX_RESERVED2 = 0x0004000,
629  PROC_EX_RESERVED3 = 0x0008000,
630  PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges
631  PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000, // If set trigger always but only one time (not used)
632  PROC_EX_INTERNAL_HOT = 0x1000000, // Only for internal use
633  PROC_EX_INTERNAL_DOT = 0x2000000 // Only for internal use
634 };
635 
637 {
638  uint32 schoolMask; // if nonzero - bit mask for matching proc condition based on spell candidate's school: Fire=2, Mask=1<<(2-1)=2
639  uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyNamer value
640  uint64 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
641  uint32 procFlags; // bitmask for matching proc event
642  uint32 procEx; // proc Extend info (see ProcFlagsEx)
643  float ppmRate; // for melee (ranged?) damage spells - proc rate per minute. if zero, falls back to flat chance from Spell.dbc
644  float customChance; // Owerride chance (in most cases for debug only)
645  uint32 cooldown; // hidden cooldown used for some spell proc events, applied to _triggered_spell_
646 };
647 
648 typedef UNORDERED_MAP<uint32, SpellProcEventEntry> SpellProcEventMap;
649 
651 {
653  float PPMChance;
655 };
656 
657 typedef UNORDERED_MAP<uint32, SpellEnchantProcEntry> SpellEnchantProcEventMap;
658 
660 {
666 };
667 
668 #define SPELL_GROUP_DB_RANGE_MIN 1000
669 
670 // spell_id, group_id
671 typedef std::multimap<uint32, SpellGroup > SpellSpellGroupMap;
672 typedef std::pair<SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator> SpellSpellGroupMapBounds;
673 
674 // group_id, spell_id
675 typedef std::multimap<SpellGroup, int32> SpellGroupSpellMap;
676 typedef std::pair<SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator> SpellGroupSpellMapBounds;
677 
679 {
683 };
684 
685 #define SPELL_GROUP_STACK_RULE_MAX 3
686 
687 typedef std::map<SpellGroup, SpellGroupStackRule> SpellGroupStackMap;
688 
690 {
691  int32 flatMod; // flat threat-value for this Spell - default: 0
692  float pctMod; // threat-multiplier for this Spell - default: 1.0f
693  float apPctMod; // Pct of AP that is added as Threat - default: 0.0f
694 };
695 
696 typedef std::map<uint32, SpellThreatEntry> SpellThreatMap;
697 
698 // Spell script target related declarations (accessed using sSpellMgr functions)
700 {
704 };
705 
706 #define MAX_SPELL_TARGET_TYPE 3
707 
709 {
710  SpellTargetEntry(SpellScriptTargetType type_, uint32 targetEntry_) : type(type_), targetEntry(targetEntry_) {}
713 };
714 
715 // coordinates for spells (accessed using sSpellMgr functions)
717 {
719  float target_X;
720  float target_Y;
721  float target_Z;
723 };
724 
725 typedef UNORDERED_MAP<uint32, SpellTargetPosition> SpellTargetPositionMap;
726 
727 // Spell pet auras
728 class PetAura
729 {
730  public:
731  PetAura() : removeOnChangePet(false), damage(0) { auras.clear(); }
732 
733  PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, int _damage) :
734  removeOnChangePet(_removeOnChangePet), damage(_damage)
735  {
736  auras[petEntry] = aura;
737  }
738 
739  uint32 GetAura(uint32 petEntry) const
740  {
741  std::map<uint32, uint32>::const_iterator itr = auras.find(petEntry);
742  if (itr != auras.end())
743  return itr->second;
744  else
745  {
746  std::map<uint32, uint32>::const_iterator itr = auras.find(0);
747  if (itr != auras.end())
748  return itr->second;
749  else
750  return 0;
751  }
752  }
753 
754  void AddAura(uint32 petEntry, uint32 aura)
755  {
756  auras[petEntry] = aura;
757  }
758 
759  bool IsRemovedOnChangePet() const
760  {
761  return removeOnChangePet;
762  }
763 
764  int32 GetDamage() const
765  {
766  return damage;
767  }
768 
769  private:
770  std::map<uint32, uint32> auras;
773 };
774 typedef std::map<uint32, PetAura> SpellPetAuraMap;
775 
776 // Spell rank chain (accessed using sSpellMgr functions)
778 {
784 };
785 
786 typedef UNORDERED_MAP<uint32, SpellChainNode> SpellChainMap;
787 
788 // spell_id req_spell
789 typedef UNORDERED_MAP<uint32, uint32> SpellRequiredMap;
790 
791 typedef std::multimap<uint32, uint32> SpellsRequiringSpellMap;
792 
793 // Spell learning properties (accessed using sSpellMgr functions)
795 {
797  uint32 value; // 0 - max skill value for player level
798  uint32 maxvalue; // 0 - max skill value for player level
799 };
800 
801 typedef std::map<uint32, SpellLearnSkillNode> SpellLearnSkillMap;
802 
804 {
807 };
808 
809 typedef std::multimap<uint32, SpellLearnSpellNode> SpellLearnSpellMap;
810 
811 typedef std::multimap<uint32, SkillLineAbilityEntry const*> SkillLineAbilityMap;
812 
814 {
815  SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
816  if (!pSkill)
817  return false;
818 
819  if (pSkill->categoryId != SKILL_CATEGORY_PROFESSION)
820  return false;
821 
822  return true;
823 }
824 
825 inline bool IsProfessionSkill(uint32 skill)
826 {
827  return IsPrimaryProfessionSkill(skill) || skill == SKILL_FISHING || skill == SKILL_COOKING || skill == SKILL_FIRST_AID;
828 }
829 
831 {
832  //SPELL_ATTR_CU_PLAYERS_ONLY 0x00000001
838  SPELL_ATTR_CU_AURA_CC = 0x00000040,
841  SPELL_ATTR_CU_CHARGE = 0x00000200,
852 };
853 
854 typedef std::vector<uint32> SpellCustomAttribute;
855 
856 typedef std::map<int32, std::vector<int32> > SpellLinkedMap;
857 
859 {
870  // bits 10 - 17 are reserved
886 };
887 
889 {
890  SDC_NONE = 0,
897  SDC_TEAM = 7,
906 };
907 
909 {
913 
914  struct
915  {
918  }
919  conditions[5];
920 };
921 
922 typedef std::multimap<uint32, SpellDummyConditionEntry> SpellDummyConditionMap;
923 
924 class SpellMgr
925 {
926  // Constructors
927  public:
928  SpellMgr();
929  ~SpellMgr();
930 
931  // Accessors (const or static functions)
932  public:
933  // Spell affects
934  uint64 GetSpellAffectMask(uint16 spellId, uint8 effectId) const
935  {
936  SpellAffectMap::const_iterator itr = mSpellAffectMap.find((spellId << 8) + effectId);
937  if (itr != mSpellAffectMap.end())
938  return itr->second;
939  return 0;
940  }
941 
942  bool IsAffectedBySpell(SpellEntry const* spellInfo, uint32 spellId, uint8 effectId, uint64 familyFlags) const;
943 
944  inline bool IsPositionTarget(uint32 target)
945  {
946  switch (SpellTargetType[target])
947  {
951  return true;
952  default:
953  break;
954  }
955  return false;
956  }
957 
959  {
960  SpellThreatMap::const_iterator itr = mSpellThreatMap.find(spellID);
961  if (itr != mSpellThreatMap.end())
962  return &itr->second;
963  else
964  {
965  uint32 firstSpell = GetFirstSpellInChain(spellID);
966  SpellThreatMap::const_iterator itr = mSpellThreatMap.find(firstSpell);
967  if (itr != mSpellThreatMap.end())
968  return &itr->second;
969  }
970  return NULL;
971  }
972 
973  // Spell proc events
975  {
976  SpellProcEventMap::const_iterator itr = mSpellProcEventMap.find(spellId);
977  if (itr != mSpellProcEventMap.end())
978  return &itr->second;
979  return NULL;
980  }
981 
982  static bool IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const* procSpell, uint32 procFlags, uint32 procExtra, bool active);
983 
985  {
986  SpellEnchantProcEventMap::const_iterator itr = mSpellEnchantProcEventMap.find(enchId);
987  if (itr != mSpellEnchantProcEventMap.end())
988  return &itr->second;
989  return NULL;
990  }
991 
992  // Spell target coordinates
994  {
995  SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find(spell_id);
996  if (itr != mSpellTargetPositions.end())
997  return &itr->second;
998  return NULL;
999  }
1000 
1001  // Spell ranks chains
1002  SpellChainNode const* GetSpellChainNode(uint32 spell_id) const
1003  {
1004  SpellChainMap::const_iterator itr = mSpellChains.find(spell_id);
1005  if (itr == mSpellChains.end())
1006  return NULL;
1007 
1008  return &itr->second;
1009  }
1010 
1012  {
1013  SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id);
1014  if (itr == mSpellReq.end())
1015  return 0;
1016 
1017  return itr->second;
1018  }
1019 
1021  {
1022  if (SpellChainNode const* node = GetSpellChainNode(spell_id))
1023  return node->first;
1024 
1025  return spell_id;
1026  }
1027 
1029  {
1030  if (SpellChainNode const* node = GetSpellChainNode(spell_id))
1031  if (node->next)
1032  return node->next;
1033 
1034  return 0;
1035  }
1036 
1038  {
1039  if (SpellChainNode const* node = GetSpellChainNode(spell_id))
1040  if (node->prev)
1041  return node->prev;
1042 
1043  return 0;
1044  }
1045 
1047  {
1048  return mSpellsReqSpell;
1049  }
1050 
1051  // Note: not use rank for compare to spell ranks: spell chains isn't linear order
1052  // Use IsHighRankOfSpell instead
1053  uint8 GetSpellRank(uint32 spell_id) const
1054  {
1055  if (SpellChainNode const* node = GetSpellChainNode(spell_id))
1056  return node->rank;
1057 
1058  return 0;
1059  }
1060 
1062  {
1063  if (SpellChainNode const* node = GetSpellChainNode(spell_id))
1064  return node->last;
1065 
1066  return spell_id;
1067  }
1068 
1069  uint8 IsHighRankOfSpell(uint32 spell1, uint32 spell2) const
1070  {
1071  SpellChainMap::const_iterator itr1 = mSpellChains.find(spell1);
1072  SpellChainMap::const_iterator itr2 = mSpellChains.find(spell2);
1073  if (itr1 == mSpellChains.end() || itr2 == mSpellChains.end())
1074  return false;
1075 
1076  if (itr1->second.first == itr2->second.first)
1077  if (itr1->second.rank > itr2->second.rank)
1078  return true;
1079 
1080  return false;
1081  }
1082 
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;
1086 
1087  SpellEntry const* SelectAuraRankForPlayerLevel(SpellEntry const* spellInfo, uint32 playerLevel) const;
1088 
1089  // Spell learning
1091  {
1092  SpellLearnSkillMap::const_iterator itr = mSpellLearnSkills.find(spell_id);
1093  if (itr != mSpellLearnSkills.end())
1094  return &itr->second;
1095  else
1096  return NULL;
1097  }
1098 
1099  bool IsSpellLearnSpell(uint32 spell_id) const
1100  {
1101  return mSpellLearnSpells.count(spell_id) != 0;
1102  }
1103 
1104  SpellLearnSpellMap::const_iterator GetBeginSpellLearnSpell(uint32 spell_id) const
1105  {
1106  return mSpellLearnSpells.lower_bound(spell_id);
1107  }
1108 
1109  SpellLearnSpellMap::const_iterator GetEndSpellLearnSpell(uint32 spell_id) const
1110  {
1111  return mSpellLearnSpells.upper_bound(spell_id);
1112  }
1113 
1114  bool IsSpellLearnToSpell(uint32 spell_id1, uint32 spell_id2) const
1115  {
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)
1120  return true;
1121  return false;
1122  }
1123 
1124  static bool IsProfessionSpell(uint32 spellId);
1125  static bool IsPrimaryProfessionSpell(uint32 spellId);
1126  bool IsPrimaryProfessionFirstRankSpell(uint32 spellId) const;
1127 
1128  // Spell correctess for client using
1129  static bool IsSpellValid(SpellEntry const* spellInfo, Player* pl = NULL, bool msg = true);
1130 
1131  // Spell Groups table
1132  SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds(uint32 spell_id) const;
1133  bool IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const;
1134 
1135  SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds(SpellGroup group_id) const;
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;
1138 
1139  // Spell Group Stack Rules table
1140  SpellGroupStackRule CheckSpellGroupStackRules(uint32 spellInfo1, uint32 spellInfo2) const;
1141 
1142  SkillLineAbilityMap::const_iterator GetBeginSkillLineAbilityMap(uint32 spell_id) const
1143  {
1144  return mSkillLineAbilityMap.lower_bound(spell_id);
1145  }
1146 
1147  SkillLineAbilityMap::const_iterator GetEndSkillLineAbilityMap(uint32 spell_id) const
1148  {
1149  return mSkillLineAbilityMap.upper_bound(spell_id);
1150  }
1151 
1152  PetAura const* GetPetAura(uint32 spell_id)
1153  {
1154  SpellPetAuraMap::const_iterator itr = mSpellPetAuraMap.find(spell_id);
1155  if (itr != mSpellPetAuraMap.end())
1156  return &itr->second;
1157  else
1158  return NULL;
1159  }
1160 
1162  {
1163  if (spell_id >= mSpellCustomAttr.size())
1164  return 0;
1165  else
1166  return mSpellCustomAttr[spell_id];
1167  /*SpellCustomAttrMap::const_iterator itr = mSpellCustomAttrMap.find(spell_id);
1168  if (itr != mSpellCustomAttrMap.end())
1169  return itr->second;
1170  else
1171  return 0;*/
1172  }
1173 
1174  const std::vector<int32>* GetSpellLinked(int32 spell_id) const
1175  {
1176  SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id);
1177  return itr != mSpellLinkedMap.end() ? &(itr->second) : NULL;
1178  }
1179 
1182 
1184  {
1185  typedef SpellDummyConditionMap::const_iterator Iterator;
1186  std::pair<Iterator, Iterator> range = mSpellDummyConditionMap.equal_range(spellId);
1187 
1188  for (Iterator it = range.first; it != range.second; it++)
1189  if (it->second.effIndex == effIndex)
1190  return &(it->second);
1191 
1192  return NULL;
1193  }
1194 
1195  // Modifiers
1196  public:
1197  static SpellMgr& Instance();
1198 
1199  // Loading data at server startup
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();
1217 
1218  private:
1237 };
1238 
1239 #define sSpellMgr SpellMgr::Instance()
1240 #endif
1241 
bool IsProfessionSkill(uint32 skill)
Definition: SpellMgr.h:825
uint32 last
Definition: SpellMgr.h:782
std::map< uint32, PetAura > SpellPetAuraMap
Definition: SpellMgr.h:774
SpellPetAuraMap mSpellPetAuraMap
Definition: SpellMgr.h:1231
uint32 GetLastSpellInChain(uint32 spell_id) const
Definition: SpellMgr.h:1061
uint32 GetSpellRangeType(SpellRangeEntry const *range)
Definition: SpellMgr.h:147
uint32 AttributesEx
Definition: DBCStructure.h:680
std::map< uint32, uint32 > auras
Definition: SpellMgr.h:770
uint32 EffectMechanic[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:730
DBCStorage< SpellEntry > const * GetSpellStore()
Definition: DBCStores.cpp:776
SpellLearnSkillNode const * GetSpellLearnSkill(uint32 spell_id) const
Definition: SpellMgr.h:1090
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
PetAura const * GetPetAura(uint32 spell_id)
Definition: SpellMgr.h:1152
bool IsPassiveSpell(uint32 spellId)
Definition: SpellMgr.cpp:278
DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const *spellproto, bool triggered)
Definition: SpellMgr.cpp:3055
uint32 spellFamilyName
Definition: SpellMgr.h:639
bool IsBinarySpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:327
SkillLineAbilityMap::const_iterator GetEndSkillLineAbilityMap(uint32 spell_id) const
Definition: SpellMgr.h:1147
SpellProcEventMap mSpellProcEventMap
Definition: SpellMgr.h:1229
uint32 GetPrevSpellInChain(uint32 spell_id) const
Definition: SpellMgr.h:1037
bool IsPositiveTarget(uint32 targetA, uint32 targetB)
Definition: SpellMgr.cpp:539
#define sDisableMgr
Definition: DisableMgr.h:73
UNORDERED_MAP< uint32, SpellChainNode > SpellChainMap
Definition: SpellMgr.h:786
bool IsDispelSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:448
bool IsDispel(SpellEntry const *spellInfo)
Definition: SpellMgr.h:442
SpellSchoolMask
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
Definition: SpellMgr.cpp:384
bool IsAreaAuraEffect(uint32 effect)
Definition: SpellMgr.h:432
std::map< SpellGroup, SpellGroupStackRule > SpellGroupStackMap
Definition: SpellMgr.h:687
SpellSpellGroupMap mSpellSpellGroup
Definition: SpellMgr.h:1227
SpellEffectTargetTypes
Definition: SpellMgr.h:58
Mechanics GetEffectMechanic(SpellEntry const *spellInfo, int32 effect)
Definition: SpellMgr.h:496
SpellSpecific
Definition: SpellMgr.h:95
bool IsAutoRepeatRangedSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:464
float GetSpellRadiusForHostile(SpellRadiusEntry const *radius)
Definition: SpellMgr.h:130
SpellRequiredMap mSpellReq
Definition: SpellMgr.h:1221
bool NeedsComboPoints(SpellEntry const *spellInfo)
Definition: SpellMgr.h:476
std::vector< uint32 > SpellCustomAttribute
Definition: SpellMgr.h:854
uint32 GetAura(uint32 petEntry) const
Definition: SpellMgr.h:739
uint8 IsHighRankOfSpell(uint32 spell1, uint32 spell2) const
Definition: SpellMgr.h:1069
UNORDERED_MAP< uint32, uint32 > SpellRequiredMap
Definition: SpellMgr.h:789
bool IsSpellLearnSpell(uint32 spell_id) const
Definition: SpellMgr.h:1099
SpellEnchantProcEventMap mSpellEnchantProcEventMap
Definition: SpellMgr.h:1235
std::map< int32, std::vector< int32 > > SpellLinkedMap
Definition: SpellMgr.h:856
bool IsSpellLearnToSpell(uint32 spell_id1, uint32 spell_id2) const
Definition: SpellMgr.h:1114
uint32 AttributesEx2
Definition: DBCStructure.h:681
DiminishingGroup
uint32 GetSpellCustomAttr(uint32 spell_id) const
Definition: SpellMgr.h:1161
SpellLearnSpellMap::const_iterator GetBeginSpellLearnSpell(uint32 spell_id) const
Definition: SpellMgr.h:1104
int32 GetSpellDuration(SpellEntry const *spellInfo)
Definition: SpellMgr.cpp:228
std::pair< SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator > SpellGroupSpellMapBounds
Definition: SpellMgr.h:676
ACE_INT32 int32
Definition: Define.h:67
NULL Dbg ErrDB Arena Chat Char Map MMap false
Definition: Log.cpp:556
SpellScriptTargetType
Definition: SpellMgr.h:699
int32 damage
Definition: SpellMgr.h:772
uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:733
SkillLineAbilityMap mSkillLineAbilityMap
Definition: SpellMgr.h:1230
#define DISPEL_ALL_MASK
uint32 DmgClass
Definition: DBCStructure.h:763
SpellTargetPositionMap mSpellTargetPositions
Definition: SpellMgr.h:1224
bool IsFarDestTargetEffect(uint32 effect)
Definition: SpellMgr.h:427
DispelType
uint32 targetEntry
Definition: SpellMgr.h:712
uint32 Effect[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:724
int32 GetSpellMaxDuration(SpellEntry const *spellInfo)
Definition: SpellMgr.cpp:238
bool IsAutocastableSpell(uint32 spellId)
Definition: SpellMgr.cpp:291
std::map< uint32, uint64 > SpellAffectMap
Definition: SpellMgr.h:520
std::multimap< uint32, uint32 > SpellsRequiringSpellMap
Definition: SpellMgr.h:791
bool IsPositiveSpell(uint32 spellId)
Definition: SpellMgr.cpp:773
uint32 EffectApplyAuraName[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:734
uint32 rangeIndex
Definition: DBCStructure.h:714
SpellTargetEntry(SpellScriptTargetType type_, uint32 targetEntry_)
Definition: SpellMgr.h:710
bool IsSpellEffectTriggerSpell(const SpellEntry *entry, SpellEffIndex eff_idx)
Definition: SpellMgr.h:229
Spell is Pickpocket.
Definition: SpellMgr.h:851
SpellSchoolMask GetSpellSchoolMask(SpellEntry const *spellInfo)
Definition: SpellMgr.h:481
static bool checkSpellForLoS(unsigned int pSpellId)
Definition: VMapFactory.cpp:94
bool IsDeathOnlySpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:287
must ignore armor
Definition: SpellMgr.h:847
PetAura()
Definition: SpellMgr.h:731
SpellLinkedType
Definition: SpellMgr.h:119
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
Definition: SpellMgr.cpp:3205
bool IsRemovedOnChangePet() const
Definition: SpellMgr.h:759
uint32 Attributes
Definition: DBCStructure.h:679
SpellEffects
SpellGroup
Definition: SpellMgr.h:659
bool HasAttribute(SpellAttributes attribute) const
Definition: DBCStructure.h:774
uint32 GetDispelMask(DispelType dispel)
Definition: SpellMgr.h:505
std::map< uint32, SpellLearnSkillNode > SpellLearnSkillMap
Definition: SpellMgr.h:801
bool IsDeathPersistentSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:299
uint32 GetSpellRequired(uint32 spell_id) const
Definition: SpellMgr.h:1011
bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS]
Definition: SpellMgr.cpp:28
SpellFamilyNames
Definition: SpellMgr.h:40
ACE_UINT8 uint8
Definition: Define.h:73
UNORDERED_MAP< uint32, SpellTargetPosition > SpellTargetPositionMap
Definition: SpellMgr.h:725
bool IsPrimaryProfessionSkill(uint32 skill)
Definition: SpellMgr.h:813
std::pair< SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator > SpellSpellGroupMapBounds
Definition: SpellMgr.h:672
uint32 AttributesEx3
Definition: DBCStructure.h:682
bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId)
Definition: SpellMgr.cpp:831
SpellTargetPosition const * GetSpellTargetPosition(uint32 spell_id) const
Definition: SpellMgr.h:993
#define TOTAL_SPELL_TARGETS
std::multimap< SpellGroup, int32 > SpellGroupSpellMap
Definition: SpellMgr.h:675
uint32 CalculatePowerCost(SpellEntry const *spellInfo, Unit const *caster, SpellSchoolMask schoolMask)
Definition: SpellMgr.cpp:303
int32 damage
Definition: Spell.h:586
SpellDummyConditionMap mSpellDummyConditionMap
Definition: SpellMgr.h:1236
uint8 GetSpellRank(uint32 spell_id) const
Definition: SpellMgr.h:1053
SpellEffIndex effIndex
Definition: SpellMgr.h:911
uint32 GetFirstSpellInChain(uint32 spell_id) const
Definition: SpellMgr.h:1020
SpellCustomAttributes
Definition: SpellMgr.h:830
uint32 Targets
Definition: DBCStructure.h:688
uint64 spellFamilyMask
Definition: SpellMgr.h:640
void AddAura(uint32 petEntry, uint32 aura)
Definition: SpellMgr.h:754
uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:732
bool IsSpellEffectAbleToCrit(const SpellEntry *entry, SpellEffIndex index)
Definition: SpellMgr.h:245
SpellEffIndex
Definition: SharedDefines.h:24
bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group)
Definition: SpellMgr.cpp:3180
SpellCustomAttribute mSpellCustomAttr
Definition: SpellMgr.h:1232
uint64 SpellFamilyFlags
Definition: DBCStructure.h:761
SpellLinkedMap mSpellLinkedMap
Definition: SpellMgr.h:1233
uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:731
bool IsSpellRemoveAllMovementAndControlLossEffects(SpellEntry const *spellProto)
Definition: SpellMgr.h:278
SpellAffectMap mSpellAffectMap
Definition: SpellMgr.h:1226
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
Definition: SpellMgr.cpp:561
PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, int _damage)
Definition: SpellMgr.h:733
DiminishingReturnsType
float GetSpellMinRange(SpellRangeEntry const *range)
Definition: SpellMgr.h:139
uint32 SchoolMask
Definition: DBCStructure.h:772
SkillLineAbilityMap::const_iterator GetBeginSkillLineAbilityMap(uint32 spell_id) const
Definition: SpellMgr.h:1142
UNORDERED_MAP< uint32, SpellEnchantProcEntry > SpellEnchantProcEventMap
Definition: SpellMgr.h:657
SpellLearnSpellMap mSpellLearnSpells
Definition: SpellMgr.h:1223
SpellLearnSkillMap mSpellLearnSkills
Definition: SpellMgr.h:1222
bool IsChanneledSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:471
bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
Definition: SpellMgr.h:207
SpellLearnSpellMap::const_iterator GetEndSpellLearnSpell(uint32 spell_id) const
Definition: SpellMgr.h:1109
ProcFlagsEx
Definition: SpellMgr.h:611
std::multimap< uint32, SkillLineAbilityEntry const * > SkillLineAbilityMap
Definition: SpellMgr.h:811
int32 EffectMiscValue[MAX_SPELL_EFFECTS]
Definition: DBCStructure.h:739
bool IsSpellIgnoringLOS(SpellEntry const *spellInfo)
Definition: SpellMgr.h:158
SpellGroupStackRule
Definition: SpellMgr.h:678
SpellDummyConditionBitmask
Definition: SpellMgr.h:858
uint64 GetSpellAffectMask(uint16 spellId, uint8 effectId) const
Definition: SpellMgr.h:934
bool IsSealSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:215
SpellGroupStackMap mSpellGroupStack
Definition: SpellMgr.h:1234
SpellDummyCondition
Definition: SpellMgr.h:888
SpellCastResult GetErrorAtShapeshiftedCast(SpellEntry const *spellInfo, uint32 form)
Definition: SpellMgr.cpp:842
approves cast on any target, even when its non-attackable
Definition: SpellMgr.h:850
SpellGroupSpellMap mSpellGroupSpell
Definition: SpellMgr.h:1228
std::map< uint32, SpellThreatEntry > SpellThreatMap
Definition: SpellMgr.h:696
ACE_UINT64 uint64
Definition: Define.h:70
uint32 CategoryRecoveryTime
Definition: DBCStructure.h:698
Mechanics
float GetSpellRadius(SpellEntry const *spellInfo, uint32 effectIdx, bool positive)
Definition: SpellMgr.h:176
float GetSpellRadiusForFriend(SpellRadiusEntry const *radius)
Definition: SpellMgr.h:134
float target_Orientation
Definition: SpellMgr.h:722
bool isSpellBreakStealth(SpellEntry const *spellInfo)
Definition: SpellMgr.h:459
SpellScriptTargetType type
Definition: SpellMgr.h:711
SpellThreatMap mSpellThreatMap
Definition: SpellMgr.h:1225
SpellsRequiringSpellMap mSpellsReqSpell
Definition: SpellMgr.h:1220
uint32 GetSpellCastTime(SpellEntry const *spellInfo, Spell const *spell=NULL)
Definition: SpellMgr.cpp:248
SpellSelectTargetTypes
Definition: SpellMgr.h:67
uint32 RecoveryTime
Definition: DBCStructure.h:697
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
bool IsFarUnitTargetEffect(uint32 effect)
Definition: SpellMgr.h:415
bool IsElementalShield(SpellEntry const *spellInfo)
Definition: SpellMgr.h:223
SpellsRequiringSpellMap const & GetSpellsRequiringSpell() const
Definition: SpellMgr.h:1046
uint32 GetSpellMechanicMask(SpellEntry const *spellInfo, int32 effect)
Definition: SpellMgr.h:486
SpellThreatEntry const * GetSpellThreatEntry(uint32 spellID) const
Definition: SpellMgr.h:958
SpellEnchantProcEntry const * GetSpellEnchantProcEvent(uint32 enchId) const
Definition: SpellMgr.h:984
std::multimap< uint32, SpellGroup > SpellSpellGroupMap
Definition: SpellMgr.h:671
const SpellDummyConditionEntry * GetSpellDummyCondition(uint32 spellId, uint32 effIndex) const
Definition: SpellMgr.h:1183
ignore bonus healing/damage
Definition: SpellMgr.h:849
uint32 SpellFamilyName
Definition: DBCStructure.h:760
bool IsNonCombatSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:315
bool IsSingleTargetSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.cpp:783
bool IsSpellAbleToCrit(const SpellEntry *entry)
Definition: SpellMgr.h:265
uint32 GetNextSpellInChain(uint32 spell_id) const
Definition: SpellMgr.h:1028
bool IsAreaOfEffectSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:404
bool IsPositionTarget(uint32 target)
Definition: SpellMgr.h:944
uint32 Mechanic
Definition: DBCStructure.h:678
int32 GetDamage() const
Definition: SpellMgr.h:764
uint32 prev
Definition: SpellMgr.h:779
UNORDERED_MAP< uint32, SpellProcEventEntry > SpellProcEventMap
Definition: SpellMgr.h:648
SpellChainMap mSpellChains
Definition: SpellMgr.h:1219
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:670
const std::vector< int32 > * GetSpellLinked(int32 spell_id) const
Definition: SpellMgr.h:1174
SpellCastResult IsSpellAllowedInLocation(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id)
Definition: SpellMgr.cpp:2900
SpellCastResult
related to movement impiaring effects
Definition: SpellMgr.h:846
SpellChainNode const * GetSpellChainNode(uint32 spell_id) const
Definition: SpellMgr.h:1002
uint32 first
Definition: SpellMgr.h:781
ProcFlags
Definition: SpellMgr.h:523
ACE_UINT16 uint16
Definition: Define.h:72
ACE_UINT32 uint32
Definition: Define.h:71
must be cast from item, never directly
Definition: SpellMgr.h:848
Definition: Unit.h:908
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2)
Definition: SpellMgr.cpp:807
std::multimap< uint32, SpellDummyConditionEntry > SpellDummyConditionMap
Definition: SpellMgr.h:922
Definition: Player.h:922
uint32 next
Definition: SpellMgr.h:780
SpellSpecific GetSpellSpecific(uint32 spellId)
Definition: SpellMgr.cpp:396
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
bool removeOnChangePet
Definition: SpellMgr.h:771
std::multimap< uint32, SpellLearnSpellNode > SpellLearnSpellMap
Definition: SpellMgr.h:809
SpellDummyCondition condition
Definition: SpellMgr.h:916
SpellProcEventEntry const * GetSpellProcEvent(uint32 spellId) const
Definition: SpellMgr.h:974
uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo)
Definition: SpellMgr.h:151
float GetSpellMaxRange(SpellRangeEntry const *range)
Definition: SpellMgr.h:143
Definition: Spell.h:249