diff --git a/src/game/Corpse.h b/src/game/Corpse.h index 819382847..c044b339e 100644 --- a/src/game/Corpse.h +++ b/src/game/Corpse.h @@ -84,6 +84,7 @@ class Corpse : public WorldObject void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); } void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } GridReference &GetGridRef() { return m_gridRef; } diff --git a/src/game/Creature.h b/src/game/Creature.h index 90a83df10..7c986ff6f 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -528,6 +528,7 @@ class MANGOS_DLL_SPEC Creature : public Unit void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId,TargetGuid,IsBossEmote); } void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId,receiver,IsBossWhisper); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } // overwrite WorldObject function for proper name localization const char* GetNameForLocaleIdx(int32 locale_idx) const; diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index 830662f0c..ed19dc28f 100644 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -52,6 +52,7 @@ class DynamicObject : public WorldObject void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); } void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } GridReference &GetGridRef() { return m_gridRef; } diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 5d7e9343e..1c9322a6f 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -448,6 +448,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); } void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } // overwrite WorldObject function for proper name localization const char* GetNameForLocaleIdx(int32 locale_idx) const; diff --git a/src/game/Map.h b/src/game/Map.h index e0739c423..8cc9b4791 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -389,6 +389,22 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj void SendToPlayers(WorldPacket const* data) const; + template + void BroadcastWorker(Do& _do) const + { + for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) + _do(itr->getSource()); + } + + template + void BroadcastWorker(Do& _do, uint32 zoneid) const + { + for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) + if(itr->getSource()->GetZoneId()==zoneid) + _do(itr->getSource()); + } + + typedef MapRefManager PlayerList; PlayerList const& GetPlayers() const { return m_mapRefManager; } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index d01ebfa47..490db791a 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1309,6 +1309,13 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) cell_lock->Visit(cell_lock, message, *GetMap()); } +void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid) +{ + MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); + MaNGOS::LocalizedPacketDo say_do(say_build); + GetMap()->BroadcastWorker(say_do,GetZoneId()); +} + void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote) { CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()); diff --git a/src/game/Object.h b/src/game/Object.h index cac13000c..35c0b429d 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -456,6 +456,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid); void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false); void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false); + void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid); void BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const; void PlayDistanceSound(uint32 sound_id, Player* target = NULL); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 28c5eeb56..87355f104 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7576" + #define REVISION_NR "7577" #endif // __REVISION_NR_H__