mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Commands] Add #finddeity Command (#3435)
# Notes - Add `#finddeity` command. - Remove `ConvertDeityTypeBitToDeityType` as it's unused. - Rename `ConvertDeityTypeToDeityTypeBit` to `GetDeityBitmask`.
This commit is contained in:
@@ -142,6 +142,7 @@ int command_init(void)
|
||||
command_add("findcharacter", "[Search Criteria] - Search for a character", AccountStatus::Guide, command_findcharacter) ||
|
||||
command_add("findclass", "[Search Criteria] - Search for a class", AccountStatus::Guide, command_findclass) ||
|
||||
command_add("findcurrency", "[Search Criteria] - Search for an alternate currency", AccountStatus::Guide, command_findcurrency) ||
|
||||
command_add("finddeity", "[Search Criteria] - Search for a deity", AccountStatus::Guide, command_finddeity) ||
|
||||
command_add("findfaction", "[Search Criteria] - Search for a faction", AccountStatus::Guide, command_findfaction) ||
|
||||
command_add("findlanguage", "[Search Criteria] - Search for a language", AccountStatus::Guide, command_findlanguage) ||
|
||||
command_add("findnpctype", "[Search Criteria] - Search database NPC types", AccountStatus::GMAdmin, command_findnpctype) ||
|
||||
@@ -984,6 +985,7 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/findcharacter.cpp"
|
||||
#include "gm_commands/findclass.cpp"
|
||||
#include "gm_commands/findcurrency.cpp"
|
||||
#include "gm_commands/finddeity.cpp"
|
||||
#include "gm_commands/findfaction.cpp"
|
||||
#include "gm_commands/findlanguage.cpp"
|
||||
#include "gm_commands/findnpctype.cpp"
|
||||
|
||||
@@ -92,6 +92,7 @@ void command_findaliases(Client *c, const Seperator *sep);
|
||||
void command_findcharacter(Client *c, const Seperator *sep);
|
||||
void command_findclass(Client *c, const Seperator *sep);
|
||||
void command_findcurrency(Client *c, const Seperator *sep);
|
||||
void command_finddeity(Client *c, const Seperator *sep);
|
||||
void command_findfaction(Client *c, const Seperator *sep);
|
||||
void command_findlanguage(Client *c, const Seperator *sep);
|
||||
void command_findnpctype(Client *c, const Seperator *sep);
|
||||
|
||||
Executable
+73
@@ -0,0 +1,73 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_finddeity(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #finddeity [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
const auto deity_id = static_cast<EQ::deity::DeityType>(Strings::ToInt(sep->arg[1]));
|
||||
const auto& deity_name = EQ::deity::GetDeityName(deity_id);
|
||||
if (!deity_name.empty()) {
|
||||
const auto deity_bit = EQ::deity::GetDeityBitmask(deity_id);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deity {} | {} ({})",
|
||||
deity_id,
|
||||
deity_name,
|
||||
deity_bit
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deity ID {} was not found.",
|
||||
deity_id
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
if (!search_criteria.empty()) {
|
||||
auto found_count = 0;
|
||||
for (const auto& d : EQ::deity::GetDeityMap()) {
|
||||
const auto& deity_name_lower = Strings::ToLower(d.second);
|
||||
if (!Strings::Contains(deity_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto deity_bit = EQ::deity::GetDeityBitmask(d.first);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deity {} | {} ({})",
|
||||
d.first,
|
||||
d.second,
|
||||
deity_bit
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Deit{} found.",
|
||||
found_count,
|
||||
found_count != 1 ? "ies" : "y"
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -523,7 +523,7 @@ public:
|
||||
virtual inline uint8 GetBaseGender() const { return base_gender; }
|
||||
virtual uint16 GetFactionRace();
|
||||
virtual inline uint16 GetDeity() const { return deity; }
|
||||
virtual EQ::deity::DeityTypeBit GetDeityBit() { return EQ::deity::ConvertDeityTypeToDeityTypeBit((EQ::deity::DeityType)deity); }
|
||||
virtual EQ::deity::DeityTypeBit GetDeityBit() { return EQ::deity::GetDeityBitmask((EQ::deity::DeityType)deity); }
|
||||
inline uint16 GetRace() const { return race; }
|
||||
inline uint16 GetModel() const { return (use_model == 0) ? race : use_model; }
|
||||
inline uint8 GetGender() const { return gender; }
|
||||
|
||||
+1
-1
@@ -3881,7 +3881,7 @@ std::string QuestManager::getgendername(uint32 gender_id) {
|
||||
}
|
||||
|
||||
std::string QuestManager::getdeityname(uint32 deity_id) {
|
||||
return EQ::deity::DeityName(static_cast<EQ::deity::DeityType>(deity_id));
|
||||
return EQ::deity::GetDeityName(static_cast<EQ::deity::DeityType>(deity_id));
|
||||
}
|
||||
|
||||
std::string QuestManager::getinventoryslotname(int16 slot_id) {
|
||||
|
||||
Reference in New Issue
Block a user