[Commands] #npcspawn Changes (#4311)

* Changes to npcspawn create command so it takes more stats from the target npc

* Add see invis stats to npccreate command

* WIP npcspawn command changes

* Add npcspawn clone and help args, fix some broken things with npcspawn

* Cleanup comments and add apostraphes to zone shortname query

* Make it so npcspawn remove only removes spawn2 row and optionally removes spawngroup and spawnentry, make create and add spawn the npc at client loc

* Make npcspawn create use the same syntax for spawngroup naming as npcspawn add

* Revert npcspawn create and add to use npc location rather than client, other misc tweaks
This commit is contained in:
twincannon
2024-05-16 15:17:37 -04:00
committed by GitHub
parent 1be86edf20
commit c87aadbf0c
5 changed files with 115 additions and 42 deletions
+5 -4
View File
@@ -1666,7 +1666,7 @@ void command_npcedit(Client *c, const Seperator *sep)
} else if (!strcasecmp(sep->arg[1], "set_grid")) {
if (sep->IsNumber(2)) {
const uint32 grid_id = Strings::ToUnsignedInt(sep->arg[2]);
if (grid_id) {
if (grid_id >= 0) {
d = fmt::format(
"{} now has a Grid ID of {} on Spawn Group ID {}.",
npc_id_string,
@@ -1674,14 +1674,15 @@ void command_npcedit(Client *c, const Seperator *sep)
Strings::Commify(std::to_string(t->GetSpawnGroupId()))
);
auto query = fmt::format(
"UPDATE spawn2 SET pathgrid = {} WHERE spawngroupID = {} AND version = {}",
"UPDATE spawn2 SET pathgrid = {} WHERE spawngroupID = {} AND version = {} AND zone = '{}'",
grid_id,
t->GetSpawnGroupId(),
zone->GetInstanceVersion()
zone->GetInstanceVersion(),
zone->GetShortName()
);
content_db.QueryDatabase(query);
} else {
c->Message(Chat::White, "Grid ID must be greater than 0.");
c->Message(Chat::White, "Grid ID must be greater than or equal to 0.");
return;
}
} else {