mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/DB: Merge pool_creature, pool_gameobject and pool_pool into a single pool_members table.
(More pooling prep, I really don't want to have any sql update files in that PR if I can help it.)
This commit is contained in:
@@ -2008,12 +2008,12 @@ void ObjectMgr::LoadCreatures()
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, spawndist, "
|
||||
// 11 12 13 14 15 16 17 18 19 20 21
|
||||
"currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, pool_entry, creature.npcflag, creature.unit_flags, creature.dynamicflags, "
|
||||
"currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.dynamicflags, "
|
||||
// 22
|
||||
"creature.ScriptName "
|
||||
"FROM creature "
|
||||
"LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid "
|
||||
"LEFT OUTER JOIN pool_creature ON creature.guid = pool_creature.guid");
|
||||
"LEFT OUTER JOIN pool_members ON pool_members.type = 0 AND creature.guid = pool_members.spawnId");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -2302,11 +2302,11 @@ void ObjectMgr::LoadGameObjects()
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, "
|
||||
// 7 8 9 10 11 12 13 14 15 16 17
|
||||
"rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry, "
|
||||
"rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, poolSpawnId, "
|
||||
// 18
|
||||
"ScriptName "
|
||||
"FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
|
||||
"LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid");
|
||||
"LEFT OUTER JOIN pool_members ON pool_members.type = 1 AND gameobject.guid = pool_members.spawnId");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
@@ -605,8 +605,8 @@ void PoolMgr::LoadFromDB()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature");
|
||||
// 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT spawnId, poolSpawnId, chance FROM pool_members WHERE type = 0");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -662,8 +662,8 @@ void PoolMgr::LoadFromDB()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_gameobject");
|
||||
// 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT spawnId, poolSpawnId, chance FROM pool_members WHERE type = 1");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -732,7 +732,7 @@ void PoolMgr::LoadFromDB()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT pool_id, mother_pool, chance FROM pool_pool");
|
||||
QueryResult result = WorldDatabase.Query("SELECT spawnId, poolSpawnId, chance FROM pool_members WHERE type = 2");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -910,9 +910,9 @@ void PoolMgr::LoadFromDB()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_pool.pool_id, pool_pool.mother_pool FROM pool_template"
|
||||
QueryResult result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_members.spawnId, pool_members.poolSpawnId FROM pool_template"
|
||||
" LEFT JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry"
|
||||
" LEFT JOIN pool_pool ON pool_template.entry = pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL");
|
||||
" LEFT JOIN pool_members ON pool_members.type = 2 AND pool_template.entry = pool_members.spawnId WHERE game_event_pool.pool_entry IS NULL");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user