mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11812] Add possibility to send sound only to a zone in Map::PlayDirectSoundToMap
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
379ef94aa7
commit
35ad6b2ae5
3 changed files with 6 additions and 4 deletions
|
|
@ -3230,13 +3230,15 @@ void Map::MonsterYellToMap(CreatureInfo const* cinfo, int32 textId, uint32 langu
|
|||
* Function to play sound to all players in map
|
||||
*
|
||||
* @param soundId Played Sound
|
||||
* @param zoneId Id of the Zone to which the sound should be restricted
|
||||
*/
|
||||
void Map::PlayDirectSoundToMap(uint32 soundId)
|
||||
void Map::PlayDirectSoundToMap(uint32 soundId, uint32 zoneId /*=0*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
||||
data << uint32(soundId);
|
||||
|
||||
Map::PlayerList const& pList = GetPlayers();
|
||||
for (PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
itr->getSource()->SendDirectMessage(&data);
|
||||
if (!zoneId || itr->getSource()->GetZoneId() == zoneId)
|
||||
itr->getSource()->SendDirectMessage(&data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue