mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +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)
|
||||
if (!zoneId || itr->getSource()->GetZoneId() == zoneId)
|
||||
itr->getSource()->SendDirectMessage(&data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
|
|||
|
||||
void MonsterYellToMap(ObjectGuid guid, int32 textId, uint32 language, Unit* target);
|
||||
void MonsterYellToMap(CreatureInfo const* cinfo, int32 textId, uint32 language, Unit* target, uint32 senderLowGuid = 0);
|
||||
void PlayDirectSoundToMap(uint32 soundId);
|
||||
void PlayDirectSoundToMap(uint32 soundId, uint32 zoneId = 0);
|
||||
|
||||
private:
|
||||
void LoadMapAndVMap(int gx, int gy);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11811"
|
||||
#define REVISION_NR "11812"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue