mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
IconDB
* initial implementation * this includes a complete reindexing of everything touching icons * this also means, no linking to red-rocket-site though, they index them differently
This commit is contained in:
@@ -177,7 +177,8 @@ CREATE TABLE `aowow_achievement` (
|
||||
`parentCat` smallint(6) NOT NULL,
|
||||
`points` tinyint(3) unsigned NOT NULL,
|
||||
`orderInGroup` tinyint(3) unsigned NOT NULL,
|
||||
`iconId` mediumint(8) unsigned NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`iconIdBak` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`flags` smallint(5) unsigned NOT NULL,
|
||||
`reqCriteriaCount` tinyint(3) unsigned NOT NULL,
|
||||
`refAchievement` smallint(5) unsigned NOT NULL,
|
||||
@@ -198,7 +199,8 @@ CREATE TABLE `aowow_achievement` (
|
||||
`reward_loc3` varchar(92) NOT NULL,
|
||||
`reward_loc6` varchar(83) NOT NULL,
|
||||
`reward_loc8` varchar(95) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `iconId` (`iconId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -540,7 +542,7 @@ CREATE TABLE `aowow_currencies` (
|
||||
`id` int(16) NOT NULL,
|
||||
`category` mediumint(8) NOT NULL,
|
||||
`cuFlags` int(10) unsigned NOT NULL,
|
||||
`iconId` mediumint(9) NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`itemId` int(16) NOT NULL,
|
||||
`cap` mediumint(8) unsigned NOT NULL,
|
||||
`name_loc0` varchar(64) NOT NULL,
|
||||
@@ -553,7 +555,8 @@ CREATE TABLE `aowow_currencies` (
|
||||
`description_loc3` varchar(256) NOT NULL,
|
||||
`description_loc6` varchar(256) NOT NULL,
|
||||
`description_loc8` varchar(256) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `iconId` (`iconId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -716,7 +719,8 @@ CREATE TABLE `aowow_glyphproperties` (
|
||||
`id` smallint(5) unsigned NOT NULL,
|
||||
`spellId` mediumint(11) unsigned NOT NULL,
|
||||
`typeFlags` tinyint(3) unsigned NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`iconIdBak` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -1146,6 +1150,7 @@ CREATE TABLE `aowow_items` (
|
||||
`name_loc3` varchar(127) DEFAULT NULL,
|
||||
`name_loc6` varchar(127) DEFAULT NULL,
|
||||
`name_loc8` varchar(127) DEFAULT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`displayId` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`spellVisualId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`quality` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
@@ -1293,7 +1298,8 @@ CREATE TABLE `aowow_items` (
|
||||
KEY `idx_name` (`name_loc0`),
|
||||
KEY `items_index` (`class`),
|
||||
KEY `idx_model` (`displayId`),
|
||||
KEY `idx_faction` (`requiredFaction`)
|
||||
KEY `idx_faction` (`requiredFaction`).
|
||||
KEY `iconId` (`iconId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -1488,7 +1494,7 @@ CREATE TABLE `aowow_pet` (
|
||||
`name_loc3` varchar(64) NOT NULL,
|
||||
`name_loc6` varchar(64) NOT NULL,
|
||||
`name_loc8` varchar(64) NOT NULL,
|
||||
`iconString` varchar(128) NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`skillLineId` mediumint(9) NOT NULL,
|
||||
`spellId1` mediumint(9) NOT NULL,
|
||||
`spellId2` mediumint(9) NOT NULL,
|
||||
@@ -1497,7 +1503,8 @@ CREATE TABLE `aowow_pet` (
|
||||
`armor` mediumint(9) NOT NULL,
|
||||
`damage` mediumint(9) NOT NULL,
|
||||
`health` mediumint(9) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `iconId` (`iconId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -1891,7 +1898,8 @@ CREATE TABLE `aowow_skillline` (
|
||||
`description_loc3` text NOT NULL,
|
||||
`description_loc6` text NOT NULL,
|
||||
`description_loc8` text NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`iconIdBak` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`professionMask` smallint(5) unsigned NOT NULL,
|
||||
`recipeSubClass` tinyint(3) unsigned NOT NULL,
|
||||
`specializations` varchar(30) NOT NULL COMMENT 'space-separated spellIds',
|
||||
@@ -2126,8 +2134,9 @@ CREATE TABLE `aowow_spell` (
|
||||
`effect1BonusMultiplier` float NOT NULL,
|
||||
`effect2BonusMultiplier` float NOT NULL,
|
||||
`effect3BonusMultiplier` float NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL,
|
||||
`iconIdAlt` mediumint(9) NOT NULL,
|
||||
`iconId` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`iconIdBak` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`iconIdAlt` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`rankNo` tinyint(3) unsigned NOT NULL,
|
||||
`spellVisualId` smallint(5) unsigned NOT NULL,
|
||||
`name_loc0` varchar(85) NOT NULL,
|
||||
@@ -2173,7 +2182,8 @@ CREATE TABLE `aowow_spell` (
|
||||
KEY `category` (`typeCat`),
|
||||
KEY `spell` (`id`) USING BTREE,
|
||||
KEY `effects` (`effect1Id`,`effect2Id`,`effect3Id`),
|
||||
KEY `items` (`effect1CreateItemId`,`effect2CreateItemId`,`effect3CreateItemId`)
|
||||
KEY `items` (`effect1CreateItemId`,`effect2CreateItemId`,`effect3CreateItemId`),
|
||||
KEY `iconId` (`iconId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -2656,7 +2666,7 @@ UNLOCK TABLES;
|
||||
|
||||
LOCK TABLES `aowow_dbversion` WRITE;
|
||||
/*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */;
|
||||
INSERT INTO `aowow_dbversion` VALUES (1490789226,0,NULL,NULL);
|
||||
INSERT INTO `aowow_dbversion` VALUES (1490815302,0,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -450,6 +450,14 @@ if (!CLI)
|
||||
|
||||
if ($missing = array_diff(array_map('strtolower', $dbcEntries), array_map('strtolower', $allPaths)))
|
||||
{
|
||||
// hide affected icons from listviews
|
||||
$iconNames = array_map(function($path) {
|
||||
preg_match('/\/([^\/]+)\.blp$/i', $path, $m);
|
||||
return $m ? $m[1] : null;
|
||||
}, $missing);
|
||||
var_dump($iconNames);
|
||||
DB::Aowow()->query('UPDATE ?_icons SET cuFlags = cuFlags | ?d WHERE name IN (?a)', CUSTOM_EXCLUDE_FOR_LISTVIEW, $iconNames);
|
||||
|
||||
asort($missing);
|
||||
CLISetup::log('the following '.count($missing).' images where referenced by DBC but not in the mpqData directory. They may need to be converted by hand later on.', CLISetup::LOG_WARN);
|
||||
foreach ($missing as $m)
|
||||
|
||||
@@ -28,7 +28,6 @@ class SqlGen
|
||||
private static $tables = array( // [dbcName, saveDbc, AowowDeps, TCDeps]
|
||||
'achievementcategory' => ['achievement_category', false, null, null],
|
||||
'achievementcriteria' => ['achievement_criteria', false, null, null],
|
||||
'glyphproperties' => ['glyphproperties', true, null, null],
|
||||
'itemenchantmentcondition' => ['spellitemenchantmentcondition', false, null, null],
|
||||
'itemextendedcost' => ['itemextendedcost', false, null, null],
|
||||
'itemlimitcategory' => ['itemlimitcategory', false, null, null],
|
||||
@@ -41,37 +40,38 @@ class SqlGen
|
||||
'spellrange' => ['spellrange', false, null, null],
|
||||
'spellvariables' => ['spelldescriptionvariables', false, null, null],
|
||||
'totemcategory' => ['totemcategory', false, null, null],
|
||||
'talents' => [null, null, null, null],
|
||||
'classes' => [null, null, null, null],
|
||||
'factions' => [null, null, null, null],
|
||||
'factiontemplate' => [null, null, null, null],
|
||||
'holidays' => [null, null, null, null],
|
||||
'icons' => [null, null, null, null],
|
||||
'itemrandomenchant' => [null, null, null, null],
|
||||
'races' => [null, null, null, null],
|
||||
'shapeshiftforms' => [null, null, null, null],
|
||||
'skillline' => [null, null, null, null],
|
||||
'emotes' => [null, null, null, null],
|
||||
'sounds' => [null, null, null, null],
|
||||
'itemenchantment' => [null, null, null, ['spell_enchant_proc_data']],
|
||||
'achievement' => [null, null, null, ['dbc_achievement', 'disables']],
|
||||
'creature' => [null, null, null, ['creature_template', 'creature_template_locale', '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', 'gameobject_template_locale', 'gameobject_questitem']],
|
||||
'pet' => [null, null, null, ['creature_template', 'creature']],
|
||||
'quests' => [null, null, null, ['quest_template', 'quest_template_addon', 'locales_quest', 'game_event', 'game_event_seasonal_questrelation', 'disables']],
|
||||
'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']],
|
||||
'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, null, ['item_template', 'locales_item', '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']],
|
||||
'item_stats' /* + ench */ => [null, null, ['items', 'spell'], null],
|
||||
'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', 'skill_perfect_item_template']]
|
||||
'icons' => [null, null, null, null],
|
||||
'glyphproperties' => [null, true, ['icons'], null],
|
||||
'talents' => [null, null, null, null],
|
||||
'classes' => [null, null, null, null],
|
||||
'factions' => [null, null, null, null],
|
||||
'factiontemplate' => [null, null, null, null],
|
||||
'holidays' => [null, null, null, null],
|
||||
'itemrandomenchant' => [null, null, null, null],
|
||||
'races' => [null, null, null, null],
|
||||
'shapeshiftforms' => [null, null, null, null],
|
||||
'skillline' => [null, null, ['icons'], null],
|
||||
'emotes' => [null, null, null, null],
|
||||
'sounds' => [null, null, null, null],
|
||||
'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']],
|
||||
'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']],
|
||||
'quests' => [null, null, null, ['quest_template', 'quest_template_addon', 'locales_quest', 'game_event', 'game_event_seasonal_questrelation', 'disables']],
|
||||
'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, ['icons'], ['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']],
|
||||
'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']],
|
||||
'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']],
|
||||
'item_stats' /* + ench */ => [null, null, ['items', 'spell'], null],
|
||||
'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', 'skill_perfect_item_template']]
|
||||
);
|
||||
|
||||
public static $cliOpts = [];
|
||||
|
||||
@@ -16,14 +16,47 @@ if (!CLI)
|
||||
$customData = array(
|
||||
1956 => ['itemExtra' => 44738]
|
||||
);
|
||||
$reqDBC = ['achievement_category', 'achievement'];
|
||||
$reqDBC = ['achievement_category', 'achievement', 'spellicon'];
|
||||
|
||||
function achievement(array $ids = [])
|
||||
{
|
||||
if ($ids)
|
||||
DB::Aowow()->query('DELETE FROM ?_achievement WHERE id IN (?a)', $ids);
|
||||
else
|
||||
DB::Aowow()->query('INSERT IGNORE INTO ?_achievement SELECT a.id, 2 - a.faction, a.map, 0, 0, a.category, ac.parentCategory, a.points, a.orderInGroup, a.iconId, a.flags, a.reqCriteriaCount, a.refAchievement, 0, 0, a.name_loc0, a.name_loc2, a.name_loc3, a.name_loc6, a.name_loc8, a.description_loc0, a.description_loc2, a.description_loc3, a.description_loc6, a.description_loc8, a.reward_loc0, a.reward_loc2, a.reward_loc3, a.reward_loc6, a.reward_loc8 FROM dbc_achievement a LEFT JOIN dbc_achievement_category ac ON ac.id = a.category');
|
||||
{
|
||||
DB::Aowow()->query('
|
||||
REPLACE INTO
|
||||
?_achievement
|
||||
SELECT
|
||||
a.id,
|
||||
2 - a.faction,
|
||||
a.map,
|
||||
0,
|
||||
0,
|
||||
a.category,
|
||||
ac.parentCategory,
|
||||
a.points,
|
||||
a.orderInGroup,
|
||||
IFNULL(i.id, 0),
|
||||
a.iconId,
|
||||
a.flags,
|
||||
a.reqCriteriaCount,
|
||||
a.refAchievement,
|
||||
0,
|
||||
0,
|
||||
a.name_loc0, a.name_loc2, a.name_loc3, a.name_loc6, a.name_loc8,
|
||||
a.description_loc0, a.description_loc2, a.description_loc3, a.description_loc6, a.description_loc8,
|
||||
a.reward_loc0, a.reward_loc2, a.reward_loc3, a.reward_loc6, a.reward_loc8
|
||||
FROM
|
||||
dbc_achievement a
|
||||
LEFT JOIN
|
||||
dbc_achievement_category ac ON ac.id = a.category
|
||||
LEFT JOIN
|
||||
dbc_spellicon si ON si.id = a.iconId
|
||||
LEFT JOIN
|
||||
?_icons i ON LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1)) = i.name
|
||||
');
|
||||
}
|
||||
|
||||
// serverside achievements
|
||||
$serverAchievements = DB::World()->select('SELECT ID, IF(requiredFaction = -1, 3, IF(requiredFaction = 0, 2, 1)) AS "faction", mapID, points, flags, count, refAchievement FROM achievement_dbc{ WHERE id IN (?a)}',
|
||||
|
||||
@@ -40,7 +40,7 @@ function currencies(array $ids = [])
|
||||
else
|
||||
{
|
||||
CLISetup::log('item #'.$itemId.' required by currency #'.$cId.' not in item_template', CLISetup::LOG_WARN);
|
||||
$strings = ['name_loc0' => 'Item #'.$itemId.' not in DB', 'iconId' => -1240, 'cuFlags' => CUSTOM_EXCLUDE_FOR_LISTVIEW, 'category' => 3];
|
||||
$strings = ['name_loc0' => 'Item #'.$itemId.' not in DB', 'iconId' => 0, 'cuFlags' => CUSTOM_EXCLUDE_FOR_LISTVIEW, 'category' => 3];
|
||||
}
|
||||
|
||||
DB::Aowow()->query('UPDATE ?_currencies SET ?a WHERE itemId = ?d', $strings, $itemId);
|
||||
@@ -49,7 +49,18 @@ function currencies(array $ids = [])
|
||||
// apply icons
|
||||
$displayIds = DB::World()->selectCol('SELECT entry AS ARRAY_KEY, displayid FROM item_template WHERE entry IN (?a)', $moneyItems);
|
||||
foreach ($displayIds as $itemId => $iconId)
|
||||
DB::Aowow()->query('UPDATE ?_currencies SET iconId = ?d WHERE itemId = ?d', -$iconId, $itemId);
|
||||
DB::Aowow()->query('
|
||||
UPDATE
|
||||
?_currencies c,
|
||||
?_icons i,
|
||||
dbc_itemdisplayinfo idi
|
||||
SET
|
||||
c.iconId = i.id
|
||||
WHERE
|
||||
i.name = LOWER(idi.inventoryIcon1) AND
|
||||
idi.id = ?d AND
|
||||
c.itemId = ?d
|
||||
', $iconId, $itemId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
20
setup/tools/sqlgen/glyphproperties.func.php
Normal file
20
setup/tools/sqlgen/glyphproperties.func.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
if (!CLI)
|
||||
die('not in cli mode');
|
||||
|
||||
$reqDBC = ['glyphproperties', 'spellicon'];
|
||||
|
||||
function glyphproperties()
|
||||
{
|
||||
DB::Aowow()->query('REPLACE INTO ?_glyphproperties SELECT id, spellId, typeFlags, 0, iconId FROM dbc_glyphproperties');
|
||||
|
||||
DB::Aowow()->query('UPDATE ?_glyphproperties gp, ?_icons ic, dbc_spellicon si SET gp.iconId = ic.id WHERE gp.iconIdBak = si.id AND ic.name = LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1))');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -13,12 +13,20 @@ $reqDBC = ['spellicon', 'itemdisplayinfo'];
|
||||
|
||||
function icons()
|
||||
{
|
||||
DB::Aowow()->query('TRUNCATE ?_icons');
|
||||
DB::Aowow()->query('ALTER TABLE ?_icons AUTO_INCREMENT = 1');
|
||||
|
||||
$baseQuery = '
|
||||
REPLACE INTO
|
||||
?_icons
|
||||
SELECT Id, LOWER(SUBSTRING_INDEX(iconPath, "\\\\", -1)) FROM dbc_spellicon
|
||||
INSERT INTO ?_icons (`name`) SELECT x FROM
|
||||
(
|
||||
(SELECT LOWER(SUBSTRING_INDEX(iconPath, "\\\\", -1)) AS x FROM dbc_spellicon WHERE iconPath LIKE "%icons%")
|
||||
UNION
|
||||
SELECT -Id, LOWER(inventoryIcon1) FROM dbc_itemdisplayinfo';
|
||||
(SELECT LOWER(inventoryIcon1) AS x FROM dbc_itemdisplayinfo WHERE inventoryIcon1 <> "")
|
||||
) y
|
||||
GROUP BY
|
||||
x
|
||||
ORDER BY
|
||||
x ASC';
|
||||
|
||||
DB::Aowow()->query($baseQuery);
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ function items(array $ids = [])
|
||||
SoundOverrideSubclass,
|
||||
IFNULL(sg.id, 0) AS subSubClass,
|
||||
name, IFNULL(li.name_loc2, ""), IFNULL(li.name_loc3, ""), IFNULL(li.name_loc6, ""), IFNULL(li.name_loc8, ""),
|
||||
0 AS iconId,
|
||||
displayid,
|
||||
0 AS spellVisualId,
|
||||
Quality,
|
||||
@@ -153,6 +154,9 @@ function items(array $ids = [])
|
||||
// get modelString
|
||||
DB::Aowow()->query('UPDATE ?_items i, dbc_itemdisplayinfo idi SET i.model = IF(idi.leftModelName = "", idi.rightModelName, idi.leftModelName) WHERE i.displayId = idi.id');
|
||||
|
||||
// get iconId
|
||||
DB::Aowow()->query('UPDATE ?_items i, dbc_itemdisplayinfo idi, ?_icons ic SET i.iconId = ic.id WHERE i.displayId = idi.id AND LOWER(idi.inventoryIcon1) = ic.name');
|
||||
|
||||
// unify slots: Robes => Chest; Ranged (right) => Ranged
|
||||
DB::Aowow()->query('UPDATE ?_items SET slot = 15 WHERE slotbak = 26');
|
||||
DB::Aowow()->query('UPDATE ?_items SET slot = 5 WHERE slotbak = 20');
|
||||
|
||||
@@ -33,12 +33,14 @@ function pet(array $ids = [])
|
||||
0, -- exotic
|
||||
0, -- expansion
|
||||
name_loc0, name_loc2, name_loc3, name_lo6, name_loc8,
|
||||
LOWER(SUBSTRING_INDEX(iconString, "\\\\", -1)),
|
||||
ic.id,
|
||||
skillLine1,
|
||||
0, 0, 0, 0, -- spell[1-4]
|
||||
0, 0, 0 -- armor, damage, health
|
||||
FROM
|
||||
dbc_creaturefamily f
|
||||
LEFT JOIN
|
||||
?_icons ic ON ic.name = LOWER(SUBSTRING_INDEX(f.iconString, "\\\\", -1))
|
||||
WHERE
|
||||
petTalentType <> -1';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ if (!CLI)
|
||||
die('not in cli mode');
|
||||
|
||||
$customData = array(
|
||||
393 => ['professionMask' => 0x0000, 'iconId' => 736], // Skinning
|
||||
393 => ['professionMask' => 0x0000], // Skinning
|
||||
171 => ['professionMask' => 0x0001, 'recipeSubClass' => 6, 'specializations' => '28677 28675 28672'], // Alchemy
|
||||
164 => ['professionMask' => 0x0002, 'recipeSubClass' => 4, 'specializations' => '9788 9787 17041 17040 17039'], // Blacksmithing
|
||||
185 => ['professionMask' => 0x0004, 'recipeSubClass' => 5], // Cooking
|
||||
@@ -21,7 +21,6 @@ $customData = array(
|
||||
356 => ['professionMask' => 0x0400, 'recipeSubClass' => 9], // Fishing
|
||||
182 => ['professionMask' => 0x0800], // Herbalism
|
||||
773 => ['professionMask' => 0x1000, 'recipeSubClass' => 11], // Inscription
|
||||
633 => ['iconId' => 936], // lockpicking
|
||||
785 => ['name_loc0' => 'Pet - Wasp'], // Pet - Wasp
|
||||
781 => ['name_loc2' => 'Familier - diablosaure exotique'], // Pet - Exotic Devilsaur
|
||||
758 => ['name_loc6' => 'Mascota: Evento - Control remoto', 'name_loc3' => 'Tier - Ereignis Ferngesteuert', 'categoryId' => 7], // Pet - Event - Remote Control
|
||||
@@ -35,7 +34,7 @@ function skillline()
|
||||
REPLACE INTO
|
||||
?_skillline
|
||||
SELECT
|
||||
Id, categoryId, 0, categoryId, name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, description_loc0, description_loc2, description_loc3, description_loc6, description_loc8, iconId, 0, 0, ""
|
||||
Id, categoryId, 0, categoryId, name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, description_loc0, description_loc2, description_loc3, description_loc6, description_loc8, 0, iconId, 0, 0, ""
|
||||
FROM
|
||||
dbc_skillline';
|
||||
|
||||
@@ -47,11 +46,30 @@ function skillline()
|
||||
DB::Aowow()->query('UPDATE ?_skillline SET typeCat = -6 WHERE id IN (778, 788, 758) OR (categoryId = 7 AND name_loc0 LIKE "%pet%")');
|
||||
|
||||
// more complex fixups
|
||||
DB::Aowow()->query('UPDATE ?_skillline sl, dbc_spell s, dbc_skilllineability sla SET sl.iconId = s.iconId WHERE (s.effect1Id IN (25, 26, 40) OR s.effect2Id = 60) AND sla.spellId = s.id AND sl.id = sla.skillLineId');
|
||||
DB::Aowow()->query('UPDATE ?_skillline SET name_loc8 = REPLACE(name_loc8, " - ", ": ") WHERE categoryId = 7 OR id IN (758, 788)');
|
||||
DB::Aowow()->query('UPDATE ?_skillline SET iconId = ?d WHERE iconId = 0', 1776); // inv_misc_questionmark
|
||||
DB::Aowow()->query('UPDATE ?_skillline SET cuFlags = ?d WHERE id IN (?a)', CUSTOM_EXCLUDE_FOR_LISTVIEW, [142, 148, 149, 150, 152, 155, 183, 533, 553, 554, 713, 769]);
|
||||
|
||||
// apply icons
|
||||
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic, dbc_spellicon si SET sl.iconId = ic.id WHERE sl.iconIdBak = si.id AND ic.name = LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1))');
|
||||
DB::Aowow()->query('
|
||||
UPDATE
|
||||
?_skillline sl,
|
||||
dbc_spell s,
|
||||
dbc_skilllineability sla,
|
||||
?_icons ic,
|
||||
dbc_spellicon si
|
||||
SET
|
||||
sl.iconId = ic.id
|
||||
WHERE
|
||||
(s.effect1Id IN (25, 26, 40) OR s.effect2Id = 60) AND
|
||||
ic.name = LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1)) AND
|
||||
s.iconId = si.id AND
|
||||
sla.spellId = s.id AND
|
||||
sl.id = sla.skillLineId
|
||||
');
|
||||
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic SET sl.iconId = ic.id WHERE ic.name = ? AND sl.id = ?d', 'inv_misc_pelt_wolf_01', 393);
|
||||
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic SET sl.iconId = ic.id WHERE ic.name = ? AND sl.id = ?d', 'inv_misc_key_03', 633);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ $reqDBC = [
|
||||
'skillraceclassinfo',
|
||||
'talent',
|
||||
'talenttab',
|
||||
'glyphproperties'
|
||||
'glyphproperties',
|
||||
'spellicon'
|
||||
];
|
||||
|
||||
function spell()
|
||||
@@ -85,8 +86,8 @@ function spell()
|
||||
EffectSpellClassMaskA1, EffectSpellClassMaskA2, EffectSpellClassMaskA3,
|
||||
EffectSpellClassMaskB1, EffectSpellClassMaskB2, EffectSpellClassMaskB3,
|
||||
EffectSpellClassMaskC1, EffectSpellClassMaskC2, EffectSpellClassMaskC3,
|
||||
0 AS spellVisualId1, 0 AS spellVisualId2,
|
||||
0 AS iconId, 0 AS iconIdActive,
|
||||
0 AS iconId, 0 AS iconIdAlt,
|
||||
0 AS rankId, 0 AS spellVisualId1,
|
||||
CONCAT("Serverside - ",Comment) AS name_loc0,CONCAT("Serverside - ",Comment) AS name_loc2,CONCAT("Serverside - ",Comment) AS name_loc3,CONCAT("Serverside - ",Comment) AS name_loc6,CONCAT("Serverside - ",Comment) AS name_loc8,
|
||||
"" AS rank_loc0, "" AS rank_loc2, "" AS rank_loc3, "" AS rank_loc6, "" AS rank_loc8,
|
||||
"" AS description_loc0, "" AS description_loc2, "" AS description_loc3, "" AS description_loc6, "" AS description_loc8,
|
||||
@@ -175,9 +176,8 @@ function spell()
|
||||
effect1SpellClassMaskC, effect2SpellClassMaskC, effect3SpellClassMaskC,
|
||||
effect1DamageMultiplier, effect2DamageMultiplier, effect3DamageMultiplier,
|
||||
effect1BonusMultiplier, effect2BonusMultiplier, effect3BonusMultiplier,
|
||||
iconId, 0 AS iconIdAlt,
|
||||
0 AS rankId,
|
||||
spellVisualId1,
|
||||
0 AS iconId, iconId AS iconIdBak, 0 AS iconIdAlt,
|
||||
0 AS rankId, spellVisualId1,
|
||||
name_loc0, name_loc2, name_loc3, name_loc6, name_loc8,
|
||||
rank_loc0, rank_loc2, rank_loc3, rank_loc6, rank_loc8,
|
||||
description_loc0, description_loc2, description_loc3, description_loc6, description_loc8,
|
||||
@@ -286,6 +286,8 @@ function spell()
|
||||
ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL = 2 not used for now
|
||||
*/
|
||||
|
||||
CLISetup::log(' - linking with skillineability');
|
||||
|
||||
$results = DB::Aowow()->select('SELECT spellId AS ARRAY_KEY, Id AS ARRAY_KEY2, skillLineId, reqRaceMask, reqClassMask, reqSkillLevel, acquireMethod, skillLevelGrey, skillLevelYellow FROM dbc_skilllineability sla');
|
||||
foreach ($results as $spellId => $sets)
|
||||
{
|
||||
@@ -443,6 +445,8 @@ function spell()
|
||||
/* talent related */
|
||||
/******************/
|
||||
|
||||
CLISetup::log(' - linking with talent');
|
||||
|
||||
for ($i = 1; $i < 6; $i++)
|
||||
{
|
||||
// classMask
|
||||
@@ -463,6 +467,8 @@ function spell()
|
||||
/* Other */
|
||||
/*********/
|
||||
|
||||
CLISetup::log(' - misc fixups & icons');
|
||||
|
||||
// FU [FixUps]
|
||||
DB::Aowow()->query('UPDATE ?_spell SET reqRaceMask = ?d WHERE skillLine1 = ?d', 1 << 10, 760); // Draenai Racials
|
||||
DB::Aowow()->query('UPDATE ?_spell SET reqRaceMask = ?d WHERE skillLine1 = ?d', 1 << 9, 756); // Bloodelf Racials
|
||||
@@ -494,7 +500,7 @@ function spell()
|
||||
$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]))
|
||||
DB::Aowow()->query('UPDATE ?_spell SET iconIdAlt = ?d, cuFlags = cuFlags | ?d WHERE id = ?d', -$itemInfo[$itemId]['d'], ((7 - $itemInfo[$itemId]['q']) << 8), $sId);
|
||||
DB::Aowow()->query('UPDATE ?_spell s, ?_icons ic, dbc_spellicon si SET s.iconIdAlt = ?d, s.cuFlags = s.cuFlags | ?d WHERE s.iconIdBak = si.id AND ic.name = LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1)) AND s.id = ?d', -$itemInfo[$itemId]['d'], ((7 - $itemInfo[$itemId]['q']) << 8), $sId);
|
||||
|
||||
// apply specializations [trainerTemplate => reqSpell]
|
||||
$specs = array(
|
||||
@@ -516,11 +522,15 @@ function spell()
|
||||
|
||||
DB::Aowow()->query('UPDATE ?_spell SET reqSpellId = id WHERE id IN (?a)', [9788, 9787, 20222, 20219, 10660, 10656, 10658, 26797, 26798, 26801, 17039, 17040, 17041]);
|
||||
|
||||
// setting icons
|
||||
DB::Aowow()->query('UPDATE ?_spell s, ?_icons ic, dbc_spellicon si SET s.iconId = ic.id WHERE s.iconIdBak = si.id AND ic.name = LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1))');
|
||||
|
||||
/**************/
|
||||
/* Categories */
|
||||
/**************/
|
||||
|
||||
CLISetup::log(' - applying categories');
|
||||
|
||||
// player talents (-2)
|
||||
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -2 WHERE t.tabId NOT IN (409, 410, 411) AND (s.Id = t.rank1 OR s.Id = t.rank2 OR s.Id = t.rank3 OR s.Id = t.rank4 OR s.Id = t.rank5)');
|
||||
|
||||
@@ -635,6 +645,8 @@ function spell()
|
||||
/* Glyphs */
|
||||
/**********/
|
||||
|
||||
CLISetup::log(' - fixing glyph data');
|
||||
|
||||
// glyphSpell => affectedSpell
|
||||
$glyphAffects = array(
|
||||
63959 => 50842, // Pestilence
|
||||
@@ -667,8 +679,10 @@ function spell()
|
||||
);
|
||||
|
||||
$queryIcons = '
|
||||
SELECT s.id, s.name_loc0, s.skillLine1 as skill, s.iconId as icon, s.typeCat * s.typeCat AS prio
|
||||
SELECT s.id, s.name_loc0, s.skillLine1 as skill, ic.id as icon, s.typeCat * s.typeCat AS prio
|
||||
FROM ?_spell s
|
||||
LEFT JOIN dbc_spellicon si ON s.iconIdBak = si.id
|
||||
LEFT JOIN ?_icons ic ON ic.name = LOWER(SUBSTRING_INDEX(si.iconPath, "\\\\", -1))
|
||||
WHERE [WHERE] AND (s.cuFlags & ?d) = 0 AND s.typeCat IN (0, 7, -2) -- not triggered; class spells first, talents second, unk last
|
||||
ORDER BY prio DESC
|
||||
';
|
||||
@@ -704,10 +718,8 @@ function spell()
|
||||
// first: manuall replace
|
||||
if ($applyId == 57144) // has no skillLine.. :/
|
||||
{
|
||||
$icons = [
|
||||
'skill' => 253,
|
||||
'icon' => 163 // ability_poisonsting
|
||||
];
|
||||
DB::Aowow()->query('UPDATE ?_spell s, ?_icons ic SET s.skillLine1 = ?d, s.iconIdAlt = ic.id WHERE s.id = ?d AND ic.name = ?', 253, 57144, 'ability_poisonsting');
|
||||
continue;
|
||||
}
|
||||
|
||||
// second: search by name and Family equality
|
||||
|
||||
45
setup/updates/1490815301_01.sql
Normal file
45
setup/updates/1490815301_01.sql
Normal file
@@ -0,0 +1,45 @@
|
||||
DROP TABLE IF EXISTS `aowow_icons`;
|
||||
CREATE TABLE `aowow_icons` (
|
||||
`id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`cuFlags` INT(11) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`name` VARCHAR(55) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `name` (`name`)
|
||||
) COLLATE='utf8_general_ci' ENGINE=MyISAM AUTO_INCREMENT=1;
|
||||
|
||||
ALTER TABLE `aowow_items`
|
||||
ADD COLUMN `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `name_loc8`,
|
||||
ADD INDEX `iconId` (`iconId`);
|
||||
|
||||
ALTER TABLE `aowow_spell`
|
||||
CHANGE COLUMN `iconId` `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `effect3BonusMultiplier`,
|
||||
ADD COLUMN `iconIdBak` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `iconId`,
|
||||
CHANGE COLUMN `iconIdAlt` `iconIdAlt` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `iconIdBak`,
|
||||
ADD INDEX `iconId` (`iconId`);
|
||||
|
||||
ALTER TABLE `aowow_achievement`
|
||||
ALTER `iconId` DROP DEFAULT;
|
||||
ALTER TABLE `aowow_achievement`
|
||||
CHANGE COLUMN `iconId` `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `orderInGroup`,
|
||||
ADD COLUMN `iconIdBak` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `iconId`,
|
||||
ADD INDEX `iconId` (`iconId`);
|
||||
|
||||
ALTER TABLE `aowow_skillline`
|
||||
CHANGE COLUMN `iconId` `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `description_loc8`,
|
||||
ADD COLUMN `iconIdBak` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `iconId`;
|
||||
|
||||
ALTER TABLE `aowow_glyphproperties`
|
||||
CHANGE COLUMN `iconId` `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `typeFlags`,
|
||||
ADD COLUMN `iconIdBak` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `iconId`;
|
||||
|
||||
ALTER TABLE `aowow_currencies`
|
||||
ALTER `iconId` DROP DEFAULT;
|
||||
ALTER TABLE `aowow_currencies`
|
||||
CHANGE COLUMN `iconId` `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `cuFlags`,
|
||||
ADD INDEX `iconId` (`iconId`);
|
||||
|
||||
ALTER TABLE `aowow_pet`
|
||||
CHANGE COLUMN `iconString` `iconId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `name_loc8`,
|
||||
ADD INDEX `iconId` (`iconId`);
|
||||
|
||||
UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' icons glyphproperties skillline items spell pet achievement'), `build` = CONCAT(IFNULL(`build`, ''), ' simpleImg');
|
||||
Reference in New Issue
Block a user