TrinityCore
Spell.h File Reference
#include "ConditionMgr.h"
#include "DBCEnums.h"
#include "ObjectGuid.h"
#include "Optional.h"
#include "Position.h"
#include "SharedDefines.h"
#include "SpellDefines.h"
#include <memory>
+ Include dependency graph for Spell.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SpellLogEffectPowerDrainParams
 
struct  SpellLogEffectExtraAttacksParams
 
struct  SpellLogEffectDurabilityDamageParams
 
struct  SpellLogEffectGenericVictimParams
 
struct  SpellLogEffectTradeSkillItemParams
 
struct  SpellLogEffectFeedPetParams
 
struct  SpellLogEffect
 
struct  SpellValue
 
class  Spell
 
struct  Spell::TargetInfoBase
 
struct  Spell::TargetInfo
 
struct  Spell::GOTargetInfo
 
struct  Spell::ItemTargetInfo
 
struct  Spell::CorpseTargetInfo
 
struct  Spell::HitTriggerSpell
 
struct  Trinity::WorldObjectSpellTargetCheck
 
struct  Trinity::WorldObjectSpellNearbyTargetCheck
 
struct  Trinity::WorldObjectSpellAreaTargetCheck
 
struct  Trinity::WorldObjectSpellConeTargetCheck
 
struct  Trinity::WorldObjectSpellTrajTargetCheck
 
struct  Trinity::WorldObjectSpellLineTargetCheck
 

Namespaces

 WorldPackets
 
 WorldPackets::Spells
 
 Trinity
 

Macros

#define SPELL_CHANNEL_UPDATE_INTERVAL   (1 * IN_MILLISECONDS)
 
#define MAX_SPELL_RANGE_TOLERANCE   3.0f
 
#define TRAJECTORY_MISSILE_SIZE   3.0f
 

Typedefs

typedef std::vector< std::pair< uint32, ObjectGuid > > DispelList
 
using SpellEffectHandlerFn = void(Spell::*)()
 

Enumerations

enum  SpellCastFlags {
  CAST_FLAG_NONE = 0x00000000, CAST_FLAG_PENDING = 0x00000001, CAST_FLAG_HAS_TRAJECTORY = 0x00000002, CAST_FLAG_UNKNOWN_3 = 0x00000004,
  CAST_FLAG_UNKNOWN_4 = 0x00000008, CAST_FLAG_UNKNOWN_5 = 0x00000010, CAST_FLAG_PROJECTILE = 0x00000020, CAST_FLAG_UNKNOWN_7 = 0x00000040,
  CAST_FLAG_UNKNOWN_8 = 0x00000080, CAST_FLAG_UNKNOWN_9 = 0x00000100, CAST_FLAG_UNKNOWN_10 = 0x00000200, CAST_FLAG_UNKNOWN_11 = 0x00000400,
  CAST_FLAG_POWER_LEFT_SELF = 0x00000800, CAST_FLAG_UNKNOWN_13 = 0x00001000, CAST_FLAG_UNKNOWN_14 = 0x00002000, CAST_FLAG_UNKNOWN_15 = 0x00004000,
  CAST_FLAG_UNKNOWN_16 = 0x00008000, CAST_FLAG_UNKNOWN_17 = 0x00010000, CAST_FLAG_ADJUST_MISSILE = 0x00020000, CAST_FLAG_NO_GCD = 0x00040000,
  CAST_FLAG_VISUAL_CHAIN = 0x00080000, CAST_FLAG_UNKNOWN_21 = 0x00100000, CAST_FLAG_RUNE_LIST = 0x00200000, CAST_FLAG_UNKNOWN_23 = 0x00400000,
  CAST_FLAG_UNKNOWN_24 = 0x00800000, CAST_FLAG_UNKNOWN_25 = 0x01000000, CAST_FLAG_UNKNOWN_26 = 0x02000000, CAST_FLAG_IMMUNITY = 0x04000000,
  CAST_FLAG_UNKNOWN_28 = 0x08000000, CAST_FLAG_UNKNOWN_29 = 0x10000000, CAST_FLAG_UNKNOWN_30 = 0x20000000, CAST_FLAG_HEAL_PREDICTION = 0x40000000,
  CAST_FLAG_UNKNOWN_32 = 0x80000000
}
 
