Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
59
void
Spell::EffectApplyAura
(
SpellEffIndex
effIndex)
60
{
61
if
(
effectHandleMode
!=
SPELL_EFFECT_HANDLE_HIT_TARGET
)
62
return
;
63
64
if
(!
m_spellAura
|| !
unitTarget
)
65
return
;
66
ASSERT
(
unitTarget
==
m_spellAura
->GetOwner());
67
m_spellAura
->_ApplyEffectForTargets(effIndex);
68
}
69
70
void
Spell::EffectApplyAreaAura
(
SpellEffIndex
effIndex)
71
{
72
if
(
effectHandleMode
!=
SPELL_EFFECT_HANDLE_HIT_TARGET
)
73
return
;
74
75
if
(!
m_spellAura
|| !
unitTarget
)
76
return
;
77
ASSERT
(
unitTarget
==
m_spellAura
->GetOwner());
78
m_spellAura
->_ApplyEffectForTargets(effIndex);
79
}
80
81
void
Spell::EffectPersistentAA
(
SpellEffIndex
effIndex)
82
{
83
if
(
effectHandleMode
!=
SPELL_EFFECT_HANDLE_HIT
)
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
);
95
if
(!dynObj->
CreateDynamicObject
(
sObjectMgr
->GenerateLowGuid(
HIGHGUID_DYNAMICOBJECT
), caster,
m_spellInfo
, *
destTarget
, radius,
DYNAMIC_OBJECT_AREA_SPELL
))
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
}
AccountMgr.h
AreaTrigger.h
BattlePetMgr.h
Battleground.h
BattlegroundMgr.h
CellImpl.h
Common.h
Creature.h
CreatureAI.h
MAX_EFFECT_MASK
#define MAX_EFFECT_MASK
Definition
DBCStructure.h:2585
DatabaseEnv.h
DynamicObject.h
DYNAMIC_OBJECT_AREA_SPELL
@ DYNAMIC_OBJECT_AREA_SPELL
Definition
DynamicObject.h:18
ASSERT
#define ASSERT
Definition
Errors.h:29
Formulas.h
GameObject.h
GameObjectAI.h
GossipDef.h
GridNotifiers.h
GridNotifiersImpl.h
Group.h
Guild.h
GuildMgr.h
InstanceScript.h
Language.h
Log.h
MapManager.h
ObjectAccessor.h
HIGHGUID_DYNAMICOBJECT
@ HIGHGUID_DYNAMICOBJECT
Definition
ObjectDefines.h:21
ObjectMgr.h
sObjectMgr
#define sObjectMgr
Definition
ObjectMgr.h:1617
Opcodes.h
OutdoorPvPMgr.h
PathGenerator.h
Pet.h
Player.h
ReputationMgr.h
ScriptMgr.h
SharedDefines.h
SpellEffIndex
SpellEffIndex
Definition
SharedDefines.h:17
SkillDiscovery.h
SkillExtraItems.h
SocialMgr.h
Spell.h
SPELL_EFFECT_HANDLE_HIT
@ SPELL_EFFECT_HANDLE_HIT
Definition
Spell.h:276
SPELL_EFFECT_HANDLE_HIT_TARGET
@ SPELL_EFFECT_HANDLE_HIT_TARGET
Definition
Spell.h:277
SpellAuraEffects.h
SpellAuras.h
SpellMgr.h
SpellValidation.h
TemporarySummon.h
Totem.h
Unit.h
WORLD_TRIGGER
#define WORLD_TRIGGER
Definition
Unit.h:20
UpdateData.h
UpdateMask.h
Util.h
VMapFactory.h
Vehicle.h
World.h
WorldPacket.h
Aura
Definition
SpellAuras.h:74
Aura::TryCreate
static Aura * TryCreate(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0)
Definition
SpellAuras.cpp:98
DynamicObject
Definition
DynamicObject.h:23
DynamicObject::CreateDynamicObject
bool CreateDynamicObject(uint32 guidlow, Unit *caster, SpellInfo const *spell, Position const &pos, float radius, DynamicObjectType type)
Definition
DynamicObject.cpp:69
Object::IsInWorld
bool IsInWorld() const
Definition
Object.h:114
Spell::m_originalCaster
Unit * m_originalCaster
Definition
Spell.h:587
Spell::EffectApplyAura
void EffectApplyAura(SpellEffIndex effIndex)
Definition
SpellEffectsAura.cpp:59
Spell::effectHandleMode
SpellEffectHandleMode effectHandleMode
Definition
Spell.h:631
Spell::m_spellAura
Aura * m_spellAura
Definition
Spell.h:633
Spell::m_caster
Unit *const m_caster
Definition
Spell.h:581
Spell::EffectPersistentAA
void EffectPersistentAA(SpellEffIndex effIndex)
Definition
SpellEffectsAura.cpp:81
Spell::EffectApplyAreaAura
void EffectApplyAreaAura(SpellEffIndex effIndex)
Definition
SpellEffectsAura.cpp:70
Spell::unitTarget
Unit * unitTarget
Definition
Spell.h:626
Spell::destTarget
WorldLocation * destTarget
Definition
Spell.h:629
Spell::m_spellValue
SpellValue *const m_spellValue
Definition
Spell.h:583
Spell::m_spellInfo
SpellInfo const *const m_spellInfo
Definition
Spell.h:530
Unit
Definition
Unit.h:1367
src
server
game
Spells
SpellEffectsAura.cpp
Generated on
for Project SkyFire Core by
1.17.0