[Commands] Cleanup #npcemote Command. (#2106)

* [Commands] Cleanup #npcemote Command.
- Cleanup messages and logic.

* Update npcemote.cpp
This commit is contained in:
Kinglykrab 2022-05-06 20:58:01 -04:00 committed by GitHub
parent 37fefad58e
commit a847e461c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -251,7 +251,7 @@ int command_init(void)
command_add("npccast", "[targetname/entityid] [spellid] - Causes NPC target to cast spellid on targetname/entityid", AccountStatus::QuestTroupe, command_npccast) ||
command_add("npcedit", "[column] [value] - Mega NPC editing command", AccountStatus::GMAdmin, command_npcedit) ||
command_add("npceditmass", "[name-search] [column] [value] - Mass (Zone wide) NPC data editing command", AccountStatus::GMAdmin, command_npceditmass) ||
command_add("npcemote", "[message] - Make your NPC target emote a message.", AccountStatus::GMLeadAdmin, command_npcemote) ||
command_add("npcemote", "[Message] - Make your NPC target emote a message.", AccountStatus::GMLeadAdmin, command_npcemote) ||
command_add("npcloot", "- Manipulate the loot an NPC is carrying. Use #npcloot help for more information.", AccountStatus::QuestTroupe, command_npcloot) ||
command_add("npcsay", "[Message] - Make your NPC target say a message.", AccountStatus::GMLeadAdmin, command_npcsay) ||
command_add("npcshout", "[Message] - Make your NPC target shout a message.", AccountStatus::GMLeadAdmin, command_npcshout) ||

View File

@ -2,11 +2,18 @@
void command_npcemote(Client *c, const Seperator *sep)
{
if (c->GetTarget() && c->GetTarget()->IsNPC() && sep->arg[1][0]) {
c->GetTarget()->Emote(sep->argplus[1]);
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
else {
c->Message(Chat::White, "Usage: #npcemote message (requires NPC target");
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #npcemote [Message]");
return;
}
std::string message = sep->argplus[1];
c->GetTarget()->Emote(message.c_str());
}