214 TC_LOG_ERROR(
"sql.sql",
"CreatureTextMgr: Could not find Text for Creature %s (%s) in 'creature_text' table. Ignoring.", source->
GetName().c_str(), source->
GetGUID().
ToString().c_str());
219 CreatureTextHolder::const_iterator itr = textHolder.find(textGroup);
220 if (itr == textHolder.end())
222 TC_LOG_ERROR(
"sql.sql",
"CreatureTextMgr: Could not find TextGroup %u for Creature %s (%s) in 'creature_text' table. Ignoring.",
uint32(textGroup), source->
GetName().c_str(), source->
GetGUID().
ToString().c_str());
230 for (CreatureTextGroup::const_iterator giter = textGroupContainer.begin(); giter != textGroupContainer.end(); ++giter)
231 if (std::find(repeatGroup.begin(), repeatGroup.end(), giter->id) == repeatGroup.end())
232 tempGroup.push_back(*giter);
234 if (tempGroup.empty())
237 tempGroup = textGroupContainer;
247 uint32 finalSound = sound ? sound : iter->sound;
250 range = iter->TextRange;
253 SendSound(source, finalSound, finalType, whisperTarget, range, team, gmOnly);
255 Unit* finalSource = source;
257 finalSource = srcPlr;
264 PlayerTextBuilder builder(source, finalSource, finalSource->
getGender(), finalType, iter->group, iter->id, finalLang, whisperTarget);
265 SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
270 SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
274 return iter->duration;
Definition: CreatureTextMgr.cpp:30
void SetRepeatId(Creature *source, uint8 textGroup, uint8 id)
Definition: CreatureTextMgr.cpp:391
Definition: CreatureTextMgr.h:31
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)
Definition: CreatureTextMgr.h:166
std::vector< CreatureTextEntry > CreatureTextGroup
Definition: CreatureTextMgr.h:73
C::const_iterator SelectRandomWeightedContainerElement(C const &container, std::vector< double > weights)
Definition: Containers.h:85
std::string const & GetName() const
Definition: Object.h:479
std::vector< uint8 > CreatureTextRepeatIds
Definition: Creature.h:464
ChatMsg
Definition: SharedDefines.h:4228
Definition: CreatureTextMgr.h:38
Language
Definition: SharedDefines.h:959
uint32_t uint32
Definition: Define.h:150
CreatureTextRepeatIds GetRepeatGroup(Creature *source, uint8 textGroup) const
Definition: CreatureTextMgr.cpp:399
Definition: CreatureTextMgr.cpp:54
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: SharedDefines.h:4230
float probability
Definition: CreatureTextMgr.h:46
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)
Definition: CreatureTextMgr.cpp:296
uint8 getGender() const
Definition: Unit.h:1415
CreatureTextMap mTextMap
Definition: CreatureTextMgr.h:109
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
std::unordered_map< uint8, CreatureTextGroup > CreatureTextHolder
Definition: CreatureTextMgr.h:74
uint32_t uint32
Definition: g3dmath.h:168
static void SendEmote(Unit *source, uint32 emote)
Definition: CreatureTextMgr.cpp:383
std::string ToString() const
Definition: ObjectGuid.cpp:99
void ClearTextRepeatGroup(uint8 textGroup)
Definition: Creature.cpp:2815
Definition: SharedDefines.h:985