![]() |
TrinityCore
|
#include <CreatureTextMgr.h>
Public Member Functions | |
| void | LoadCreatureTexts () |
| void | LoadCreatureTextLocales () |
| CreatureTextMap const & | GetTextMap () const |
| uint32 | SendChat (Creature *source, uint8 textGroup, WorldObject const *whisperTarget=nullptr, ChatMsg msgType=CHAT_MSG_ADDON, Language language=LANG_ADDON, CreatureTextRange range=TEXT_RANGE_NORMAL, uint32 sound=0, Team team=TEAM_OTHER, bool gmOnly=false, Player *srcPlr=nullptr) |
| bool | TextExist (uint32 sourceEntry, uint8 textGroup) const |
| std::string | GetLocalizedChatString (uint32 entry, uint8 gender, uint8 textGroup, uint32 id, LocaleConstant locale) const |
Static Public Member Functions | |
| static CreatureTextMgr * | instance () |
| static void | SendSound (Creature *source, uint32 sound, ChatMsg msgType, WorldObject const *whisperTarget=nullptr, CreatureTextRange range=TEXT_RANGE_NORMAL, Team team=TEAM_OTHER, bool gmOnly=false) |
| static void | SendEmote (Unit *source, Emote emote) |
| template<class Builder > | |
| static void | SendChatPacket (WorldObject *source, Builder const &builder, ChatMsg msgType, WorldObject const *whisperTarget=nullptr, CreatureTextRange range=TEXT_RANGE_NORMAL, Team team=TEAM_OTHER, bool gmOnly=false) |
Private Member Functions | |
| CreatureTextMgr () | |
| ~CreatureTextMgr () | |
Static Private Member Functions | |
| static void | SendNonChatPacket (WorldObject *source, WorldPacket const *data, ChatMsg msgType, WorldObject const *whisperTarget, CreatureTextRange range, Team team, bool gmOnly) |
| static float | GetRangeForChatType (ChatMsg msgType) |
Private Attributes | |
| CreatureTextMap | mTextMap |
| LocaleCreatureTextMap | mLocaleTextMap |
Definition at line 80 of file CreatureTextMgr.h.
|
inlineprivate |
Definition at line 83 of file CreatureTextMgr.h.
|
inlineprivate |
Definition at line 84 of file CreatureTextMgr.h.
| std::string CreatureTextMgr::GetLocalizedChatString | ( | uint32 | entry, |
| uint8 | gender, | ||
| uint8 | textGroup, | ||
| uint32 | id, | ||
| LocaleConstant | locale | ||
| ) | const |
Definition at line 429 of file CreatureTextMgr.cpp.
References DEFAULT_LOCALE, ObjectMgr::GetLocaleString(), BroadcastTextEntry::GetText(), MAX_LOCALES, mLocaleTextMap, mTextMap, and sObjectMgr.
|
staticprivate |
Definition at line 292 of file CreatureTextMgr.cpp.
References CHAT_MSG_MONSTER_EMOTE, CHAT_MSG_MONSTER_YELL, CHAT_MSG_RAID_BOSS_EMOTE, CONFIG_LISTEN_RANGE_SAY, CONFIG_LISTEN_RANGE_TEXTEMOTE, CONFIG_LISTEN_RANGE_YELL, and sWorld.
Referenced by SendChatPacket(), and SendNonChatPacket().
|
inline |
Definition at line 91 of file CreatureTextMgr.h.
|
static |
| void CreatureTextMgr::LoadCreatureTextLocales | ( | ) |
Definition at line 189 of file CreatureTextMgr.cpp.
References ObjectMgr::AddLocaleString(), GetLocaleByName(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt32(), Field::GetUInt8(), LOCALE_enUS, mLocaleTextMap, TC_LOG_INFO, CreatureTextLocale::Text, and WorldDatabase.
| void CreatureTextMgr::LoadCreatureTexts | ( | ) |
Definition at line 97 of file CreatureTextMgr.cpp.
References CreatureTextEntry::BroadcastTextId, CHAT_MSG_SAY, CreatureTextEntry::creatureId, CreatureTextEntry::duration, CreatureTextEntry::emote, EMOTE_ONESHOT_NONE, Field::GetFloat(), GetLanguageDescByID(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt32(), Field::GetUInt8(), CreatureTextEntry::groupId, CreatureTextEntry::id, CreatureTextEntry::lang, LANG_UNIVERSAL, MAX_CHAT_MSG_TYPE, mTextMap, CreatureTextEntry::probability, sEmotesStore, sObjectMgr, CreatureTextEntry::sound, sSoundEntriesStore, TC_LOG_ERROR, TC_LOG_INFO, CreatureTextEntry::text, TEXT_RANGE_NORMAL, TEXT_RANGE_WORLD, CreatureTextEntry::TextRange, CreatureTextEntry::type, WORLD_SEL_CREATURE_TEXT, and WorldDatabase.
| uint32 CreatureTextMgr::SendChat | ( | Creature * | source, |
| uint8 | textGroup, | ||
| WorldObject const * | whisperTarget = nullptr, |
||
| ChatMsg | msgType = CHAT_MSG_ADDON, |
||
| Language | language = LANG_ADDON, |
||
| CreatureTextRange | range = TEXT_RANGE_NORMAL, |
||
| uint32 | sound = 0, |
||
| Team | team = TEAM_OTHER, |
||
| bool | gmOnly = false, |
||
| Player * | srcPlr = nullptr |
||
| ) |
Definition at line 221 of file CreatureTextMgr.cpp.
References CHAT_MSG_ADDON, Creature::ClearTextRepeatGroup(), Object::GetEntry(), Unit::GetGender(), Object::GetGUID(), WorldObject::GetName(), Creature::GetTextRepeatGroup(), LANG_ADDON, mTextMap, CreatureTextEntry::probability, Trinity::Containers::SelectRandomWeightedContainerElement(), SendChatPacket(), SendEmote(), SendSound(), Creature::SetTextRepeatId(), TC_LOG_ERROR, TEXT_RANGE_NORMAL, and ObjectGuid::ToString().
|
static |
Definition at line 87 of file CreatureTextMgrImpl.h.
References MapRefManager::begin(), CHAT_MSG_MONSTER_PARTY, CHAT_MSG_MONSTER_WHISPER, CHAT_MSG_RAID_BOSS_WHISPER, MapRefManager::end(), WorldObject::GetAreaId(), WorldObject::GetMap(), Map::GetPlayers(), GetRangeForChatType(), Object::GetTypeId(), WorldObject::GetZoneId(), sWorld, TEXT_RANGE_AREA, TEXT_RANGE_MAP, TEXT_RANGE_NORMAL, TEXT_RANGE_WORLD, TEXT_RANGE_ZONE, Object::ToPlayer(), TYPEID_PLAYER, and Cell::VisitWorldObjects().
Referenced by SmartScript::ProcessAction(), and SendChat().
Definition at line 398 of file CreatureTextMgr.cpp.
References Unit::HandleEmoteCommand().
Referenced by SendChat().
|
staticprivate |
Definition at line 319 of file CreatureTextMgr.cpp.
References MapRefManager::begin(), CHAT_MSG_MONSTER_PARTY, CHAT_MSG_MONSTER_WHISPER, CHAT_MSG_RAID_BOSS_WHISPER, MapRefManager::end(), WorldObject::GetAreaId(), WorldObject::GetMap(), Map::GetPlayers(), GetRangeForChatType(), Object::GetTypeId(), WorldObject::GetZoneId(), Player::SendDirectMessage(), WorldObject::SendMessageToSetInRange(), sWorld, TEXT_RANGE_AREA, TEXT_RANGE_MAP, TEXT_RANGE_NORMAL, TEXT_RANGE_WORLD, TEXT_RANGE_ZONE, Object::ToPlayer(), and TYPEID_PLAYER.
Referenced by SendSound().
|
static |
Definition at line 311 of file CreatureTextMgr.cpp.
References SendNonChatPacket().
Referenced by SendChat(), boss_the_lich_king::UpdateAI(), and boss_yogg_saron::boss_yogg_saronAI::UpdateAI().
Definition at line 406 of file CreatureTextMgr.cpp.
References mTextMap, and TC_LOG_DEBUG.
|
private |
Definition at line 109 of file CreatureTextMgr.h.
Referenced by GetLocalizedChatString(), and LoadCreatureTextLocales().
|
private |
Definition at line 108 of file CreatureTextMgr.h.
Referenced by GetLocalizedChatString(), LoadCreatureTexts(), SendChat(), and TextExist().