mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Commands] Cleanup #permagender Command. (#1779)
- Cleanup message and logic.
This commit is contained in:
parent
e9fc80815a
commit
1acdc6034b
@ -275,7 +275,7 @@ int command_init(void)
|
|||||||
command_add("peekinv", "[equip/gen/cursor/poss/limbo/curlim/trib/bank/shbank/allbank/trade/world/all] - Print out contents of your player target's inventory", AccountStatus::GMAdmin, command_peekinv) ||
|
command_add("peekinv", "[equip/gen/cursor/poss/limbo/curlim/trib/bank/shbank/allbank/trade/world/all] - Print out contents of your player target's inventory", AccountStatus::GMAdmin, command_peekinv) ||
|
||||||
command_add("peqzone", "[zonename] - Go to specified zone, if you have > 75% health", AccountStatus::Player, command_peqzone) ||
|
command_add("peqzone", "[zonename] - Go to specified zone, if you have > 75% health", AccountStatus::Player, command_peqzone) ||
|
||||||
command_add("permaclass", "[Class ID] - Change your or your player target's class, changed client is disconnected", AccountStatus::QuestTroupe, command_permaclass) ||
|
command_add("permaclass", "[Class ID] - Change your or your player target's class, changed client is disconnected", AccountStatus::QuestTroupe, command_permaclass) ||
|
||||||
command_add("permagender", "[gendernum] - Change your or your player target's gender (zone to take effect)", AccountStatus::QuestTroupe, command_permagender) ||
|
command_add("permagender", "[Gender ID] - Change your or your player target's gender", AccountStatus::QuestTroupe, command_permagender) ||
|
||||||
command_add("permarace", "[Race ID] - Change your or your player target's race", AccountStatus::QuestTroupe, command_permarace) ||
|
command_add("permarace", "[Race ID] - Change your or your player target's race", AccountStatus::QuestTroupe, command_permarace) ||
|
||||||
command_add("petitioninfo", "[petition number] - Get info about a petition", AccountStatus::ApprenticeGuide, command_petitioninfo) ||
|
command_add("petitioninfo", "[petition number] - Get info about a petition", AccountStatus::ApprenticeGuide, command_petitioninfo) ||
|
||||||
command_add("pf", "- Display additional mob coordinate and wandering data", AccountStatus::Player, command_pf) ||
|
command_add("pf", "- Display additional mob coordinate and wandering data", AccountStatus::Player, command_pf) ||
|
||||||
|
|||||||
@ -2,28 +2,38 @@
|
|||||||
|
|
||||||
void command_permagender(Client *c, const Seperator *sep)
|
void command_permagender(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
Client *t = c;
|
int arguments = sep->argnum;
|
||||||
|
if (!arguments || !sep->IsNumber(1)) {
|
||||||
|
c->Message(Chat::White, "Usage: #permagender [Gender ID]");
|
||||||
|
c->Message(Chat::White, "Genders: 0 = Male, 1 = Female, 2 = Neuter");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Client *target = c;
|
||||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
t = c->GetTarget()->CastToClient();
|
target = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sep->arg[1][0] == 0) {
|
auto gender_id = std::stoi(sep->arg[1]);
|
||||||
c->Message(Chat::White, "Usage: #permagender <gendernum>");
|
|
||||||
c->Message(Chat::White, "Gender Numbers: 0=Male, 1=Female, 2=Neuter");
|
LogInfo("Gender changed by {} for {} to {} ({})",
|
||||||
}
|
c->GetCleanName(),
|
||||||
else if (!t->IsClient()) {
|
target->GetCleanName(),
|
||||||
c->Message(Chat::White, "Target is not a client.");
|
GetGenderName(gender_id),
|
||||||
}
|
gender_id
|
||||||
else {
|
);
|
||||||
c->Message(Chat::White, "Setting %s's gender - zone to take effect", t->GetName());
|
|
||||||
LogInfo("Permanant gender change request from [{}] for [{}], requested gender:[{}]",
|
target->SetBaseGender(gender_id);
|
||||||
c->GetName(),
|
target->Save();
|
||||||
t->GetName(),
|
target->SendIllusionPacket(target->GetRace(), gender_id);
|
||||||
atoi(sep->arg[1]));
|
|
||||||
t->SetBaseGender(atoi(sep->arg[1]));
|
c->Message(
|
||||||
t->Save();
|
Chat::White,
|
||||||
t->SendIllusionPacket(atoi(sep->arg[1]));
|
fmt::format(
|
||||||
}
|
"Gender changed for {} to {} ({}).",
|
||||||
|
c == target ? "yourself" : target->GetCleanName(),
|
||||||
|
GetGenderName(gender_id),
|
||||||
|
gender_id
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user