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,
282
283 // debug flags (used with .cast triggered commands)
287 TRIGGERED_FULL_DEBUG_MASK = 0xFFFFFFFF
289
291
293{
294 TARGET_FLAG_NONE = 0x00000000,
295 TARGET_FLAG_UNUSED_1 = 0x00000001, // not used
296 TARGET_FLAG_UNIT = 0x00000002, // pguid
297 TARGET_FLAG_UNIT_RAID = 0x00000004, // not sent, used to validate target (if raid member)
298 TARGET_FLAG_UNIT_PARTY = 0x00000008, // not sent, used to validate target (if party member)
299 TARGET_FLAG_ITEM = 0x00000010, // pguid
300 TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // pguid, 3 float
301 TARGET_FLAG_DEST_LOCATION = 0x00000040, // pguid, 3 float
302 TARGET_FLAG_UNIT_ENEMY = 0x00000080, // not sent, used to validate target (if enemy)
303 TARGET_FLAG_UNIT_ALLY = 0x00000100, // not sent, used to validate target (if ally)
304 TARGET_FLAG_CORPSE_ENEMY = 0x00000200, // pguid
305 TARGET_FLAG_UNIT_DEAD = 0x00000400, // not sent, used to validate target (if dead creature)
306 TARGET_FLAG_GAMEOBJECT = 0x00000800, // pguid, used with TARGET_GAMEOBJECT_TARGET
307 TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid
308 TARGET_FLAG_STRING = 0x00002000, // string
309 TARGET_FLAG_GAMEOBJECT_ITEM = 0x00004000, // not sent, used with TARGET_GAMEOBJECT_ITEM_TARGET
310 TARGET_FLAG_CORPSE_ALLY = 0x00008000, // pguid
311 TARGET_FLAG_UNIT_MINIPET = 0x00010000, // pguid, used to validate target (if non combat pet)
312 TARGET_FLAG_GLYPH_SLOT = 0x00020000, // used in glyph spells
313 TARGET_FLAG_DEST_TARGET = 0x00040000, // sometimes appears with DEST_TARGET spells (may appear or not for a given spell)
314 TARGET_FLAG_EXTRA_TARGETS = 0x00080000, // uint32 counter, loop { vec3 - screen position (?), guid }, not used so far
315 TARGET_FLAG_UNIT_PASSENGER = 0x00100000, // guessed, used to validate target (if vehicle passenger)
321
328
330{
332 SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID) : _position(mapId, x, y, z, orientation) { }
333 SpellDestination(Position const& pos) : _position(MAPID_INVALID, pos) { }
334 SpellDestination(WorldLocation const& loc) : _position(loc) { }
335 SpellDestination(WorldObject const& wObj);
336
337 void Relocate(Position const& pos);
338 void RelocateOffset(Position const& offset);
339
343};
344
346{
347public:
349 SpellCastTargets(Unit* caster, WorldPackets::Spells::SpellCastRequest const& spellCastRequest);
351
353
354 uint32 GetTargetMask() const { return m_targetMask; }
355 void SetTargetMask(uint32 newMask) { m_targetMask = newMask; }
356
357 void SetTargetFlag(SpellCastTargetFlags flag) { m_targetMask |= flag; }
358
359 ObjectGuid GetUnitTargetGUID() const;
360 Unit* GetUnitTarget() const;
361 void SetUnitTarget(Unit* target);
362
363 ObjectGuid GetGOTargetGUID() const;
364 GameObject* GetGOTarget() const;
365 void SetGOTarget(GameObject* target);
366
367 ObjectGuid GetCorpseTargetGUID() const;
368 Corpse* GetCorpseTarget() const;
369
370 WorldObject* GetObjectTarget() const;
371 ObjectGuid GetObjectTargetGUID() const;
372 void RemoveObjectTarget();
373
374 ObjectGuid GetItemTargetGUID() const { return m_itemTargetGUID; }
375 Item* GetItemTarget() const { return m_itemTarget; }
376 uint32 GetItemTargetEntry() const { return m_itemTargetEntry; }
377 void SetItemTarget(Item* item);
378 void SetTradeItemTarget(Player* caster);
379 void UpdateTradeSlotItem();
380
381 SpellDestination const* GetSrc() const;
382 Position const* GetSrcPos() const;
383 void SetSrc(float x, float y, float z);
384 void SetSrc(Position const& pos);
385 void SetSrc(WorldObject const& wObj);
386 void ModSrc(Position const& pos);
387 void RemoveSrc();
388
389 SpellDestination const* GetDst() const;
390 WorldLocation const* GetDstPos() const;
391 void SetDst(float x, float y, float z, float orientation, uint32 mapId = MAPID_INVALID);
392 void SetDst(Position const& pos);
393 void SetDst(WorldObject const& wObj);
394 void SetDst(SpellDestination const& spellDest);
395 void SetDst(SpellCastTargets const& spellTargets);
396 void ModDst(Position const& pos);
397 void ModDst(SpellDestination const& spellDest);
398 void RemoveDst();
399
400 bool HasSrc() const;
401 bool HasDst() const;
402 bool HasTraj() const { return m_speed != 0; }
403
404 float GetPitch() const { return m_pitch; }
405 void SetPitch(float pitch) { m_pitch = pitch; }
406 float GetSpeed() const { return m_speed; }
407 void SetSpeed(float speed) { m_speed = speed; }
408
409 float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); }
410 float GetSpeedXY() const { return m_speed * std::cos(m_pitch); }
411 float GetSpeedZ() const { return m_speed * std::sin(m_pitch); }
412
413 void Update(WorldObject* caster);
414 std::string GetTargetString() const { return m_strTarget; }
415
416private:
418
419 // objects (can be used at spell creating and after Update at casting)
422
423 // object GUID/etc, can be used always
427
430
431 float m_pitch, m_speed;
432 std::string m_strTarget;
433};
434
436{
438 CastSpellTargetArg(std::nullptr_t) { Targets.emplace(); }
441 {
442 Targets.emplace();
443 Targets->SetItemTarget(itemTarget);
444 }
446 {
447 Targets.emplace();
448 Targets->SetDst(dest);
449 }
451 {
452 Targets.emplace();
453 Targets->SetDst(dest);
454 }
456 {
457 Targets.emplace(std::move(targets));
458 }
459
460 Optional<SpellCastTargets> Targets; // empty optional used to signal error state
461};
462
464{
467 Item* CastItem = nullptr;
468 Spell const* TriggeringSpell = nullptr;
469 AuraEffect const* TriggeringAura = nullptr;
474 {
475 SpellValueOverride(SpellValueMod mod, int32 val) : Type(mod) { Value.I = val; }
476 SpellValueOverride(SpellValueModFloat mod, float val) : Type(mod) { Value.F = val; }
477
479 union
480 {
481 float F;
484 };
485 std::vector<SpellValueOverride> SpellValueOverrides;
486 std::any CustomArg;
489};
490
492{
494 CastSpellExtraArgs(bool triggered) { TriggerFlags = triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE; }
495 CastSpellExtraArgs(TriggerCastFlags trigger) { TriggerFlags = trigger; }
496 CastSpellExtraArgs(Item* item) { TriggerFlags = TRIGGERED_FULL_MASK; CastItem = item; }
497 CastSpellExtraArgs(Spell const* triggeringSpell) { TriggerFlags = TRIGGERED_FULL_MASK; SetTriggeringSpell(triggeringSpell); }
498 CastSpellExtraArgs(AuraEffect const* eff) { TriggerFlags = TRIGGERED_FULL_MASK; SetTriggeringAura(eff); }
499 CastSpellExtraArgs(Difficulty castDifficulty) { CastDifficulty = castDifficulty; }
500 CastSpellExtraArgs(SpellValueMod mod, int32 val) { SpellValueOverrides.emplace_back(mod, val); }
501 CastSpellExtraArgs(SpellValueModFloat mod, float val) { SpellValueOverrides.emplace_back(mod, val); }
502 CastSpellExtraArgs(CastSpellExtraArgsInit&& init) : CastSpellExtraArgsInit(std::move(init)) { SetTriggeringSpell(TriggeringSpell); }
503
506
509
511
512 CastSpellExtraArgs& SetTriggerFlags(TriggerCastFlags flag) { TriggerFlags = flag; return *this; }
513 CastSpellExtraArgs& SetCastItem(Item* item) { CastItem = item; return *this; }
514 CastSpellExtraArgs& SetTriggeringSpell(Spell const* triggeringSpell);
515 CastSpellExtraArgs& SetTriggeringAura(AuraEffect const* triggeringAura) { TriggeringAura = triggeringAura; return *this; }
516 CastSpellExtraArgs& SetOriginalCaster(ObjectGuid const& guid) { OriginalCaster = guid; return *this; }
517 CastSpellExtraArgs& SetCastDifficulty(Difficulty castDifficulty) { CastDifficulty = castDifficulty; return *this; }
518 CastSpellExtraArgs& SetOriginalCastId(ObjectGuid const& castId) { OriginalCastId = castId; return *this; }
519 CastSpellExtraArgs& AddSpellMod(SpellValueMod mod, int32 val) { SpellValueOverrides.emplace_back(mod, val); return *this; }
520 CastSpellExtraArgs& AddSpellMod(SpellValueModFloat mod, float val) { SpellValueOverrides.emplace_back(mod, val); return *this; }
521 CastSpellExtraArgs& AddSpellBP0(int32 val) { return AddSpellMod(SPELLVALUE_BASE_POINT0, val); } // because i don't want to type SPELLVALUE_BASE_POINT0 300 times
522 CastSpellExtraArgs& SetCustomArg(std::any customArg) { CustomArg = std::move(customArg); return *this; }
523 CastSpellExtraArgs& SetScriptResult(Scripting::v2::ActionResultSetter<SpellCastResult> scriptResult) { ScriptResult.emplace(std::move(scriptResult)); return *this; }
524 CastSpellExtraArgs& SetScriptWaitsForSpellHit(bool scriptWaitsForSpellHit) { ScriptWaitsForSpellHit = scriptWaitsForSpellHit; return *this; }
525};
526
528{
531
532 operator UF::SpellCastVisual() const;
534};
535
536class ProcFlagsInit : public FlagsArray<int32, 2>
537{
539
540public:
541 constexpr ProcFlagsInit(ProcFlags procFlags = {}, ProcFlags2 procFlags2 = {})
542 {
543 _storage[0] = int32(procFlags);
544 _storage[1] = int32(procFlags2);
545 }
546
547 constexpr ProcFlagsInit& operator|=(ProcFlags procFlags)
548 {
549 _storage[0] |= int32(procFlags);
550 return *this;
551 }
552
553 constexpr ProcFlagsInit& operator|=(ProcFlags2 procFlags2)
554 {
555 _storage[1] |= int32(procFlags2);
556 return *this;
557 }
558
559 using Base::operator&;
560
561 constexpr ProcFlags operator&(ProcFlags procFlags) const
562 {
563 return static_cast<ProcFlags>(_storage[0] & procFlags);
564 }
565
566 constexpr ProcFlags2 operator&(ProcFlags2 procFlags2) const
567 {
568 return static_cast<ProcFlags2>(_storage[1] & procFlags2);
569 }
570
571 using Base::operator=;
572
573 constexpr ProcFlagsInit& operator=(Base const& right)
574 {
575 _storage[0] = right[0];
576 _storage[1] = right[1];
577 return *this;
578 }
579};
580
581#endif
Difficulty
Definition: DBCEnums.h:925
#define TC_GAME_API
Definition: Define.h:129
uint8_t uint8
Definition: Define.h:150
int32_t int32
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:148
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:293
@ TARGET_FLAG_TRADE_ITEM
Definition: SpellDefines.h:307
@ TARGET_FLAG_GAMEOBJECT
Definition: SpellDefines.h:306
@ TARGET_FLAG_STRING
Definition: SpellDefines.h:308
@ TARGET_FLAG_NONE
Definition: SpellDefines.h:294
@ TARGET_FLAG_UNIT_RAID
Definition: SpellDefines.h:297
@ TARGET_FLAG_UNIT_ENEMY
Definition: SpellDefines.h:302
@ TARGET_FLAG_GLYPH_SLOT
Definition: SpellDefines.h:312
@ TARGET_FLAG_CORPSE_ALLY
Definition: SpellDefines.h:310
@ TARGET_FLAG_ITEM
Definition: SpellDefines.h:299
@ TARGET_FLAG_UNIT_MINIPET
Definition: SpellDefines.h:311
@ TARGET_FLAG_UNIT_PASSENGER
Definition: SpellDefines.h:315
@ TARGET_FLAG_GAMEOBJECT_ITEM
Definition: SpellDefines.h:309
@ TARGET_FLAG_DEST_LOCATION
Definition: SpellDefines.h:301
@ TARGET_FLAG_UNK4000000
Definition: SpellDefines.h:318
@ TARGET_FLAG_UNIT_ALLY
Definition: SpellDefines.h:303
@ TARGET_FLAG_SOURCE_LOCATION
Definition: SpellDefines.h:300
@ TARGET_FLAG_ITEM_MASK
Definition: SpellDefines.h:326
@ TARGET_FLAG_UNK1000000
Definition: SpellDefines.h:317
@ TARGET_FLAG_UNUSED_1
Definition: SpellDefines.h:295
@ TARGET_FLAG_UNK40000000
Definition: SpellDefines.h:320
@ TARGET_FLAG_UNIT
Definition: SpellDefines.h:296
@ TARGET_FLAG_DEST_TARGET
Definition: SpellDefines.h:313
@ TARGET_FLAG_UNK10000000
Definition: SpellDefines.h:319
@ TARGET_FLAG_UNK400000
Definition: SpellDefines.h:316
@ TARGET_FLAG_UNIT_MASK
Definition: SpellDefines.h:322
@ TARGET_FLAG_UNIT_DEAD
Definition: SpellDefines.h:305
@ TARGET_FLAG_CORPSE_ENEMY
Definition: SpellDefines.h:304
@ TARGET_FLAG_CORPSE_MASK
Definition: SpellDefines.h:325
@ TARGET_FLAG_EXTRA_TARGETS
Definition: SpellDefines.h:314
@ TARGET_FLAG_GAMEOBJECT_MASK
Definition: SpellDefines.h:324
@ TARGET_FLAG_UNIT_PARTY
Definition: SpellDefines.h:298
TriggerCastFlags
Definition: SpellDefines.h:256
@ TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT
Will ignore equipped item requirements.
Definition: SpellDefines.h:284
@ 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:285
@ TRIGGERED_IGNORE_CASTER_AURASTATE
Will ignore caster aura states including combat requirements and death state.
Definition: SpellDefines.h:286
@ 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:287
@ TRIGGERED_IS_TRIGGERED_MASK
Will be recognized by Spell::IsTriggered as triggered.
Definition: SpellDefines.h:278
@ 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:91
ProcFlags2
Definition: SpellMgr.h:188
Action
Definition: Corpse.h:53
std::array< int32, N > _storage
Definition: FlagsArray.h:113
Definition: Item.h:163
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
constexpr ProcFlags operator&(ProcFlags procFlags) const
Definition: SpellDefines.h:561
constexpr ProcFlagsInit & operator|=(ProcFlags2 procFlags2)
Definition: SpellDefines.h:553
constexpr ProcFlagsInit(ProcFlags procFlags={}, ProcFlags2 procFlags2={})
Definition: SpellDefines.h:541
constexpr ProcFlagsInit & operator|=(ProcFlags procFlags)
Definition: SpellDefines.h:547
constexpr ProcFlagsInit & operator=(Base const &right)
Definition: SpellDefines.h:573
constexpr ProcFlags2 operator&(ProcFlags2 procFlags2) const
Definition: SpellDefines.h:566
void SetPitch(float pitch)
Definition: SpellDefines.h:405
ObjectGuid m_objectTargetGUID
Definition: SpellDefines.h:424
SpellDestination m_dst
Definition: SpellDefines.h:429
bool HasTraj() const
Definition: SpellDefines.h:402
void SetSpeed(float speed)
Definition: SpellDefines.h:407
void SetTargetFlag(SpellCastTargetFlags flag)
Definition: SpellDefines.h:357
void SetTargetMask(uint32 newMask)
Definition: SpellDefines.h:355
std::string m_strTarget
Definition: SpellDefines.h:432
std::string GetTargetString() const
Definition: SpellDefines.h:414
SpellDestination m_src
Definition: SpellDefines.h:428
float GetSpeedZ() const
Definition: SpellDefines.h:411
float GetSpeed() const
Definition: SpellDefines.h:406
ObjectGuid GetItemTargetGUID() const
Definition: SpellDefines.h:374
WorldObject * m_objectTarget
Definition: SpellDefines.h:420
Item * GetItemTarget() const
Definition: SpellDefines.h:375
uint32 GetTargetMask() const
Definition: SpellDefines.h:354
uint32 GetItemTargetEntry() const
Definition: SpellDefines.h:376
ObjectGuid m_itemTargetGUID
Definition: SpellDefines.h:425
float GetSpeedXY() const
Definition: SpellDefines.h:410
float GetDist2d() const
Definition: SpellDefines.h:409
uint32 m_itemTargetEntry
Definition: SpellDefines.h:426
float GetPitch() const
Definition: SpellDefines.h:404
Definition: Spell.h:262
Definition: Unit.h:632
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:476
union CastSpellExtraArgsInit::SpellValueOverride::@326 Value
SpellValueOverride(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:475
std::vector< SpellValueOverride > SpellValueOverrides
Definition: SpellDefines.h:485
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:465
Optional< Scripting::v2::ActionResultSetter< SpellCastResult > > ScriptResult
Definition: SpellDefines.h:487
Spell const * TriggeringSpell
Definition: SpellDefines.h:468
Optional< int32 > OriginalCastItemLevel
Definition: SpellDefines.h:472
AuraEffect const * TriggeringAura
Definition: SpellDefines.h:469
CastSpellExtraArgs(CastSpellExtraArgsInit &&init)
Definition: SpellDefines.h:502
CastSpellExtraArgs(Spell const *triggeringSpell)
Definition: SpellDefines.h:497
CastSpellExtraArgs(CastSpellExtraArgs const &other)
CastSpellExtraArgs(AuraEffect const *eff)
Definition: SpellDefines.h:498
CastSpellExtraArgs & SetCastDifficulty(Difficulty castDifficulty)
Definition: SpellDefines.h:517
CastSpellExtraArgs(SpellValueModFloat mod, float val)
Definition: SpellDefines.h:501
CastSpellExtraArgs & SetScriptWaitsForSpellHit(bool scriptWaitsForSpellHit)
Definition: SpellDefines.h:524
CastSpellExtraArgs & SetOriginalCastId(ObjectGuid const &castId)
Definition: SpellDefines.h:518
CastSpellExtraArgs(TriggerCastFlags trigger)
Definition: SpellDefines.h:495
CastSpellExtraArgs(Item *item)
Definition: SpellDefines.h:496
CastSpellExtraArgs(CastSpellExtraArgs &&other) noexcept
CastSpellExtraArgs & SetOriginalCaster(ObjectGuid const &guid)
Definition: SpellDefines.h:516
CastSpellExtraArgs & AddSpellMod(SpellValueModFloat mod, float val)
Definition: SpellDefines.h:520
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
Definition: SpellDefines.h:512
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:521
CastSpellExtraArgs & SetCustomArg(std::any customArg)
Definition: SpellDefines.h:522
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:519
CastSpellExtraArgs(Difficulty castDifficulty)
Definition: SpellDefines.h:499
CastSpellExtraArgs(bool triggered)
Definition: SpellDefines.h:494
CastSpellExtraArgs & operator=(CastSpellExtraArgs &&other) noexcept
CastSpellExtraArgs & SetCastItem(Item *item)
Definition: SpellDefines.h:513
CastSpellExtraArgs & operator=(CastSpellExtraArgs const &other)
CastSpellExtraArgs(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:500
CastSpellExtraArgs & SetTriggeringAura(AuraEffect const *triggeringAura)
Definition: SpellDefines.h:515
CastSpellExtraArgs & SetScriptResult(Scripting::v2::ActionResultSetter< SpellCastResult > scriptResult)
Definition: SpellDefines.h:523
CastSpellTargetArg(Item *itemTarget)
Definition: SpellDefines.h:440
CastSpellTargetArg(std::nullptr_t)
Definition: SpellDefines.h:438
Optional< SpellCastTargets > Targets
Definition: SpellDefines.h:460
CastSpellTargetArg(Position const &dest)
Definition: SpellDefines.h:445
CastSpellTargetArg(SpellDestination const &dest)
Definition: SpellDefines.h:450
CastSpellTargetArg(SpellCastTargets &&targets)
Definition: SpellDefines.h:455
uint32 ScriptVisualID
Definition: SpellDefines.h:530
uint32 SpellXSpellVisualID
Definition: SpellDefines.h:529
SpellDestination(Position const &pos)
Definition: SpellDefines.h:333
SpellDestination(WorldLocation const &loc)
Definition: SpellDefines.h:334
Position _transportOffset
Definition: SpellDefines.h:342
WorldLocation _position
Definition: SpellDefines.h:340
SpellDestination(float x, float y, float z, float orientation=0.0f, uint32 mapId=MAPID_INVALID)
Definition: SpellDefines.h:332
ObjectGuid _transportGUID
Definition: SpellDefines.h:341