Core/Packets: converted SMSG_PLAY_MUSIC to packet class and corrected packet structure

This commit is contained in:
Ovahlord
2020-04-07 15:51:25 +02:00
parent 77f94a456c
commit 113202ea48
5 changed files with 31 additions and 24 deletions

View File

@@ -38,6 +38,7 @@
#include "Language.h"
#include "Log.h"
#include "LootMgr.h"
#include "MiscPackets.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
@@ -5405,18 +5406,15 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
uint32 soundid = m_spellInfo->Effects[effIndex].MiscValue;
uint32 soundId = m_spellInfo->Effects[effIndex].MiscValue;
if (!sSoundEntriesStore.LookupEntry(soundid))
if (!sSoundEntriesStore.LookupEntry(soundId))
{
TC_LOG_ERROR("spells", "EffectPlayMusic: Sound (Id: %u) does not exist in spell %u.", soundid, m_spellInfo->Id);
TC_LOG_ERROR("spells", "EffectPlayMusic: Sound (Id: %u) does not exist in spell %u.", soundId, m_spellInfo->Id);
return;
}
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << uint32(soundid);
data << uint64(unitTarget->GetGUID());
unitTarget->ToPlayer()->SendDirectMessage(&data);
unitTarget->ToPlayer()->SendDirectMessage(WorldPackets::Misc::PlayMusic(soundId, unitTarget->GetGUID()).Write());
}
void Spell::EffectSpecCount(SpellEffIndex /*effIndex*/)