summaryrefslogtreecommitdiff
path: root/src/scripts/Commands/cs_lookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/Commands/cs_lookup.cpp')
-rw-r--r--src/scripts/Commands/cs_lookup.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/scripts/Commands/cs_lookup.cpp b/src/scripts/Commands/cs_lookup.cpp
index c8f72068d1..fda4b5e7c6 100644
--- a/src/scripts/Commands/cs_lookup.cpp
+++ b/src/scripts/Commands/cs_lookup.cpp
@@ -164,6 +164,33 @@ public:
for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
{
uint32 id = itr->second.Entry;
+ uint8 localeIndex = handler->GetSessionDbLocaleIndex();
+ if (CreatureLocale const* creatureLocale = sObjectMgr->GetCreatureLocale(id))
+ {
+ if (creatureLocale->Name.size() > localeIndex && !creatureLocale->Name[localeIndex].empty())
+ {
+ std::string name = creatureLocale->Name[localeIndex];
+
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
+
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str());
+
+ if (!found)
+ found = true;
+
+ continue;
+ }
+ }
+ }
std::string name = itr->second.Name;
if (name.empty())