From e0a3c44776c6eec885f82ff1c7c94038f0a95160 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 24 Mar 2023 18:37:17 +0100 Subject: [PATCH] Setup/Spells (#374) * fixed rarity color for spells that create items --- setup/db_structure.sql | 2 +- setup/tools/sqlgen/spell.func.php | 22 ++++++++++++++++++++-- setup/updates/1679679565_01.sql | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 setup/updates/1679679565_01.sql diff --git a/setup/db_structure.sql b/setup/db_structure.sql index 95b6cede..adf11de3 100644 --- a/setup/db_structure.sql +++ b/setup/db_structure.sql @@ -3185,7 +3185,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_dbversion` WRITE; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; -INSERT INTO `aowow_dbversion` VALUES (1679660927,0,NULL,NULL); +INSERT INTO `aowow_dbversion` VALUES (1679679566,0,NULL,NULL); /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/tools/sqlgen/spell.func.php b/setup/tools/sqlgen/spell.func.php index 0cd8dec5..6b5c6555 100644 --- a/setup/tools/sqlgen/spell.func.php +++ b/setup/tools/sqlgen/spell.func.php @@ -476,8 +476,26 @@ SqlGen::register(new class extends SetupScript LEFT JOIN dbc_talent t1 ON t1.rank1 = s.id LEFT JOIN dbc_talent t2 ON t2.rank2 = s.id LEFT JOIN dbc_talent t3 ON t3.rank3 = s.id - WHERE effect1CreateItemId > 0 AND effect1Id <> 53 AND t1.id IS NULL AND t2.id IS NULL AND t3.id IS NULL - '); // no enchant-spells & no talents! + WHERE effect1CreateItemId > 0 AND (effect1Id in (?a) OR effect1AuraId in (?a)) AND t1.id IS NULL AND t2.id IS NULL AND t3.id IS NULL + UNION + SELECT s.id AS ARRAY_KEY, effect2CreateItemId + FROM dbc_spell s + LEFT JOIN dbc_talent t1 ON t1.rank1 = s.id + LEFT JOIN dbc_talent t2 ON t2.rank2 = s.id + LEFT JOIN dbc_talent t3 ON t3.rank3 = s.id + WHERE effect2CreateItemId > 0 AND (effect2Id in (?a) OR effect2AuraId in (?a)) AND t1.id IS NULL AND t2.id IS NULL AND t3.id IS NULL + UNION + SELECT s.id AS ARRAY_KEY, effect3CreateItemId + FROM dbc_spell s + LEFT JOIN dbc_talent t1 ON t1.rank1 = s.id + LEFT JOIN dbc_talent t2 ON t2.rank2 = s.id + LEFT JOIN dbc_talent t3 ON t3.rank3 = s.id + WHERE effect3CreateItemId > 0 AND (effect3Id in (?a) OR effect3AuraId in (?a)) AND t1.id IS NULL AND t2.id IS NULL AND t3.id IS NULL + ', + SpellList::$effects['itemCreate'], SpellList::$auras['itemCreate'], + SpellList::$effects['itemCreate'], SpellList::$auras['itemCreate'], + SpellList::$effects['itemCreate'], SpellList::$auras['itemCreate']); + $itemInfo = DB::World()->select('SELECT entry AS ARRAY_KEY, displayId AS d, Quality AS q FROM item_template WHERE entry IN (?a)', $itemSpells); foreach ($itemSpells as $sId => $itemId) if (isset($itemInfo[$itemId])) diff --git a/setup/updates/1679679565_01.sql b/setup/updates/1679679565_01.sql new file mode 100644 index 00000000..c42d3f9e --- /dev/null +++ b/setup/updates/1679679565_01.sql @@ -0,0 +1 @@ +UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`sql`, ''), ' spell');