mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
[7577] Implement YellToZone for different world object types. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -86,6 +86,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<Corpse> &GetGridRef() { return m_gridRef; }
|
||||
private:
|
||||
|
||||
@@ -553,6 +553,7 @@ class TRINITY_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;
|
||||
|
||||
@@ -54,6 +54,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<DynamicObject> &GetGridRef() { return m_gridRef; }
|
||||
protected:
|
||||
|
||||
@@ -451,6 +451,7 @@ class TRINITY_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;
|
||||
|
||||
@@ -396,6 +396,22 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
|
||||
|
||||
void SendToPlayers(WorldPacket const* data) const;
|
||||
|
||||
template<class Do>
|
||||
void BroadcastWorker(Do& _do) const
|
||||
{
|
||||
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
_do(itr->getSource());
|
||||
}
|
||||
|
||||
template<class Do>
|
||||
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; }
|
||||
|
||||
|
||||
@@ -1516,6 +1516,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<MaNGOS::MonsterChatBuilder> say_do(say_build);
|
||||
GetMap()->BroadcastWorker(say_do,GetZoneId());
|
||||
}
|
||||
|
||||
void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote)
|
||||
{
|
||||
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||
|
||||
@@ -485,6 +485,7 @@ class TRINITY_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);
|
||||
|
||||
Reference in New Issue
Block a user