[Commands] Cleanup #viewnpctype Command. (#1713)

* [Commands] Cleanup #viewnpctype Command.
- Create a temporary NPC to use ShowStats() instead.
- Cleanup message.

* Cleanup spawn/emote/textures logic in ShowStats() when unused.

* Formatting.
This commit is contained in:
Kinglykrab
2021-11-12 08:58:43 -05:00
committed by GitHub
parent 0997a8a31e
commit f591378ed3
2 changed files with 75 additions and 56 deletions
+53 -34
View File
@@ -1641,15 +1641,21 @@ void Mob::ShowStats(Client* client)
);
// Spawn Data
client->Message(
Chat::White,
fmt::format(
"Spawn | Group: {} Point: {} Grid: {}",
target->GetSpawnGroupId(),
target->GetSpawnPointID(),
target->GetGrid()
).c_str()
);
if (
target->GetGrid() ||
target->GetSpawnGroupId() ||
target->GetSpawnPointID()
) {
client->Message(
Chat::White,
fmt::format(
"Spawn | Group: {} Point: {} Grid: {}",
target->GetSpawnGroupId(),
target->GetSpawnPointID(),
target->GetGrid()
).c_str()
);
}
client->Message(
Chat::White,
@@ -1817,24 +1823,35 @@ void Mob::ShowStats(Client* client)
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Textures | Arms: {} Bracers: {} Hands: {}",
target->GetArmTexture(),
target->GetBracerTexture(),
target->GetHandTexture()
).c_str()
);
if (
target->GetArmTexture() ||
target->GetBracerTexture() ||
target->GetHandTexture()
) {
client->Message(
Chat::White,
fmt::format(
"Textures | Arms: {} Bracers: {} Hands: {}",
target->GetArmTexture(),
target->GetBracerTexture(),
target->GetHandTexture()
).c_str()
);
}
client->Message(
Chat::White,
fmt::format(
"Textures | Legs: {} Feet: {}",
target->GetLegTexture(),
target->GetFeetTexture()
).c_str()
);
if (
target->GetFeetTexture() ||
target->GetLegTexture()
) {
client->Message(
Chat::White,
fmt::format(
"Textures | Legs: {} Feet: {}",
target->GetLegTexture(),
target->GetFeetTexture()
).c_str()
);
}
// Hero's Forge
if (target->GetHeroForgeModel()) {
@@ -2147,14 +2164,16 @@ void Mob::ShowStats(Client* client)
).c_str()
);
// Emote
client->Message(
Chat::White,
fmt::format(
"Emote: {}",
target->GetEmoteID()
).c_str()
);
// Emote
if (target->GetEmoteID()) {
client->Message(
Chat::White,
fmt::format(
"Emote: {}",
target->GetEmoteID()
).c_str()
);
}
// Run/Walk Speed
client->Message(