TrinityCore
SpellDefines.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore 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 TRINITY_SPELLDEFINES_H
19#define TRINITY_SPELLDEFINES_H
20
21#include "Define.h"
22#include "FlagsArray.h"
23#include "EnumFlag.h"
24#include "ObjectGuid.h"
25#include "Optional.h"
26#include "Position.h"
27#include "ScriptActionResult.h"
28#include <any>
29#include <vector>
30
31class AuraEffect;
32class Corpse;
33class GameObject;
34class Item;
35class Player;
36class Spell;
37class Unit;
38class WorldObject;
39enum Difficulty : uint8;
40enum ProcFlags : uint32;
41enum ProcFlags2 : int32;
43
44namespace UF
45{
46 struct SpellCastVisual;
47}
48
49namespace WorldPackets
50{
51 namespace Spells
52 {
53 struct SpellCastRequest;
54 struct SpellCastVisual;
55 struct SpellTargetData;
56 }
57}
58
60{
61 None = 0,
62 Movement = 0x00000001,
63 DamagePushbackPlayerOnly = 0x00000002,
64 Stun = 0x00000004, // useless, even spells without it get interrupted
65 Combat = 0x00000008,
66 DamageCancelsPlayerOnly = 0x00000010,
67 MeleeCombat = 0x00000020, // NYI
68 Immunity = 0x00000040, // NYI
69 DamageAbsorb = 0x00000080,
70 ZeroDamageCancels = 0x00000100,
71 DamagePushback = 0x00000200,
72 DamageCancels = 0x00000400
73};
74
76
78{
79 None = 0,
80 HostileActionReceived = 0x00000001,
81 Damage = 0x00000002,
82 Action = 0x00000004,
83 Moving = 0x00000008,
84 Turning = 0x00000010,
85 Anim = 0x00000020,
86 Dismount = 0x00000040,
87 UnderWater = 0x00000080, // TODO: disallow casting when swimming (SPELL_FAILED_ONLY_ABOVEWATER)
88 AboveWater = 0x00000100, // TODO: disallow casting when not swimming (SPELL_FAILED_ONLY_UNDERWATER)
89 Sheathing = 0x00000200,
90 Interacting = 0x00000400, // TODO: more than gossip, replace all the feign death removals by aura type
91 Looting = 0x00000800,
92 Attacking = 0x00001000,
93 ItemUse = 0x00002000,
94 DamageChannelDuration = 0x00004000,
95 Shapeshifting = 0x00008000,
96 ActionDelayed = 0x00010000,
97 Mount = 0x00020000,
98 Standing = 0x00040000,
99 LeaveWorld = 0x00080000,
100 StealthOrInvis = 0x00100000,
101 InvulnerabilityBuff = 0x00200000,
102 EnterWorld = 0x00400000,
103 PvPActive = 0x00800000,
104 NonPeriodicDamage = 0x01000000,
105 LandingOrFlight = 0x02000000,
106 Release = 0x04000000,
107 DamageCancelsScript = 0x08000000, // NYI dedicated aura script hook
108 EnteringCombat = 0x10000000,
109 Login = 0x20000000,
110 Summon = 0x40000000,
111 LeavingCombat = 0x80000000,
112
114};
115
117
119{
120 None = 0,
121 Falling = 0x00000001, // Implemented in Unit::UpdatePosition
122 Swimming = 0x00000002,
123 NotMoving = 0x00000004, // NYI
124 Ground = 0x00000008,
125 Transform = 0x00000010, // NYI
126 Jump = 0x00000020,
127 ChangeSpec = 0x00000040,
128 AbandonVehicle = 0x00000080, // Implemented in Unit::_ExitVehicle
129 StartOfRaidEncounterAndStartOfMythicPlus = 0x00000100, // Implemented in Unit::AtStartOfEncounter
130 EndOfRaidEncounterAndStartOfMythicPlus = 0x00000200, // Implemented in Unit::AtEndOfEncounter
131 Disconnect = 0x00000400, // NYI
132 EnteringInstance = 0x00000800, // Implemented in Map::AddPlayerToMap
133 DuelEnd = 0x00001000, // Implemented in Player::DuelComplete
134 LeaveArenaOrBattleground = 0x00002000, // Implemented in Battleground::RemovePlayerAtLeave
135 ChangeTalent = 0x00004000,
136 ChangeGlyph = 0x00008000,
137 SeamlessTransfer = 0x00010000, // NYI
138 WarModeLeave = 0x00020000, // Implemented in Player::UpdateWarModeAuras
139 TouchingGround = 0x00040000, // NYI
140 ChromieTime = 0x00080000, // NYI
141 SplineFlightOrFreeFlight = 0x00100000, // NYI
142 ProcOrPeriodicAttacking = 0x00200000, // NYI
143 ChallengeModeStart = 0x00400000, // Implemented in Unit::AtStartOfEncounter
144 StartOfEncounter = 0x00800000, // Implemented in Unit::AtStartOfEncounter
145 EndOfEncounter = 0x01000000, // Implemented in Unit::AtEndOfEncounter
146 ReleaseEmpower = 0x02000000, // Implemented in Spell::update
147};
148
150
151enum class SpellModOp : uint8
152{
154 Duration = 1,
155 Hate = 2,
156 PointsIndex0 = 3,
157 ProcCharges = 4,
158 Range = 5,
159 Radius = 6,
160 CritChance = 7,
161 Points = 8,
162 ResistPushback = 9,
163 ChangeCastTime = 10,
164 Cooldown = 11,
165 PointsIndex1 = 12,
166 TargetResistance = 13,
167 PowerCost0 = 14, // Used when SpellPowerEntry::PowerIndex == 0
169 HitChance = 16,
170 ChainTargets = 17,
171 ProcChance = 18,
172 Period = 19,
173 ChainAmplitude = 20,
174 StartCooldown = 21,
176 PointsIndex2 = 23,
177 BonusCoefficient = 24,
178 TriggerDamage = 25, // NYI
179 ProcFrequency = 26,
180 Amplitude = 27,
181 DispelResistance = 28,
182 CrowdDamage = 29, // NYI
183 PowerCostOnMiss = 30,
184 Doses = 31,
185 PointsIndex3 = 32,
186 PointsIndex4 = 33,
187 PowerCost1 = 34, // Used when SpellPowerEntry::PowerIndex == 1
189 AreaTriggerMaxSummons = 36, // NYI
190 MaxAuraStacks = 37,
191 ProcCooldown = 38,
192 PowerCost2 = 39, // Used when SpellPowerEntry::PowerIndex == 2
193};
194
195#define MAX_SPELLMOD 40
196
198{
231
233
239
242
244{
248};
249
251{
254
256{
257 TRIGGERED_NONE = 0x00000000,
258 TRIGGERED_IGNORE_GCD = 0x00000001,
269 // reuse = 0x00000800,
272 // reuse = 0x00004000,
273 // reuse = 0x00008000,
277 TRIGGERED_FULL_MASK = 0x0007FFFF,
278
279 // debug flags (used with .cast triggered commands)
283 TRIGGERED_FULL_DEBUG_MASK = 0xFFFFFFFF
285
287
289{
290 TARGET_FLAG_NONE = 0x00000000,
291 TARGET_FLAG_UNUSED_1 = 0x00000001, // not used
292 TARGET_FLAG_UNIT = 0x00000002, // pguid
293 TARGET_FLAG_UNIT_RAID = 0x00000004, // not sent, used to validate target (if raid member)
294 TARGET_FLAG_UNIT_PARTY = 0x00000008, // not sent, used to validate target (if party member)
295 TARGET_FLAG_ITEM = 0x00000010, // pguid
296 TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // pguid, 3 float
297 TARGET_FLAG_DEST_LOCATION = 0x00000040, // pguid, 3 float
298 TARGET_FLAG_UNIT_ENEMY = 0x00000080, // not sent, used to validate target (if enemy)
299 TARGET_FLAG_UNIT_ALLY = 0x00000100, // not sent, used to validate target (if ally)
300 TARGET_FLAG_CORPSE_ENEMY = 0x00000200, // pguid
301 TARGET_FLAG_UNIT_DEAD = 0x00000400, // not sent, used to validate target (if dead creature)
302 TARGET_FLAG_GAMEOBJECT = 0x00000800, // pguid, used with TARGET_GAMEOBJECT_TARGET
303 TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid
304 TARGET_FLAG_STRING = 0x00002000, // string
305 TARGET_FLAG_GAMEOBJECT_ITEM = 0x00004000, // not sent, used with TARGET_GAMEOBJECT_ITEM_TARGET
306 TARGET_FLAG_CORPSE_ALLY = 0x00008000, // pguid
307 TARGET_FLAG_UNIT_MINIPET = 0x00010000, // pguid, used to validate target (if non combat pet)
308 TARGET_FLAG_GLYPH_SLOT = 0x00020000, // used in glyph spells
309 TARGET_FLAG_DEST_TARGET = 0x00040000, // sometimes appears with DEST_TARGET spells (may appear or not for a given spell)
310 TARGET_FLAG_EXTRA_TARGETS = 0x00080000, // uint32 counter, loop { vec3 - screen position (?), guid }, not used so far
311 TARGET_FLAG_UNIT_PASSENGER = 0x00100000, // guessed, used to validate target (if vehicle passenger)
317
324
326{
328 SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID);
329 SpellDestination(Position const& pos);
331 SpellDestination(WorldObject const& wObj);
332
333 void Relocate(Position const& pos);
334 void RelocateOffset(Position const& offset);
335
339};
340
342{
343public:
345 SpellCastTargets(Unit* caster, WorldPackets::Spells::SpellCastRequest const& spellCastRequest);
347
349
350 uint32 GetTargetMask() const { return m_targetMask; }
351 void SetTargetMask(uint32 newMask) { m_targetMask = newMask; }
352
353 void SetTargetFlag(SpellCastTargetFlags flag) { m_targetMask |= flag; }
354
355 ObjectGuid GetUnitTargetGUID() const;
356 Unit* GetUnitTarget() const;
357 void SetUnitTarget(Unit* target);
358
359 ObjectGuid GetGOTargetGUID() const;
360 GameObject* GetGOTarget() const;
361 void SetGOTarget(GameObject* target);
362
363 ObjectGuid GetCorpseTargetGUID() const;
364 Corpse* GetCorpseTarget() const;
365
366 WorldObject* GetObjectTarget() const;
367 ObjectGuid GetObjectTargetGUID() const;
368 void RemoveObjectTarget();
369
370 ObjectGuid GetItemTargetGUID() const { return m_itemTargetGUID; }
371 Item* GetItemTarget() const { return m_itemTarget; }
372 uint32 GetItemTargetEntry() const { return m_itemTargetEntry; }
373 void SetItemTarget(Item* item);
374 void SetTradeItemTarget(Player* caster);
375 void UpdateTradeSlotItem();
376
377 SpellDestination const* GetSrc() const;
378 Position const* GetSrcPos() const;
379 void SetSrc(float x, float y, float z);
380 void SetSrc(Position const& pos);
381 void SetSrc(WorldObject const& wObj);
382 void ModSrc(Position const& pos);
383 void RemoveSrc();
384
385 SpellDestination const* GetDst() const;
386 WorldLocation const* GetDstPos() const;
387 void SetDst(float x, float y, float z, float orientation, uint32 mapId = MAPID_INVALID);
388 void SetDst(Position const& pos);
389 void SetDst(WorldObject const& wObj);
390 void SetDst(SpellDestination const& spellDest);
391 void SetDst(SpellCastTargets const& spellTargets);
392 void ModDst(Position const& pos);
393 void ModDst(SpellDestination const& spellDest);
394 void RemoveDst();
395
396 bool HasSrc() const;
397 bool HasDst() const;
398 bool HasTraj() const { return m_speed != 0; }
399
400 float GetPitch() const { return m_pitch; }
401 void SetPitch(float pitch) { m_pitch = pitch; }
402 float GetSpeed() const { return m_speed; }
403 void SetSpeed(float speed) { m_speed = speed; }
404
405 float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); }
406 float GetSpeedXY() const { return m_speed * std::cos(m_pitch); }
407 float GetSpeedZ() const { return m_speed * std::sin(m_pitch); }
408
409 void Update(WorldObject* caster);
410 std::string GetTargetString() const { return m_strTarget; }
411
412private:
414
415 // objects (can be used at spell creating and after Update at casting)
418
419 // object GUID/etc, can be used always
423
426
427 float m_pitch, m_speed;
428 std::string m_strTarget;
429};
430
432{
434 CastSpellTargetArg(std::nullptr_t) { Targets.emplace(); }
437 {
438 Targets.emplace();
439 Targets->SetItemTarget(itemTarget);
440 }
442 {
443 Targets.emplace();
444 Targets->SetDst(dest);
445 }
447 {
448 Targets.emplace();
449 Targets->SetDst(dest);
450 }
452 {
453 Targets.emplace(std::move(targets));
454 }
455
456 Optional<SpellCastTargets> Targets; // empty optional used to signal error state
457};
458
460{
463 Item* CastItem = nullptr;
464 Spell const* TriggeringSpell = nullptr;
465 AuraEffect const* TriggeringAura = nullptr;
470 {
471 SpellValueOverride(SpellValueMod mod, int32 val) : Type(mod) { Value.I = val; }
472 SpellValueOverride(SpellValueModFloat mod, float val) : Type(mod) { Value.F = val; }
473
475 union
476 {
477 float F;
480 };
481 std::vector<SpellValueOverride> SpellValueOverrides;
482 std::any CustomArg;
485};
486
488{
490 CastSpellExtraArgs(bool triggered) { TriggerFlags = triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE; }
491 CastSpellExtraArgs(TriggerCastFlags trigger) { TriggerFlags = trigger; }
492 CastSpellExtraArgs(Item* item) { TriggerFlags = TRIGGERED_FULL_MASK; CastItem = item; }
493 CastSpellExtraArgs(Spell const* triggeringSpell) { TriggerFlags = TRIGGERED_FULL_MASK; SetTriggeringSpell(triggeringSpell); }
494 CastSpellExtraArgs(AuraEffect const* eff) { TriggerFlags = TRIGGERED_FULL_MASK; SetTriggeringAura(eff); }
495 CastSpellExtraArgs(Difficulty castDifficulty) { CastDifficulty = castDifficulty; }
496 CastSpellExtraArgs(SpellValueMod mod, int32 val) { SpellValueOverrides.emplace_back(mod, val); }
497 CastSpellExtraArgs(SpellValueModFloat mod, float val) { SpellValueOverrides.emplace_back(mod, val); }
498 CastSpellExtraArgs(CastSpellExtraArgsInit&& init) : CastSpellExtraArgsInit(std::move(init)) { SetTriggeringSpell(TriggeringSpell); }
499
502
505
507
508 CastSpellExtraArgs& SetTriggerFlags(TriggerCastFlags flag) { TriggerFlags = flag; return *this; }
509 CastSpellExtraArgs& SetCastItem(Item* item) { CastItem = item; return *this; }
510 CastSpellExtraArgs& SetTriggeringSpell(Spell const* triggeringSpell);
511 CastSpellExtraArgs& SetTriggeringAura(AuraEffect const* triggeringAura) { TriggeringAura = triggeringAura; return *this; }
512 CastSpellExtraArgs& SetOriginalCaster(ObjectGuid const& guid) { OriginalCaster = guid; return *this; }
513 CastSpellExtraArgs& SetCastDifficulty(Difficulty castDifficulty) { CastDifficulty = castDifficulty; return *this; }
514 CastSpellExtraArgs& SetOriginalCastId(ObjectGuid const& castId) { OriginalCastId = castId; return *this; }
515 CastSpellExtraArgs& AddSpellMod(SpellValueMod mod, int32 val) { SpellValueOverrides.emplace_back(mod, val); return *this; }
516 CastSpellExtraArgs& AddSpellMod(SpellValueModFloat mod, float val) { SpellValueOverrides.emplace_back(mod, val); return *this; }
517 CastSpellExtraArgs& AddSpellBP0(int32 val) { return AddSpellMod(SPELLVALUE_BASE_POINT0, val); } // because i don't want to type SPELLVALUE_BASE_POINT0 300 times
518 CastSpellExtraArgs& SetCustomArg(std::any customArg) { CustomArg = std::move(customArg); return *this; }
519 CastSpellExtraArgs& SetScriptResult(Scripting::v2::ActionResultSetter<SpellCastResult> scriptResult) { ScriptResult.emplace(std::move(scriptResult)); return *this; }
520 CastSpellExtraArgs& SetScriptWaitsForSpellHit(bool scriptWaitsForSpellHit) { ScriptWaitsForSpellHit = scriptWaitsForSpellHit; return *this; }
521};
522
524{
527
528 operator UF::SpellCastVisual() const;
530};
531
532class ProcFlagsInit : public FlagsArray<int32, 2>
533{
535
536public:
537 constexpr ProcFlagsInit(ProcFlags procFlags = {}, ProcFlags2 procFlags2 = {})
538 {
539 _storage[0] = int32(procFlags);
540 _storage[1] = int32(procFlags2);
541 }
542
543 constexpr ProcFlagsInit& operator|=(ProcFlags procFlags)
544 {
545 _storage[0] |= int32(procFlags);
546 return *this;
547 }
548
549 constexpr ProcFlagsInit& operator|=(ProcFlags2 procFlags2)
550 {
551 _storage[1] |= int32(procFlags2);
552 return *this;
553 }
554
555 using Base::operator&;
556
557 constexpr ProcFlags operator&(ProcFlags procFlags) const
558 {
559 return static_cast<ProcFlags>(_storage[0] & procFlags);
560 }
561
562 constexpr ProcFlags2 operator&(ProcFlags2 procFlags2) const
563 {
564 return static_cast<ProcFlags2>(_storage[1] & procFlags2);
565 }
566
567 using Base::operator=;
568
569 constexpr ProcFlagsInit& operator=(Base const& right)
570 {
571 _storage[0] = right[0];
572 _storage[1] = right[1];
573 return *this;
574 }
575};
576
577#endif
Difficulty
Definition: DBCEnums.h:918
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
Spells
Definition: PlayerAI.cpp:32
#define MAPID_INVALID
Definition: Position.h:188
Targets
Anim
SpellCastResult
SpellValueMod
Definition: SpellDefines.h:198
@ SPELLVALUE_BASE_POINT24
Definition: SpellDefines.h:223
@ SPELLVALUE_BASE_POINT5
Definition: SpellDefines.h:204
@ SPELLVALUE_BASE_POINT18
Definition: SpellDefines.h:217
@ SPELLVALUE_BASE_POINT6
Definition: SpellDefines.h:205
@ SPELLVALUE_BASE_POINT31
Definition: SpellDefines.h:230
@ SPELLVALUE_BASE_POINT8
Definition: SpellDefines.h:207
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:235
@ SPELLVALUE_INT_END
Definition: SpellDefines.h:240
@ SPELLVALUE_BASE_POINT26
Definition: SpellDefines.h:225
@ SPELLVALUE_BASE_POINT7
Definition: SpellDefines.h:206
@ SPELLVALUE_BASE_POINT3
Definition: SpellDefines.h:202
@ SPELLVALUE_BASE_POINT30
Definition: SpellDefines.h:229
@ SPELLVALUE_BASE_POINT_END
Definition: SpellDefines.h:232
@ SPELLVALUE_BASE_POINT29
Definition: SpellDefines.h:228
@ SPELLVALUE_BASE_POINT1
Definition: SpellDefines.h:200
@ SPELLVALUE_BASE_POINT19
Definition: SpellDefines.h:218
@ SPELLVALUE_BASE_POINT28
Definition: SpellDefines.h:227
@ SPELLVALUE_BASE_POINT14
Definition: SpellDefines.h:213
@ SPELLVALUE_BASE_POINT21
Definition: SpellDefines.h:220
@ SPELLVALUE_BASE_POINT16
Definition: SpellDefines.h:215
@ SPELLVALUE_BASE_POINT27
Definition: SpellDefines.h:226
@ SPELLVALUE_PARENT_SPELL_TARGET_COUNT
Definition: SpellDefines.h:237
@ SPELLVALUE_BASE_POINT20
Definition: SpellDefines.h:219
@ SPELLVALUE_BASE_POINT17
Definition: SpellDefines.h:216
@ SPELLVALUE_BASE_POINT22
Definition: SpellDefines.h:221
@ SPELLVALUE_BASE_POINT11
Definition: SpellDefines.h:210
@ SPELLVALUE_PARENT_SPELL_TARGET_INDEX
Definition: SpellDefines.h:238
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:234
@ SPELLVALUE_BASE_POINT15
Definition: SpellDefines.h:214
@ SPELLVALUE_BASE_POINT25
Definition: SpellDefines.h:224
@ SPELLVALUE_BASE_POINT4
Definition: SpellDefines.h:203
@ SPELLVALUE_BASE_POINT2
Definition: SpellDefines.h:201
@ SPELLVALUE_BASE_POINT23
Definition: SpellDefines.h:222
@ SPELLVALUE_BASE_POINT13
Definition: SpellDefines.h:212
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:199
@ SPELLVALUE_DURATION
Definition: SpellDefines.h:236
@ SPELLVALUE_BASE_POINT10
Definition: SpellDefines.h:209
@ SPELLVALUE_BASE_POINT9
Definition: SpellDefines.h:208
@ SPELLVALUE_BASE_POINT12
Definition: SpellDefines.h:211
SpellInterruptFlags
Definition: SpellDefines.h:60
DEFINE_ENUM_FLAG(SpellInterruptFlags)
SpellAuraInterruptFlags2
Definition: SpellDefines.h:119
SpellModOp
Definition: SpellDefines.h:152
@ PeriodicHealingAndDamage
@ AreaTriggerMaxSummons
@ CritDamageAndHealing
SpellCastTargetFlags
Definition: SpellDefines.h:289
@ TARGET_FLAG_TRADE_ITEM
Definition: SpellDefines.h:303
@ TARGET_FLAG_GAMEOBJECT
Definition: SpellDefines.h:302
@ TARGET_FLAG_STRING
Definition: SpellDefines.h:304
@ TARGET_FLAG_NONE
Definition: SpellDefines.h:290
@ TARGET_FLAG_UNIT_RAID
Definition: SpellDefines.h:293
@ TARGET_FLAG_UNIT_ENEMY
Definition: SpellDefines.h:298
@ TARGET_FLAG_GLYPH_SLOT
Definition: SpellDefines.h:308
@ TARGET_FLAG_CORPSE_ALLY
Definition: SpellDefines.h:306
@ TARGET_FLAG_ITEM
Definition: SpellDefines.h:295
@ TARGET_FLAG_UNIT_MINIPET
Definition: SpellDefines.h:307
@ TARGET_FLAG_UNIT_PASSENGER
Definition: SpellDefines.h:311
@ TARGET_FLAG_GAMEOBJECT_ITEM
Definition: SpellDefines.h:305
@ TARGET_FLAG_DEST_LOCATION
Definition: SpellDefines.h:297
@ TARGET_FLAG_UNK4000000
Definition: SpellDefines.h:314
@ TARGET_FLAG_UNIT_ALLY
Definition: SpellDefines.h:299
@ TARGET_FLAG_SOURCE_LOCATION
Definition: SpellDefines.h:296
@ TARGET_FLAG_ITEM_MASK
Definition: SpellDefines.h:322
@ TARGET_FLAG_UNK1000000
Definition: SpellDefines.h:313
@ TARGET_FLAG_UNUSED_1
Definition: SpellDefines.h:291
@ TARGET_FLAG_UNK40000000
Definition: SpellDefines.h:316
@ TARGET_FLAG_UNIT
Definition: SpellDefines.h:292
@ TARGET_FLAG_DEST_TARGET
Definition: SpellDefines.h:309
@ TARGET_FLAG_UNK10000000
Definition: SpellDefines.h:315
@ TARGET_FLAG_UNK400000
Definition: SpellDefines.h:312
@ TARGET_FLAG_UNIT_MASK
Definition: SpellDefines.h:318
@ TARGET_FLAG_UNIT_DEAD
Definition: SpellDefines.h:301
@ TARGET_FLAG_CORPSE_ENEMY
Definition: SpellDefines.h:300
@ TARGET_FLAG_CORPSE_MASK
Definition: SpellDefines.h:321
@ TARGET_FLAG_EXTRA_TARGETS
Definition: SpellDefines.h:310
@ TARGET_FLAG_GAMEOBJECT_MASK
Definition: SpellDefines.h:320
@ TARGET_FLAG_UNIT_PARTY
Definition: SpellDefines.h:294
TriggerCastFlags
Definition: SpellDefines.h:256
@ TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT
Will ignore equipped item requirements.
Definition: SpellDefines.h:280
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:277
@ TRIGGERED_DONT_RESET_PERIODIC_TIMER
Will allow periodic aura timers to keep ticking (instead of resetting)
Definition: SpellDefines.h:275
@ TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
Will ignore Spell and Category cooldowns.
Definition: SpellDefines.h:259
@ TRIGGERED_CAST_DIRECTLY
In Spell::prepare, will be cast directly without setting containers for executed spell.
Definition: SpellDefines.h:265
@ TRIGGERED_IGNORE_TARGET_CHECK
Will ignore most target checks (mostly DBC target checks)
Definition: SpellDefines.h:281
@ TRIGGERED_IGNORE_CASTER_AURASTATE
Will ignore caster aura states including combat requirements and death state.
Definition: SpellDefines.h:282
@ TRIGGERED_IGNORE_AURA_SCALING
Will ignore aura scaling.
Definition: SpellDefines.h:262
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
Definition: SpellDefines.h:263
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore mounted/on vehicle restrictions.
Definition: SpellDefines.h:271
@ TRIGGERED_IGNORE_SHAPESHIFT
Will ignore shapeshift checks.
Definition: SpellDefines.h:268
@ TRIGGERED_IGNORE_POWER_COST
Will ignore power and reagent cost.
Definition: SpellDefines.h:260
@ TRIGGERED_IGNORE_CAST_ITEM
Will not take away cast item or update related achievement criteria.
Definition: SpellDefines.h:261
@ TRIGGERED_IGNORE_REAGENT_COST
Will ignore reagent cost.
Definition: SpellDefines.h:266
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
Definition: SpellDefines.h:258
@ TRIGGERED_DISALLOW_PROC_EVENTS
Disallows proc events from triggered spell (default)
Definition: SpellDefines.h:270
@ TRIGGERED_IGNORE_CASTER_AURAS
Will ignore caster aura restrictions or requirements.
Definition: SpellDefines.h:274
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:276
@ TRIGGERED_NONE
Not triggered.
Definition: SpellDefines.h:257
@ TRIGGERED_IGNORE_CAST_TIME
Will always be instantly cast.
Definition: SpellDefines.h:264
@ TRIGGERED_FULL_DEBUG_MASK
Definition: SpellDefines.h:283
@ TRIGGERED_IGNORE_SET_FACING
Will not adjust facing to target (if any)
Definition: SpellDefines.h:267
SpellValueModFloat
Definition: SpellDefines.h:244
@ SPELLVALUE_DURATION_PCT
Definition: SpellDefines.h:247
@ SPELLVALUE_RADIUS_MOD
Definition: SpellDefines.h:245
@ SPELLVALUE_CRIT_CHANCE
Definition: SpellDefines.h:246
SpellFacingFlags
Definition: SpellDefines.h:251
@ SPELL_FACING_FLAG_INFRONT
Definition: SpellDefines.h:252
SpellAuraInterruptFlags
Definition: SpellDefines.h:78
ProcFlags
Definition: SpellMgr.h:135
ProcFlags2
Definition: SpellMgr.h:232
Action
Definition: Corpse.h:53
std::array< int32, N > _storage
Definition: FlagsArray.h:113
Definition: Item.h:171
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
constexpr ProcFlags operator&(ProcFlags procFlags) const
Definition: SpellDefines.h:557
constexpr ProcFlagsInit & operator|=(ProcFlags2 procFlags2)
Definition: SpellDefines.h:549
constexpr ProcFlagsInit(ProcFlags procFlags={}, ProcFlags2 procFlags2={})
Definition: SpellDefines.h:537
constexpr ProcFlagsInit & operator|=(ProcFlags procFlags)
Definition: SpellDefines.h:543
constexpr ProcFlagsInit & operator=(Base const &right)
Definition: SpellDefines.h:569
constexpr ProcFlags2 operator&(ProcFlags2 procFlags2) const
Definition: SpellDefines.h:562
void SetPitch(float pitch)
Definition: SpellDefines.h:401
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:420
SpellDestination m_dst
Definition: SpellDefines.h:425
bool HasTraj() const
Definition: SpellDefines.h:398
void SetSpeed(float speed)
Definition: SpellDefines.h:403
void SetTargetFlag(SpellCastTargetFlags flag)
Definition: SpellDefines.h:353
void SetTargetMask(uint32 newMask)
Definition: SpellDefines.h:351
std::string m_strTarget
Definition: SpellDefines.h:428
std::string GetTargetString() const
Definition: SpellDefines.h:410
SpellDestination m_src
Definition: SpellDefines.h:424
float GetSpeedZ() const
Definition: SpellDefines.h:407
float GetSpeed() const
Definition: SpellDefines.h:402
ObjectGuid GetItemTargetGUID() const
Definition: SpellDefines.h:370
WorldObject * m_objectTarget
Definition: SpellDefines.h:416
Item * GetItemTarget() const
Definition: SpellDefines.h:371
uint32 GetTargetMask() const
Definition: SpellDefines.h:350
uint32 GetItemTargetEntry() const
Definition: SpellDefines.h:372
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:421
float GetSpeedXY() const
Definition: SpellDefines.h:406
float GetDist2d() const
Definition: SpellDefines.h:405
uint32 m_itemTargetEntry
Definition: SpellDefines.h:422
float GetPitch() const
Definition: SpellDefines.h:400
Definition: Spell.h:262
Definition: Unit.h:630
Definition: Object.h:111
void Update(VignetteData &vignette, WorldObject const *owner)
Definition: Vignette.cpp:101
STL namespace.
SpellValueOverride(SpellValueModFloat mod, float val)
Definition: SpellDefines.h:472
union CastSpellExtraArgsInit::SpellValueOverride::@326 Value
SpellValueOverride(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:471
std::vector< SpellValueOverride > SpellValueOverrides
Definition: SpellDefines.h:481
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:461
Optional< Scripting::v2::ActionResultSetter< SpellCastResult > > ScriptResult
Definition: SpellDefines.h:483
Spell const * TriggeringSpell
Definition: SpellDefines.h:464
Optional< int32 > OriginalCastItemLevel
Definition: SpellDefines.h:468
AuraEffect const * TriggeringAura
Definition: SpellDefines.h:465
CastSpellExtraArgs(CastSpellExtraArgsInit &&init)
Definition: SpellDefines.h:498
CastSpellExtraArgs(Spell const *triggeringSpell)
Definition: SpellDefines.h:493
CastSpellExtraArgs(CastSpellExtraArgs const &other)
CastSpellExtraArgs(AuraEffect const *eff)
Definition: SpellDefines.h:494
CastSpellExtraArgs & SetCastDifficulty(Difficulty castDifficulty)
Definition: SpellDefines.h:513
CastSpellExtraArgs(SpellValueModFloat mod, float val)
Definition: SpellDefines.h:497
CastSpellExtraArgs & SetScriptWaitsForSpellHit(bool scriptWaitsForSpellHit)
Definition: SpellDefines.h:520
CastSpellExtraArgs & SetOriginalCastId(ObjectGuid const &castId)
Definition: SpellDefines.h:514
CastSpellExtraArgs(TriggerCastFlags trigger)
Definition: SpellDefines.h:491
CastSpellExtraArgs(Item *item)
Definition: SpellDefines.h:492
CastSpellExtraArgs(CastSpellExtraArgs &&other) noexcept
CastSpellExtraArgs & SetOriginalCaster(ObjectGuid const &guid)
Definition: SpellDefines.h:512
CastSpellExtraArgs & AddSpellMod(SpellValueModFloat mod, float val)
Definition: SpellDefines.h:516
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
Definition: SpellDefines.h:508
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:517
CastSpellExtraArgs & SetCustomArg(std::any customArg)
Definition: SpellDefines.h:518
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:515
CastSpellExtraArgs(Difficulty castDifficulty)
Definition: SpellDefines.h:495
CastSpellExtraArgs(bool triggered)
Definition: SpellDefines.h:490
CastSpellExtraArgs & operator=(CastSpellExtraArgs &&other) noexcept
CastSpellExtraArgs & SetCastItem(Item *item)
Definition: SpellDefines.h:509
CastSpellExtraArgs & operator=(CastSpellExtraArgs const &other)
CastSpellExtraArgs(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:496
CastSpellExtraArgs & SetTriggeringAura(AuraEffect const *triggeringAura)
Definition: SpellDefines.h:511
CastSpellExtraArgs & SetScriptResult(Scripting::v2::ActionResultSetter< SpellCastResult > scriptResult)
Definition: SpellDefines.h:519
CastSpellTargetArg(Item *itemTarget)
Definition: SpellDefines.h:436
CastSpellTargetArg(std::nullptr_t)
Definition: SpellDefines.h:434
Optional< SpellCastTargets > Targets
Definition: SpellDefines.h:456
CastSpellTargetArg(Position const &dest)
Definition: SpellDefines.h:441
CastSpellTargetArg(SpellDestination const &dest)
Definition: SpellDefines.h:446
CastSpellTargetArg(SpellCastTargets &&targets)
Definition: SpellDefines.h:451
uint32 ScriptVisualID
Definition: SpellDefines.h:526
uint32 SpellXSpellVisualID
Definition: SpellDefines.h:525
Position _transportOffset
Definition: SpellDefines.h:338
WorldLocation _position
Definition: SpellDefines.h:336
ObjectGuid _transportGUID
Definition: SpellDefines.h:337