Jump to content

[dev]Reload item_template & creature_template


Guest Stab

Recommended Posts

I know a lot of asked for reloading of items and creatures. On my realm, I'm building a custom zone with lots of new custom items. To save restarts, I decided to code it in and since I've seen it requested several times, thought I'd share. Sorry for no real patch, but my core has many changes and is 3.3.3, so it wouldn't match default GIT, so you'll have to commit it in manually.

Chat.cpp




       { "spell_threats",               SEC_ADMINISTRATOR, true,  &ChatHandler::HandleReloadSpellThreatsCommand,            "", NULL },

+     { "item_template",         SEC_ADMINISTRATOR, true,  &ChatHandler::HandleReloadItemPrototypesCommand,          "", NULL },
+     { "creature_template",           SEC_ADMINISTRATOR, true,  &ChatHandler::HandleReloadCreatureTemplatesCommand,       "", NULL },

Chat.h

       bool HandleReloadSpellPetAurasCommand(const char* args);
+     bool HandleReloadItemPrototypesCommand(const char* args);
+     bool HandleReloadCreatureTemplatesCommand(const char* args);

Level3.cpp


   HandleReloadLocalesQuestCommand("a");
   return true;
}

+ bool ChatHandler::HandleReloadItemPrototypesCommand(const char * /*args*/)
+ {
+   sLog.outString( "Loading Item Data... (`item_template`)" );
+    sObjectMgr.LoadItemPrototypes();
+    SendGlobalSysMessage("DB table `item_template` reloaded.");
+  return true;
+  }
+  bool ChatHandler::HandleReloadCreatureTemplatesCommand(const char * /*args*/)
+ {
+  sLog.outString( "Loading Creature Data... (`creature_template`)" );
+    sObjectMgr.LoadCreatureTemplates();
+    SendGlobalSysMessage("DB table `creature_template` (creature data) reloaded.");
+    return true;
+ }



INSERT INTO `command` (`name`, `security`, `help`) VALUES
('reload creature_template', 3, 'Syntax: .reload creature_template'),
('reload item_template', 3, 'Syntax: .reload item_template');


Link to comment
Share on other sites

If you can live with related crashes after ti use in some case...

Yeap, that's why I marked it as "dev" due to the chance of crashes. On that note though, of all my reloads so far, I have yet to crash. It's a realm I'm only on building the area, so a crash wouldn't be a big deal. Just a time saver really rather then having to keep logging back in. Since I know many have asked for commands like this, I just figured I'd share =)

Link to comment
Share on other sites

also I think you're "missing" a part in Level3.cpp

HandleReloadReservedNameCommand("");
HandleReloadMangosStringCommand("");
HandleReloadGameTeleCommand("");
+HandleReloadCreatureTemplatesCommand("");
+HandleReloadItemPrototypesCommand("");
    return true;
{

Link to comment
Share on other sites

also I think you're "missing" a part in Level3.cpp

HandleReloadReservedNameCommand("");
HandleReloadMangosStringCommand("");
HandleReloadGameTeleCommand("");
+HandleReloadCreatureTemplatesCommand("");
+HandleReloadItemPrototypesCommand("");
    return true;
{

oh, I think I did, but it still works fine on my server without. So I guess not really needed

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use