TrinityCore
Loading...
Searching...
No Matches
Spell.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 __SPELL_H
19#define __SPELL_H
20
21#include "ConditionMgr.h"
22#include "DBCEnums.h"
23#include "ModelIgnoreFlags.h"
24#include "ObjectGuid.h"
25#include "Optional.h"
26#include "Position.h"
27#include "SharedDefines.h"
28#include "SpellDefines.h"
29#include <memory>
30
31namespace WorldPackets
32{
33 namespace Spells
34 {
35 struct SpellCastData;
36 }
37}
38
39class Aura;
40class AuraEffect;
41class BasicEvent;
42class Corpse;
43class DamageInfo;
44class DynamicObject;
45class DynObjAura;
46class GameObject;
47class Item;
48class Object;
49class PathGenerator;
50class Player;
51class SpellEffectInfo;
52class SpellEvent;
54class SpellInfo;
55class SpellScript;
56class Unit;
57class UnitAura;
58class WorldObject;
59struct SpellPowerCost;
61enum AuraType : uint32;
63enum LootType : uint8;
64enum ProcFlagsHit : uint32;
68enum SpellValueMod : uint8;
71
72#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS)
73#define MAX_SPELL_RANGE_TOLERANCE 3.0f
74#define TRAJECTORY_MISSILE_SIZE 3.0f
75#define AOE_DAMAGE_TARGET_CAP SI64LIT(20)
76
78{
79 CAST_FLAG_NONE = 0x00000000,
80 CAST_FLAG_PENDING = 0x00000001, // aoe combat log?
82 CAST_FLAG_UNKNOWN_3 = 0x00000004,
83 CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual
84 CAST_FLAG_UNKNOWN_5 = 0x00000010,
86 CAST_FLAG_UNKNOWN_7 = 0x00000040,
87 CAST_FLAG_UNKNOWN_8 = 0x00000080,
88 CAST_FLAG_UNKNOWN_9 = 0x00000100,
98 CAST_FLAG_NO_GCD = 0x00040000, // no GCD for spell casts from charm/summon (vehicle spells is an example)
106 CAST_FLAG_IMMUNITY = 0x04000000,
111 CAST_FLAG_TRIGGER_PET_COOLDOWN = 0x80000000 // causes the cooldown to be stored in pets SpellHistory on client
113
115{
121 CAST_FLAG_EX_DELAY_STARTING_COOLDOWNS = 0x00010, // makes client start cooldown after precalculated delay instead of immediately after SPELL_GO (used by empower spells)
125 CAST_FLAG_EX_IGNORE_PET_COOLDOWN = 0x00100, // makes client not automatically start cooldown for pets after SPELL_GO
126 CAST_FLAG_EX_IGNORE_COOLDOWN = 0x00200, // makes client not automatically start cooldown after SPELL_GO
132 CAST_FLAG_EX_USE_TOY_SPELL = 0x08000, // Starts cooldown on toy
138
140{
148};
149
151{
153 SPELL_RANGE_MELEE = 1, //melee
154 SPELL_RANGE_RANGED = 2 //hunter range and ranged weapon
156
158{
162 float Amplitude = 0;
163};
164
166{
169};
170
172{
176};
177
179{
181};
182
184{
186};
187
189{
191};
192
194{
196
203};
204
206{
207 explicit SpellValue(SpellInfo const* proto, WorldObject const* caster);
218};
219
221{
229
231{
237
238typedef std::vector<std::pair<uint32, ObjectGuid>> DispelList;
239
241
243{
244 friend class SpellScript;
245 public:
246
247 void EffectNULL();
248 void EffectUnused();
249 void EffectDistract();
250 void EffectSchoolDMG();
251 void EffectEnvironmentalDMG();
252 void EffectInstaKill();
253 void EffectDummy();
254 void EffectTeleportUnits();
255 void EffectTeleportUnitsWithVisualLoadingScreen();
256 void EffectApplyAura();
257 void EffectSendEvent();
258 void EffectPowerBurn();
259 void EffectPowerDrain();
260 void EffectHeal();
261 void EffectBind();
262 void EffectTeleportToReturnPoint();
263 void EffectIncreaseCurrencyCap();
264 void EffectHealthLeech();
265 void EffectQuestComplete();
266 void EffectCreateItem();
267 void EffectCreateItem2();
268 void EffectCreateRandomItem();
269 void EffectPersistentAA();
270 void EffectEnergize();
271 void EffectOpenLock();
272 void EffectSummonChangeItem();
273 void EffectProficiency();
274 void EffectSummonType();
275 void EffectLearnSpell();
276 void EffectDispel();
277 void EffectDualWield();
278 void EffectPickPocket();
279 void EffectAddFarsight();
280 void EffectUntrainTalents();
281 void EffectHealMechanical();
282 void EffectJump();
283 void EffectJumpDest();
284 void EffectLeapBack();
285 void EffectQuestClear();
286 void EffectTeleUnitsFaceCaster();
287 void EffectLearnSkill();
288 void EffectPlayMovie();
289 void EffectTradeSkill();
290 void EffectEnchantItemPerm();
291 void EffectEnchantItemTmp();
292 void EffectTameCreature();
293 void EffectSummonPet();
294 void EffectLearnPetSpell();
295 void EffectWeaponDmg();
296 void EffectForceCast();
297 void EffectTriggerSpell();
298 void EffectTriggerMissileSpell();
299 void EffectThreat();
300 void EffectHealMaxHealth();
301 void EffectInterruptCast();
302 void EffectSummonObjectWild();
303 void EffectScriptEffect();
304 void EffectSanctuary();
305 void EffectDuel();
306 void EffectStuck();
307 void EffectSummonPlayer();
308 void EffectActivateObject();
309 void EffectApplyGlyph();
310 void EffectEnchantHeldItem();
311 void EffectSummonObject();
312 void EffectChangeRaidMarker();
313 void EffectResurrect();
314 void EffectParry();
315 void EffectBlock();
316 void EffectLeap();
317 void EffectTransmitted();
318 void EffectDisEnchant();
319 void EffectInebriate();
320 void EffectFeedPet();
321 void EffectDismissPet();
322 void EffectReputation();
323 void EffectForceDeselect();
324 void EffectSelfResurrect();
325 void EffectSkinning();
326 void EffectCharge();
327 void EffectChargeDest();
328 void EffectProspecting();
329 void EffectMilling();
330 void EffectRenamePet();
331 void EffectSendTaxi();
332 void EffectKnockBack();
333 void EffectPullTowards();
334 void EffectPullTowardsDest();
335 void EffectDispelMechanic();
336 void EffectResurrectPet();
337 void EffectDestroyAllTotems();
338 void EffectDurabilityDamage();
339 void EffectSkill();
340 void EffectTaunt();
341 void EffectDurabilityDamagePCT();
342 void EffectModifyThreatPercent();
343 void EffectResurrectNew();
344 void EffectAddExtraAttacks();
345 void EffectSpiritHeal();
346 void EffectSkinPlayerCorpse();
347 void EffectStealBeneficialBuff();
348 void EffectUnlearnSpecialization();
349 void EffectHealPct();
350 void EffectEnergizePct();
351 void EffectTriggerRitualOfSummoning();
352 void EffectSummonRaFFriend();
353 void EffectUnlockGuildVaultTab();
354 void EffectKillCreditPersonal();
355 void EffectKillCredit();
356 void EffectQuestFail();
357 void EffectQuestStart();
358 void EffectRedirectThreat();
359 void EffectGameObjectDamage();
360 void EffectGameObjectRepair();
361 void EffectGameObjectSetDestructionState();
362 void EffectCreateTamedPet();
363 void EffectDiscoverTaxi();
364 void EffectTitanGrip();
365 void EffectEnchantItemPrismatic();
366 void EffectPlayMusic();
367 void EffectActivateSpec();
368 void EffectPlaySound();
369 void EffectRemoveAura();
370 void EffectDamageFromMaxHealthPCT();
371 void EffectCastButtons();
372 void EffectRechargeItem();
373 void EffectGiveCurrency();
374 void EffectSummonPersonalGameObject();
375 void EffectResurrectWithAura();
376 void EffectCreateAreaTrigger();
377 void EffectRemoveTalent();
378 void EffectDestroyItem();
379 void EffectLearnGarrisonBuilding();
380 void EffectRemoveAuraBySpellLabel();
381 void EffectCreateGarrison();
382 void EffectCreateConversation();
383 void EffectCancelConversation();
384 void EffectAddGarrisonFollower();
385 void EffectActivateGarrisonBuilding();
386 void EffectGrantBattlePetLevel();
387 void EffectGiveExperience();
388 void EffectGiveRestedExperience();
389 void EffectHealBattlePetPct();
390 void EffectEnableBattlePets();
391 void EffectChangeBattlePetQuality();
392 void EffectLaunchQuestChoice();
393 void EffectUncageBattlePet();
394 void EffectCreateHeirloomItem();
395 void EffectUpgradeHeirloom();
396 void EffectApplyEnchantIllusion();
397 void EffectUpdatePlayerPhase();
398 void EffectUpdateZoneAurasAndPhases();
399 void EffectGiveArtifactPower();
400 void EffectGiveArtifactPowerNoBonus();
401 void EffectPlaySceneScriptPackage();
402 void EffectCreateSceneObject();
403 void EffectCreatePrivateSceneObject();
404 void EffectPlayScene();
405 void EffectGiveHonor();
406 void EffectJumpCharge();
407 void EffectLearnTransmogSet();
408 void EffectRespecAzeriteEmpoweredItem();
409 void EffectLearnAzeriteEssencePower();
410 void EffectCreatePrivateConversation();
411 void EffectSendChatMessage();
412 void EffectGrantBattlePetExperience();
413 void EffectLearnTransmogIllusion();
414 void EffectModifyAuraStacks();
415 void EffectModifyCooldown();
416 void EffectModifyCooldowns();
417 void EffectModifyCooldownsByCategory();
418 void EffectModifySpellCharges();
419 void EffectCreateTraitTreeConfig();
420 void EffectChangeActiveCombatTraitConfig();
421 void EffectTeleportGraveyard();
422
423 typedef std::unordered_set<Aura*> UsedSpellMods;
424
425 Spell(WorldObject* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID = ObjectGuid::Empty, ObjectGuid originalCastId = ObjectGuid::Empty);
426 ~Spell();
427
428 void InitExplicitTargets(SpellCastTargets const& targets);
429 void SelectExplicitTargets();
430
431 void SelectSpellTargets();
432 void SelectEffectImplicitTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex, uint32& processedEffectMask);
433 void SelectImplicitChannelTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType);
434 void SelectImplicitNearbyTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex, uint32 effMask);
435 void SelectImplicitConeTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex, uint32 effMask);
436 void SelectImplicitAreaTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex, uint32 effMask);
437 void SelectImplicitCasterDestTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex);
438 void SelectImplicitTargetDestTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex);
439 void SelectImplicitDestDestTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex);
440 void SelectImplicitCasterObjectTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType);
441 void SelectImplicitTargetObjectTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType);
442 void SelectImplicitChainTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask);
443 void SelectImplicitTrajTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType);
444 void SelectImplicitLineTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex, uint32 effMask);
445
446 void SelectEffectTypeImplicitTargets(SpellEffectInfo const& spellEffectInfo);
447
448 uint32 GetSearcherTypeMask(SpellTargetObjectTypes objType, ConditionContainer* condList);
449 template<class SEARCHER> void SearchTargets(SEARCHER& searcher, uint32 containerMask, WorldObject* referer, Position const* pos, float radius);
450
451 WorldObject* SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer* condList = nullptr);
452 void SearchAreaTargets(std::list<WorldObject*>& targets, float range, Position const* position, WorldObject* referer, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionContainer* condList);
453 void SearchChainTargets(std::list<WorldObject*>& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, SpellEffectInfo const& spellEffectInfo, bool isChainHeal);
454
455 GameObject* SearchSpellFocus();
456
457 SpellCastResult prepare(SpellCastTargets const& targets, AuraEffect const* triggeredByAura = nullptr);
458 void cancel();
459 void update(uint32 difftime);
460 void cast(bool skipCheck = false);
461 void finish(SpellCastResult result = SPELL_CAST_OK);
462 void TakePower();
463
464 void TakeRunePower(bool didHit);
465 void TakeReagents();
466 void TakeCastItem();
467
468 SpellCastResult CheckCast(bool strict, int32* param1 = nullptr, int32* param2 = nullptr);
469 SpellCastResult CheckPetCast(Unit* target);
470
471 // handlers
472 void handle_immediate();
473 uint64 handle_delayed(uint64 t_offset);
474 // handler helpers
475 void _handle_immediate_phase();
476 void _handle_finish_phase();
477
478 SpellCastResult CheckItems(int32* param1, int32* param2) const;
479 SpellCastResult CheckRange(bool strict) const;
480 SpellCastResult CheckPower() const;
481 SpellCastResult CheckRuneCost() const;
482 SpellCastResult CheckCasterAuras(int32* param1) const;
483 SpellCastResult CheckArenaAndRatedBattlegroundCastRules();
484 SpellCastResult CheckMovement() const;
485
486 bool CheckSpellCancelsAuraEffect(AuraType auraType, int32* param1) const;
487 bool CheckSpellCancelsCharm(int32* param1) const;
488 bool CheckSpellCancelsStun(int32* param1) const;
489 bool CheckSpellCancelsSilence(int32* param1) const;
490 bool CheckSpellCancelsPacify(int32* param1) const;
491 bool CheckSpellCancelsFear(int32* param1) const;
492 bool CheckSpellCancelsConfuse(int32* param1) const;
493 bool CheckSpellCancelsNoActions(int32* param1) const;
494
495 int32 CalculateDamage(SpellEffectInfo const& spellEffectInfo, Unit const* target, float* var = nullptr) const;
496
497 void Delayed();
498 void DelayedChannel();
499 uint32 getState() const { return m_spellState; }
500 void setState(uint32 state) { m_spellState = state; }
501
502 void DoCreateItem(uint32 itemId, ItemContext context = ItemContext::NONE, std::vector<int32> const* bonusListIDs = nullptr);
503
504 bool CheckEffectTarget(Unit const* target, SpellEffectInfo const& spellEffectInfo, Position const* losPosition) const;
505 bool CheckEffectTarget(GameObject const* target, SpellEffectInfo const& spellEffectInfo) const;
506 bool CheckEffectTarget(Item const* target, SpellEffectInfo const& spellEffectInfo) const;
507 bool CanAutoCast(Unit* target);
508 void CheckSrc();
509 void CheckDst();
510
511 static void SendCastResult(Player* caster, SpellInfo const* spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE, int32* param1 = nullptr, int32* param2 = nullptr);
512 void SendCastResult(SpellCastResult result, int32* param1 = nullptr, int32* param2 = nullptr) const;
513 void SendPetCastResult(SpellCastResult result, int32* param1 = nullptr, int32* param2 = nullptr) const;
514 void SendMountResult(MountResult result);
515 void SendSpellStart();
516 void SendSpellGo();
517 void SendSpellCooldown();
518 void SendSpellExecuteLog();
519 SpellLogEffect& GetExecuteLogEffect(SpellEffectName effect);
520 template<typename T>
521 std::vector<T>& GetExecuteLogEffectTargets(SpellEffectName effect, Optional<std::vector<T>> SpellLogEffect::* member)
522 {
523 Optional<std::vector<T>>& opt = GetExecuteLogEffect(effect).*member;
524 if (!opt)
525 opt.emplace();
526
527 return *opt;
528 }
529 void ExecuteLogEffectTakeTargetPower(SpellEffectName effect, Unit* target, uint32 powerType, uint32 points, float amplitude);
530 void ExecuteLogEffectExtraAttacks(SpellEffectName effect, Unit* victim, uint32 numAttacks);
531 void ExecuteLogEffectDurabilityDamage(SpellEffectName effect, Unit* victim, int32 itemId, int32 amount);
532 void ExecuteLogEffectOpenLock(SpellEffectName effect, Object* obj);
533 void ExecuteLogEffectCreateItem(SpellEffectName effect, uint32 entry);
534 void ExecuteLogEffectDestroyItem(SpellEffectName effect, uint32 entry);
535 void ExecuteLogEffectSummonObject(SpellEffectName effect, WorldObject* obj);
536 void ExecuteLogEffectUnsummonObject(SpellEffectName effect, WorldObject* obj);
537 void ExecuteLogEffectResurrect(SpellEffectName effect, Unit* target);
538 void SendSpellInterruptLog(Unit* victim, uint32 spellId);
539 void SendInterrupted(uint8 result);
540 void SendChannelUpdate(uint32 time);
541 void SendChannelStart(uint32 duration);
542 void SendResurrectRequest(Player* target);
543
544 void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGoTarget, Corpse* pCorpseTarget, SpellEffectInfo const& spellEffectInfo, SpellEffectHandleMode mode);
545 void HandleThreatSpells();
546 static Spell const* ExtractSpellFromEvent(BasicEvent* event);
547
548 SpellInfo const* const m_spellInfo;
557 union
558 {
559 // Alternate names for this value
561
562 // SPELL_EFFECT_APPLY_GLYPH
564
565 // SPELL_EFFECT_TALENT_SPEC_SELECT
567
568 // SPELL_EFFECT_SET_FOLLOWER_QUALITY
569 // SPELL_EFFECT_INCREASE_FOLLOWER_ITEM_LEVEL
570 // SPELL_EFFECT_INCREASE_FOLLOWER_EXPERIENCE
571 // SPELL_EFFECT_RANDOMIZE_FOLLOWER_ABILITIES
572 // SPELL_EFFECT_LEARN_FOLLOWER_ABILITY
573 struct
574 {
576 uint32 AbilityId; // only SPELL_EFFECT_LEARN_FOLLOWER_ABILITY
577 } GarrFollower;
578
579 // SPELL_EFFECT_FINISH_GARRISON_MISSION
581
582 // SPELL_EFFECT_UPGRADE_HEIRLOOM
584
585 struct
586 {
588 } Raw;
589 } m_misc;
590 std::any m_customArg;
594
596
597 int32 GetCastTime() const { return m_casttime; }
598 bool IsAutoRepeat() const { return m_autoRepeat; }
599 void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
600 void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
601 bool IsTriggered() const;
602 bool IsIgnoringCooldowns() const;
603 bool IsFocusDisabled() const;
604 bool IsProcDisabled() const;
605 bool IsChannelActive() const;
606 bool IsAutoActionResetSpell() const;
607 bool IsPositive() const;
608
609 bool IsTriggeredByAura(SpellInfo const* auraSpellInfo) const { return (auraSpellInfo == m_triggeredByAuraSpell); }
610
611 int32 GetProcChainLength() const { return m_procChainLength; }
612
613 bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; }
614 void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; }
615 bool IsInterruptable() const { return !m_executedCurrently; }
616 void SetExecutedCurrently(bool yes) {m_executedCurrently = yes;}
617 uint64 GetDelayStart() const { return m_delayStart; }
618 void SetDelayStart(uint64 m_time) { m_delayStart = m_time; }
619 uint64 GetDelayMoment() const { return m_delayMoment; }
620 uint64 CalculateDelayMomentForDst(float launchDelay) const;
621 void RecalculateDelayMomentForDst();
622 void UpdateDelayMomentForDst(uint64 hitDelay);
623 void UpdateDelayMomentForUnitTarget(Unit* unit, uint64 hitDelay);
624 uint8 GetRuneState() const { return m_runesState; }
625 void SetRuneState(uint8 value) { m_runesState = value; }
626
627 bool IsNeedSendToClient() const;
628
629 CurrentSpellTypes GetCurrentContainer() const;
630
631 WorldObject* GetCaster() const { return m_caster; }
632 ObjectGuid GetOriginalCasterGUID() const { return m_originalCasterGUID; }
633 Unit* GetOriginalCaster() const { return m_originalCaster; }
634 SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
635 Difficulty GetCastDifficulty() const;
636 std::vector<SpellPowerCost> const& GetPowerCost() const { return m_powerCost; }
637 bool HasPowerTypeCost(Powers power) const;
638 Optional<int32> GetPowerTypeCostAmount(Powers power) const;
639
640 bool UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
641
642 void CleanupTargetList();
643
644 void SetSpellValue(SpellValueMod mod, int32 value);
645
646 Spell** m_selfContainer; // pointer to our spell container (if applicable)
647
648 SpellInfo const* GetTriggeredByAuraSpell() const { return m_triggeredByAuraSpell; }
649
650 int32 GetTimer() const { return m_timer; }
651
652 int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const;
653 int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const;
654 int64 GetItemTargetCountForEffect(SpellEffIndex effect) const;
655 int64 GetCorpseTargetCountForEffect(SpellEffIndex effect) const;
656
657 std::string GetDebugInfo() const;
658 void CallScriptOnResistAbsorbCalculateHandlers(DamageInfo const& damageInfo, uint32& resistAmount, int32& absorbAmount);
659
660 bool IsWithinLOS(WorldObject const* source, WorldObject const* target, bool targetAsSourceLocation, VMAP::ModelIgnoreFlags ignoreFlags) const;
661 bool IsWithinLOS(WorldObject const* source, Position const& target, VMAP::ModelIgnoreFlags ignoreFlags) const;
662
663 protected:
664 bool HasGlobalCooldown() const;
665 void TriggerGlobalCooldown();
666 void CancelGlobalCooldown();
667 void _cast(bool skipCheck = false);
668
669 std::pair<float, float> GetMinMaxRange(bool strict) const;
670
672
674
675 ObjectGuid m_originalCasterGUID; // real source of cast (aura caster/etc), used for spell targets selection
676 // e.g. damage around area spell trigered by victim aura and damage enemies of aura caster
677 Unit* m_originalCaster; // cached pointer for m_originalCaster, updated at Spell::UpdatePointers()
678
679 // Spell data
680 SpellSchoolMask m_spellSchoolMask; // Spell school (can be overwrite for some spells (wand shoot for example)
681 WeaponAttackType m_attackType; // For weapon based attack
682
683 std::vector<SpellPowerCost> m_powerCost; // Calculated spell cost initialized only in Spell::prepare
684 int32 m_casttime; // Calculated spell cast time initialized only in Spell::prepare
685 int32 m_channeledDuration; // Calculated channeled spell duration in order to calculate correct pushback.
686 bool m_canReflect; // can reflect this spell?
689
692 {
693 if (m_delayAtDamageCount >= 2)
694 return true;
695
696 ++m_delayAtDamageCount;
697 return false;
698 }
699
700 // Delayed spells system
701 uint64 m_delayStart; // time of spell delay start, filled by event handler, zero = just started
702 uint64 m_delayMoment; // moment of next delay call, used internally
703 bool m_launchHandled; // were launch actions handled
704 bool m_immediateHandled; // were immediate actions handled? (used by delayed spells only)
705
706 // These vars are used in both delayed spell system and modified immediate spell system
707 bool m_referencedFromCurrentSpell; // mark as references to prevent deleted and access by dead pointers
708 bool m_executedCurrently; // mark as executed to prevent deleted and access by dead pointers
710 float m_damageMultipliers[MAX_SPELL_EFFECTS];
711
712 // Current targets, to be used in SpellEffects (MUST BE USED ONLY IN SPELL EFFECTS)
720 float variance;
723 // used in effects handlers
724 Unit* GetUnitCasterForEffectHandlers() const;
727
728 // -------------------------------------------
730
731 // Damage and healing in effects need just calculate
732 int32 m_damage; // Damage in effects count here
733 int32 m_healing; // Healing in effects count here
734
735 // ******************************************
736 // Spell trigger system
737 // ******************************************
738 ProcFlagsInit m_procAttacker; // Attacker trigger flags
739 ProcFlagsInit m_procVictim; // Victim trigger flags
742 void prepareDataForTriggerSystem();
743
744 // *****************************************
745 // Spell target subsystem
746 // *****************************************
747 // Targets store structures and data
749 {
750 virtual void PreprocessTarget(Spell* /*spell*/) { }
751 virtual void DoTargetSpellHit(Spell* spell, SpellEffectInfo const& spellEffectInfo) = 0;
752 virtual void DoDamageAndTriggers(Spell* /*spell*/) { }
753
754 uint32 EffectMask = 0;
755
756 protected:
758 virtual ~TargetInfoBase() { }
759 };
760
762 {
763 void PreprocessTarget(Spell* spell) override;
764 void DoTargetSpellHit(Spell* spell, SpellEffectInfo const& spellEffectInfo) override;
765 void DoDamageAndTriggers(Spell* spell) override;
766
768 uint64 TimeDelay = 0ULL;
770 int32 Healing = 0;
771
774
775 bool IsAlive = false;
776 bool IsCrit = false;
777
778 // info set at PreprocessTarget, used by DoTargetSpellHit
780 int32 AuraDuration = 0;
781 int32 AuraBasePoints[MAX_SPELL_EFFECTS] = { };
782 bool Positive = true;
783 UnitAura* HitAura = nullptr;
784
785 private:
786 Unit* _spellHitTarget = nullptr; // changed for example by reflect
787 bool _enablePVP = false; // need to enable PVP at DoDamageAndTriggers?
788 };
789 std::vector<TargetInfo> m_UniqueTargetInfo;
790 uint32 m_channelTargetEffectMask; // Mask req. alive targets
791
793 {
794 void DoTargetSpellHit(Spell* spell, SpellEffectInfo const& spellEffectInfo) override;
795
797 uint64 TimeDelay = 0ULL;
798 };
799 std::vector<GOTargetInfo> m_UniqueGOTargetInfo;
800
802 {
803 void DoTargetSpellHit(Spell* spell, SpellEffectInfo const& spellEffectInfo) override;
804
805 Item* TargetItem = nullptr;
806 };
807 std::vector<ItemTargetInfo> m_UniqueItemInfo;
808
810 {
811 void DoTargetSpellHit(Spell* spell, SpellEffectInfo const& spellEffectInfo) override;
812
814 uint64 TimeDelay = 0ULL;
815 };
816 std::vector<CorpseTargetInfo> m_UniqueCorpseTargetInfo;
817
818 template <class Container>
819 void DoProcessTargetContainer(Container& targetContainer);
820
822
823 int32 GetUnitTargetIndexForEffect(ObjectGuid const& target, SpellEffIndex effect) const;
824
825 void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true, bool implicit = true, Position const* losPosition = nullptr);
826 void AddGOTarget(GameObject* target, uint32 effectMask);
827 void AddItemTarget(Item* item, uint32 effectMask);
828 void AddCorpseTarget(Corpse* target, uint32 effectMask);
829 void AddDestTarget(SpellDestination const& dest, uint32 effIndex);
830
831 void PreprocessSpellLaunch(TargetInfo& targetInfo);
832 SpellMissInfo PreprocessSpellHit(Unit* unit, TargetInfo& targetInfo);
833 void DoSpellEffectHit(Unit* unit, SpellEffectInfo const& spellEffectInfo, TargetInfo& targetInfo);
834
835 void DoTriggersOnSpellHit(Unit* unit);
836 bool UpdateChanneledTargetList();
837 bool IsValidDeadOrAliveTarget(Unit const* target) const;
838 void HandleLaunchPhase();
839 void DoEffectOnLaunchTarget(TargetInfo& targetInfo, float multiplier, SpellEffectInfo const& spellEffectInfo);
840
841 void PrepareTargetProcessing();
842 void FinishTargetProcessing();
843
844 // Scripting system
845 void LoadScripts();
846 void CallScriptOnPrecastHandler();
847 void CallScriptBeforeCastHandlers();
848 void CallScriptOnCastHandlers();
849 void CallScriptAfterCastHandlers();
850 SpellCastResult CallScriptCheckCastHandlers();
851 int32 CallScriptCalcCastTimeHandlers(int32 originalCastTime);
852 bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode);
853 void CallScriptSuccessfulDispel(SpellEffIndex effIndex);
854 void CallScriptBeforeHitHandlers(SpellMissInfo missInfo);
855 void CallScriptOnHitHandlers();
856 void CallScriptAfterHitHandlers();
857 public:
858 void CallScriptCalcCritChanceHandlers(Unit const* victim, float& chance);
859 void CallScriptCalcDamageHandlers(Unit* victim, int32& damage, int32& flatMod, float& pctMod);
860 void CallScriptCalcHealingHandlers(Unit* victim, int32& healing, int32& flatMod, float& pctMod);
861 protected:
862 void CallScriptObjectAreaTargetSelectHandlers(std::list<WorldObject*>& targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
863 void CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
864 void CallScriptDestinationTargetSelectHandlers(SpellDestination& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
865 bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck);
866 std::vector<SpellScript*> m_loadedScripts;
867
869 {
870 HitTriggerSpell(SpellInfo const* spellInfo, SpellInfo const* auraSpellInfo, int32 procChance) :
871 triggeredSpell(spellInfo), triggeredByAura(auraSpellInfo), chance(procChance) { }
872
875 // uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now
877 };
878
879 bool CanExecuteTriggersOnHit(Unit* unit, SpellInfo const* triggeredByAura = nullptr) const;
880 void PrepareTriggersExecutedOnHit();
881 typedef std::vector<HitTriggerSpell> HitTriggerSpellList;
883
884 // effect helpers
885 void SummonGuardian(SpellEffectInfo const* effect, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons, ObjectGuid privateObjectOwner);
886 void CalculateJumpSpeeds(SpellEffectInfo const* effInfo, float dist, float& speedXY, float& speedZ);
887
888 void UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData& data);
889 int32 GetSpellCastDataAmmo();
890
891 SpellCastResult CanOpenLock(SpellEffectInfo const& effect, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue);
892 // -------------------------------------------
893
896
899
900 // if need this can be replaced by Aura copy
901 // we can't store original aura link to prevent access to deleted auras
902 // and in same time need aura data and after aura deleting.
905
906 std::unique_ptr<PathGenerator> m_preGeneratedPath;
907
908 std::vector<SpellLogEffect> _executeLogEffects;
909
910 Spell(Spell const& right) = delete;
911 Spell& operator=(Spell const& right) = delete;
912};
913
914namespace Trinity
915{
917 {
918 protected:
923 std::unique_ptr<ConditionSourceInfo> _condSrcInfo;
926
927 WorldObjectSpellTargetCheck(WorldObject* caster, WorldObject* referer, SpellInfo const* spellInfo,
928 SpellTargetCheckTypes selectionType, ConditionContainer const* condList, SpellTargetObjectTypes objectType);
930
931 bool operator()(WorldObject* target) const;
932 };
933
935 {
936 float _range;
938 WorldObjectSpellNearbyTargetCheck(float range, WorldObject* caster, SpellInfo const* spellInfo,
939 SpellTargetCheckTypes selectionType, ConditionContainer const* condList, SpellTargetObjectTypes objectType);
940
941 bool operator()(WorldObject* target);
942 };
943
945 {
946 float _range;
948 WorldObjectSpellAreaTargetCheck(float range, Position const* position, WorldObject* caster,
949 WorldObject* referer, SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const* condList, SpellTargetObjectTypes objectType);
950
951 bool operator()(WorldObject* target) const;
952 };
953
955 {
959 WorldObjectSpellConeTargetCheck(Position const& coneSrc, float coneAngle, float lineWidth, float range, WorldObject* caster,
960 SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const* condList, SpellTargetObjectTypes objectType);
961
962 bool operator()(WorldObject* target) const;
963 };
964
966 {
967 float _range;
969 WorldObjectSpellTrajTargetCheck(float range, Position const* position, WorldObject* caster,
970 SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const* condList, SpellTargetObjectTypes objectType);
971
972 bool operator()(WorldObject* target) const;
973 };
974
976 {
979 WorldObjectSpellLineTargetCheck(Position const* srcPosition, Position const* dstPosition, float lineWidth, float range, WorldObject* caster,
980 SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer const* condList, SpellTargetObjectTypes objectType);
981
982 bool operator()(WorldObject* target) const;
983 };
984
985 TC_GAME_API void SelectRandomInjuredTargets(std::list<WorldObject*>& targets, size_t maxTargets, bool prioritizePlayers, Unit const* prioritizeGroupMembersOf = nullptr);
986}
987
988using SpellEffectHandlerFn = void(Spell::*)();
989
990#endif
std::vector< Condition * > ConditionContainer
Definition: ConditionMgr.h:267
Difficulty
Definition: DBCEnums.h:817
ItemContext
Definition: DBCEnums.h:1007
#define MAX_SPELL_EFFECTS
Definition: DBCEnums.h:1875
#define TC_GAME_API
Definition: Define.h:124
uint8_t uint8
Definition: Define.h:145
int64_t int64
Definition: Define.h:138
int32_t int32
Definition: Define.h:139
uint64_t uint64
Definition: Define.h:142
uint32_t uint32
Definition: Define.h:143
std::string GetDebugInfo()
Definition: Errors.cpp:157
LootType
Definition: Loot.h:98
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
Spells
Definition: PlayerAI.cpp:32
SpellEffIndex
Definition: SharedDefines.h:29
MountResult
SpellTargetIndex
Definition: SharedDefines.h:65
SpellMissInfo
@ SPELL_MISS_NONE
SpellSchoolMask
SpellEffectName
WeaponAttackType
SpellCustomErrors
@ SPELL_CUSTOM_ERROR_NONE
Powers
DiminishingGroup
@ DIMINISHING_NONE
SpellCastResult
@ SPELL_CAST_OK
SkillType
AuraType
TriggerCastFlags
Definition: SpellDefines.h:245
SpellValueMod
Definition: SpellDefines.h:195
SpellTargetCheckTypes
Definition: SpellInfo.h:81
SpellTargetObjectTypes
Definition: SpellInfo.h:65
ProcFlagsSpellType
Definition: SpellMgr.h:248
ProcFlagsHit
Definition: SpellMgr.h:270
SpellCastSource
Definition: Spell.h:140
@ SPELL_CAST_SOURCE_AURA
Definition: Spell.h:146
@ SPELL_CAST_SOURCE_SPELL
Definition: Spell.h:147
@ SPELL_CAST_SOURCE_PET
Definition: Spell.h:145
@ SPELL_CAST_SOURCE_PLAYER
Definition: Spell.h:141
@ SPELL_CAST_SOURCE_PASSIVE
Definition: Spell.h:144
@ SPELL_CAST_SOURCE_NORMAL
Definition: Spell.h:142
@ SPELL_CAST_SOURCE_ITEM
Definition: Spell.h:143
SpellRangeFlag
Definition: Spell.h:151
@ SPELL_RANGE_MELEE
Definition: Spell.h:153
@ SPELL_RANGE_RANGED
Definition: Spell.h:154
@ SPELL_RANGE_DEFAULT
Definition: Spell.h:152
std::vector< std::pair< uint32, ObjectGuid > > DispelList
Definition: Spell.h:238
void(Spell::*)() SpellEffectHandlerFn
Definition: Spell.h:988
SpellCastFlagsEx
Definition: Spell.h:115
@ CAST_FLAG_EX_DELAY_STARTING_COOLDOWNS
Definition: Spell.h:121
@ CAST_FLAG_EX_UNKNOWN_15
Definition: Spell.h:131
@ CAST_FLAG_EX_UNKNOWN_7
Definition: Spell.h:123
@ CAST_FLAG_EX_UNKNOWN_17
Definition: Spell.h:133
@ CAST_FLAG_EX_UNKNOWN_2
Definition: Spell.h:118
@ CAST_FLAG_EX_DONT_CONSUME_CHARGES
Definition: Spell.h:119
@ CAST_FLAG_EX_USE_TOY_SPELL
Definition: Spell.h:132
@ CAST_FLAG_EX_UNKNOWN_11
Definition: Spell.h:127
@ CAST_FLAG_EX_UNKNOWN_14
Definition: Spell.h:130
@ CAST_FLAG_EX_UNKNOWN_12
Definition: Spell.h:128
@ CAST_FLAG_EX_UNKNOWN_19
Definition: Spell.h:135
@ CAST_FLAG_EX_UNKNOWN_8
Definition: Spell.h:124
@ CAST_FLAG_EX_IGNORE_COOLDOWN
Definition: Spell.h:126
@ CAST_FLAG_EX_UNKNOWN_13
Definition: Spell.h:129
@ CAST_FLAG_EX_UNKNOWN_4
Definition: Spell.h:120
@ CAST_FLAG_EX_UNKNOWN_18
Definition: Spell.h:134
@ CAST_FLAG_EX_UNKNOWN_6
Definition: Spell.h:122
@ CAST_FLAG_EX_NONE
Definition: Spell.h:116
@ CAST_FLAG_EX_IGNORE_PET_COOLDOWN
Definition: Spell.h:125
@ CAST_FLAG_EX_UNKNOWN_20
Definition: Spell.h:136
@ CAST_FLAG_EX_TRIGGER_COOLDOWN_ON_SPELL_START
Definition: Spell.h:117
SpellEffectHandleMode
Definition: Spell.h:231
@ SPELL_EFFECT_HANDLE_LAUNCH_TARGET
Definition: Spell.h:233
@ SPELL_EFFECT_HANDLE_LAUNCH
Definition: Spell.h:232
@ SPELL_EFFECT_HANDLE_HIT
Definition: Spell.h:234
@ SPELL_EFFECT_HANDLE_HIT_TARGET
Definition: Spell.h:235
SpellState
Definition: Spell.h:221
@ SPELL_STATE_DELAYED
Definition: Spell.h:227
@ SPELL_STATE_NULL
Definition: Spell.h:222
@ SPELL_STATE_FINISHED
Definition: Spell.h:225
@ SPELL_STATE_PREPARING
Definition: Spell.h:223
@ SPELL_STATE_CASTING
Definition: Spell.h:224
@ SPELL_STATE_IDLE
Definition: Spell.h:226
static const uint32 SPELL_INTERRUPT_NONPLAYER
Definition: Spell.h:240
SpellCastFlags
Definition: Spell.h:78
@ CAST_FLAG_UNKNOWN_5
Definition: Spell.h:84
@ CAST_FLAG_UNKNOWN_10
Definition: Spell.h:89
@ CAST_FLAG_UNKNOWN_25
Definition: Spell.h:104
@ CAST_FLAG_VISUAL_CHAIN
Definition: Spell.h:99
@ CAST_FLAG_ADJUST_MISSILE
Definition: Spell.h:97
@ CAST_FLAG_UNKNOWN_8
Definition: Spell.h:87
@ CAST_FLAG_HEAL_PREDICTION
Definition: Spell.h:110
@ CAST_FLAG_UNKNOWN_9
Definition: Spell.h:88
@ CAST_FLAG_UNKNOWN_3
Definition: Spell.h:82
@ CAST_FLAG_UNKNOWN_26
Definition: Spell.h:105
@ CAST_FLAG_UNKNOWN_11
Definition: Spell.h:90
@ CAST_FLAG_UNKNOWN_30
Definition: Spell.h:109
@ CAST_FLAG_UNKNOWN_4
Definition: Spell.h:83
@ CAST_FLAG_NO_GCD
Definition: Spell.h:98
@ CAST_FLAG_UNKNOWN_23
Definition: Spell.h:102
@ CAST_FLAG_UNKNOWN_16
Definition: Spell.h:95
@ CAST_FLAG_PROJECTILE
Definition: Spell.h:85
@ CAST_FLAG_UNKNOWN_29
Definition: Spell.h:108
@ CAST_FLAG_UNKNOWN_7
Definition: Spell.h:86
@ CAST_FLAG_POWER_LEFT_SELF
Definition: Spell.h:91
@ CAST_FLAG_UNKNOWN_13
Definition: Spell.h:92
@ CAST_FLAG_UNKNOWN_28
Definition: Spell.h:107
@ CAST_FLAG_UNKNOWN_24
Definition: Spell.h:103
@ CAST_FLAG_TRIGGER_PET_COOLDOWN
Definition: Spell.h:111
@ CAST_FLAG_HAS_TRAJECTORY
Definition: Spell.h:81
@ CAST_FLAG_RUNE_LIST
Definition: Spell.h:101
@ CAST_FLAG_UNKNOWN_14
Definition: Spell.h:93
@ CAST_FLAG_UNKNOWN_15
Definition: Spell.h:94
@ CAST_FLAG_PENDING
Definition: Spell.h:80
@ CAST_FLAG_NONE
Definition: Spell.h:79
@ CAST_FLAG_UNKNOWN_17
Definition: Spell.h:96
@ CAST_FLAG_IMMUNITY
Definition: Spell.h:106
@ CAST_FLAG_UNKNOWN_21
Definition: Spell.h:100
CurrentSpellTypes
Definition: Unit.h:585
PowerType
Definition: Corpse.h:53
Definition: Item.h:170
static ObjectGuid const Empty
Definition: ObjectGuid.h:272
Definition: Object.h:149
Definition: Spell.h:243
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:634
std::vector< HitTriggerSpell > HitTriggerSpellList
Definition: Spell.h:881
bool m_fromClient
Definition: Spell.h:555
std::vector< SpellPowerCost > m_powerCost
Definition: Spell.h:683
uint32 m_castFlagsEx
Definition: Spell.h:556
std::vector< SpellScript * > m_loadedScripts
Definition: Spell.h:866
GameObject * gameObjTarget
Definition: Spell.h:715
SpellMissInfo targetMissInfo
Definition: Spell.h:719
bool m_referencedFromCurrentSpell
Definition: Spell.h:707
bool m_canReflect
Definition: Spell.h:686
Unit * m_originalCaster
Definition: Spell.h:677
DynObjAura * _dynObjAura
Definition: Spell.h:726
uint32 m_channelTargetEffectMask
Definition: Spell.h:790
uint64 m_delayStart
Definition: Spell.h:701
SpellCastTargets m_targets
Definition: Spell.h:592
void setState(uint32 state)
Definition: Spell.h:500
std::unique_ptr< PathGenerator > m_preGeneratedPath
Definition: Spell.h:906
int32 m_procChainLength
Definition: Spell.h:904
TriggerCastFlags _triggeredCastFlags
Definition: Spell.h:898
bool IsAutoRepeat() const
Definition: Spell.h:598
int32 damage
Definition: Spell.h:718
SpellEffectHandleMode effectHandleMode
Definition: Spell.h:721
int32 m_channeledDuration
Definition: Spell.h:685
uint32 Id
Definition: Spell.h:575
std::vector< TargetInfo > m_UniqueTargetInfo
Definition: Spell.h:789
bool IsInterruptable() const
Definition: Spell.h:615
void SetExecutedCurrently(bool yes)
Definition: Spell.h:616
ObjectGuid m_originalCastId
Definition: Spell.h:554
uint8 m_delayAtDamageCount
Definition: Spell.h:690
ProcFlagsSpellType m_procSpellType
Definition: Spell.h:741
uint64 m_delayMoment
Definition: Spell.h:702
uint32 SpecializationId
Definition: Spell.h:566
WeaponAttackType m_attackType
Definition: Spell.h:681
bool m_immediateHandled
Definition: Spell.h:704
uint32 m_spellState
Definition: Spell.h:894
uint32 AbilityId
Definition: Spell.h:576
std::any m_customArg
Definition: Spell.h:590
ObjectGuid m_originalCasterGUID
Definition: Spell.h:675
WorldObject *const m_caster
Definition: Spell.h:671
int32 GetCastTime() const
Definition: Spell.h:597
bool IsDeletable() const
Definition: Spell.h:613
int32 m_timer
Definition: Spell.h:895
int32 m_casttime
Definition: Spell.h:684
Item * itemTarget
Definition: Spell.h:714
uint32 TalentId
Definition: Spell.h:560
float variance
Definition: Spell.h:720
int32 m_damage
Definition: Spell.h:732
std::vector< CorpseTargetInfo > m_UniqueCorpseTargetInfo
Definition: Spell.h:816
uint32 getState() const
Definition: Spell.h:499
bool m_executedCurrently
Definition: Spell.h:708
std::unordered_set< Aura * > UsedSpellMods
Definition: Spell.h:423
ObjectGuid GetOriginalCasterGUID() const
Definition: Spell.h:632
SpellCustomErrors m_customError
Definition: Spell.h:593
Spell(Spell const &right)=delete
std::vector< GOTargetInfo > m_UniqueGOTargetInfo
Definition: Spell.h:799
int32 GetProcChainLength() const
Definition: Spell.h:611
HitTriggerSpellList m_hitTriggerSpells
Definition: Spell.h:882
uint32 ItemId
Definition: Spell.h:583
int32 m_healing
Definition: Spell.h:733
void SetDelayStart(uint64 m_time)
Definition: Spell.h:618
SpellEffectInfo const * effectInfo
Definition: Spell.h:722
SpellInfo const * m_triggeredByAuraSpell
Definition: Spell.h:903
int32 m_castItemLevel
Definition: Spell.h:552
UnitAura * _spellAura
Definition: Spell.h:725
uint32 m_applyMultiplierMask
Definition: Spell.h:709
Unit * unitTarget
Definition: Spell.h:713
SpellSchoolMask m_spellSchoolMask
Definition: Spell.h:680
WorldObject * GetCaster() const
Definition: Spell.h:631
SpellEvent * _spellEvent
Definition: Spell.h:897
uint32 SpellId
Definition: Spell.h:563
Unit * GetOriginalCaster() const
Definition: Spell.h:633
Corpse * m_corpseTarget
Definition: Spell.h:716
void ReSetTimer()
Definition: Spell.h:600
void SetAutoRepeat(bool rep)
Definition: Spell.h:599
WorldLocation * destTarget
Definition: Spell.h:717
Spell ** m_selfContainer
Definition: Spell.h:646
uint32 GarrMissionId
Definition: Spell.h:580
std::vector< SpellPowerCost > const & GetPowerCost() const
Definition: Spell.h:636
bool IsTriggeredByAura(SpellInfo const *auraSpellInfo) const
Definition: Spell.h:609
void SetReferencedFromCurrent(bool yes)
Definition: Spell.h:614
bool IsDelayableNoMore()
Definition: Spell.h:691
uint64 GetDelayStart() const
Definition: Spell.h:617
ProcFlagsInit m_procVictim
Definition: Spell.h:739
void SetRuneState(uint8 value)
Definition: Spell.h:625
Item * m_CastItem
Definition: Spell.h:549
std::vector< SpellLogEffect > _executeLogEffects
Definition: Spell.h:908
uint32 m_castItemEntry
Definition: Spell.h:551
uint64 GetDelayMoment() const
Definition: Spell.h:619
UsedSpellMods m_appliedMods
Definition: Spell.h:595
SpellValue *const m_spellValue
Definition: Spell.h:673
uint8 GetRuneState() const
Definition: Spell.h:624
int32 GetTimer() const
Definition: Spell.h:650
std::vector< ItemTargetInfo > m_UniqueItemInfo
Definition: Spell.h:807
SpellInfo const * GetTriggeredByAuraSpell() const
Definition: Spell.h:648
ProcFlagsInit m_procAttacker
Definition: Spell.h:738
ObjectGuid m_castItemGUID
Definition: Spell.h:550
SpellCastVisual m_SpellVisual
Definition: Spell.h:591
GameObject * focusObject
Definition: Spell.h:729
ProcFlagsHit m_hitMask
Definition: Spell.h:740
Spell & operator=(Spell const &right)=delete
ObjectGuid m_castId
Definition: Spell.h:553
bool m_launchHandled
Definition: Spell.h:703
SpellInfo const *const m_spellInfo
Definition: Spell.h:548
std::vector< T > & GetExecuteLogEffectTargets(SpellEffectName effect, Optional< std::vector< T > > SpellLogEffect::*member)
Definition: Spell.h:521
uint8 m_runesState
Definition: Spell.h:688
bool m_autoRepeat
Definition: Spell.h:687
Definition: Unit.h:747
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
Definition: Spell.cpp:9161
Optional< std::vector< SpellLogEffectTradeSkillItemParams > > TradeSkillTargets
Definition: Spell.h:201
Optional< std::vector< SpellLogEffectFeedPetParams > > FeedPetTargets
Definition: Spell.h:202
Optional< std::vector< SpellLogEffectPowerDrainParams > > PowerDrainTargets
Definition: Spell.h:197
Optional< std::vector< SpellLogEffectDurabilityDamageParams > > DurabilityDamageTargets
Definition: Spell.h:199
int32 Effect
Definition: Spell.h:195
Optional< std::vector< SpellLogEffectGenericVictimParams > > GenericVictimTargets
Definition: Spell.h:200
Optional< std::vector< SpellLogEffectExtraAttacksParams > > ExtraAttacksTargets
Definition: Spell.h:198
float RadiusMod
Definition: Spell.h:211
Optional< int32 > Duration
Definition: Spell.h:215
Optional< int32 > ParentSpellTargetIndex
Definition: Spell.h:217
int32 EffectBasePoints[MAX_SPELL_EFFECTS]
Definition: Spell.h:208
uint32 CustomBasePointsMask
Definition: Spell.h:209
uint32 MaxAffectedTargets
Definition: Spell.h:210
int32 AuraStackAmount
Definition: Spell.h:212
float CriticalChance
Definition: Spell.h:214
Optional< int32 > ParentSpellTargetCount
Definition: Spell.h:216
float DurationMul
Definition: Spell.h:213
ObjectGuid TargetGUID
Definition: Spell.h:813
ObjectGuid TargetGUID
Definition: Spell.h:796
SpellInfo const * triggeredSpell
Definition: Spell.h:873
HitTriggerSpell(SpellInfo const *spellInfo, SpellInfo const *auraSpellInfo, int32 procChance)
Definition: Spell.h:870
SpellInfo const * triggeredByAura
Definition: Spell.h:874
virtual void DoTargetSpellHit(Spell *spell, SpellEffectInfo const &spellEffectInfo)=0
virtual void PreprocessTarget(Spell *)
Definition: Spell.h:750
virtual ~TargetInfoBase()
Definition: Spell.h:758
virtual void DoDamageAndTriggers(Spell *)
Definition: Spell.h:752
ObjectGuid TargetGUID
Definition: Spell.h:767
SpellTargetCheckTypes _targetSelectionType
Definition: Spell.h:922
std::unique_ptr< ConditionSourceInfo > _condSrcInfo
Definition: Spell.h:923
SpellInfo const * _spellInfo
Definition: Spell.h:921
ConditionContainer const * _condList
Definition: Spell.h:924
SpellTargetObjectTypes _objectType
Definition: Spell.h:925
int finish(char const *message, int returnValue)