From 48552a97ab8c04df64fe59fd0556c0c3aeefa6d0 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 14 Feb 2020 17:35:16 +0100 Subject: [PATCH] Creature/Spells * update db structure for https://github.com/TrinityCore/TrinityCore/commit/d5fb0a30ec6 --- setup/tools/sqlgen/creature.func.php | 18 +++++++++++++++++- setup/tools/sqlgen/spell.func.php | 9 +-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/setup/tools/sqlgen/creature.func.php b/setup/tools/sqlgen/creature.func.php index 56abf74a..69823ee8 100644 --- a/setup/tools/sqlgen/creature.func.php +++ b/setup/tools/sqlgen/creature.func.php @@ -56,7 +56,7 @@ SqlGen::register(new class extends SetupScript type, type_flags, lootid, pickpocketloot, skinloot, - spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, + IFNULL(cts0.Spell, 0), IFNULL(cts1.Spell, 0), IFNULL(cts2.Spell, 0), IFNULL(cts3.Spell, 0), IFNULL(cts4.Spell, 0), IFNULL(cts5.Spell, 0), IFNULL(cts6.Spell, 0), IFNULL(cts7.Spell, 0), PetSpellDataId, VehicleId, mingold, maxgold, @@ -89,6 +89,22 @@ SqlGen::register(new class extends SetupScript creature_template_locale ctl8 ON ct.entry = ctl8.entry AND ctl8.`locale` = "ruRU" LEFT JOIN instance_encounters ie ON ie.creditEntry = ct.entry AND ie.creditType = 0 + LEFT JOIN + creature_template_spell cts0 ON ct.entry = cts0.CreatureID AND cts0.Index = 0 + LEFT JOIN + creature_template_spell cts1 ON ct.entry = cts1.CreatureID AND cts1.Index = 1 + LEFT JOIN + creature_template_spell cts2 ON ct.entry = cts2.CreatureID AND cts2.Index = 2 + LEFT JOIN + creature_template_spell cts3 ON ct.entry = cts3.CreatureID AND cts3.Index = 3 + LEFT JOIN + creature_template_spell cts4 ON ct.entry = cts4.CreatureID AND cts4.Index = 4 + LEFT JOIN + creature_template_spell cts5 ON ct.entry = cts5.CreatureID AND cts5.Index = 5 + LEFT JOIN + creature_template_spell cts6 ON ct.entry = cts6.CreatureID AND cts6.Index = 6 + LEFT JOIN + creature_template_spell cts7 ON ct.entry = cts7.CreatureID AND cts7.Index = 7 WHERE ct.entry > ?d { diff --git a/setup/tools/sqlgen/spell.func.php b/setup/tools/sqlgen/spell.func.php index fcc6dba7..263f1dc0 100644 --- a/setup/tools/sqlgen/spell.func.php +++ b/setup/tools/sqlgen/spell.func.php @@ -612,14 +612,7 @@ SqlGen::register(new class extends SetupScript // npc spells (-8) (run as last! .. missing from npc_scripts? "enum Spells { \s+(\w\d_)+\s+=\s(\d+) }" and "#define SPELL_(\d\w_)+\s+(\d+)") // RAID_MODE(1, 2[, 3, 4]) - macro still not considered $world = DB::World()->selectCol(' SELECT ss.action_param1 FROM smart_scripts ss WHERE ss.action_type IN (11, 75, 85, 86) UNION - SELECT ct.spell1 FROM creature_template ct WHERE ct.spell1 <> 0 UNION - SELECT ct.spell2 FROM creature_template ct WHERE ct.spell2 <> 0 UNION - SELECT ct.spell3 FROM creature_template ct WHERE ct.spell3 <> 0 UNION - SELECT ct.spell4 FROM creature_template ct WHERE ct.spell4 <> 0 UNION - SELECT ct.spell5 FROM creature_template ct WHERE ct.spell5 <> 0 UNION - SELECT ct.spell6 FROM creature_template ct WHERE ct.spell6 <> 0 UNION - SELECT ct.spell7 FROM creature_template ct WHERE ct.spell7 <> 0 UNION - SELECT ct.spell8 FROM creature_template ct WHERE ct.spell8 <> 0' + SELECT cts.Spell FROM creature_template_spell cts' ); $auras = DB::World()->selectCol('SELECT cta.auras FROM creature_template_addon cta WHERE auras <> ""');