mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-23 16:48:21 +00:00
[Commands] Cleanup #randomizefeatures Command. (#2118)
- Cleanup messages and logic. - Make #randomizefeatures function for Iksar and Vah Shir.
This commit is contained in:
@@ -2,17 +2,33 @@
|
||||
|
||||
void command_randomfeatures(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *target = c->GetTarget();
|
||||
if (!target) {
|
||||
c->Message(Chat::White, "Error: This command requires a target");
|
||||
if (!c->GetTarget()) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (target->RandomizeFeatures()) {
|
||||
c->Message(Chat::White, "Features Randomized");
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "This command requires a Playable Race as the target");
|
||||
}
|
||||
|
||||
auto target = c->GetTarget();
|
||||
|
||||
if (target->RandomizeFeatures()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} ({}) has had their features randomized.",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} ({}) is not a player race, their race is {} ({}).",
|
||||
target->GetCleanName(),
|
||||
target->GetID(),
|
||||
GetRaceIDName(target->GetRace()),
|
||||
target->GetRace()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user