feat(Core/Script): Playing music from GameObjects and added holiday zones music script (#3307)

This commit is contained in:
Petric
2020-09-02 15:32:41 +01:00
committed by GitHub
parent e2f9a080f2
commit 29f2c2aeda
4 changed files with 399 additions and 0 deletions

View File

@@ -2894,6 +2894,21 @@ void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= NULL*/)
SendMessageToSet(&data, true);
}
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= NULL*/)
{
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << uint32(music_id);
if (target)
{
target->SendDirectMessage(&data);
}
else
{
SendMessageToSet(&data, true);
}
}
void WorldObject::DestroyForNearbyPlayers()
{
if (!IsInWorld())