mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7577] Implement YellToZone for different world object types.
This commit is contained in:
parent
5dd3ce31bc
commit
24f1cf4b83
8 changed files with 29 additions and 1 deletions
|
|
@ -84,6 +84,7 @@ class Corpse : public WorldObject
|
||||||
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
||||||
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
|
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
|
||||||
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
|
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; }
|
GridReference<Corpse> &GetGridRef() { return m_gridRef; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -528,6 +528,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
||||||
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
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 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 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
|
// overwrite WorldObject function for proper name localization
|
||||||
const char* GetNameForLocaleIdx(int32 locale_idx) const;
|
const char* GetNameForLocaleIdx(int32 locale_idx) const;
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ class DynamicObject : public WorldObject
|
||||||
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
||||||
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
|
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
|
||||||
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
|
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; }
|
GridReference<DynamicObject> &GetGridRef() { return m_gridRef; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -448,6 +448,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
||||||
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
|
||||||
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
|
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
|
||||||
void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); }
|
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
|
// overwrite WorldObject function for proper name localization
|
||||||
const char* GetNameForLocaleIdx(int32 locale_idx) const;
|
const char* GetNameForLocaleIdx(int32 locale_idx) const;
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,22 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||||
|
|
||||||
void SendToPlayers(WorldPacket const* data) const;
|
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;
|
typedef MapRefManager PlayerList;
|
||||||
PlayerList const& GetPlayers() const { return m_mapRefManager; }
|
PlayerList const& GetPlayers() const { return m_mapRefManager; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1309,6 +1309,13 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
|
||||||
cell_lock->Visit(cell_lock, message, *GetMap());
|
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)
|
void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote)
|
||||||
{
|
{
|
||||||
CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());
|
CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());
|
||||||
|
|
|
||||||
|
|
@ -456,6 +456,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
||||||
void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid);
|
void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid);
|
||||||
void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
|
void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
|
||||||
void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = 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 BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
|
||||||
|
|
||||||
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
|
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7576"
|
#define REVISION_NR "7577"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue