Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellEffectsAura.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "AccountMgr.h"
7#include "AreaTrigger.h"
8#include "Battleground.h"
9#include "BattlegroundMgr.h"
10#include "BattlePetMgr.h"
11#include "CellImpl.h"
12#include "Common.h"
13#include "Creature.h"
14#include "CreatureAI.h"
15#include "DatabaseEnv.h"
16#include "DynamicObject.h"
17#include "Formulas.h"
18#include "GameObject.h"
19#include "GameObjectAI.h"
20#include "GossipDef.h"
21#include "GridNotifiers.h"
22#include "GridNotifiersImpl.h"
23#include "Group.h"
24#include "Guild.h"
25#include "GuildMgr.h"
26#include "InstanceScript.h"
27#include "Language.h"
28#include "Log.h"
29#include "MapManager.h"
30#include "ObjectAccessor.h"
31#include "ObjectMgr.h"
32#include "Opcodes.h"
33#include "OutdoorPvPMgr.h"
34#include "PathGenerator.h"
35#include "Pet.h"
36#include "Player.h"
37#include "ReputationMgr.h"
38#include "ScriptMgr.h"
39#include "SharedDefines.h"
40#include "SkillDiscovery.h"
41#include "SkillExtraItems.h"
42#include "SocialMgr.h"
43#include "Spell.h"
44#include "SpellAuraEffects.h"
45#include "SpellAuras.h"
46#include "SpellMgr.h"
47#include "SpellValidation.h"
48#include "TemporarySummon.h"
49#include "Totem.h"
50#include "Unit.h"
51#include "UpdateData.h"
52#include "UpdateMask.h"
53#include "Util.h"
54#include "Vehicle.h"
55#include "VMapFactory.h"
56#include "World.h"
57#include "WorldPacket.h"
58
60{
62 return;
63
64 if (!m_spellAura || !unitTarget)
65 return;
66 ASSERT(unitTarget == m_spellAura->GetOwner());
67 m_spellAura->_ApplyEffectForTargets(effIndex);
68}
69
71{
73 return;
74
75 if (!m_spellAura || !unitTarget)
76 return;
77 ASSERT(unitTarget == m_spellAura->GetOwner());
78 m_spellAura->_ApplyEffectForTargets(effIndex);
79}
80
82{
84 return;
85
86 if (!m_spellAura)
87 {
88 Unit* caster = m_caster->GetEntry() == WORLD_TRIGGER ? m_originalCaster : m_caster;
89 float radius = m_spellInfo->Effects[effIndex].CalcRadius(caster);
90
91 // Caster not in world, might be spell triggered from aura removal
92 if (!caster->IsInWorld())
93 return;
94 DynamicObject* dynObj = new DynamicObject(false);
96 {
97 delete dynObj;
98 return;
99 }
100
101 if (Aura* aura = Aura::TryCreate(m_spellInfo, MAX_EFFECT_MASK, dynObj, caster, &m_spellValue->EffectBasePoints[0]))
102 {
103 m_spellAura = aura;
104 m_spellAura->_RegisterForTargets();
105 }
106 else
107 return;
108 }
109
110 ASSERT(m_spellAura->GetDynobjOwner());
111 m_spellAura->_ApplyEffectForTargets(effIndex);
112}
#define MAX_EFFECT_MASK
@ DYNAMIC_OBJECT_AREA_SPELL
#define ASSERT
Definition Errors.h:29
@ HIGHGUID_DYNAMICOBJECT
#define sObjectMgr
Definition ObjectMgr.h:1617
SpellEffIndex
@ SPELL_EFFECT_HANDLE_HIT
Definition Spell.h:276
@ SPELL_EFFECT_HANDLE_HIT_TARGET
Definition Spell.h:277
#define WORLD_TRIGGER
Definition Unit.h:20
static Aura * TryCreate(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0)
bool CreateDynamicObject(uint32 guidlow, Unit *caster, SpellInfo const *spell, Position const &pos, float radius, DynamicObjectType type)
bool IsInWorld() const
Definition Object.h:114
Unit * m_originalCaster
Definition Spell.h:587
void EffectApplyAura(SpellEffIndex effIndex)
SpellEffectHandleMode effectHandleMode
Definition Spell.h:631
Aura * m_spellAura
Definition Spell.h:633
Unit *const m_caster
Definition Spell.h:581
void EffectPersistentAA(SpellEffIndex effIndex)
void EffectApplyAreaAura(SpellEffIndex effIndex)
Unit * unitTarget
Definition Spell.h:626
WorldLocation * destTarget
Definition Spell.h:629
SpellValue *const m_spellValue
Definition Spell.h:583
SpellInfo const *const m_spellInfo
Definition Spell.h:530
Definition Unit.h:1367