diff --git a/zone/gm_commands/setanim.cpp b/zone/gm_commands/setanim.cpp index 2a191aac2..72f16edc9 100755 --- a/zone/gm_commands/setanim.cpp +++ b/zone/gm_commands/setanim.cpp @@ -2,9 +2,24 @@ void command_setanim(Client *c, const Seperator *sep) { - int arguments = sep->argnum; + const auto arguments = sep->argnum; if (!arguments || !sep->IsNumber(1)) { - c->Message(Chat::White, "Usage: #setanim [Animation ID (IDs are 0 to 4)]"); + c->Message(Chat::White, "Usage: #setanim [Animation ID]"); + + uint32 animation_number = 1; + for (const auto& a : EQ::constants::GetSpawnAnimationMap()) { + c->Message( + Chat::White, + fmt::format( + "Animation {} | ID: {} Name: {}", + animation_number, + a.first, + a.second + ).c_str() + ); + + animation_number++; + } return; } @@ -13,29 +28,36 @@ void command_setanim(Client *c, const Seperator *sep) target = c->GetTarget(); } - - int animation_id = Strings::ToInt(sep->arg[1]); + const auto animation_id = static_cast(Strings::ToUnsignedInt(sep->arg[1])); if ( - animation_id < 0 || - animation_id > eaLooting + !EQ::ValueWithin( + animation_id, + static_cast(eaStanding), + static_cast(eaLooting) + ) ) { - c->Message(Chat::White, "Usage: #setanim [Animation ID (IDs are 0 to 4)]"); + c->Message(Chat::White, "Usage: #setanim [Animation ID]"); + + uint32 animation_number = 1; + for (const auto& a : EQ::constants::GetSpawnAnimationMap()) { + c->Message( + Chat::White, + fmt::format( + "Animation {} | ID: {} Name: {}", + animation_number, + a.first, + a.second + ).c_str() + ); + + animation_number++; + } return; } target->SetAppearance(static_cast(animation_id), false); - std::string animation_name; - if (animation_id == eaStanding) { - animation_name = "Standing"; - } else if (animation_id == eaSitting) { - animation_name = "Sitting"; - } else if (animation_id == eaCrouching) { - animation_name = "Crouching"; - } else if (animation_id == eaDead) { - animation_name = "Dead"; - } else if (animation_id == eaLooting) { - animation_name = "Looting"; - } + + const auto animation_name = EQ::constants::GetSpawnAnimationName(animation_id); c->Message( Chat::White,