Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
61{
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
76{
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
95{
97 return;
98
99 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
100 return;
101
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}
DBCStorage< MovieEntry > sMovieStore(MovieEntryfmt)
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
std::uint32_t uint32
Definition Define.h:77
@ LANG_ZONE_NOFLYZONE
Definition Language.h:761
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
@ TYPEID_PLAYER
Definition Object.h:55
SpellEffIndex
@ SPELL_EFFECT_HANDLE_HIT_TARGET
Definition Spell.h:277
bool WriteBit(uint32 bit)
Definition ByteBuffer.h:164
void WriteByteSeq(uint8 b)
Definition ByteBuffer.h:227
SpellInfo const * GetSpellInfo() const
Definition Spell.h:565
void EffectPlayMusic(SpellEffIndex effIndex)
SpellEffectHandleMode effectHandleMode
Definition Spell.h:631
Unit *const m_caster
Definition Spell.h:581
Unit * unitTarget
Definition Spell.h:626
void EffectPlaySound(SpellEffIndex effIndex)
void EffectPlayMovie(SpellEffIndex effIndex)
SpellInfo const *const m_spellInfo
Definition Spell.h:530
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
Definition SpellInfo.h:255
@ SMSG_PLAY_SOUND
Definition Opcodes.h:883
bool ShouldSendNoFlyZoneNotification(uint32 spellId)