mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
[Commands] Add #npcedit set_grid [Grid ID] to #npcedit (#4004)
* [Commands] Add #npcedit grid_id to #npcedit # Notes - Adds `#npcedit grid_id [Grid ID]` to `#npcedit`. * set_grid
This commit is contained in:
parent
f6148b9b8d
commit
26769f40d9
@ -1645,6 +1645,31 @@ void command_npcedit(Client *c, const Seperator *sep)
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (!strcasecmp(sep->arg[1], "set_grid")) {
|
||||||
|
if (sep->IsNumber(2)) {
|
||||||
|
const uint32 grid_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||||
|
if (grid_id) {
|
||||||
|
d = fmt::format(
|
||||||
|
"{} now has a Grid ID of {} on Spawn Group ID {}.",
|
||||||
|
npc_id_string,
|
||||||
|
grid_id,
|
||||||
|
Strings::Commify(std::to_string(t->GetSpawnGroupId()))
|
||||||
|
);
|
||||||
|
auto query = fmt::format(
|
||||||
|
"UPDATE spawn2 SET pathgrid = {} WHERE spawngroupID = {} AND version = {}",
|
||||||
|
grid_id,
|
||||||
|
t->GetSpawnGroupId(),
|
||||||
|
zone->GetInstanceVersion()
|
||||||
|
);
|
||||||
|
content_db.QueryDatabase(query);
|
||||||
|
} else {
|
||||||
|
c->Message(Chat::White, "Grid ID must be greater than 0.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SendNPCEditSubCommands(c);
|
SendNPCEditSubCommands(c);
|
||||||
return;
|
return;
|
||||||
@ -1768,4 +1793,5 @@ void SendNPCEditSubCommands(Client *c)
|
|||||||
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 keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items 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 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 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");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ void command_petitems(Client *c, const Seperator *sep)
|
|||||||
c->Message(Chat::White, "You must have a pet to use this command.");
|
c->Message(Chat::White, "You must have a pet to use this command.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pet = c->GetPet()->CastToNPC();
|
auto pet = c->GetPet()->CastToNPC();
|
||||||
auto loot_list = pet->GetLootList();
|
auto loot_list = pet->GetLootList();
|
||||||
if (!loot_list.empty()) {
|
if (!loot_list.empty()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user