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