enum  SpellCastFlagsEx {
  CAST_FLAG_EX_NONE = 0x00000, CAST_FLAG_EX_UNKNOWN_1 = 0x00001, CAST_FLAG_EX_UNKNOWN_2 = 0x00002, CAST_FLAG_EX_UNKNOWN_3 = 0x00004,
  CAST_FLAG_EX_UNKNOWN_4 = 0x00008, CAST_FLAG_EX_UNKNOWN_5 = 0x00010, CAST_FLAG_EX_UNKNOWN_6 = 0x00020, CAST_FLAG_EX_UNKNOWN_7 = 0x00040,
  CAST_FLAG_EX_UNKNOWN_8 = 0x00080, CAST_FLAG_EX_UNKNOWN_9 = 0x00100, CAST_FLAG_EX_IGNORE_COOLDOWN = 0x00200, CAST_FLAG_EX_UNKNOWN_11 = 0x00400,
  CAST_FLAG_EX_UNKNOWN_12 = 0x00800, CAST_FLAG_EX_UNKNOWN_13 = 0x01000, CAST_FLAG_EX_UNKNOWN_14 = 0x02000, CAST_FLAG_EX_UNKNOWN_15 = 0x04000,
  CAST_FLAG_EX_USE_TOY_SPELL = 0x08000, CAST_FLAG_EX_UNKNOWN_17 = 0x10000, CAST_FLAG_EX_UNKNOWN_18 = 0x20000, CAST_FLAG_EX_UNKNOWN_19 = 0x40000,
  CAST_FLAG_EX_UNKNOWN_20 = 0x80000
}
 
enum  SpellCastSource : uint8 {
  SPELL_CAST_SOURCE_PLAYER = 2, SPELL_CAST_SOURCE_NORMAL = 3, SPELL_CAST_SOURCE_ITEM = 4, SPELL_CAST_SOURCE_PASSIVE = 7,
  SPELL_CAST_SOURCE_PET = 9, SPELL_CAST_SOURCE_AURA = 13, SPELL_CAST_SOURCE_SPELL = 16
}
 
enum  SpellRangeFlag { SPELL_RANGE_DEFAULT = 0, SPELL_RANGE_MELEE = 1, SPELL_RANGE_RANGED = 2 }
 
enum  SpellState {
  SPELL_STATE_NULL = 0, SPELL_STATE_PREPARING = 1, SPELL_STATE_CASTING = 2, SPELL_STATE_FINISHED = 3,
  SPELL_STATE_IDLE = 4, SPELL_STATE_DELAYED = 5
}
 
enum  SpellEffectHandleMode { SPELL_EFFECT_HANDLE_LAUNCH, SPELL_EFFECT_HANDLE_LAUNCH_TARGET, SPELL_EFFECT_HANDLE_HIT, SPELL_EFFECT_HANDLE_HIT_TARGET }
 

Functions

void Trinity::SelectRandomInjuredTargets (std::list< WorldObject *> &targets, size_t maxTargets, bool prioritizePlayers)
 

Variables

static const uint32 SPELL_INTERRUPT_NONPLAYER = 32747
 

Macro Definition Documentation

◆ MAX_SPELL_RANGE_TOLERANCE

#define MAX_SPELL_RANGE_TOLERANCE   3.0f

◆ SPELL_CHANNEL_UPDATE_INTERVAL

#define SPELL_CHANNEL_UPDATE_INTERVAL   (1 * IN_MILLISECONDS)

◆ TRAJECTORY_MISSILE_SIZE

#define TRAJECTORY_MISSILE_SIZE   3.0f

Typedef Documentation

◆ DispelList

typedef std::vector<std::pair<uint32, ObjectGuid> > DispelList

◆ SpellEffectHandlerFn

using SpellEffectHandlerFn = void(Spell::*)()

Enumeration Type Documentation

◆ SpellCastFlags

