mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
[Rules] Add Rule to Disable NPC Last Names. (#2227)
* [Rules] Add Rule to Disable NPC Last Names. - Add NPC:DisableLastNames to disable NPC Last Names. - Fix #npcedit lastname to allow you to use an empty string. * Cleanup of classes in naming. * Duplicate. * Update classes.cpp
This commit is contained in:
@@ -10,7 +10,7 @@ void command_findclass(Client *c, const Seperator *sep)
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
int class_id = std::stoi(sep->arg[1]);
|
||||
if (class_id >= WARRIOR && class_id <= MERCERNARY_MASTER) {
|
||||
if (class_id >= WARRIOR && class_id <= MERCENARY_MASTER) {
|
||||
std::string class_name = GetClassIDName(class_id);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
@@ -41,7 +41,7 @@ void command_findclass(Client *c, const Seperator *sep)
|
||||
} else {
|
||||
auto search_criteria = str_tolower(sep->argplus[1]);
|
||||
int found_count = 0;
|
||||
for (uint16 class_id = WARRIOR; class_id <= MERCERNARY_MASTER; class_id++) {
|
||||
for (uint16 class_id = WARRIOR; class_id <= MERCENARY_MASTER; class_id++) {
|
||||
std::string class_name = GetClassIDName(class_id);
|
||||
auto class_name_lower = str_tolower(class_name);
|
||||
if (
|
||||
|
||||
@@ -204,24 +204,20 @@ void command_npcedit(Client *c, const Seperator *sep)
|
||||
return;
|
||||
} else if (!strcasecmp(sep->arg[1], "lastname")) {
|
||||
std::string last_name = sep->argplus[2];
|
||||
if (!last_name.empty()) {
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"{} now has the lastname '{}'.",
|
||||
npc_id_string,
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
auto query = fmt::format(
|
||||
"UPDATE npc_types SET lastname = '{}' WHERE id = {}",
|
||||
sep->argplus[2],
|
||||
npc_id
|
||||
);
|
||||
content_db.QueryDatabase(query);
|
||||
} else {
|
||||
c->Message(Chat::White, "Usage: #npcedit lastname [Last Name] - Sets an NPC's Last Name");
|
||||
}
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"{} now has the lastname '{}'.",
|
||||
npc_id_string,
|
||||
last_name
|
||||
).c_str()
|
||||
);
|
||||
auto query = fmt::format(
|
||||
"UPDATE npc_types SET lastname = '{}' WHERE id = {}",
|
||||
last_name,
|
||||
npc_id
|
||||
);
|
||||
content_db.QueryDatabase(query);
|
||||
return;
|
||||
} else if (!strcasecmp(sep->arg[1], "level")) {
|
||||
if (sep->IsNumber(2)) {
|
||||
|
||||
Reference in New Issue
Block a user