diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-08-25 17:43:19 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-08-27 15:50:01 +0200 |
commit | 9ccd2daa16d89b933701a0888475a110e09a80a4 (patch) | |
tree | 436450a23048dafdd47efa0da74715280bd77622 /sql | |
parent | a9b7540d4b12b2f8614483838fbab35901f40a7e (diff) |
Core/Loot: Added type to LootStoreItem to replace reference != 0 checks
(cherry picked from commit 7e70ea701e554c9e404683014cd3bc1cc4885eaf)
# Conflicts:
# sql/updates/world/cata_classic/2024_08_25_02_world.sql
Diffstat (limited to 'sql')
-rw-r--r-- | sql/updates/world/cata_classic/2024_08_27_00_world_2024_08_25_02_world.sql | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/sql/updates/world/cata_classic/2024_08_27_00_world_2024_08_25_02_world.sql b/sql/updates/world/cata_classic/2024_08_27_00_world_2024_08_25_02_world.sql new file mode 100644 index 00000000000..d11c8b98167 --- /dev/null +++ b/sql/updates/world/cata_classic/2024_08_27_00_world_2024_08_25_02_world.sql @@ -0,0 +1,64 @@ +ALTER TABLE `creature_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `disenchant_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `fishing_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `gameobject_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `item_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `mail_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `milling_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `pickpocketing_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `prospecting_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `reference_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `skinning_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; +ALTER TABLE `spell_loot_template` ADD `ItemType` tinyint NOT NULL DEFAULT 0 AFTER `Entry`; + +UPDATE `conditions` c INNER JOIN `creature_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=1 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `disenchant_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=2 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `fishing_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=3 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `gameobject_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=4 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `item_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=5 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `mail_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=6 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `milling_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=7 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `pickpocketing_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=8 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `prospecting_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=9 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `reference_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=10 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `skinning_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=11 AND lt.`Reference`<>0; +UPDATE `conditions` c INNER JOIN `spell_loot_template` lt ON c.`SourceGroup`=lt.`Entry` AND c.`SourceEntry`=lt.`Item` SET `SourceEntry`=lt.`Reference` WHERE c.`SourceTypeOrReferenceId`=12 AND lt.`Reference`<>0; + +ALTER TABLE `creature_loot_template` DROP PRIMARY KEY; +ALTER TABLE `disenchant_loot_template` DROP PRIMARY KEY; +ALTER TABLE `fishing_loot_template` DROP PRIMARY KEY; +ALTER TABLE `gameobject_loot_template` DROP PRIMARY KEY; +ALTER TABLE `item_loot_template` DROP PRIMARY KEY; +ALTER TABLE `mail_loot_template` DROP PRIMARY KEY; +ALTER TABLE `milling_loot_template` DROP PRIMARY KEY; +ALTER TABLE `pickpocketing_loot_template` DROP PRIMARY KEY; +ALTER TABLE `prospecting_loot_template` DROP PRIMARY KEY; +ALTER TABLE `reference_loot_template` DROP PRIMARY KEY; +ALTER TABLE `skinning_loot_template` DROP PRIMARY KEY; +ALTER TABLE `spell_loot_template` DROP PRIMARY KEY; + +UPDATE `creature_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `disenchant_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `fishing_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `gameobject_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `item_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `mail_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `milling_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `pickpocketing_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `prospecting_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `reference_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `skinning_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; +UPDATE `spell_loot_template` SET `ItemType`=1,`Item`=`Reference` WHERE `Reference`<>0; + +ALTER TABLE `creature_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `disenchant_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `fishing_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `gameobject_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `item_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `mail_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `milling_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `pickpocketing_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `prospecting_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `reference_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `skinning_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); +ALTER TABLE `spell_loot_template` DROP `Reference`, ADD INDEX `idx_primary` (`Entry`,`ItemType`,`Item`); |