Enumerator
CAST_FLAG_NONE 
CAST_FLAG_PENDING 
CAST_FLAG_HAS_TRAJECTORY 
CAST_FLAG_UNKNOWN_3 
CAST_FLAG_UNKNOWN_4 
CAST_FLAG_UNKNOWN_5 
CAST_FLAG_PROJECTILE 
CAST_FLAG_UNKNOWN_7 
CAST_FLAG_UNKNOWN_8 
CAST_FLAG_UNKNOWN_9 
CAST_FLAG_UNKNOWN_10 
CAST_FLAG_UNKNOWN_11 
CAST_FLAG_POWER_LEFT_SELF 
CAST_FLAG_UNKNOWN_13 
CAST_FLAG_UNKNOWN_14 
CAST_FLAG_UNKNOWN_15 
CAST_FLAG_UNKNOWN_16 
CAST_FLAG_UNKNOWN_17 
CAST_FLAG_ADJUST_MISSILE 
CAST_FLAG_NO_GCD 
CAST_FLAG_VISUAL_CHAIN 
CAST_FLAG_UNKNOWN_21 
CAST_FLAG_RUNE_LIST 
CAST_FLAG_UNKNOWN_23 
CAST_FLAG_UNKNOWN_24 
CAST_FLAG_UNKNOWN_25 
CAST_FLAG_UNKNOWN_26 
CAST_FLAG_IMMUNITY 
CAST_FLAG_UNKNOWN_28 
CAST_FLAG_UNKNOWN_29 
CAST_FLAG_UNKNOWN_30 
CAST_FLAG_HEAL_PREDICTION 
CAST_FLAG_UNKNOWN_32 
76 {
77  CAST_FLAG_NONE = 0x00000000,
78  CAST_FLAG_PENDING = 0x00000001, // aoe combat log?
79  CAST_FLAG_HAS_TRAJECTORY = 0x00000002,
80  CAST_FLAG_UNKNOWN_3 = 0x00000004,
81  CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual
82  CAST_FLAG_UNKNOWN_5 = 0x00000010,
83  CAST_FLAG_PROJECTILE = 0x00000020,
84  CAST_FLAG_UNKNOWN_7 = 0x00000040,
85  CAST_FLAG_UNKNOWN_8 = 0x00000080,
86  CAST_FLAG_UNKNOWN_9 = 0x00000100,
87  CAST_FLAG_UNKNOWN_10 = 0x00000200,
88  CAST_FLAG_UNKNOWN_11 = 0x00000400,
89  CAST_FLAG_POWER_LEFT_SELF = 0x00000800,
90  CAST_FLAG_UNKNOWN_13 = 0x00001000,
91  CAST_FLAG_UNKNOWN_14 = 0x00002000,
92  CAST_FLAG_UNKNOWN_15 = 0x00004000,
93  CAST_FLAG_UNKNOWN_16 = 0x00008000,
94  CAST_FLAG_UNKNOWN_17 = 0x00010000,
95  CAST_FLAG_ADJUST_MISSILE = 0x00020000,
96  CAST_FLAG_NO_GCD = 0x00040000, // no GCD for spell casts from charm/summon (vehicle spells is an example)
97  CAST_FLAG_VISUAL_CHAIN = 0x00080000,
98  CAST_FLAG_UNKNOWN_21 = 0x00100000,
99  CAST_FLAG_RUNE_LIST = 0x00200000,
100  CAST_FLAG_UNKNOWN_23 = 0x00400000,
101  CAST_FLAG_UNKNOWN_24 = 0x00800000,
102  CAST_FLAG_UNKNOWN_25 = 0x01000000,
103  CAST_FLAG_UNKNOWN_26 = 0x02000000,
104  CAST_FLAG_IMMUNITY = 0x04000000,
105  CAST_FLAG_UNKNOWN_28 = 0x08000000,
106  CAST_FLAG_UNKNOWN_29 = 0x10000000,
107  CAST_FLAG_UNKNOWN_30 = 0x20000000,
108  CAST_FLAG_HEAL_PREDICTION = 0x40000000,
109  CAST_FLAG_UNKNOWN_32 = 0x80000000
110 };
Definition: Spell.h:86
Definition: Spell.h:97
Definition: Spell.h:93
Definition: Spell.h:80
Definition: Spell.h:96
Definition: Spell.h:81
Definition: Spell.h:85
Definition: Spell.h:89
Definition: Spell.h:84
Definition: Spell.h:82
Definition: Spell.h:101
Definition: Spell.h:95
Definition: Spell.h:79
Definition: Spell.h:98
Definition: Spell.h:103
Definition: Spell.h:104
Definition: Spell.h:94
Definition: Spell.h:105
Definition: Spell.h:91
Definition: Spell.h:109
Definition: Spell.h:78
Definition: Spell.h:100
Definition: Spell.h:90
Definition: Spell.h:77
Definition: Spell.h:88
Definition: Spell.h:107
Definition: Spell.h:102
Definition: Spell.h:106
Definition: Spell.h:92
Definition: Spell.h:108
Definition: Spell.h:99
Definition: Spell.h:83
Definition: Spell.h:87

◆ SpellCastFlagsEx

