mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Commands] Consolidate #show commands into a singular #show command (#3478)
* [Cleanup] Consolidate #show commands into a singular #show command # Notes - All `#show` commands like `#showbuffs` are now subcommands of `#show`. - All aliases like `#showbuffs` still function. * Push up progress. * Final push. * Cleanup. * Update ip_lookup.cpp * emotes not emote * Cleanup * Update servertalk.h * Update show.cpp * Fix * Final push. * #aggro * #who
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowEmotes(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to view their emotes.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
uint32 emote_count = 0;
|
||||
const uint32 emote_id = t->GetEmoteID();
|
||||
|
||||
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
const auto& e = iterator.GetData();
|
||||
if (emote_id == e->emoteid) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Event: {} ({}) Type: {} ({})",
|
||||
e->emoteid,
|
||||
EQ::constants::GetEmoteEventTypeName(e->event_),
|
||||
e->event_,
|
||||
EQ::constants::GetEmoteTypeName(e->type),
|
||||
e->type
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Text: {}",
|
||||
e->emoteid,
|
||||
e->text
|
||||
).c_str()
|
||||
);
|
||||
|
||||
emote_count++;
|
||||
}
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} has {} emote{} on Emote ID {}.",
|
||||
c->GetTargetDescription(t),
|
||||
emote_count,
|
||||
emote_count != 1 ? "s" : "",
|
||||
emote_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user