I’m currently doing some pooling work for chest, fishing schools, herbs, and ore. The massive amount of lines of sql, finding guids to use, finding two different pool ids is tiresome.
I’m assuming the current system was designed with minimal coding in mind rather than ease of use.
Also the current design does not make it easy to go back at a later date and add more spawns. Below I have provided sql examples for current system and, what i think would be a better design for adding in future:
– ### SQL for Current pooling system tables with set guids ###
– Feralas (Zone 357) Mithril Deposit spawns
SET @LASTGUID := 7;
SET @OGUID1 := xxxxxx;
SET @OGUID2 := @OGUID1 + (@LASTGUID + 1);
SET @POOL := 357xxx; – xxx pooled
SET @MOTHER := 357xx;
SET @ACTIVE := 2; – Max number of active spawns
SET @TIMER := 30; – Respawn timer in seconds
DELETE FROM gameobject
WHERE guid
BETWEEN @OGUID1 AND @OGUID1+@LASTGUID;
DELETE FROM gameobject
WHERE guid
BETWEEN @OGUID2 AND @OGUID2+@LASTGUID;
INSERT INTO gameobject
(guid
,id
,map
,zoneId
,spawnMask
,phaseMask
,phaseId
,PhaseGroup
,position_x
,position_y
,position_z
,orientation
,rotation0
,rotation1
,rotation2
,rotation3
,spawntimesecs
,animprogress
,state
,VerifiedBuild
) VALUES
– Mithril Deposit (2) 10% Truesilver Deposit 2047
(@OGUID1+0,2040,1,357,0,1,1,0,0,-4535.05,1617.48,114.628,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID1+1,2040,1,357,0,1,1,0,0,-4483.9,1216.35,129.027,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID1+2,2040,1,357,0,1,1,0,0,-4478.17,1110.82,131.305,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID1+3,2040,1,357,0,1,1,0,0,-4567.82,1241.38,136.818,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID1+4,2040,1,357,0,1,1,0,0,-4510.09,1583.08,126.23,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID1+5,2040,1,357,0,1,1,0,0,-4461.69,1127.75,134.806,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID1+6,2040,1,357,0,1,1,0,0,-4470.21,1454.98,135.588,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+7,2040,1,357,0,1,1,0,0,-4495.98,1536.9,135.482,0,0,0,0,1, @TIMER,255,1,20444),
– Truesilver Deposit
(@OGUID2+0,2047,1,357,0,1,1,0,0,-4535.05,1617.48,114.628,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+1,2047,1,357,0,1,1,0,0,-4483.9,1216.35,129.027,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+2,2047,1,357,0,1,1,0,0,-4478.17,1110.82,131.305,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+3,2047,1,357,0,1,1,0,0,-4567.82,1241.38,136.818,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+4,2047,1,357,0,1,1,0,0,-4510.09,1583.08,126.23,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+5,2047,1,357,0,1,1,0,0,-4461.69,1127.75,134.806,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+6,2047,1,357,0,1,1,0,0,-4470.21,1454.98,135.588,0,0,0,0,1, @TIMER,255,1,20444),
(@OGUID2+7,2047,1,357,0,1,1,0,0,-4495.98,1536.9,135.482,0,0,0,0,1, @TIMER,255,1,20444);
– Add mother pool to pool template
DELETE FROM pool_template
WHERE entry
=@MOTHER;
INSERT INTO pool_template
(entry
,max_limit
,description
) VALUES
(@MOTHER,@ACTIVE, ‘Feralas Mithril Deposit Mother pool’);
– Pool Ore Spawnpoints
DELETE FROM pool_gameobject
WHERE guid
BETWEEN @OGUID1 AND @OGUID1+@LASTGUID;
DELETE FROM pool_gameobject
WHERE guid
BETWEEN @OGUID2 AND @OGUID2+@LASTGUID;
DELETE FROM pool_gameobject
WHERE guid
BETWEEN @OGUID3 AND @OGUID3+@LASTGUID;
INSERT INTO pool_gameobject
(guid
,pool_entry
,chance
,description
) VALUES
(@OGUID1+0,@POOL+0,80, ‘Mithril Deposit’),
(@OGUID2+0,@POOL+0,10, ‘Truesilver Deposit’),
(@OGUID3+0,@POOL+0,10, ‘Gold Vein’),
(@OGUID1+1,@POOL+1,80, ‘Mithril Deposit’),
(@OGUID2+1,@POOL+1,10, ‘Truesilver Deposit’),
(@OGUID3+1,@POOL+1,10, ‘Gold Vein’),
(@OGUID1+2,@POOL+2,80, ‘Mithril Deposit’),
(@OGUID2+2,@POOL+2,10, ‘Truesilver Deposit’),
(@OGUID3+2,@POOL+2,10, ‘Gold Vein’),
(@OGUID1+3,@POOL+3,80, ‘Mithril Deposit’),
(@OGUID2+3,@POOL+3,10, ‘Truesilver Deposit’),
(@OGUID3+3,@POOL+3,10, ‘Gold Vein’),
(@OGUID1+4,@POOL+4,80, ‘Mithril Deposit’),
(@OGUID2+4,@POOL+4,10, ‘Truesilver Deposit’),
(@OGUID3+4,@POOL+4,10, ‘Gold Vein’),
(@OGUID1+5,@POOL+5,80, ‘Mithril Deposit’),
(@OGUID2+5,@POOL+5,10, ‘Truesilver Deposit’),
(@OGUID3+5,@POOL+5,10, ‘Gold Vein’),
(@OGUID1+6,@POOL+6,80, ‘Mithril Deposit’),
(@OGUID2+6,@POOL+6,10, ‘Truesilver Deposit’),
(@OGUID3+6,@POOL+6,10, ‘Gold Vein’),
(@OGUID1+7,@POOL+7,80, ‘Mithril Deposit’),
(@OGUID2+7,@POOL+7,10, ‘Truesilver Deposit’),
(@OGUID3+7,@POOL+7,10, ‘Gold Vein’);
– Pool Mithril Deposit Spawnpoints
DELETE FROM pool_gameobject
WHERE guid
BETWEEN @OGUID AND @OGUID+@LASTGUID;
INSERT INTO pool_gameobject
(guid
,pool_entry
,chance
,description
) VALUES
(@OGUID+0,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+1,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+2,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+3,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+4,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+5,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+6,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’),
(@OGUID+7,@MOTHER,0, ‘Feralas Mithril Deposit Spawnpoint’);
– Add each pool to pool template
DELETE FROM pool_template
WHERE entry
BETWEEN @POOL AND @POOL+@LASTGUID;
INSERT INTO pool_template
(entry
,max_limit
,description
) VALUES
(@POOL+0,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+1,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+2,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+3,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+4,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+5,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+6,1, ‘Feralas Mithril Deposit Spawnpoint’),
(@POOL+7,1, ‘Feralas Mithril Deposit Spawnpoint’);
– ### SQL for pooling system tables with dynamic guids ###
– Mithril Deposit 10% Truesilver Deposit 2047
SET @POOL := 357xxx; – xxx pooled
SET @ACTIVE := 2; – Max number of active spawns
SET @TIMER := 30; – Respawn timer in seconds
– Add pool to pool template
DELETE FROM gameobject_spawn_pool
WHERE entry
=@POOL;
INSERT INTO gameobject_spawn_pool
(entry
,max_limit
,spawntimesecs
,description
) VALUES
(@POOL,@ACTIVE,@TIMER, ‘Feralas Mithril / Truesilver Deposit Mother pool’);
– Pool spawn points
DELETE FROM gameobject_pool
WHERE pool
=@POOL;
INSERT INTO gameobject_pool
(pool
,spawn
,id1
,id2
,id3
,chance1
,chance2
,chance2
,map
,zoneId
,spawnMask
,phaseMask
,phaseId
,PhaseGroup
,position_x
,position_y
,position_z
,orientation
,rotation0
,rotation1
,rotation2
,rotation3
,animprogress
,state
,VerifiedBuild
) VALUES
(@POOL,0,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4535.05,1617.48,114.628,0,0,0,0,1,255,1,20444),
(@POOL,1,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4483.9,1216.35,129.027,0,0,0,0,1,255,1,20444),
(@POOL,2,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4478.17,1110.82,131.305,0,0,0,0,1,255,1,20444),
(@POOL,3,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4567.82,1241.38,136.818,0,0,0,0,1,255,1,20444),
(@POOL,4,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4510.09,1583.08,126.23,0,0,0,0,1,255,1,20444),
(@POOL,5,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4461.69,1127.75,134.806,0,0,0,0,1,255,1,20444),
(@POOL,6,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4470.21,1454.98,135.588,0,0,0,0,1,255,1,20444),
(@POOL,7,2040,2047,0,90,10,0,1,357,0,1,1,0,0,-4495.98,1536.9,135.482,0,0,0,0,1,255,1,20444);In the proposed dynamic design you would only need to find a pool id and adding extra spawns in the future would be easy for any db dev.
I’m just throwing this out as an idea for anyone interested in looking into it.