mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
* [Commands] Cleanup #reloadzps Command. - Cleanup messages and logic. - Make reloading of zone points global instead of zone specific. * Further cleanup. - Add zone->GetZoneDescription(). - Add mob->GetTargetDescription(mob). * Final cleanup. * Typo.
39 lines
1003 B
C++
Executable File
39 lines
1003 B
C++
Executable File
#include "../client.h"
|
|
|
|
void command_zunderworld(Client *c, const Seperator *sep)
|
|
{
|
|
int arguments = sep->argnum;
|
|
if (!arguments || !sep->IsNumber(1)) {
|
|
c->Message(Chat::White, "Usage: #zunderworld [Z] [Permanent (0 = False, 1 = True)]");
|
|
return;
|
|
}
|
|
|
|
auto z = std::stof(sep->arg[1]);
|
|
auto permanent = sep->arg[2] ? atobool(sep->arg[2]) : false;
|
|
if (permanent) {
|
|
auto query = fmt::format(
|
|
"UPDATE zone SET underworld = {:.2f} WHERE zoneidnumber = {} AND version = {}",
|
|
z,
|
|
zone->GetZoneID(),
|
|
zone->GetInstanceVersion()
|
|
);
|
|
database.QueryDatabase(query);
|
|
}
|
|
|
|
zone->newzone_data.underworld = z;
|
|
auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct));
|
|
memcpy(outapp->pBuffer, &zone->newzone_data, outapp->size);
|
|
entity_list.QueueClients(c, outapp);
|
|
safe_delete(outapp);
|
|
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"Underworld Z Changed | Zone: {} Z: {:.2f} Permanent: {}",
|
|
zone->GetZoneDescription(),
|
|
z,
|
|
permanent ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
}
|