mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Commands] Cleanup #permaclass Command. (#1777)
- Cleanup message and logic.
This commit is contained in:
parent
7559732408
commit
7c12c5d5ef
@ -274,7 +274,7 @@ int command_init(void)
|
|||||||
command_add("path", "- view and edit pathing", AccountStatus::GMMgmt, command_path) ||
|
command_add("path", "- view and edit pathing", AccountStatus::GMMgmt, command_path) ||
|
||||||
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", "[classnum] - Change your or your player target's class (target 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", "[gendernum] - Change your or your player target's gender (zone to take effect)", AccountStatus::QuestTroupe, command_permagender) ||
|
||||||
command_add("permarace", "[racenum] - Change your or your player target's race (zone to take effect)", AccountStatus::QuestTroupe, command_permarace) ||
|
command_add("permarace", "[racenum] - Change your or your player target's race (zone to take effect)", 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) ||
|
||||||
|
|||||||
@ -2,27 +2,39 @@
|
|||||||
|
|
||||||
void command_permaclass(Client *c, const Seperator *sep)
|
void command_permaclass(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
Client *t = c;
|
int arguments = sep->argnum;
|
||||||
|
if (!arguments || !sep->IsNumber(1)) {
|
||||||
|
c->Message(Chat::White, "Usage: #permaclass [Class ID]");
|
||||||
|
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 class_id = std::stoi(sep->arg[1]);
|
||||||
c->Message(Chat::White, "Usage: #permaclass <classnum>");
|
|
||||||
}
|
LogInfo("Class changed by {} for {} to {} ({})",
|
||||||
else if (!t->IsClient()) {
|
c->GetCleanName(),
|
||||||
c->Message(Chat::White, "Target is not a client.");
|
target->GetCleanName(),
|
||||||
}
|
GetClassIDName(class_id),
|
||||||
else {
|
class_id
|
||||||
c->Message(Chat::White, "Setting %s's class...Sending to char select.", t->GetName());
|
);
|
||||||
LogInfo("Class change request from [{}] for [{}], requested class:[{}]",
|
|
||||||
c->GetName(),
|
target->SetBaseClass(class_id);
|
||||||
t->GetName(),
|
target->Save();
|
||||||
atoi(sep->arg[1]));
|
target->Kick("Class was changed.");
|
||||||
t->SetBaseClass(atoi(sep->arg[1]));
|
|
||||||
t->Save();
|
if (c != target) {
|
||||||
t->Kick("Class was changed.");
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Class changed for {} to {} ({}).",
|
||||||
|
target->GetCleanName(),
|
||||||
|
GetClassIDName(class_id),
|
||||||
|
class_id
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user