DB/Structure

* implemented changes from 460e2c5dc5 (item localization)
This commit is contained in:
Sarjuuk
2017-05-02 22:01:24 +02:00
parent 189ac56fc0
commit 6168937901
4 changed files with 33 additions and 8 deletions

View File

@@ -57,7 +57,7 @@ class SqlGen
'itemenchantment' => [null, null, null, ['spell_enchant_proc_data']],
'achievement' => [null, null, ['icons'], ['dbc_achievement', 'disables']],
'creature' => [null, null, null, ['creature_template', 'creature_template_locale', 'creature_classlevelstats', 'instance_encounters']],
'currencies' => [null, null, null, ['item_template', 'locales_item']],
'currencies' => [null, null, null, ['item_template', 'item_template_locale']],
'events' => [null, null, null, ['game_event', 'game_event_prerequisite']],
'objects' => [null, null, null, ['gameobject_template', 'gameobject_template_locale', 'gameobject_questitem']],
'pet' => [null, null, ['icons'], ['creature_template', 'creature']],
@@ -67,7 +67,7 @@ class SqlGen
'spelldifficulty' => [null, null, null, ['spelldifficulty_dbc']],
'taxi' /* nodes + paths */ => [null, null, null, ['creature_template', 'creature']],
'titles' => [null, null, null, ['quest_template', 'game_event_seasonal_questrelation', 'game_event', 'achievement_reward']],
'items' => [null, null, ['icons'], ['item_template', 'locales_item', 'spell_group', 'game_event']],
'items' => [null, null, ['icons'], ['item_template', 'item_template_locale', 'spell_group', 'game_event']],
'spawns' /* + waypoints */ => [null, null, null, ['creature', 'creature_addon', 'gameobject', 'gameobject_template', 'vehicle_accessory', 'vehicle_accessory_template', 'script_waypoint', 'waypoints', 'waypoint_data']],
'zones' => [null, null, null, ['access_requirement']],
'itemset' => [null, null, ['spell'], ['item_template', 'game_event']],

View File

@@ -9,7 +9,7 @@ if (!CLI)
/* deps:
* item_template
* locales_item
* item_template_locale
*/
// hide test tokens and move them to unused
@@ -32,7 +32,25 @@ function currencies(array $ids = [])
$moneyItems = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, itemId FROM dbc_currencytypes{ WHERE id IN (?a)}', $ids ?: DBSIMPLE_SKIP);
// apply names & cap
$moneyNames = DB::World()->select('SELECT it.entry AS ARRAY_KEY, name AS name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, it.maxCount AS cap FROM item_template it LEFT JOIN locales_item li ON li.entry = it.entry WHERE it.entry IN (?a)', $moneyItems);
$moneyNames = DB::World()->select('
SELECT
it.entry AS ARRAY_KEY,
it.name AS name_loc0, IFNULL(itl2.Name, "") AS name_loc2, IFNULL(itl3.Name, "") AS name_loc3, IFNULL(itl6.Name, "") AS name_loc6, IFNULL(itl8.Name, "") AS name_loc8,
it.maxCount AS cap
FROM
item_template it
LEFT JOIN
item_template_locale itl2 ON it.entry = itl2.ID AND itl2.locale = "frFR"
LEFT JOIN
item_template_locale itl3 ON it.entry = itl3.ID AND itl3.locale = "deDE"
LEFT JOIN
item_template_locale itl6 ON it.entry = itl6.ID AND itl6.locale = "esES"
LEFT JOIN
item_template_locale itl8 ON it.entry = itl8.ID AND itl8.locale = "ruRU"
WHERE
it.entry IN (?a)',
$moneyItems);
foreach ($moneyItems as $cId => $itemId)
{
if (!empty($moneyNames[$itemId]))

View File

@@ -9,7 +9,7 @@ if (!CLI)
/* deps:
* item_template
* locales_item
* item_template_locale
* spell_group
* game_event
*/
@@ -35,7 +35,7 @@ function items(array $ids = [])
subclass, subclass AS subClassBak,
SoundOverrideSubclass,
IFNULL(sg.id, 0) AS subSubClass,
name, IFNULL(li.name_loc2, ""), IFNULL(li.name_loc3, ""), IFNULL(li.name_loc6, ""), IFNULL(li.name_loc8, ""),
it.name, IFNULL(itl2.Name, ""), IFNULL(itl3.Name, ""), IFNULL(itl6.Name, ""), IFNULL(itl8.Name, ""),
0 AS iconId,
displayid,
0 AS spellVisualId,
@@ -84,7 +84,7 @@ function items(array $ids = [])
spellid_4, spelltrigger_4, spellcharges_4, spellppmRate_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4,
spellid_5, spelltrigger_5, spellcharges_5, spellppmRate_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5,
bonding,
it.description, IFNULL(li.description_loc2, ""), IFNULL(li.description_loc3, ""), IFNULL(li.description_loc6, ""), IFNULL(li.description_loc8, ""),
it.description, IFNULL(itl2.Description, ""), IFNULL(itl3.Description, ""), IFNULL(itl6.Description, ""), IFNULL(itl8.Description, ""),
PageText,
LanguageID,
startquest,
@@ -119,7 +119,13 @@ function items(array $ids = [])
FROM
item_template it
LEFT JOIN
locales_item li ON li.entry = it.entry
item_template_locale itl2 ON it.entry = itl2.ID AND itl2.locale = "frFR"
LEFT JOIN
item_template_locale itl3 ON it.entry = itl3.ID AND itl3.locale = "deDE"
LEFT JOIN
item_template_locale itl6 ON it.entry = itl6.ID AND itl6.locale = "esES"
LEFT JOIN
item_template_locale itl8 ON it.entry = itl8.ID AND itl8.locale = "ruRU"
LEFT JOIN
spell_group sg ON sg.spell_id = it.spellid_1 AND it.class = 0 AND it.subclass = 2 AND sg.id IN (1, 2)
LEFT JOIN

View File

@@ -0,0 +1 @@
UPDATE aowow_dbversion SET `sql` = CONCAT(IFNULL(`sql`, ''), 'currencies items');