-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathtemplate_npc.patch
82 lines (78 loc) · 3.8 KB
/
template_npc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 01b1fe0a..e02036f2 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -76,6 +76,7 @@
#include "AsyncAuctionListing.h"
#include "SavingSystem.h"
#include <VMapManager2.h>
+#include "../../../modules/TemplateNPC/src/TemplateNPC.h"
ACE_Atomic_Op<ACE_Thread_Mutex, bool> World::m_stopEvent = false;
uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE;
@@ -1871,6 +1872,28 @@ void World::SetInitialWorldSettings()
mgr = ChannelMgr::forTeam(TEAM_HORDE);
mgr->LoadChannels();
+ // Load templates for Template NPC #1
+ sLog->outString("== TEMPLATE NPC ===========================================================================");
+ sLog->outString("Loading Template Talents...");
+ sTemplateNpcMgr->LoadTalentsContainer();
+
+ // Load templates for Template NPC #2
+ sLog->outString("Loading Template Glyphs...");
+ sTemplateNpcMgr->LoadGlyphsContainer();
+
+ // Load templates for Template NPC #3
+ sLog->outString("Loading Template Gear for Humans...");
+ sTemplateNpcMgr->LoadHumanGearContainer();
+
+ // Load templates for Template NPC #4
+ sLog->outString("Loading Template Gear for Alliances...");
+ sTemplateNpcMgr->LoadAllianceGearContainer();
+
+ // Load templates for Template NPC #5
+ sLog->outString("Loading Template Gear for Hordes...");
+ sTemplateNpcMgr->LoadHordeGearContainer();
+ sLog->outString("== TEMPLATE NPC ===========================================================================");
+
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
sLog->outString();
sLog->outError("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 13fdf2c1..be9e3046 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -29,6 +29,7 @@ EndScriptData */
#include "TicketMgr.h"
#include "WardenCheckMgr.h"
#include "WaypointManager.h"
+#include "../../../modules/TemplateNPC/src/TemplateNPC.h"
class reload_commandscript : public CommandScript
{
@@ -142,7 +143,8 @@ public:
{ "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "" },
{ "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "" },
{ "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "" },
- { "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "" }
+ { "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "" },
+ { "template_npc", SEC_ADMINISTRATOR, true, &HandleReloadTemplateNPCCommand, "" },
};
static std::vector<ChatCommand> commandTable =
{
@@ -1202,6 +1204,18 @@ public:
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
return true;
}
+
+ static bool HandleReloadTemplateNPCCommand(ChatHandler * handler, const char* /*args*/)
+ {
+ sLog->outString("misc", "Reloading templates for Template NPC table...");
+ sTemplateNpcMgr->LoadTalentsContainer();
+ sTemplateNpcMgr->LoadGlyphsContainer();
+ sTemplateNpcMgr->LoadHumanGearContainer();
+ sTemplateNpcMgr->LoadAllianceGearContainer();
+ sTemplateNpcMgr->LoadHordeGearContainer();
+ handler->SendGlobalGMSysMessage("Template NPC templates reloaded.");
+ return true;
+ }
};
void AddSC_reload_commandscript()