aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorTraesh <traesh@farahlon.com>2016-09-25 16:13:12 +0200
committerShauren <shauren.trinity@gmail.com>2016-09-25 16:13:12 +0200
commitd4887311e39527e036419ebd966f399fdbdae67a (patch)
tree7a87b65e493e3b0660790b02b151107fc4ab66b4 /src/server/game/Globals/ObjectMgr.cpp
parentdd64a3cd36d7c8db67f4075c5a8c1eb01898d1ed (diff)
Core/Scenes: Implemented scene system
Closes #17858 Closes #17976
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index ec1492d7d4f..b05576e223f 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -8764,6 +8764,8 @@ void ObjectMgr::LoadScriptNames()
"UNION "
"SELECT DISTINCT(ScriptName) FROM outdoorpvp_template WHERE ScriptName <> '' "
"UNION "
+ "SELECT DISTINCT(ScriptName) FROM scene_template WHERE ScriptName <> '' "
+ "UNION "
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
if (!result)
@@ -9601,3 +9603,34 @@ void ObjectMgr::LoadCreatureQuestItems()
TC_LOG_INFO("server.loading", ">> Loaded %u creature quest items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
+
+void ObjectMgr::LoadSceneTemplates()
+{
+ uint32 oldMSTime = getMSTime();
+ _sceneTemplateStore.clear();
+
+ QueryResult templates = WorldDatabase.Query("SELECT SceneId, Flags, ScriptPackageID, ScriptName FROM scene_template");
+
+ if (!templates)
+ {
+ TC_LOG_INFO("server.loading", ">> Loaded 0 scene templates. DB table `scene_template` is empty.");
+ return;
+ }
+
+ uint32 count = 0;
+
+ do
+ {
+ Field* fields = templates->Fetch();
+
+ uint32 sceneId = fields[0].GetUInt32();
+ SceneTemplate& sceneTemplate = _sceneTemplateStore[sceneId];
+ sceneTemplate.SceneId = sceneId;
+ sceneTemplate.PlaybackFlags = fields[1].GetUInt32();
+ sceneTemplate.ScenePackageId = fields[2].GetUInt32();
+ sceneTemplate.ScriptId = sObjectMgr->GetScriptId(fields[3].GetCString());
+
+ } while (templates->NextRow());
+
+ TC_LOG_INFO("server.loading", ">> Loaded %u scene templates in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
+}