[Feature] Add is_parcel_merchant to #npcedit (#4290)

This commit is contained in:
Alex King 2024-05-04 05:11:52 -04:00 committed by GitHub
parent 7b19225e48
commit b3538021cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1579,6 +1579,24 @@ void command_npcedit(Client *c, const Seperator *sep)
);
return;
}
} else if (!strcasecmp(sep->arg[1], "is_parcel_merchant")) {
if (sep->IsNumber(2)) {
const bool is_parcel_merchant = static_cast<uint8_t>(Strings::ToUnsignedInt(sep->arg[2]));
n.is_parcel_merchant = is_parcel_merchant;
d = fmt::format(
"{} will {} be a Parcel Merchant.",
npc_id_string,
is_parcel_merchant ? "now" : "no longer"
);
} else {
c->Message(
Chat::White,
"Usage: #npcedit is_parcel_merchant [Flag] - Sets an NPC's Parcel Merchant Flag [0 = False, 1 = True]"
);
return;
}
} else if (!strcasecmp(sep->arg[1], "setanimation")) {
if (sep->IsNumber(2)) {
auto animation_id = Strings::ToUnsignedInt(sep->arg[2]);
@ -1791,6 +1809,7 @@ void SendNPCEditSubCommands(Client *c)
c->Message(Chat::White, "Usage: #npcedit heroic_strikethrough [Heroic Strikethrough] - Sets an NPC's Heroic Strikethrough");
c->Message(Chat::White, "Usage: #npcedit faction_amount [Faction Amount] - Sets an NPC's Faction Amount");
c->Message(Chat::White, "Usage: #npcedit keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items Flag [0 = False, 1 = True]");
c->Message(Chat::White, "Usage: #npcedit is_parcel_merchant [Flag] - Sets an NPC's Parcel Merchant Flag [0 = False, 1 = True]");
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");