[Commands] Cleanup #reloadlevelmods Command. (#2122)

* [Commands] Cleanup #reloadlevelmods Command.
- Cleanup messages and logic.
- Make the reloading of modifiers global instead of zone-specific.

* Remove unnecessary message.

* Update worldserver.cpp

* Update worldserver.cpp

* Update worldserver.cpp
This commit is contained in:
Kinglykrab
2022-05-06 22:31:17 -04:00
committed by GitHub
parent e26eba8e03
commit 7549fbbeea
5 changed files with 44 additions and 9 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ int command_init(void)
command_add("reloadallrules", "Executes a reload of all rules globally.", AccountStatus::QuestTroupe, command_reloadallrules) ||
command_add("reloadcontentflags", "Executes a reload of all expansion and content flags", AccountStatus::QuestTroupe, command_reloadcontentflags) ||
command_add("reloademote", "Reloads NPC Emotes", AccountStatus::QuestTroupe, command_reloademote) ||
command_add("reloadlevelmods", nullptr, AccountStatus::Max, command_reloadlevelmods) ||
command_add("reloadlevelmods", "Reloads level based experience modifiers globally", AccountStatus::Max, command_reloadlevelmods) ||
command_add("reloadmerchants", "Reloads merchant lists globally", AccountStatus::Max, command_reloadmerchants) ||
command_add("reloadperlexportsettings", "Reloads Perl event export settings globally", AccountStatus::Max, command_reloadperlexportsettings) ||
command_add("reloadqst", " - Clear quest cache (any argument causes it to also stop all timers)", AccountStatus::GMLeadAdmin, command_reloadqst) ||
+8 -8
View File
@@ -2,14 +2,14 @@
void command_reloadlevelmods(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
if (RuleB(Zone, LevelBasedEXPMods)) {
zone->LoadLevelEXPMods();
c->Message(Chat::Yellow, "Level based EXP Mods have been reloaded zonewide");
}
else {
c->Message(Chat::Yellow, "Level based EXP Mods are disabled in rules!");
}
if (!RuleB(Zone, LevelBasedEXPMods)) {
c->Message(Chat::White, "Level based experience modifiers are disabled.");
return;
}
c->Message(Chat::White, "Attempted to reload level based experience modifiers globally.");
auto pack = new ServerPacket(ServerOP_ReloadLevelEXPMods, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}
+29
View File
@@ -2073,6 +2073,35 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
parse->LoadPerlEventExportSettings(parse->perl_event_export_settings);
break;
}
case ServerOP_ReloadLevelEXPMods: {
if (zone) {
worldserver.SendEmoteMessage(
0,
0,
AccountStatus::GMAdmin,
Chat::Yellow,
fmt::format(
"Level based experience modifiers reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
zone->LoadLevelEXPMods();
}
break;
}
case ServerOP_ReloadAAData: {
if (zone) {
worldserver.SendEmoteMessage(