OregonCore  revision fb2a440-git
Your Favourite TBC server
CreatureTextMgr.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #include "Common.h"
19 #include "DatabaseEnv.h"
20 #include "ObjectMgr.h"
21 #include "Cell.h"
22 #include "CellImpl.h"
23 #include "Chat.h"
24 #include "GridNotifiers.h"
25 #include "GridNotifiersImpl.h"
26 #include "CreatureTextMgr.h"
27 #include "World.h"
28 
30 {
31 public:
32  CreatureTextBuilder(WorldObject* obj, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject* target)
33  : _source(obj), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { }
34 
35  size_t operator()(WorldPacket* data, int loc_idx) const
36  {
37  std::string text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, loc_idx);
38 
40  }
41 
42 private:
50 };
51 
53 {
54 public:
55  PlayerTextBuilder(WorldObject* obj, WorldObject* speaker, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject* target)
56  : _source(obj), _talker(speaker), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { }
57 
58  size_t operator()(WorldPacket* data, int loc_idx) const
59  {
60  std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, loc_idx);
61 
62  return CreatureTextMgr::BuildMonsterChat(data, _talker, _msgType, text, Language(_language), _target, loc_idx);
63  }
64 
65 private:
74 };
75 
77 {
78  uint32 oldMSTime = getMSTime();
79 
80  mTextMap.clear(); // for reload case
81  //all currently used temp texts are NOT reset
82 
83  QueryResult_AutoPtr result = WorldDatabase.Query("SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, TextRange FROM creature_text");
84 
85  if (!result)
86  {
87  sLog.outString(">> Loaded 0 ceature texts. DB table `creature_text` is empty.");
88 
89  return;
90  }
91 
92  uint32 textCount = 0;
93 
94  do
95  {
96  Field* fields = result->Fetch();
97  CreatureTextEntry temp;
98 
99  temp.creatureId = fields[0].GetUInt32();
100  temp.groupId = fields[1].GetUInt8();
101  temp.id = fields[2].GetUInt8();
102  temp.text = fields[3].GetString();
103  temp.type = ChatMsg(fields[4].GetUInt8());
104  temp.lang = Language(fields[5].GetUInt8());
105  temp.probability = fields[6].GetFloat();
106  temp.emote = Emote(fields[7].GetUInt32());
107  temp.duration = fields[8].GetUInt32();
108  temp.sound = fields[9].GetUInt32();
109  temp.TextRange = CreatureTextRange(fields[10].GetUInt8());
110 
111  if (temp.sound)
112  {
113  if (!sSoundEntriesStore.LookupEntry(temp.sound))
114  {
115  sLog.outError("CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.creatureId, temp.groupId, temp.sound);
116  temp.sound = 0;
117  }
118  }
119 
120  if (!GetLanguageDescByID(temp.lang))
121  {
122  sLog.outError("CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.creatureId, temp.groupId, uint32(temp.lang));
123  temp.lang = LANG_UNIVERSAL;
124  }
125 
126  if (temp.type >= MAX_CHAT_MSG_TYPE)
127  {
128  sLog.outError("CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.creatureId, temp.groupId, uint32(temp.type));
129  temp.type = CHAT_MSG_SAY;
130  }
131 
132  if (temp.emote)
133  {
134  if (!sEmotesStore.LookupEntry(temp.emote))
135  {
136  sLog.outError("CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.creatureId, temp.groupId, uint32(temp.emote));
137  temp.emote = EMOTE_ONESHOT_NONE;
138  }
139  }
140 
141  if (temp.TextRange > TEXT_RANGE_WORLD)
142  {
143  sLog.outError("CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has incorrect TextRange %u.", temp.creatureId, temp.groupId, temp.id, temp.TextRange);
145  }
146 
147  // add the text into our entry's group
148  mTextMap[temp.creatureId][temp.groupId].push_back(temp);
149 
150  ++textCount;
151  }
152  while (result->NextRow());
153 
154  sLog.outString(">> Loaded %u creature texts for %lu creatures in %u ms", textCount, mTextMap.size(), GetMSTimeDiffToNow(oldMSTime));
155 }
156 
158 {
159  uint32 oldMSTime = getMSTime();
160 
161  mLocaleTextMap.clear(); // for reload case
162 
163  QueryResult_AutoPtr result = WorldDatabase.Query("SELECT CreatureID, GroupID, ID, Locale, Text FROM creature_text_locale");
164 
165  if (!result)
166  return;
167 
168  do
169  {
170  Field* fields = result->Fetch();
171  uint32 creatureId = fields[0].GetUInt32();
172  uint32 groupId = fields[1].GetUInt8();
173  uint32 id = fields[2].GetUInt8();
174  std::string localeName = fields[3].GetString();
175  std::string text = fields[4].GetString();
176 
177  CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(creatureId, groupId, id)];
178  LocaleConstant locale = GetLocaleByName(localeName);
179  if (locale == LOCALE_enUS)
180  continue;
181 
182  ObjectMgr::AddLocaleString(text, locale, data.Text);
183  } while (result->NextRow());
184 
185  sLog.outString(">> Loaded %u creature localized texts in %u ms", int32(mLocaleTextMap.size()), GetMSTimeDiffToNow(oldMSTime));
186 
187 }
188 
189 uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject* 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*/)
190 {
191  if (!source)
192  return 0;
193 
194  CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry());
195  if (sList == mTextMap.end())
196  {
197  sLog.outError("CreatureTextMgr: Could not find Text for Creature %s (Entry %u, GUID %u) in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry(), source->GetGUIDLow());
198  return 0;
199  }
200 
201  CreatureTextHolder const& textHolder = sList->second;
202  CreatureTextHolder::const_iterator itr = textHolder.find(textGroup);
203  if (itr == textHolder.end())
204  {
205  sLog.outError("CreatureTextMgr: Could not find TextGroup %u for Creature %s (Entry %u, GUID %u) in 'creature_text' table. Ignoring.", uint32(textGroup), source->GetName(), source->GetEntry(), source->GetGUIDLow());
206  return 0;
207  }
208 
209  CreatureTextGroup const& textGroupContainer = itr->second; //has all texts in the group
210  CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source, textGroup);//has all textIDs from the group that were already said
211  CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup
212 
213  for (CreatureTextGroup::const_iterator giter = textGroupContainer.begin(); giter != textGroupContainer.end(); ++giter)
214  if (std::find(repeatGroup.begin(), repeatGroup.end(), giter->id) == repeatGroup.end())
215  tempGroup.push_back(*giter);
216 
217  if (tempGroup.empty())
218  {
219  source->ClearTextRepeatGroup(textGroup);
220  tempGroup = textGroupContainer;
221  }
222 
223  uint8 count = 0;
224  float lastChance = -1;
225  bool isEqualChanced = true;
226 
227  float totalChance = 0;
228 
229  for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter)
230  {
231  if (lastChance >= 0 && lastChance != iter->probability)
232  isEqualChanced = false;
233 
234  lastChance = iter->probability;
235  totalChance += iter->probability;
236  ++count;
237  }
238 
239  int32 offset = -1;
240  if (!isEqualChanced)
241  {
242  for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter)
243  {
244  uint32 chance = uint32(iter->probability);
245  uint32 r = urand(0, 100);
246  ++offset;
247  if (r <= chance)
248  break;
249  }
250  }
251 
252  uint32 pos = 0;
253  if (isEqualChanced || offset < 0)
254  pos = urand(0, count - 1);
255  else if (offset >= 0)
256  pos = offset;
257 
258  CreatureTextGroup::const_iterator iter = tempGroup.begin() + pos;
259 
260  ChatMsg finalType = (msgType == CHAT_MSG_ADDON) ? iter->type : msgType;
261  Language finalLang = (language == LANG_ADDON) ? iter->lang : language;
262  uint32 finalSound = sound ? sound : iter->sound;
263 
264  if (range == TEXT_RANGE_NORMAL)
265  range = iter->TextRange;
266 
267  if (finalSound)
268  SendSound(source, finalSound, finalType, whisperTarget, range, team, gmOnly);
269 
270  Unit* finalSource = source;
271  if (srcPlr)
272  finalSource = srcPlr;
273 
274  if (iter->emote)
275  SendEmote(finalSource, iter->emote);
276 
277  if (srcPlr)
278  {
279  PlayerTextBuilder builder(source, finalSource, finalSource->getGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget);
280  SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
281  }
282  else
283  {
284  CreatureTextBuilder builder(finalSource, finalSource->getGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget);
285  SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
286  }
287 
288  if (isEqualChanced || totalChance == 100.0f)
289  SetRepeatId(source, textGroup, iter->id);
290 
291  return iter->duration;
292 }
293 
294 size_t CreatureTextMgr::BuildMonsterChat(WorldPacket* data, WorldObject* source, ChatMsg msgtype, std::string text, Language language, WorldObject* whisperTarget, int loc_idx)
295 {
296  if (!source)
297  return 0;
298 
299  size_t receiverGUIDPos = 0;
301 
302  std::string senderName = "";
303  uint64 senderGuid = 0;
304  if (source)
305  {
306  senderGuid = source->GetGUID();
307  senderName = source->GetNameForLocaleIdx(loc_idx);
308  }
309 
310  std::string receiverName = "";
311  uint64 receiverGuid = 0;
312  if (whisperTarget)
313  {
314  receiverGuid = whisperTarget->GetGUID();
315  receiverName = whisperTarget->GetNameForLocaleIdx(loc_idx);
316  }
317 
318  *data << (uint8)msgtype;
319  *data << (uint32)language;
320  *data << (uint64)senderGuid;
321  *data << (uint32)0; // 2.1.0
322  *data << (uint32)(senderName.length() + 1);
323  *data << senderName.c_str();
324  receiverGUIDPos = data->wpos();
325  *data << (uint64)receiverGuid; // Unit Target
326  if (whisperTarget && !IS_PLAYER_GUID(receiverGuid)) //can only whisper players
327  {
328  *data << uint32(receiverName.length() + 1); // string listener_name_length
329  *data << receiverName.c_str(); // string listener_name
330  }
331  *data << (uint32)(text.length() + 1);
332  *data << text;
333  *data << (uint8)0; // ChatTag
334 
335  return receiverGUIDPos;
336 }
337 
338 void CreatureTextMgr::SendNonChatPacket(WorldPacket* data, WorldObject* source, ChatMsg msgtype, WorldObject* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const
339 {
340  if (!source)
341  return;
342 
343  switch (msgtype)
344  {
346  {
347  if (!whisperTarget)
348  return;
349 
350  if (Player* whisperPlayer = whisperTarget->ToPlayer())
351  {
352  if (Group* group = whisperPlayer->GetGroup())
353  group->BroadcastPacket(data, false);
354  }
355  return;
356  }
359  {
360  if (range == TEXT_RANGE_NORMAL) // ignores team and gmOnly
361  {
362  if (!whisperTarget || whisperTarget->GetTypeId() != TYPEID_PLAYER)
363  return;
364 
365  whisperTarget->ToPlayer()->GetSession()->SendPacket(data);
366  return;
367  }
368  }
369  break;
370  case CHAT_MSG_SAY://default dist
371  default:
372  break;
373  }
374 
375  switch (range)
376  {
377  case TEXT_RANGE_AREA:
378  {
379  uint32 areaId = source->GetAreaId();
380  Map::PlayerList const& pList = source->GetMap()->GetPlayers();
381  for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
382  if (itr->GetSource()->GetAreaId() == areaId && (!team || (team && itr->GetSource()->GetTeam() == team)) && (!gmOnly || itr->GetSource()->IsGameMaster()))
383  itr->GetSource()->GetSession()->SendPacket(data);
384  }
385  return;
386  case TEXT_RANGE_ZONE:
387  {
388  uint32 zoneId = source->GetZoneId();
389  Map::PlayerList const& pList = source->GetMap()->GetPlayers();
390  for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
391  if (itr->GetSource()->GetZoneId() == zoneId && (!team || (team && itr->GetSource()->GetTeam() == team)) && (!gmOnly || itr->GetSource()->IsGameMaster()))
392  itr->GetSource()->GetSession()->SendPacket(data);
393  }
394  return;
395  case TEXT_RANGE_MAP:
396  {
397  Map::PlayerList const& pList = source->GetMap()->GetPlayers();
398  for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
399  if (!team || ((team && itr->GetSource()->GetTeam() == team) && (!gmOnly || itr->GetSource()->IsGameMaster())))
400  itr->GetSource()->GetSession()->SendPacket(data);
401  }
402  return;
403  case TEXT_RANGE_WORLD:
404  {
405  const SessionMap smap = sWorld.GetAllSessions();
406  for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
407  if (Player* plr = (*iter).second->GetPlayer())
408  if (plr->GetSession() && (!team || (team && plr->GetTeam() == team)) && (!gmOnly || plr->IsGameMaster()))
409  plr->GetSession()->SendPacket(data);
410  }
411  return;
412  case TEXT_RANGE_NORMAL:
413  default:
414  break;
415  }
416 
417  float dist = GetRangeForChatType(msgtype);
418  source->SendMessageToSetInRange(data, dist, true);
419 }
420 
422 {
423  float dist = sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY);
424  switch (msgType)
425  {
427  dist = sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL);
428  break;
431  dist = sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE);
432  break;
433  default:
434  break;
435  }
436 
437  return dist;
438 }
439 
440 void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject* whisperTarget, CreatureTextRange range, Team team, bool gmOnly)
441 {
442  if (!sound || !source)
443  return;
444 
445  WorldPacket data(SMSG_PLAY_SOUND, 4);
446  data << uint32(sound);
447  SendNonChatPacket(&data, source, msgType, whisperTarget, range, team, gmOnly);
448 }
449 
451 {
452  if (!source)
453  return;
454 
455  source->HandleEmoteCommand(emote);
456 }
457 
458 void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id)
459 {
460  if (!source)
461  return;
462 
463  source->SetTextRepeatId(textGroup, id);
464 }
465 
467 {
468  ASSERT(source);//should never happen
469 
470  return source->GetTextRepeatGroup(textGroup);
471 }
472 
473 bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup)
474 {
475  if (!sourceEntry)
476  return false;
477 
478  CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry);
479  if (sList == mTextMap.end())
480  {
481  sLog.outDebug("CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry);
482  return false;
483  }
484 
485  CreatureTextHolder const& textHolder = sList->second;
486  CreatureTextHolder::const_iterator itr = textHolder.find(textGroup);
487  if (itr == textHolder.end())
488  {
489  sLog.outDebug("CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry);
490  return false;
491  }
492 
493  return true;
494 }
495 
496 std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, int loc_idx) const
497 {
498  CreatureTextMap::const_iterator mapitr = mTextMap.find(entry);
499  if (mapitr == mTextMap.end())
500  return "";
501 
502  CreatureTextHolder::const_iterator holderItr = mapitr->second.find(textGroup);
503  if (holderItr == mapitr->second.end())
504  return "";
505 
506  CreatureTextGroup::const_iterator groupItr = holderItr->second.begin();
507  for (; groupItr != holderItr->second.end(); ++groupItr)
508  if (groupItr->id == id)
509  break;
510 
511  if (groupItr == holderItr->second.end())
512  return "";
513 
514  std::string baseText = groupItr->text;
515 
516  LocaleCreatureTextMap::const_iterator locItr = mLocaleTextMap.find(CreatureTextId(entry, uint32(textGroup), id));
517  if (locItr != mLocaleTextMap.end())
518  ObjectMgr::GetLocaleString(locItr->second.Text, loc_idx, baseText);
519 
520  return baseText;
521 }
void SetTextRepeatId(uint8 textGroup, uint8 id)
Definition: Creature.cpp:2656
UNORDERED_MAP< uint32, WorldSession * > SessionMap
Definition: World.h:454
float GetRangeForChatType(ChatMsg msgType) const
void SetRepeatId(Creature *source, uint8 textGroup, uint8 id)
Map * GetMap() const
Definition: Object.h:841
DatabaseType WorldDatabase
Accessor to the world database.
Definition: Main.cpp:53
static void AddLocaleString(std::string const &s, LocaleConstant locale, StringVector &data)
Definition: ObjectMgr.cpp:7564
Emote
DBCStorage< EmotesEntry > sEmotesStore(EmotesEntryfmt)
std::vector< CreatureTextEntry > CreatureTextGroup
CreatureTextRange TextRange
Definition: Field.h:24
uint32 SendChat(Creature *source, uint8 textGroup, WorldObject *whisperTarget=nullptr, ChatMsg msgType=CHAT_MSG_ADDON, Language language=LANG_ADDON, CreatureTextRange range=TEXT_RANGE_NORMAL, uint32 sound=0, Team team=TEAM_NONE, bool gmOnly=false, Player *srcPlr=nullptr)
uint32 GetZoneId() const
Definition: Object.cpp:1179
WorldObject * _target
std::vector< uint8 > CreatureTextRepeatIds
Definition: Creature.h:456
uint32 getMSTime()
Definition: Timer.h:32
#define sLog
Log class singleton.
Definition: Log.h:187
ChatMsg
ACE_INT32 int32
Definition: Define.h:67
QueryResult_AutoPtr Query(const char *sql)
Definition: Database.cpp:383
void Initialize(uint16 opcode, size_t newres=200)
Definition: WorldPacket.h:37
CreatureTextBuilder(WorldObject *obj, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject *target)
static size_t BuildMonsterChat(WorldPacket *data, WorldObject *source, ChatMsg msgtype, std::string text, Language language, WorldObject *whisperTarget, int loc_idx)
LocaleConstant GetLocaleByName(const std::string &name)
Definition: Common.cpp:33
uint32 GetGUIDLow() const
Definition: Object.h:166
PlayerTextBuilder(WorldObject *obj, WorldObject *speaker, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject *target)
iterator begin()
Definition: MapRefManager.h:48
void SendPacket(WorldPacket const *packet)
UNORDERED_MAP< uint8, CreatureTextGroup > CreatureTextHolder
const char * GetString() const
Definition: Field.h:41
Player * ToPlayer()
Definition: Object.h:392
#define IS_PLAYER_GUID(Guid)
Definition: ObjectGuid.h:69
size_t wpos() const
Definition: ByteBuffer.h:264
uint8 GetTypeId() const
Definition: Object.h:210
bool TextExist(uint32 sourceEntry, uint8 textGroup)
Team
ACE_UINT8 uint8
Definition: Define.h:73
Language
WorldObject * _talker
#define sCreatureTextMgr
size_t operator()(WorldPacket *data, int loc_idx) const
CreatureTextRepeatIds GetRepeatGroup(Creature *source, uint8 textGroup)
uint32 GetAreaId() const
Definition: Object.cpp:1184
void SendNonChatPacket(WorldPacket *data, WorldObject *source, ChatMsg msgtype, WorldObject *whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const
std::string GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, int loc_idx) const
CreatureTextRange
WorldObject * _source
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
const char * GetName() const
Definition: Object.h:704
size_t operator()(WorldPacket *data, int loc_idx) const
LanguageDesc const * GetLanguageDescByID(uint32 lang)
Definition: ObjectMgr.cpp:269
ACE_UINT64 uint64
Definition: Define.h:70
PlayerList const & GetPlayers() const
Definition: Map.h:491
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:94
static void GetLocaleString(const StringVector &data, int loc_idx, std::string &value)
Definition: ObjectMgr.h:1151
ACE_Refcounted_Auto_Ptr< QueryResult, ACE_Null_Mutex > QueryResult_AutoPtr
Definition: QueryResult.h:113
uint8 getGender() const
Definition: Unit.h:1064
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self)
Definition: Object.cpp:1933
#define ASSERT
Definition: Errors.h:29
void HandleEmoteCommand(uint32 anim_id)
Definition: Unit.cpp:1970
uint32 GetEntry() const
Definition: Object.h:192
WorldSession * GetSession() const
Definition: Player.h:1944
LocaleConstant
Definition: Common.h:211
#define sWorld
Definition: World.h:860
CreatureTextRepeatIds GetTextRepeatGroup(uint8 textGroup)
Definition: Creature.cpp:2665
void LoadCreatureTextLocales()
void SendEmote(Unit *source, uint32 emote)
ACE_UINT32 uint32
Definition: Define.h:71
virtual const char * GetNameForLocaleIdx(int32) const
Definition: Object.h:713
Definition: Unit.h:908
static Player * GetPlayer(WorldObject &object, uint64 guid)
Definition: Unit.cpp:10676
Definition: Player.h:922
void SendSound(Creature *source, uint32 sound, ChatMsg msgType, WorldObject *whisperTarget, CreatureTextRange range, Team team, bool gmOnly)
#define MAX_CHAT_MSG_TYPE
void ClearTextRepeatGroup(uint8 textGroup)
Definition: Creature.cpp:2676
iterator end()
Definition: MapRefManager.h:52
Definition: Group.h:154
uint32 urand(uint32 min, uint32 max)
Definition: Util.cpp:33
const uint64 & GetGUID() const
Definition: Object.h:162