Enumerator
CAST_FLAG_EX_NONE 
CAST_FLAG_EX_UNKNOWN_1 
CAST_FLAG_EX_UNKNOWN_2 
CAST_FLAG_EX_UNKNOWN_3 
CAST_FLAG_EX_UNKNOWN_4 
CAST_FLAG_EX_UNKNOWN_5 
CAST_FLAG_EX_UNKNOWN_6 
CAST_FLAG_EX_UNKNOWN_7 
CAST_FLAG_EX_UNKNOWN_8 
CAST_FLAG_EX_UNKNOWN_9 
CAST_FLAG_EX_IGNORE_COOLDOWN 
CAST_FLAG_EX_UNKNOWN_11 
CAST_FLAG_EX_UNKNOWN_12 
CAST_FLAG_EX_UNKNOWN_13 
CAST_FLAG_EX_UNKNOWN_14 
CAST_FLAG_EX_UNKNOWN_15 
CAST_FLAG_EX_USE_TOY_SPELL 
CAST_FLAG_EX_UNKNOWN_17 
CAST_FLAG_EX_UNKNOWN_18 
CAST_FLAG_EX_UNKNOWN_19 
CAST_FLAG_EX_UNKNOWN_20 
113 {
114  CAST_FLAG_EX_NONE = 0x00000,
115  CAST_FLAG_EX_UNKNOWN_1 = 0x00001,
116  CAST_FLAG_EX_UNKNOWN_2 = 0x00002,
117  CAST_FLAG_EX_UNKNOWN_3 = 0x00004,
118  CAST_FLAG_EX_UNKNOWN_4 = 0x00008,
119  CAST_FLAG_EX_UNKNOWN_5 = 0x00010,
120  CAST_FLAG_EX_UNKNOWN_6 = 0x00020,
121  CAST_FLAG_EX_UNKNOWN_7 = 0x00040,
122  CAST_FLAG_EX_UNKNOWN_8 = 0x00080,
123  CAST_FLAG_EX_UNKNOWN_9 = 0x00100,
124  CAST_FLAG_EX_IGNORE_COOLDOWN = 0x00200, // makes client not automatically start cooldown after SPELL_GO
125  CAST_FLAG_EX_UNKNOWN_11 = 0x00400,
126  CAST_FLAG_EX_UNKNOWN_12 = 0x00800,
127  CAST_FLAG_EX_UNKNOWN_13 = 0x01000,
128  CAST_FLAG_EX_UNKNOWN_14 = 0x02000,
129  CAST_FLAG_EX_UNKNOWN_15 = 0x04000,
130  CAST_FLAG_EX_USE_TOY_SPELL = 0x08000, // Starts cooldown on toy
131  CAST_FLAG_EX_UNKNOWN_17 = 0x10000,
132  CAST_FLAG_EX_UNKNOWN_18 = 0x20000,
133  CAST_FLAG_EX_UNKNOWN_19 = 0x40000,
134  CAST_FLAG_EX_UNKNOWN_20 = 0x80000
135 };
Definition: Spell.h:125
Definition: Spell.h:119
Definition: Spell.h:134
Definition: Spell.h:130
Definition: Spell.h:116
Definition: Spell.h:122
Definition: Spell.h:124
Definition: Spell.h:114
Definition: Spell.h:118
Definition: Spell.h:129
Definition: Spell.h:132
Definition: Spell.h:127
Definition: Spell.h:131
Definition: Spell.h:128
Definition: Spell.h:120
Definition: Spell.h:126
Definition: Spell.h:133
Definition: Spell.h:123
Definition: Spell.h:115
Definition: Spell.h:117
Definition: Spell.h:121

◆ SpellCastSource

Enumerator
SPELL_CAST_SOURCE_PLAYER 
SPELL_CAST_SOURCE_NORMAL 
SPELL_CAST_SOURCE_ITEM 
SPELL_CAST_SOURCE_PASSIVE 
SPELL_CAST_SOURCE_PET 
SPELL_CAST_SOURCE_AURA 
SPELL_CAST_SOURCE_SPELL 
137  : uint8
138 {
146 };
Definition: Spell.h:144
Definition: Spell.h:145
Definition: Spell.h:142
Definition: Spell.h:143
Definition: Spell.h:139
uint8_t uint8
Definition: Define.h:145
Definition: Spell.h:140
Definition: Spell.h:141

◆ SpellEffectHandleMode

Enumerator
SPELL_EFFECT_HANDLE_LAUNCH 
SPELL_EFFECT_HANDLE_LAUNCH_TARGET 
SPELL_EFFECT_HANDLE_HIT 
SPELL_EFFECT_HANDLE_HIT_TARGET 

◆ SpellRangeFlag

Enumerator
SPELL_RANGE_DEFAULT 
SPELL_RANGE_MELEE 
SPELL_RANGE_RANGED 
149 {
151  SPELL_RANGE_MELEE = 1, //melee
152  SPELL_RANGE_RANGED = 2 //hunter range and ranged weapon
153 };
Definition: Spell.h:151
Definition: Spell.h:150
Definition: Spell.h:152

◆ SpellState

enum SpellState
Enumerator
SPELL_STATE_NULL 
SPELL_STATE_PREPARING 
SPELL_STATE_CASTING 
SPELL_STATE_FINISHED 
SPELL_STATE_IDLE 
SPELL_STATE_DELAYED 
217 {
218  SPELL_STATE_NULL = 0,
222  SPELL_STATE_IDLE = 4,
224 };
Definition: Spell.h:218
Definition: Spell.h:222
Definition: Spell.h:223
Definition: Spell.h:220
Definition: Spell.h:219
Definition: Spell.h:221

Variable Documentation

◆ SPELL_INTERRUPT_NONPLAYER

const uint32 SPELL_INTERRUPT_NONPLAYER = 32747
static