41#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
42#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
54 static std::vector<ChatCommand> lookupPlayerCommandTable =
61 static std::vector<ChatCommand> lookupCommandTable =
73 {
"player", lookupPlayerCommandTable },
86 {
"lookup", lookupCommandTable },
96 std::string namePart = args;
97 std::wstring wNamePart;
116 std::string name = areaEntry->
AreaName[locale];
139 if (maxResults && count++ == maxResults)
146 std::ostringstream ss;
148 ss << i <<
" - |cffffffff|Harea:" << i <<
"|h[" << name <<
"]|h|r";
150 ss << i <<
" - " << name;
171 std::string namePart = args;
172 std::wstring wNamePart;
185 for (
auto const& creatureTemplatePair : ctc)
187 uint32 id = creatureTemplatePair.first;
191 if (creatureLocale->Name.size() > localeIndex && !creatureLocale->Name[localeIndex].empty())
193 std::string
const& name = creatureLocale->Name[localeIndex];
197 if (maxResults && count++ == maxResults)
216 std::string
const& name = creatureTemplatePair.second.Name;
222 if (maxResults && count++ == maxResults)
249 std::string namePart = args;
250 std::wstring wNamePart;
265 for (
uint32 id = 0;
id < events.size(); ++id)
275 if (maxResults && count++ == maxResults)
307 std::string namePart = args;
308 std::wstring wNamePart;
328 std::string name = factionEntry->
Name[locale];
340 name = factionEntry->
Name[locale];
351 if (maxResults && count++ == maxResults)
359 std::ostringstream ss;
361 ss <<
id <<
" - |cffffffff|Hfaction:" <<
id <<
"|h[" << name <<
' ' <<
localeNames[locale] <<
"]|h|r";
363 ss <<
id <<
" - " << name <<
' ' <<
localeNames[locale];
405 std::string namePart = args;
406 std::wstring wNamePart;
420 for (
auto const& itemTemplatePair : its)
428 if (maxResults && count++ == maxResults)
455 uint32 id = atoi((
char*)args);
483 std::string namePart = args;
484 std::wstring wNamePart;
503 std::string name = set->
Name[locale];
515 name = set->
Name[locale];
526 if (maxResults && count++ == maxResults)
554 std::string namePart = args;
555 std::wstring wNamePart;
568 for (
auto const& gameObjectTemplatePair : gotc)
573 if (objectLocalte->Name.size() > localeIndex && !objectLocalte->Name[localeIndex].empty())
575 std::string
const& name = objectLocalte->Name[localeIndex];
578 if (maxResults && count++ == maxResults)
597 std::string
const& name = gameObjectTemplatePair.second.name;
603 if (maxResults && count++ == maxResults)
633 std::string namePart = args;
634 std::wstring wNamePart;
647 for (
auto const& questTemplatePair : questTemplates)
652 if (questLocale->LogTitle.size() > localeIndex && !questLocale->LogTitle[localeIndex].empty())
654 std::string title = questLocale->LogTitle[localeIndex];
658 if (maxResults && count++ == maxResults)
664 char const* statusStr =
"";
689 maxLevel = questLevels->MaxLevel;
691 int32 scalingFactionGroup = 0;
693 scalingFactionGroup = contentTuning->GetScalingFactionGroup();
698 maxLevel, scalingFactionGroup,
699 title.c_str(), statusStr);
712 std::string title = questTemplatePair.second->GetLogTitle();
718 if (maxResults && count++ == maxResults)
724 char const* statusStr =
"";
749 maxLevel = questLevels->MaxLevel;
751 int32 scalingFactionGroup = 0;
753 scalingFactionGroup = contentTuning->GetScalingFactionGroup();
758 maxLevel, scalingFactionGroup,
759 title.c_str(), statusStr);
780 uint32 id = atoi((
char*)args);
787 std::string title = quest->GetLogTitle();
794 char const* statusStr =
"";
819 maxLevel = questLevels->MaxLevel;
821 int32 scalingFactionGroup = 0;
823 scalingFactionGroup = contentTuning->GetScalingFactionGroup();
828 maxLevel, scalingFactionGroup,
829 title.c_str(), statusStr);
848 std::string namePart = args;
849 std::wstring wNamePart;
891 if (maxResults && count++ == maxResults)
897 std::string valStr =
"";
898 char const* knownStr =
"";
935 std::string namePart = args;
936 std::wstring wNamePart;
954 std::string name = spellInfo->SpellName->Str[locale];
966 name = spellInfo->SpellName->Str[locale];
977 if (maxResults && count++ == maxResults)
983 bool known = target && target->
HasSpell(spellInfo->Id);
985 auto spellEffectInfo = std::find_if(spellInfo->GetEffects().begin(), spellInfo->GetEffects().end(), [](
SpellEffectInfo const& spelleffectInfo)
987 return spelleffectInfo.IsEffect(SPELL_EFFECT_LEARN_SPELL);
990 SpellInfo const* learnSpellInfo = spellEffectInfo != spellInfo->
GetEffects().end() ?
sSpellMgr->GetSpellInfo(spellEffectInfo->TriggerSpell, spellInfo->Difficulty) :
nullptr;
993 bool passive = spellInfo->IsPassive();
994 bool active = target && target->
HasAura(spellInfo->Id);
998 uint32 rank = learnSpellInfo ? learnSpellInfo->
GetRank() : spellInfo->GetRank();
1001 std::ostringstream ss;
1003 ss << spellInfo->Id <<
" - |cffffffff|Hspell:" << spellInfo->Id <<
"|h[" << name;
1005 ss << spellInfo->Id <<
" - " << name;
1046 uint32 id = atoi((
char*)args);
1051 std::string name = spellInfo->SpellName->Str[locale];
1058 bool known = target && target->
HasSpell(
id);
1060 auto spellEffectInfo = std::find_if(spellInfo->GetEffects().begin(), spellInfo->GetEffects().end(), [](
SpellEffectInfo const& spelleffectInfo)
1062 return spelleffectInfo.IsEffect(SPELL_EFFECT_LEARN_SPELL);
1065 SpellInfo const* learnSpellInfo = spellEffectInfo != spellInfo->
GetEffects().end() ?
sSpellMgr->GetSpellInfo(spellEffectInfo->TriggerSpell, spellInfo->Difficulty) :
nullptr;
1068 bool passive = spellInfo->IsPassive();
1069 bool active = target && target->
HasAura(
id);
1073 uint32 rank = learnSpellInfo ? learnSpellInfo->
GetRank() : spellInfo->GetRank();
1076 std::ostringstream ss;
1078 ss <<
id <<
" - |cffffffff|Hspell:" <<
id <<
"|h[" << name;
1080 ss <<
id <<
" - " << name;
1115 std::string namePart = args;
1116 std::wstring wNamePart;
1132 std::string name = nodeEntry->Name[locale];
1139 if (maxResults && count++ == maxResults)
1148 uint32(nodeEntry->ContinentID), nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z);
1151 uint32(nodeEntry->ContinentID), nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z);
1172 char const* str = strtok((
char*)args,
" ");
1176 std::string namePart = str;
1177 std::wstring wNamePart;
1185 std::ostringstream reply;
1188 bool limitReached =
false;
1191 for (GameTeleContainer::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
1193 GameTele const* tele = &itr->second;
1195 if (tele->
wnameLow.find(wNamePart) == std::wstring::npos)
1198 if (maxResults && count++ == maxResults)
1200 limitReached =
true;
1205 reply <<
" |cffffffff|Htele:" << itr->first <<
"|h[" << tele->
name <<
"]|h|r\n";
1207 reply <<
" " << itr->first <<
' ' << tele->
name <<
"\n";
1210 if (reply.str().empty())
1230 char const* targetName = target ? target->
GetName().c_str() :
"NAME";
1232 std::string namePart = args;
1233 std::wstring wNamePart;
1251 if (target && target->
GetGender() != gender)
1255 std::string name = (gender ==
GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[locale];
1268 name = (gender ==
GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[locale];
1279 if (maxResults && counter == maxResults)
1287 char const* activeStr = target && *target->
m_playerData->PlayerTitle == titleInfo->MaskID
1291 std::string titleNameStr = fmt::sprintf(name, targetName);
1315 std::string namePart = args;
1316 std::wstring wNamePart;
1332 std::string name = mapInfo->MapName[locale];
1344 name = mapInfo->MapName[locale];
1355 if (maxResults && counter == maxResults)
1361 std::ostringstream ss;
1362 ss <<
id <<
" - [" << name <<
']';
1364 if (mapInfo->IsContinent())
1367 switch (mapInfo->InstanceType)
1404 uint32 id = atoi((
char*)args);
1409 std::string name = mapInfo->MapName[locale];
1416 std::ostringstream ss;
1417 ss <<
id <<
" - [" << name <<
']';
1419 if (mapInfo->IsContinent())
1422 switch (mapInfo->InstanceType)
1467 ip = strtok((
char*)args,
" ");
1468 limitStr = strtok(
nullptr,
" ");
1469 limit = limitStr ? atoi(limitStr) : -1;
1484 std::string account = strtok((
char*)args,
" ");
1485 char* limitStr = strtok(
nullptr,
" ");
1486 int32 limit = limitStr ? atoi(limitStr) : -1;
1503 std::string email = strtok((
char*)args,
" ");
1504 char* limitStr = strtok(
nullptr,
" ");
1505 int32 limit = limitStr ? atoi(limitStr) : -1;
1529 if (maxResults && count++ == maxResults)
1535 Field* fields = result->Fetch();
1537 std::string accountName = fields[1].
GetString();
1549 Field* characterFields = result2->Fetch();
1550 ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(characterFields[0].GetUInt64());
1551 std::string name = characterFields[1].
GetString();
1557 while (result2->NextRow() && (limit == -1 || counter < limit));
1560 while (result->NextRow());
@ CHAR_SEL_CHAR_GUID_NAME_BY_ACC
char const * localeNames[TOTAL_LOCALES]
DB2Storage< SkillLineEntry > sSkillLineStore("SkillLine.db2", &SkillLineLoadInfo::Instance)
DB2Storage< SpellNameEntry > sSpellNameStore("SpellName.db2", &SpellNameLoadInfo::Instance)
DB2Storage< MapEntry > sMapStore("Map.db2", &MapLoadInfo::Instance)
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", &TaxiNodesLoadInfo::Instance)
DB2Storage< CharTitlesEntry > sCharTitlesStore("CharTitles.db2", &CharTitlesLoadInfo::Instance)
DB2Storage< ItemSetEntry > sItemSetStore("ItemSet.db2", &ItemSetLoadInfo::Instance)
DB2Storage< ContentTuningEntry > sContentTuningStore("ContentTuning.db2", &ContentTuningLoadInfo::Instance)
DB2Storage< AreaTableEntry > sAreaTableStore("AreaTable.db2", &AreaTableLoadInfo::Instance)
DB2Storage< FactionEntry > sFactionStore("Faction.db2", &FactionLoadInfo::Instance)
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
@ LANG_FACTION_PEACE_FORCED
@ LANG_COMMAND_TELE_PARAMETER
@ LANG_COMMAND_NOAREAFOUND
@ LANG_COMMAND_TELE_LOCATION
@ LANG_COMMAND_QUEST_REWARDED
@ LANG_EVENT_ENTRY_LIST_CONSOLE
@ LANG_COMMAND_NOTAXINODEFOUND
@ LANG_GO_ENTRY_LIST_CONSOLE
@ LANG_COMMAND_TELE_NOLOCATION
@ LANG_EVENT_ENTRY_LIST_CHAT
@ LANG_COMMAND_NOCREATUREFOUND
@ LANG_CREATURE_ENTRY_LIST_CONSOLE
@ LANG_FACTION_NOREPUTATION
@ LANG_SKILL_LIST_CONSOLE
@ LANG_FACTION_INVISIBLE_FORCED
@ LANG_COMMAND_NOITEMFOUND
@ LANG_QUEST_LIST_CONSOLE
@ LANG_COMMAND_QUEST_ACTIVE
@ LANG_LOOKUP_PLAYER_CHARACTER
@ LANG_GO_ENTRY_LIST_CHAT
@ LANG_COMMAND_NOMAPFOUND
@ LANG_COMMAND_NOSKILLFOUND
@ LANG_COMMAND_NOTITLEFOUND
@ LANG_COMMAND_NOITEMSETFOUND
@ LANG_TAXINODE_ENTRY_LIST_CHAT
@ LANG_COMMAND_NOSPELLFOUND
@ LANG_COMMAND_LOOKUP_MAX_RESULTS
@ LANG_COMMAND_NOQUESTFOUND
@ LANG_COMMAND_FACTION_NOTFOUND
@ LANG_COMMAND_NOGAMEOBJECTFOUND
@ LANG_TAXINODE_ENTRY_LIST_CONSOLE
@ LANG_COMMAND_QUEST_COMPLETE
@ LANG_TITLE_LIST_CONSOLE
@ LANG_ITEMSET_LIST_CONSOLE
@ LANG_LOOKUP_PLAYER_ACCOUNT
@ LANG_CREATURE_ENTRY_LIST_CHAT
@ LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL
@ LOGIN_SEL_ACCOUNT_BY_IP
@ LOGIN_SEL_ACCOUNT_LIST_BY_NAME
std::unordered_map< uint32, ItemTemplate > ItemTemplateContainer
std::unordered_map< uint32, GameObjectTemplate > GameObjectTemplateContainer
std::unordered_map< uint32, GameTele > GameTeleContainer
std::unordered_map< uint32, CreatureTemplate > CreatureTemplateContainer
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ QUEST_STATUS_INCOMPLETE
@ SPELL_ATTR0_CU_IS_TALENT
bool Utf8ToUpperOnlyLatin(std::string &utf8String)
void wstrToLower(std::wstring &str)
bool Utf8FitTo(std::string_view str, std::wstring_view search)
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Player * getSelectedPlayerOrSelf()
virtual LocaleConstant GetSessionDbLocaleIndex() const
Player * getSelectedPlayer()
WorldSession * GetSession()
virtual LocaleConstant GetSessionDbcLocale() const
std::string PGetParseString(uint32 entry, Args &&... args) const
void PSendSysMessage(const char *fmt, Args &&... args)
void SetSentErrorMessage(bool val)
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
virtual char const * GetTrinityString(uint32 entry) const
constexpr bool HasFlag(T flag) const
Class used to access individual fields of database query result.
std::string GetString() const
std::vector< GameEventData > GameEventDataMap
std::set< uint16 > ActiveEvents
std::string ToString() const
std::unordered_map< uint32, Trinity::unique_trackable_ptr< Quest > > QuestContainer
int32 GetQuestLevel(Quest const *quest) const
UF::UpdateField< UF::PlayerData, 0, TYPEID_PLAYER > m_playerData
bool HasTitle(uint32 bitIndex) const
uint16 GetPureSkillValue(uint32 skill) const
int16 GetSkillTempBonusValue(uint32 skill) const
int16 GetSkillPermBonusValue(uint32 skill) const
WorldSession * GetSession() const
bool HasSkill(uint32 skill) const
uint16 GetPureMaxSkillValue(uint32 skill) const
QuestStatus GetQuestStatus(uint32 quest_id) const
bool HasSpell(uint32 spell) const override
int32 GetQuestMinLevel(Quest const *quest) const
ReputationMgr & GetReputationMgr()
void setUInt32(const uint8 index, const uint32 value)
void setString(const uint8 index, const std::string &value)
std::string GetReputationRankName(FactionEntry const *factionEntry) const
int32 GetReputation(uint32 faction_id) const
FactionState const * GetState(FactionEntry const *factionEntry) const
std::vector< SpellEffectInfo > const & GetEffects() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
std::string const & GetName() const
LocaleConstant GetSessionDbcLocale() const
Player * GetPlayer() const
std::string const & GetRemoteAddress() const
std::vector< ChatCommand > GetCommands() const override
static bool HandleLookupItemIdCommand(ChatHandler *handler, char const *args)
static bool HandleLookupPlayerAccountCommand(ChatHandler *handler, char const *args)
static bool HandleLookupSkillCommand(ChatHandler *handler, char const *args)
static bool HandleLookupItemCommand(ChatHandler *handler, char const *args)
static bool HandleLookupSpellIdCommand(ChatHandler *handler, char const *args)
static bool HandleLookupPlayerEmailCommand(ChatHandler *handler, char const *args)
static bool HandleLookupFactionCommand(ChatHandler *handler, char const *args)
static bool HandleLookupPlayerIpCommand(ChatHandler *handler, char const *args)
static bool HandleLookupMapCommand(ChatHandler *handler, char const *args)
static bool HandleLookupAreaCommand(ChatHandler *handler, char const *args)
static bool HandleLookupTaxiNodeCommand(ChatHandler *handler, const char *args)
static bool LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit, ChatHandler *handler)
static bool HandleLookupItemSetCommand(ChatHandler *handler, char const *args)
static bool HandleLookupQuestIdCommand(ChatHandler *handler, char const *args)
static bool HandleLookupObjectCommand(ChatHandler *handler, char const *args)
static bool HandleLookupCreatureCommand(ChatHandler *handler, char const *args)
static bool HandleLookupSpellCommand(ChatHandler *handler, char const *args)
static bool HandleLookupQuestCommand(ChatHandler *handler, char const *args)
static bool HandleLookupTitleCommand(ChatHandler *handler, char const *args)
static bool HandleLookupMapIdCommand(ChatHandler *handler, char const *args)
static bool HandleLookupEventCommand(ChatHandler *handler, char const *args)
static bool HandleLookupTeleCommand(ChatHandler *handler, char const *args)
void AddSC_lookup_commandscript()
@ CONFIG_MAX_RESULTS_LOOKUP_COMMANDS
std::vector< ChatCommandBuilder > ChatCommandTable
@ RBAC_PERM_COMMAND_LOOKUP_QUEST
@ RBAC_PERM_COMMAND_LOOKUP_EVENT
@ RBAC_PERM_COMMAND_LOOKUP_SPELL
@ RBAC_PERM_COMMAND_LOOKUP_PLAYER_EMAIL
@ RBAC_PERM_COMMAND_LOOKUP_OBJECT
@ RBAC_PERM_COMMAND_LOOKUP_AREA
@ RBAC_PERM_COMMAND_LOOKUP_ITEMSET
@ RBAC_PERM_COMMAND_LOOKUP_FACTION
@ RBAC_PERM_COMMAND_LOOKUP_TELE
@ RBAC_PERM_COMMAND_LOOKUP_PLAYER_IP
@ RBAC_PERM_COMMAND_LOOKUP_QUEST_ID
@ RBAC_PERM_COMMAND_LOOKUP_ITEM_ID
@ RBAC_PERM_COMMAND_LOOKUP_SPELL_ID
@ RBAC_PERM_COMMAND_LOOKUP_SKILL
@ RBAC_PERM_COMMAND_LOOKUP_CREATURE
@ RBAC_PERM_COMMAND_LOOKUP_TITLE
@ RBAC_PERM_COMMAND_LOOKUP_MAP_ID
@ RBAC_PERM_COMMAND_LOOKUP_PLAYER_ACCOUNT
@ RBAC_PERM_COMMAND_LOOKUP_ITEM
@ RBAC_PERM_COMMAND_LOOKUP_MAP
@ RBAC_PERM_COMMAND_LOOKUP_TAXINODE
EnumFlag< ReputationFlags > Flags
LocalizedString DisplayName