Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
SpellEffectsMedia.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 "
SpellEffectMetadata.h
"
47
#include "
SpellMgr.h
"
48
#include "
SpellValidation.h
"
49
#include "
TemporarySummon.h
"
50
#include "
Totem.h
"
51
#include "
Unit.h
"
52
#include "
UpdateData.h
"
53
#include "
UpdateMask.h
"
54
#include "
Util.h
"
55
#include "
Vehicle.h
"
56
#include "
VMapFactory.h
"
57
#include "
World.h
"
58
#include "
WorldPacket.h
"
59
60
void
Spell::EffectPlayMovie
(
SpellEffIndex
effIndex)
61
{
62
if
(
effectHandleMode
!=
SPELL_EFFECT_HANDLE_HIT_TARGET
)
63
return
;
64
65
if
(
unitTarget
->GetTypeId() !=
TypeID::TYPEID_PLAYER
)
66
return
;
67
68
uint32
movieId =
GetSpellInfo
()->
Effects
[effIndex].
MiscValue
;
69
if
(!
sMovieStore
.LookupEntry(movieId))
70
return
;
71
72
unitTarget
->ToPlayer()->SendMovieStart(movieId);
73
}
74
75
void
Spell::EffectPlayMusic
(
SpellEffIndex
effIndex)
76
{
77
if
(
effectHandleMode
!=
SPELL_EFFECT_HANDLE_HIT_TARGET
)
78
return
;
79
80
if
(!
unitTarget
||
unitTarget
->GetTypeId() !=
TypeID::TYPEID_PLAYER
)
81
return
;
82
83
uint32
SoundKitID =
m_spellInfo
->Effects[effIndex].MiscValue;
84
85
if
(!
sSoundEntriesStore
.LookupEntry(SoundKitID))
86
{
87
SF_LOG_ERROR
(
"spells"
,
"EffectPlayMusic: Sound (Id: %u) not exist in spell %u."
, SoundKitID,
m_spellInfo
->Id);
88
return
;
89
}
90
91
unitTarget
->ToPlayer()->GetSession()->SendPlayMusic(SoundKitID);
92
}
93
94
void
Spell::EffectPlaySound
(
SpellEffIndex
effIndex)
95
{
96
if
(
effectHandleMode
!=
SPELL_EFFECT_HANDLE_HIT_TARGET
)
97
return
;
98
99
if
(!
unitTarget
||
unitTarget
->GetTypeId() !=
TypeID::TYPEID_PLAYER
)
100
return
;
101
102
if
(
Skyfire::Spells::ShouldSendNoFlyZoneNotification
(
m_spellInfo
->Id))
103
unitTarget
->ToPlayer()->GetSession()->SendNotification(
LANG_ZONE_NOFLYZONE
);
104
105
uint32
soundId =
m_spellInfo
->Effects[effIndex].MiscValue;
106
107
if
(!
sSoundEntriesStore
.LookupEntry(soundId))
108
{
109
SF_LOG_ERROR
(
"spells"
,
"EffectPlaySound: Sound (Id: %u) not exist in spell %u."
, soundId,
m_spellInfo
->Id);
110
return
;
111
}
112
113
ObjectGuid
guid =
m_caster
->GetGUID();
114
115
WorldPacket
data(
SMSG_PLAY_SOUND
, 4 + 9);
116
data.
WriteBit
(guid[2]);
117
data.
WriteBit
(guid[3]);
118
data.
WriteBit
(guid[7]);
119
data.
WriteBit
(guid[6]);
120
data.
WriteBit
(guid[0]);
121
data.
WriteBit
(guid[5]);
122
data.
WriteBit
(guid[4]);
123
data.
WriteBit
(guid[1]);
124
data <<
uint32
(soundId);
125
data.
WriteByteSeq
(guid[3]);
126
data.
WriteByteSeq
(guid[2]);
127
data.
WriteByteSeq
(guid[4]);
128
data.
WriteByteSeq
(guid[7]);
129
data.
WriteByteSeq
(guid[5]);
130
data.
WriteByteSeq
(guid[0]);
131
data.
WriteByteSeq
(guid[6]);
132
data.
WriteByteSeq
(guid[1]);
133
unitTarget
->ToPlayer()->GetSession()->SendPacket(&data);
134
}
AccountMgr.h
AreaTrigger.h
BattlePetMgr.h
Battleground.h
BattlegroundMgr.h
CellImpl.h
Common.h
Creature.h
CreatureAI.h
sMovieStore
DBCStorage< MovieEntry > sMovieStore(MovieEntryfmt)
sSoundEntriesStore
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
DatabaseEnv.h
uint32
std::uint32_t uint32
Definition
Define.h:77
DynamicObject.h
Formulas.h
GameObject.h
GameObjectAI.h
GossipDef.h
GridNotifiers.h
GridNotifiersImpl.h
Group.h
Guild.h
GuildMgr.h
InstanceScript.h
Language.h
LANG_ZONE_NOFLYZONE
@ LANG_ZONE_NOFLYZONE
Definition
Language.h:761
Log.h
SF_LOG_ERROR
#define SF_LOG_ERROR(filterType__,...)
Definition
Log.h:143
MapManager.h
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
ObjectAccessor.h
ObjectMgr.h
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_TARGET
@ SPELL_EFFECT_HANDLE_HIT_TARGET
Definition
Spell.h:277
SpellAuraEffects.h
SpellAuras.h
SpellEffectMetadata.h
SpellMgr.h
SpellValidation.h
TemporarySummon.h
Totem.h
Unit.h
UpdateData.h
UpdateMask.h
Util.h
VMapFactory.h
Vehicle.h
World.h
WorldPacket.h
ByteBuffer::WriteBit
bool WriteBit(uint32 bit)
Definition
ByteBuffer.h:164
ByteBuffer::WriteByteSeq
void WriteByteSeq(uint8 b)
Definition
ByteBuffer.h:227
SpellEffectInfo::MiscValue
int32 MiscValue
Definition
SpellInfo.h:99
Spell::GetSpellInfo
SpellInfo const * GetSpellInfo() const
Definition
Spell.h:565
Spell::EffectPlayMusic
void EffectPlayMusic(SpellEffIndex effIndex)
Definition
SpellEffectsMedia.cpp:75
Spell::effectHandleMode
SpellEffectHandleMode effectHandleMode
Definition
Spell.h:631
Spell::m_caster
Unit *const m_caster
Definition
Spell.h:581
Spell::unitTarget
Unit * unitTarget
Definition
Spell.h:626
Spell::EffectPlaySound
void EffectPlaySound(SpellEffIndex effIndex)
Definition
SpellEffectsMedia.cpp:94
Spell::EffectPlayMovie
void EffectPlayMovie(SpellEffIndex effIndex)
Definition
SpellEffectsMedia.cpp:60
Spell::m_spellInfo
SpellInfo const *const m_spellInfo
Definition
Spell.h:530
SpellInfo::Effects
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
Definition
SpellInfo.h:255
WorldPacket
Definition
WorldPacket.h:16
SMSG_PLAY_SOUND
@ SMSG_PLAY_SOUND
Definition
Opcodes.h:883
Skyfire::Spells::ShouldSendNoFlyZoneNotification
bool ShouldSendNoFlyZoneNotification(uint32 spellId)
Definition
SpellEffectMetadata.cpp:237
ObjectGuid
Definition
ByteBuffer.h:66
src
server
game
Spells
SpellEffectsMedia.cpp
Generated on
for Project SkyFire Core by
1.17.0