diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 33 |
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)); +} |