diff --git a/zone/command.cpp b/zone/command.cpp index db24d3185..29b611135 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -317,6 +317,7 @@ int command_init(void) command_add("reloadallrules", "Executes a reload of all rules.", 80, command_reloadallrules) || command_add("reloademote", "Reloads NPC Emotes", 80, command_reloademote) || command_add("reloadlevelmods", nullptr, 255, command_reloadlevelmods) || + command_add("reloadmerchants", nullptr, 255, command_reloadmerchants) || command_add("reloadperlexportsettings", nullptr, 255, command_reloadperlexportsettings) || command_add("reloadqst", " - Clear quest cache (any argument causes it to also stop all timers)", 150, command_reloadqst) || command_add("reloadrulesworld", "Executes a reload of all rules in world specifically.", 80, command_reloadworldrules) || @@ -2996,6 +2997,11 @@ void command_reloadworld(Client *c, const Seperator *sep) safe_delete(pack); } +void command_reloadmerchants(Client *c, const Seperator *sep) { + zone->ReloadMerchants(); + c->Message(15, "Reloading merchants."); +} + void command_reloadlevelmods(Client *c, const Seperator *sep) { if (sep->arg[1][0] == 0) diff --git a/zone/command.h b/zone/command.h index a27f173fc..8f6257949 100644 --- a/zone/command.h +++ b/zone/command.h @@ -224,6 +224,7 @@ void command_reloadaa(Client *c, const Seperator *sep); void command_reloadallrules(Client *c, const Seperator *sep); void command_reloademote(Client* c, const Seperator *sep); void command_reloadlevelmods(Client *c, const Seperator *sep); +void command_reloadmerchants(Client *c, const Seperator *sep); void command_reloadperlexportsettings(Client *c, const Seperator *sep); void command_reloadqst(Client *c, const Seperator *sep); void command_reloadstatic(Client *c, const Seperator *sep); diff --git a/zone/zone.cpp b/zone/zone.cpp index 0e6a50092..262092db8 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2272,6 +2272,18 @@ void Zone::ReloadWorld(uint32 Option){ } } +void Zone::ReloadMerchants() { + std::list npc_list; + entity_list.GetNPCList(npc_list); + + for(std::list::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) { + NPC* npc = *itr; + if (npc->MerchantType != 0) { + zone->LoadNewMerchantData(npc->MerchantType); + } + } +} + void Zone::LoadTickItems() { tick_items.clear(); diff --git a/zone/zone.h b/zone/zone.h index b3ea9fbf1..3a5125eb4 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -209,6 +209,7 @@ public: void LoadAlternateCurrencies(); void LoadNPCEmotes(LinkedList* NPCEmoteList); void ReloadWorld(uint32 Option); + void ReloadMerchants(); Map* zonemap; WaterMap* watermap;