diff --git a/common/servertalk.h b/common/servertalk.h index a59bfae03..7ae8efd40 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -231,6 +231,7 @@ #define ServerOP_ReloadLevelEXPMods 0x4015 #define ServerOP_ReloadMerchants 0x4016 #define ServerOP_ReloadAAData 0x4017 +#define ServerOP_ReloadTraps 0x4018 #define ServerOP_ReloadStaticZoneData 0x4020 #define ServerOP_CZDialogueWindow 0x4500 diff --git a/zone/command.cpp b/zone/command.cpp index dcef4e6af..fd9e7cff1 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -293,7 +293,7 @@ int command_init(void) command_add("reloadqst", " - Clear quest cache (any argument causes it to also stop all timers)", AccountStatus::GMLeadAdmin, command_reloadqst) || command_add("reloadrulesworld", "Executes a reload of all rules in world specifically.", AccountStatus::QuestTroupe, command_reloadworldrules) || command_add("reloadstatic", "- Reload Static Zone Data globally", AccountStatus::GMLeadAdmin, command_reloadstatic) || - command_add("reloadtraps", "- Repops all traps in the current zone.", AccountStatus::QuestTroupe, command_reloadtraps) || + command_add("reloadtraps", "[0|1] - Reloads and repops traps, globally if specified (1 = global)", AccountStatus::QuestTroupe, command_reloadtraps) || command_add("reloadtitles", "- Reload player titles from the database", AccountStatus::GMLeadAdmin, command_reloadtitles) || command_add("reloadworld", "[0|1|2] - Reload quests global and repop NPCs if specified (0 = No Repop, 1 = Repop, 2 = Force Repop)", AccountStatus::Max, command_reloadworld) || command_add("reloadzps", "- Reload zone points from database", AccountStatus::GMLeadAdmin, command_reloadzps) || diff --git a/zone/gm_commands/reloadtraps.cpp b/zone/gm_commands/reloadtraps.cpp index 1057ec771..3712c8e04 100755 --- a/zone/gm_commands/reloadtraps.cpp +++ b/zone/gm_commands/reloadtraps.cpp @@ -2,7 +2,64 @@ void command_reloadtraps(Client *c, const Seperator *sep) { - entity_list.UpdateAllTraps(true, true); - c->Message(Chat::Default, "Traps reloaded for %s.", zone->GetShortName()); + int arguments = sep->argnum; + if (!arguments) { + entity_list.UpdateAllTraps(true, true); + c->Message( + Chat::Yellow, + fmt::format( + "Traps reloaded for {}{}.", + fmt::format( + "{} ({})", + zone->GetLongName(), + zone->GetZoneID() + ), + ( + zone->GetInstanceID() ? + fmt::format( + " (Instance ID {})", + zone->GetInstanceID() + ) : + "" + ) + ).c_str() + ); + return; + } + + bool global = false; + + if (sep->IsNumber(1)) { + global = std::stoi(sep->arg[1]) ? true : false; + } + + if (!global) { + entity_list.UpdateAllTraps(true, true); + c->Message( + Chat::Yellow, + fmt::format( + "Traps reloaded for {}{}.", + fmt::format( + "{} ({})", + zone->GetLongName(), + zone->GetZoneID() + ), + ( + zone->GetInstanceID() ? + fmt::format( + " (Instance ID {})", + zone->GetInstanceID() + ) : + "" + ) + ).c_str() + ); + return; + } + + c->Message(Chat::White, "Attempting to reload traps globally."); + auto pack = new ServerPacket(ServerOP_ReloadTraps, 0); + worldserver.SendPacket(pack); + safe_delete(pack); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index ded148c2d..daf031708 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -2073,7 +2073,38 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) parse->LoadPerlEventExportSettings(parse->perl_event_export_settings); break; } - case ServerOP_ReloadLevelEXPMods: { +case ServerOP_ReloadTraps: + { + if (zone) { + worldserver.SendEmoteMessage( + 0, + 0, + AccountStatus::GMAdmin, + Chat::Yellow, + fmt::format( + "Traps reloaded for {}{}.", + fmt::format( + "{} ({})", + zone->GetLongName(), + zone->GetZoneID() + ), + ( + zone->GetInstanceID() ? + fmt::format( + " (Instance ID {})", + zone->GetInstanceID() + ) : + "" + ) + ).c_str() + ); + + entity_list.UpdateAllTraps(true, true); + } + break; + } + case ServerOP_ReloadLevelEXPMods: + { if (zone) { worldserver.SendEmoteMessage( 0,