mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
* [Commands] Cleanup #appearance Command # Notes - Cleanup messages and logic. - Cleanup appearance type constants to use a namespace with constexpr instead. - Cleanup animation constants to use a namespace with constexpr instead. * Update emu_constants.cpp * Cleanup
35 lines
754 B
C++
Executable File
35 lines
754 B
C++
Executable File
#include "../../client.h"
|
|
|
|
void SetFrozen(Client *c, const Seperator *sep)
|
|
{
|
|
const auto arguments = sep->argnum;
|
|
if (arguments < 2) {
|
|
c->Message(Chat::White, "Usage: #set frozen [on|off]");
|
|
return;
|
|
}
|
|
|
|
if (!c->GetTarget()) {
|
|
c->Message(Chat::White, "You must have a target to use this command.");
|
|
return;
|
|
}
|
|
|
|
const bool is_frozen = Strings::ToBool(sep->arg[2]);
|
|
|
|
auto t = c->GetTarget();
|
|
if (c == t) {
|
|
c->Message(Chat::White, "You cannot use this command on yourself.");
|
|
return;
|
|
}
|
|
|
|
t->SendAppearancePacket(AppearanceType::Animation, is_frozen ? Animation::Freeze : Animation::Standing);
|
|
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"You have {}frozen {}.",
|
|
!is_frozen ? "un" : "",
|
|
c->GetTargetDescription(t)
|
|
).c_str()
|
|
);
|
|
}
|