From cb1916c48472ef6ade04a81ca1a0629ebd93d2a8 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Wed, 19 Aug 2015 17:10:50 +0200 Subject: [PATCH] Setup/Fixups * some additions to latest pull requests - added missing dependancies - added quest_template changes to source.func.php --- setup/tools/sqlGen.class.php | 6 +++--- setup/tools/sqlgen/objects.func.php | 12 ++++++------ setup/tools/sqlgen/quests.func.php | 1 + setup/tools/sqlgen/source.func.php | 9 ++++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/setup/tools/sqlGen.class.php b/setup/tools/sqlGen.class.php index 8b14ce2f..1ac65e13 100644 --- a/setup/tools/sqlGen.class.php +++ b/setup/tools/sqlGen.class.php @@ -57,9 +57,9 @@ class SqlGen 'creature' => [null, null, null, ['creature_template', 'locales_creature', 'creature_classlevelstats', 'instance_encounters']], 'currencies' => [null, null, null, ['item_template', 'locales_item']], 'events' => [null, null, null, ['game_event', 'game_event_prerequisite']], - 'objects' => [null, null, null, ['gameobject_template', 'locales_gameobject', 'gameobject_questitem']], + 'objects' => [null, null, null, ['gameobject_template', 'gameobject_template_locale', 'gameobject_questitem']], 'pet' => [null, null, null, ['creature_template', 'creature']], - 'quests' => [null, null, null, ['quest_template', 'locales_quest', 'game_event', 'game_event_seasonal_questrelation']], + 'quests' => [null, null, null, ['quest_template', 'quest_template_addon', 'locales_quest', 'game_event', 'game_event_seasonal_questrelation']], 'quests_startend' => [null, null, null, ['creature_queststarter', 'creature_questender', 'game_event_creature_quest', 'gameobject_queststarter', 'gameobject_questender', 'game_event_gameobject_quest', 'item_template']], 'spell' => [null, null, null, ['skill_discovery_template', 'item_template', 'creature_template', 'creature_template_addon', 'smart_scripts', 'npc_trainer', 'disables', 'spell_ranks', 'spell_dbc']], 'spelldifficulty' => [null, null, null, ['spelldifficulty_dbc']], @@ -70,7 +70,7 @@ class SqlGen 'zones' => [null, null, null, ['access_requirement']], 'itemset' => [null, null, ['spell'], ['item_template', 'game_event']], 'item_stats' /* + ench */ => [null, null, ['items', 'spell'], null], - 'source' => [null, null, ['spell', 'achievement'], ['npc_vendor', 'game_event_npc_vendor', 'creature', 'quest_template', 'playercreateinfo_item', 'npc_trainer', 'skill_discovery_template', 'playercreateinfo_skill', 'achievement_reward']] + 'source' => [null, null, ['spell', 'achievement'], ['npc_vendor', 'game_event_npc_vendor', 'creature', 'quest_template', 'quest_template_addon', 'playercreateinfo_item', 'npc_trainer', 'skill_discovery_template', 'playercreateinfo_skills', 'achievement_reward']] ); public static $cliOpts = []; diff --git a/setup/tools/sqlgen/objects.func.php b/setup/tools/sqlgen/objects.func.php index 003ffc2c..fdbf10cb 100644 --- a/setup/tools/sqlgen/objects.func.php +++ b/setup/tools/sqlgen/objects.func.php @@ -9,7 +9,7 @@ if (!CLI) /* deps: * gameobject_template - * locales_gameobject + * gameobject_template_locale * gameobject_questitem */ @@ -30,11 +30,11 @@ function objects(array $ids = []) IF(`type` IN (3, 9, 25), `type`, 0)))), -- regular chests, books, pools 0 AS event, -- linked worldevent displayId, - go.name, - gtl2.`name` AS name_loc2, - gtl3.`name` AS name_loc3, - gtl6.`name` AS name_loc6, - gtl8.`name` AS name_loc8, + go.name, + gtl2.`name` AS name_loc2, + gtl3.`name` AS name_loc3, + gtl6.`name` AS name_loc6, + gtl8.`name` AS name_loc8, faction, flags, 0 AS cuFlags, -- custom Flags diff --git a/setup/tools/sqlgen/quests.func.php b/setup/tools/sqlgen/quests.func.php index dc87634a..1586559b 100644 --- a/setup/tools/sqlgen/quests.func.php +++ b/setup/tools/sqlgen/quests.func.php @@ -9,6 +9,7 @@ if (!CLI) /* deps: * quest_template + * quest_template_addon * locales_quest * game_event * game_event_seasonal_questrelation diff --git a/setup/tools/sqlgen/source.func.php b/setup/tools/sqlgen/source.func.php index abb7b492..ae439cc8 100644 --- a/setup/tools/sqlgen/source.func.php +++ b/setup/tools/sqlgen/source.func.php @@ -24,6 +24,7 @@ if (!CLI) * creature_template * gameobject_template * quest_template + * quest_template_addon * npc_trainer * npc_vendor @@ -420,11 +421,13 @@ function source(array $ids = []) FROM mail_loot_template mlt JOIN - quest_template qt ON qt.RewardMailTemplateId = mlt.entry + quest_template_addon qta ON qta.RewardMailTemplateId = mlt.entry + JOIN + quest_template qt ON qt.ID = qta.ID LEFT JOIN item_template it ON it.entry = mlt.Item AND mlt.Reference <= 0 WHERE - qt.RewardMailTemplateId > 0 + qta.RewardMailTemplateId > 0 GROUP BY ARRAY_KEY '); @@ -1047,7 +1050,7 @@ function source(array $ids = []) SELECT spell AS ARRAY_KEY, id, SUM(qty) AS qty, BIT_OR(side) AS side FROM ( SELECT IF(rewardSpellCast = 0, rewardSpell, rewardSpellCast) AS spell, ID, COUNT(1) AS qty, IF(RequiredRaces & 0x2B2 AND !(RequiredRaces & 0x44D), 2, IF(RequiredRaces & 0x44D AND !(RequiredRaces & 0x2B2), 1, 3)) AS side FROM quest_template WHERE IF(rewardSpellCast = 0, rewardSpell, rewardSpellCast) > 0 GROUP BY spell UNION - SELECT SourceSpellId AS spell, ID, COUNT(1) AS qty, IF(RequiredRaces & 0x2B2 AND !(RequiredRaces & 0x44D), 2, IF(RequiredRaces & 0x44D AND !(RequiredRaces & 0x2B2), 1, 3)) AS side FROM quest_template WHERE SourceSpellId > 0 GROUP BY spell + SELECT qta.SourceSpellId AS spell, qt.ID, COUNT(1) AS qty, IF(RequiredRaces & 0x2B2 AND !(RequiredRaces & 0x44D), 2, IF(RequiredRaces & 0x44D AND !(RequiredRaces & 0x2B2), 1, 3)) AS side FROM quest_template qt JOIN quest_template_addon qta ON qta.ID = qt.ID WHERE qta.SourceSpellId > 0 GROUP BY spell ) t GROUP BY spell'); if ($quests)