From d6da679e798d2571c7988e3527c513e7f512aa39 Mon Sep 17 00:00:00 2001 From: "Jan M. D. Hansen" <53914190+jamadaha@users.noreply.github.com> Date: Fri, 23 Jul 2021 15:09:57 +0200 Subject: [PATCH] fix(DB/GO): chest pooling to battered chests in Jangolade Mine (#7053) - Closes #6458 --- .../rev_1626826866431944500.sql | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1626826866431944500.sql diff --git a/data/sql/updates/pending_db_world/rev_1626826866431944500.sql b/data/sql/updates/pending_db_world/rev_1626826866431944500.sql new file mode 100644 index 000000000..b7164e144 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1626826866431944500.sql @@ -0,0 +1,41 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1626826866431944500'); + +-- Remove the nodes from any existing nodes then add them to their distinct pool + +-- JM = Jangolode Mine + +SET +@POOL_ENTRY_JM = 11670, +@POOL_SIZE = 1, +@CHANCE = 0, +@RESPAWN = 3600, +@POOL_DESCRIPTION_JM = 'Battered Chests - Jangolode Mine'; + +-- Create temp table with pool entries +CREATE TABLE TEMP_POOL_ENTRIES (guid int, pool_entry int, description char(64)); +INSERT INTO TEMP_POOL_ENTRIES VALUES +(42718, @POOL_ENTRY_JM, 'Battered Chest, Jangolode Mine, Node 1'), +(85887, @POOL_ENTRY_JM, 'Battered Chest, Jangolode Mine, Node 2'), +(42739, @POOL_ENTRY_JM, 'Battered Chest, Jangolode Mine, Node 3'); + +-- General Winterspring Zone +DELETE FROM `pool_template` WHERE `entry` IN (SELECT DISTINCT `pool_entry` FROM TEMP_POOL_ENTRIES); + + +INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES +(@POOL_ENTRY_JM, @POOL_SIZE, @POOL_DESCRIPTION_JM); + + +-- Delete from any existing pools +DELETE FROM `pool_gameobject` WHERE `guid` IN (SELECT `guid` FROM TEMP_POOL_ENTRIES); + +-- Add to new pool +INSERT INTO `pool_gameobject` +(`guid`, `pool_entry`, `chance`, `description`) +SELECT `guid`, `pool_entry`, @CHANCE, `description` FROM TEMP_POOL_ENTRIES; + +-- Set spawn time +UPDATE `gameobject` SET `spawntimesecs` = @RESPAWN WHERE `guid` IN (SELECT `guid` FROM TEMP_POOL_ENTRIES); + +-- Drop temp table +DROP TABLE TEMP_POOL_ENTRIES;