Setup/DBC

* index column Id => id
 * why was this exception even there.
 * also DBCs copied directly into aowow_tables should work again
This commit is contained in:
Sarjuuk
2017-04-11 15:29:10 +02:00
parent 6df3a27279
commit b5c7faff65
25 changed files with 281 additions and 192 deletions

View File

@@ -24,7 +24,7 @@ $reqDBC = ['spell', 'charbaseinfo', 'skillraceclassinfo', 'skilllineability', 'c
function classes()
{
$classes = DB::Aowow()->select('SELECT *, Id AS ARRAY_KEY FROM dbc_chrclasses');
$classes = DB::Aowow()->select('SELECT *, id AS ARRAY_KEY FROM dbc_chrclasses');
// add raceMask
$races = DB::Aowow()->select('SELECT classId AS ARRAY_KEY, BIT_OR(1 << (raceId - 1)) AS raceMask FROM dbc_charbaseinfo GROUP BY classId');

View File

@@ -27,7 +27,7 @@ $reqDBC = ['itemdisplayinfo', 'currencytypes'];
function currencies(array $ids = [])
{
if (!$ids)
DB::Aowow()->query('REPLACE INTO ?_currencies (id, category, itemId) SELECT Id, category, itemId FROM dbc_currencytypes');
DB::Aowow()->query('REPLACE INTO ?_currencies (id, category, itemId) SELECT id, category, itemId FROM dbc_currencytypes');
$moneyItems = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, itemId FROM dbc_currencytypes{ WHERE id IN (?a)}', $ids ?: DBSIMPLE_SKIP);

View File

@@ -46,7 +46,7 @@ function emotes(/*array $ids = [] */)
}
$_= DB::Aowow()->query('REPLACE INTO ?_emotes SELECT
et.Id,
et.id,
LOWER(et.command),
IF(e.animationId, 1, 0),
0, -- cuFlags
@@ -56,13 +56,13 @@ function emotes(/*array $ids = [] */)
FROM
dbc_emotestext et
LEFT JOIN
dbc_emotes e ON e.Id = et.emoteId
dbc_emotes e ON e.id = et.emoteId
LEFT JOIN
dbc_emotestextdata etdT ON etdT.Id = et.targetId
dbc_emotestextdata etdT ON etdT.id = et.targetId
LEFT JOIN
dbc_emotestextdata etdNT ON etdNT.Id = et.noTargetId
dbc_emotestextdata etdNT ON etdNT.id = et.noTargetId
LEFT JOIN
dbc_emotestextdata etdS ON etdS.Id = et.selfId'
dbc_emotestextdata etdS ON etdS.id = et.selfId'
);
if (!$_)

View File

@@ -72,7 +72,7 @@ function factions()
UPDATE
?_factions f
JOIN
(SELECT ft.factionId, GROUP_CONCAT(ft.Id SEPARATOR " ") AS tplIds FROM dbc_factiontemplate ft GROUP BY ft.factionId) temp ON f.id = temp.factionId
(SELECT ft.factionId, GROUP_CONCAT(ft.id SEPARATOR " ") AS tplIds FROM dbc_factiontemplate ft GROUP BY ft.factionId) temp ON f.id = temp.factionId
SET
f.templateIds = temp.tplIds';
@@ -98,7 +98,7 @@ function factions()
JOIN
dbc_faction f ON f.id = x.id
LEFT JOIN
dbc_factiontemplate ft ON f.Id = ft.factionId
dbc_factiontemplate ft ON f.id = ft.factionId
SET
cuFlags = cuFlags | ?d
WHERE

View File

@@ -169,7 +169,7 @@ function item_stats(array $ids = [])
function enchantment_stats()
{
$statCols = DB::Aowow()->selectCol('SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME` LIKE "%item_stats"');
$enchants = DB::Aowow()->select('SELECT *, Id AS ARRAY_KEY FROM dbc_spellitemenchantment');
$enchants = DB::Aowow()->select('SELECT *, id AS ARRAY_KEY FROM dbc_spellitemenchantment');
$spells = [];
$spellStats = [];

View File

@@ -207,7 +207,7 @@ function items(array $ids = [])
DB::Aowow()->query('UPDATE ?_items SET class = 12 WHERE classBak = 15 AND startQuest <> 0 AND name_loc0 NOT LIKE "sayge\'s fortune%"');
// move perm. enchantments into appropriate cat/subcat
DB::Aowow()->query('UPDATE ?_items i, dbc_spell s SET i.class = 0, i.subClass = 6 WHERE s.Id = i.spellId1 AND s.effect1Id = 53 AND i.classBak = 12');
DB::Aowow()->query('UPDATE ?_items i, dbc_spell s SET i.class = 0, i.subClass = 6 WHERE s.id = i.spellId1 AND s.effect1Id = 53 AND i.classBak = 12');
// move some generic recipes into appropriate sub-categories
$skillz = array(

View File

@@ -102,15 +102,15 @@ function quests(array $ids = [])
LEFT JOIN
quest_request_items qri ON q.ID = qri.ID
LEFT JOIN
locales_quest lq ON q.ID = lq.Id
locales_quest lq ON q.ID = lq.id
LEFT JOIN
game_event_seasonal_questrelation gesqr ON gesqr.questId = q.ID
LEFT JOIN
disables d ON d.entry = q.ID AND d.sourceType = 1
WHERE
q.Id > ?d
q.id > ?d
{
AND q.Id IN (?a)
AND q.id IN (?a)
}
ORDER BY
q.ID ASC
@@ -136,7 +136,7 @@ function quests(array $ids = [])
UPDATE
?_quests q
LEFT JOIN
dbc_questfactionreward rep ON rep.Id = IF(rewardFactionValue?d > 0, 1, 2)
dbc_questfactionreward rep ON rep.id = IF(rewardFactionValue?d > 0, 1, 2)
SET
rewardFactionValue?d = (CASE ABS(rewardFactionValue?d)
WHEN 0 THEN rep.Field1 WHEN 1 THEN rep.Field2 WHEN 2 THEN rep.Field3 WHEN 3 THEN rep.Field4 WHEN 4 THEN rep.Field5

View File

@@ -33,7 +33,7 @@ function races()
REPLACE INTO
?_races
SELECT
Id, 0, flags, 0, factionId, 0, 0, baseLanguage, IF(side = 2, 0, side + 1), fileString, name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, expansion
id, 0, flags, 0, factionId, 0, 0, baseLanguage, IF(side = 2, 0, side + 1), fileString, name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, expansion
FROM
dbc_chrraces';

View File

@@ -34,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, 0, 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';

View File

@@ -32,7 +32,7 @@ function sounds(/*array $ids = [] */)
content: e.g. Tavern Music
*/
// WMOAreaTable.dbc/Id => AreaTable.dbc/Id
// WMOAreaTable.dbc/id => AreaTable.dbc/id
$worldStateZoneSoundFix = array(
18153 => 2119,
18154 => 2119,
@@ -56,7 +56,7 @@ function sounds(/*array $ids = [] */)
// .mp3 => audio/mpeg
$query = '
SELECT Id AS `id`, `type` AS `cat`, `name`, 0 AS cuFlags,
SELECT id AS `id`, `type` AS `cat`, `name`, 0 AS cuFlags,
`file1` AS soundFile1, `file2` AS soundFile2, `file3` AS soundFile3, `file4` AS soundFile4, `file5` AS soundFile5,
`file6` AS soundFile6, `file7` AS soundFile7, `file8` AS soundFile8, `file9` AS soundFile9, `file10` AS soundFile10,
path, flags
@@ -196,7 +196,7 @@ function sounds(/*array $ids = [] */)
INSERT INTO
?_creature_sounds (`id`, `greeting`, `farewell`, `angry`, `exertion`, `exertioncritical`, `injury`, `injurycritical`, `death`, `stun`, `stand`, `aggro`, `wingflap`, `wingglide`, `alert`, `fidget`, `customattack`, `loop`, `jumpstart`, `jumpend`, `petattack`, `petorder`, `petdismiss`, `birth`, `spellcast`, `submerge`, `submerged`)
SELECT
cdi.Id,
cdi.id,
IFNULL(ns.greetSoundId, 0),
IFNULL(ns.byeSoundId, 0),
IFNULL(ns.angrySoundId, 0),
@@ -226,13 +226,13 @@ function sounds(/*array $ids = [] */)
FROM
dbc_creaturedisplayinfo cdi
LEFT JOIN
dbc_creaturemodeldata cmd ON cmd.Id = cdi.modelId
dbc_creaturemodeldata cmd ON cmd.id = cdi.modelId
LEFT JOIN
dbc_creaturesounddata csdA ON cdi.creatureSoundId = csdA.Id
dbc_creaturesounddata csdA ON cdi.creatureSoundId = csdA.id
LEFT JOIN
dbc_creaturesounddata csdB ON cmd.creatureSoundId = csdB.Id
dbc_creaturesounddata csdB ON cmd.creatureSoundId = csdB.id
LEFT JOIN
dbc_npcsounds ns ON cdi.npcSoundId = ns.Id
dbc_npcsounds ns ON cdi.npcSoundId = ns.id
');
@@ -250,9 +250,9 @@ function sounds(/*array $ids = [] */)
DB::Aowow()->query('TRUNCATE ?_spell_sounds');
DB::Aowow()->query('
INSERT INTO
?_spell_sounds (`Id`, `precast`, `cast`, `impact`, `state`, `statedone`, `channel`, `missile`, `animation`, `casterimpact`, `targetimpact`, `missiletargeting`, `instantarea`, `impactarea`, `persistentarea`)
?_spell_sounds (`id`, `precast`, `cast`, `impact`, `state`, `statedone`, `channel`, `missile`, `animation`, `casterimpact`, `targetimpact`, `missiletargeting`, `instantarea`, `impactarea`, `persistentarea`)
SELECT
sv.Id,
sv.id,
IFNULL(svk1.soundId, 0),
IFNULL(svk2.soundId, 0),
IFNULL(svk3.soundId, 0),
@@ -270,29 +270,29 @@ function sounds(/*array $ids = [] */)
FROM
dbc_spellvisual sv
LEFT JOIN
dbc_spellvisualkit svk1 ON svk1.Id = sv.precastKitId
dbc_spellvisualkit svk1 ON svk1.id = sv.precastKitId
LEFT JOIN
dbc_spellvisualkit svk2 ON svk2.Id = sv.castKitId
dbc_spellvisualkit svk2 ON svk2.id = sv.castKitId
LEFT JOIN
dbc_spellvisualkit svk3 ON svk3.Id = sv.impactKitId
dbc_spellvisualkit svk3 ON svk3.id = sv.impactKitId
LEFT JOIN
dbc_spellvisualkit svk4 ON svk4.Id = sv.stateKitId
dbc_spellvisualkit svk4 ON svk4.id = sv.stateKitId
LEFT JOIN
dbc_spellvisualkit svk5 ON svk5.Id = sv.statedoneKitId
dbc_spellvisualkit svk5 ON svk5.id = sv.statedoneKitId
LEFT JOIN
dbc_spellvisualkit svk6 ON svk6.Id = sv.channelKitId
dbc_spellvisualkit svk6 ON svk6.id = sv.channelKitId
LEFT JOIN
dbc_spellvisualkit svk7 ON svk7.Id = sv.casterImpactKitId
dbc_spellvisualkit svk7 ON svk7.id = sv.casterImpactKitId
LEFT JOIN
dbc_spellvisualkit svk8 ON svk8.Id = sv.targetImpactKitId
dbc_spellvisualkit svk8 ON svk8.id = sv.targetImpactKitId
LEFT JOIN
dbc_spellvisualkit svk9 ON svk9.Id = sv.missileTargetingKitId
dbc_spellvisualkit svk9 ON svk9.id = sv.missileTargetingKitId
LEFT JOIN
dbc_spellvisualkit svk10 ON svk10.Id = sv.instantAreaKitId
dbc_spellvisualkit svk10 ON svk10.id = sv.instantAreaKitId
LEFT JOIN
dbc_spellvisualkit svk11 ON svk11.Id = sv.impactAreaKitId
dbc_spellvisualkit svk11 ON svk11.id = sv.impactAreaKitId
LEFT JOIN
dbc_spellvisualkit svk12 ON svk12.Id = sv.persistentAreaKitId
dbc_spellvisualkit svk12 ON svk12.id = sv.persistentAreaKitId
');

View File

@@ -356,8 +356,8 @@ function source(array $ids = [])
$spellBuff = [];
$itemBuff = [];
$xCostH = DB::Aowow()->selectCol('SELECT Id FROM dbc_itemextendedcost WHERE reqHonorPoints > 0 AND reqArenaPoints = 0');
$xCostA = DB::Aowow()->selectCol('SELECT Id FROM dbc_itemextendedcost WHERE reqArenaPoints > 0');
$xCostH = DB::Aowow()->selectCol('SELECT id FROM dbc_itemextendedcost WHERE reqHonorPoints > 0 AND reqArenaPoints = 0');
$xCostA = DB::Aowow()->selectCol('SELECT id FROM dbc_itemextendedcost WHERE reqArenaPoints > 0');
$vendorQuery = 'SELECT n.item AS ARRAY_KEY, SUM(n.qty) AS qty, it.class, it.subclass, it.spellid_1, it.spelltrigger_1, it.spellid_2, it.spelltrigger_2 FROM (
SELECT item, COUNT(1) AS qty FROM npc_vendor WHERE ExtendedCost IN (?a) GROUP BY item
UNION
@@ -477,7 +477,7 @@ function source(array $ids = [])
$spellBuff = [];
$itemBuff = [];
$xCostIds = DB::Aowow()->selectCol('SELECT Id FROM dbc_itemextendedcost WHERE reqHonorPoints <> 0 OR reqArenaPoints <> 0');
$xCostIds = DB::Aowow()->selectCol('SELECT id FROM dbc_itemextendedcost WHERE reqHonorPoints <> 0 OR reqArenaPoints <> 0');
$vendors = DB::World()->select(
'SELECT n.item AS ARRAY_KEY, n.npc, SUM(n.qty) AS qty, it.class, it.subclass, it.spellid_1, it.spelltrigger_1, it.spellid_2, it.spelltrigger_2 FROM (
SELECT item, entry AS npc, COUNT(1) AS qty FROM npc_vendor WHERE ExtendedCost NOT IN (?a) GROUP BY item
@@ -1088,7 +1088,7 @@ function source(array $ids = [])
CLISetup::log(' * #6 Trainer');
if ($tNpcs = DB::World()->select('SELECT SpellID AS ARRAY_KEY, ID AS entry, COUNT(1) AS qty FROM npc_trainer WHERE SpellID > 0 GROUP BY ARRAY_KEY'))
{
$tSpells = DB::Aowow()->select('SELECT Id AS ARRAY_KEY, effect1Id, effect2Id, effect3Id, effect1TriggerSpell, effect2TriggerSpell, effect3TriggerSpell FROM dbc_spell WHERE Id IN (?a)', array_keys($tNpcs));
$tSpells = DB::Aowow()->select('SELECT id AS ARRAY_KEY, effect1Id, effect2Id, effect3Id, effect1TriggerSpell, effect2TriggerSpell, effect3TriggerSpell FROM dbc_spell WHERE id IN (?a)', array_keys($tNpcs));
$buff = [];
// todo (med): this skips some spells (e.g. riding)
@@ -1126,9 +1126,9 @@ function source(array $ids = [])
# 9: Talent
CLISetup::log(' * #9 Talent');
$tSpells = DB::Aowow()->select('
SELECT s.Id AS ARRAY_KEY, s.effect1Id, s.effect2Id, s.effect3Id, s.effect1TriggerSpell, s.effect2TriggerSpell, s.effect3TriggerSpell
SELECT s.id AS ARRAY_KEY, s.effect1Id, s.effect2Id, s.effect3Id, s.effect1TriggerSpell, s.effect2TriggerSpell, s.effect3TriggerSpell
FROM dbc_talent t
JOIN dbc_spell s ON s.Id = t.rank1
JOIN dbc_spell s ON s.id = t.rank1
WHERE t.rank2 < 1 AND (t.talentSpell = 1 OR (s.effect1Id = 36 OR s.effect2Id = 36 OR s.effect3Id = 36))
');
@@ -1155,7 +1155,7 @@ function source(array $ids = [])
if (!$recurse)
break;
$tSpells = DB::Aowow()->select('SELECT Id AS ARRAY_KEY, effect1Id, effect2Id, effect3Id, effect1TriggerSpell, effect2TriggerSpell, effect3TriggerSpell FROM dbc_spell WHERE Id IN (?a)', array_keys($recurse));
$tSpells = DB::Aowow()->select('SELECT id AS ARRAY_KEY, effect1Id, effect2Id, effect3Id, effect1TriggerSpell, effect2TriggerSpell, effect3TriggerSpell FROM dbc_spell WHERE id IN (?a)', array_keys($recurse));
}
DB::Aowow()->query(queryfy('[V]', $buff, $insBasic), 9, 9, 9);

View File

@@ -98,11 +98,11 @@ function spawns() // and waypoints
'FROM gameobject c',
' - assembling '.CLISetup::bold('gameobject').' spawns'];
$query[3] = ['SELECT Id AS "guid", 19 AS "type", soundId AS typeId, 0 AS respawn, 0 AS phaseMask, 0 AS areaId, mapId AS "map", 0 AS pathId, posX, posY ' .
$query[3] = ['SELECT id AS "guid", 19 AS "type", soundId AS typeId, 0 AS respawn, 0 AS phaseMask, 0 AS areaId, mapId AS "map", 0 AS pathId, posX, posY ' .
'FROM dbc_soundemitters',
' - assembling '.CLISetup::bold('sound emitter').' spawns'];
$query[4] = ['SELECT Id AS "guid", 503 AS "type", Id AS typeId, 0 AS respawn, 0 AS phaseMask, 0 AS areaId, mapId AS "map", 0 AS pathId, posX, posY ' .
$query[4] = ['SELECT id AS "guid", 503 AS "type", id AS typeId, 0 AS respawn, 0 AS phaseMask, 0 AS areaId, mapId AS "map", 0 AS pathId, posX, posY ' .
'FROM dbc_areatrigger',
' - assembling '.CLISetup::bold('areatrigger').' spawns'];
@@ -118,15 +118,15 @@ function spawns() // and waypoints
'FROM creature c JOIN creature_addon ca ON ca.guid = c.guid JOIN waypoint_data w ON w.id = ca.path_id WHERE ca.path_id <> 0',
' - assembling waypoints from '.CLISetup::bold('waypoint_data')];
$queryPost = 'SELECT dm.Id, wma.areaId, IFNULL(dm.floor, 0) AS floor, ' .
'100 - ROUND(IF(dm.Id IS NOT NULL, (?f - dm.minY) * 100 / (dm.maxY - dm.minY), (?f - wma.right) * 100 / (wma.left - wma.right)), 1) AS `posX`, ' .
'100 - ROUND(IF(dm.Id IS NOT NULL, (?f - dm.minX) * 100 / (dm.maxX - dm.minX), (?f - wma.bottom) * 100 / (wma.top - wma.bottom)), 1) AS `posY`, ' .
'((abs(IF(dm.Id IS NOT NULL, (?f - dm.minY) * 100 / (dm.maxY - dm.minY), (?f - wma.right) * 100 / (wma.left - wma.right)) - 50) / 50) * ' .
' (abs(IF(dm.Id IS NOT NULL, (?f - dm.minX) * 100 / (dm.maxX - dm.minX), (?f - wma.bottom) * 100 / (wma.top - wma.bottom)) - 50) / 50)) AS quality ' .
$queryPost = 'SELECT dm.id, wma.areaId, IFNULL(dm.floor, 0) AS floor, ' .
'100 - ROUND(IF(dm.id IS NOT NULL, (?f - dm.minY) * 100 / (dm.maxY - dm.minY), (?f - wma.right) * 100 / (wma.left - wma.right)), 1) AS `posX`, ' .
'100 - ROUND(IF(dm.id IS NOT NULL, (?f - dm.minX) * 100 / (dm.maxX - dm.minX), (?f - wma.bottom) * 100 / (wma.top - wma.bottom)), 1) AS `posY`, ' .
'((abs(IF(dm.id IS NOT NULL, (?f - dm.minY) * 100 / (dm.maxY - dm.minY), (?f - wma.right) * 100 / (wma.left - wma.right)) - 50) / 50) * ' .
' (abs(IF(dm.id IS NOT NULL, (?f - dm.minX) * 100 / (dm.maxX - dm.minX), (?f - wma.bottom) * 100 / (wma.top - wma.bottom)) - 50) / 50)) AS quality ' .
'FROM dbc_worldmaparea wma ' .
'LEFT JOIN dbc_dungeonmap dm ON dm.mapId = IF(?d AND (wma.mapId NOT IN (0, 1, 530, 571) OR wma.areaId = 4395), wma.mapId, -1) ' .
'WHERE wma.mapId = ?d AND IF(?d, wma.areaId = ?d, wma.areaId <> 0) ' .
'HAVING (`posX` BETWEEN 0.1 AND 99.9 AND `posY` BETWEEN 0.1 AND 99.9) ' . // AND (dm.Id IS NULL OR ?d) ' .
'HAVING (`posX` BETWEEN 0.1 AND 99.9 AND `posY` BETWEEN 0.1 AND 99.9) ' . // AND (dm.id IS NULL OR ?d) ' .
'ORDER BY quality ASC';
@@ -277,7 +277,7 @@ function spawns() // and waypoints
/* restrict difficulty displays */
/********************************/
DB::Aowow()->query('UPDATE ?_spawns s, dbc_worldmaparea wma, dbc_map m SET s.spawnMask = 0 WHERE s.areaId = wma.areaId AND wma.mapId = m.Id AND m.areaType IN (0, 3, 4)');
DB::Aowow()->query('UPDATE ?_spawns s, dbc_worldmaparea wma, dbc_map m SET s.spawnMask = 0 WHERE s.areaId = wma.areaId AND wma.mapId = m.id AND m.areaType IN (0, 3, 4)');
return true;
}

View File

@@ -40,8 +40,8 @@ function spell()
{
$ssQuery = '
SELECT
Id AS ARRAY_KEY,
Id,
id AS ARRAY_KEY,
id,
0 AS category,
Dispel,
Mechanic,
@@ -113,13 +113,13 @@ function spell()
FROM
spell_dbc
WHERE
Id > ?d
id > ?d
LIMIT
?d';
$baseQuery = '
SELECT
s.Id,
s.id,
category,
dispelType,
mechanic,
@@ -142,7 +142,7 @@ function spell()
powerPerSecond,
powerPerSecondPerLevel,
IFNULL (src.runicPowerGain, 0) AS powerGainRunicPower,
IF (src.Id IS NULL, 0, (src.costBlood << 8) | (src.costUnholy << 4) | src.costFrost) AS powerCostRunes,
IF (src.id IS NULL, 0, (src.costBlood << 8) | (src.costUnholy << 4) | src.costFrost) AS powerCostRunes,
rangeId,
stackAmount,
tool1, tool2,
@@ -202,19 +202,19 @@ function spell()
FROM
dbc_spell s
LEFT JOIN
dbc_spellcasttimes sct ON s.castTimeId = sct.Id
dbc_spellcasttimes sct ON s.castTimeId = sct.id
LEFT JOIN
dbc_spellrunecost src ON s.runeCostId = src.Id
dbc_spellrunecost src ON s.runeCostId = src.id
LEFT JOIN
dbc_spellduration sd ON s.durationId = sd.Id
dbc_spellduration sd ON s.durationId = sd.id
LEFT JOIN
dbc_spellradius sr1 ON s.effect1RadiusId = sr1.Id
dbc_spellradius sr1 ON s.effect1RadiusId = sr1.id
LEFT JOIN
dbc_spellradius sr2 ON s.effect2RadiusId = sr2.Id
dbc_spellradius sr2 ON s.effect2RadiusId = sr2.id
LEFT JOIN
dbc_spellradius sr3 ON s.effect3RadiusId = sr3.Id
dbc_spellradius sr3 ON s.effect3RadiusId = sr3.id
WHERE
s.Id > ?d
s.id > ?d
LIMIT
?d';
@@ -225,7 +225,7 @@ function spell()
CLISetup::log(' - merging serverside spells into spell.dbc');
while ($spells = DB::World()->select($ssQuery, $lastMax, SqlGen::$stepSize))
{
$newMax = max(array_column($spells, 'Id'));
$newMax = max(array_column($spells, 'id'));
CLISetup::log(' * sets '.($lastMax + 1).' - '.$newMax);
@@ -243,7 +243,7 @@ function spell()
CLISetup::log(' - filling aowow_spell');
while ($spells = DB::Aowow()->select($baseQuery, $lastMax, SqlGen::$stepSize))
{
$newMax = max(array_column($spells, 'Id'));
$newMax = max(array_column($spells, 'id'));
CLISetup::log(' * sets '.($lastMax + 1).' - '.$newMax);
@@ -288,7 +288,7 @@ function spell()
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');
$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)
{
$names = array_keys(current($sets));
@@ -367,7 +367,7 @@ function spell()
// fill learnedAt, trainingCost from trainer
if ($trainer = DB::World()->select('SELECT SpellID AS ARRAY_KEY, MIN(ReqSkillRank) AS reqSkill, MIN(MoneyCost) AS cost, COUNT(*) AS count FROM npc_trainer GROUP BY SpellID'))
{
$spells = DB::Aowow()->select('SELECT Id AS ARRAY_KEY, effect1Id, effect2Id, effect3Id, effect1TriggerSpell, effect2TriggerSpell, effect3TriggerSpell FROM dbc_spell WHERE Id IN (?a)', array_keys($trainer));
$spells = DB::Aowow()->select('SELECT id AS ARRAY_KEY, effect1Id, effect2Id, effect3Id, effect1TriggerSpell, effect2TriggerSpell, effect3TriggerSpell FROM dbc_spell WHERE id IN (?a)', array_keys($trainer));
$links = [];
// todo (med): this skips some spells (e.g. riding)
@@ -490,7 +490,7 @@ function spell()
// altIcons and quality for craftSpells
$itemSpells = DB::Aowow()->selectCol('
SELECT s.Id AS ARRAY_KEY, effect1CreateItemId
SELECT s.id AS ARRAY_KEY, effect1CreateItemId
FROM dbc_spell s
LEFT JOIN dbc_talent t1 ON t1.rank1 = s.id
LEFT JOIN dbc_talent t2 ON t2.rank2 = s.id
@@ -532,7 +532,7 @@ function spell()
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)');
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)');
// pet spells (-3)
DB::Aowow()->query('UPDATE ?_spell s SET s.typeCat = -3 WHERE (s.cuFlags & 0x3) = 0 AND s.skillline1 IN (?a)',
@@ -554,9 +554,9 @@ function spell()
DB::Aowow()->query('UPDATE ?_spell s SET s.typeCat = -6 WHERE s.skillLine1 = 778');
// pet talents (-7)
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -7, s.cuFlags = s.cuFlags | 0x10 WHERE t.tabId = 409 AND (s.Id = t.rank1 OR s.Id = t.rank2 OR s.Id = t.rank3)');
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -7, s.cuFlags = s.cuFlags | 0x08 WHERE t.tabId = 410 AND (s.Id = t.rank1 OR s.Id = t.rank2 OR s.Id = t.rank3)');
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -7, s.cuFlags = s.cuFlags | 0x20 WHERE t.tabId = 411 AND (s.Id = t.rank1 OR s.Id = t.rank2 OR s.Id = t.rank3)');
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -7, s.cuFlags = s.cuFlags | 0x10 WHERE t.tabId = 409 AND (s.id = t.rank1 OR s.id = t.rank2 OR s.id = t.rank3)');
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -7, s.cuFlags = s.cuFlags | 0x08 WHERE t.tabId = 410 AND (s.id = t.rank1 OR s.id = t.rank2 OR s.id = t.rank3)');
DB::Aowow()->query('UPDATE ?_spell s, dbc_talent t SET s.typeCat = -7, s.cuFlags = s.cuFlags | 0x20 WHERE t.tabId = 411 AND (s.id = t.rank1 OR s.id = t.rank2 OR s.id = t.rank3)');
// internal (-9) by faaaaaar not complete
DB::Aowow()->query('UPDATE ?_spell s SET s.typeCat = -9 WHERE s.skillLine1 = 769');
@@ -689,8 +689,8 @@ function spell()
$effects = DB::Aowow()->select('
SELECT
s2.Id AS ARRAY_KEY,
s1.Id,
s2.id AS ARRAY_KEY,
s1.id,
s1.name_loc0,
s1.spellFamilyId,
s1.spellFamilyFlags1, s1.spellFamilyFlags2, s1.spellFamilyFlags3,
@@ -701,11 +701,11 @@ function spell()
FROM
dbc_glyphproperties gp
JOIN
?_spell s1 ON s1.Id = gp.spellId
?_spell s1 ON s1.id = gp.spellId
JOIN
?_spell s2 ON s2.effect1MiscValue = gp.id AND s2.effect1Id = 74
WHERE
gp.typeFlags IN (0, 1) -- AND s2.Id In (58271, 56297, 56289, 63941, 58275)
gp.typeFlags IN (0, 1) -- AND s2.id In (58271, 56297, 56289, 63941, 58275)
');
foreach ($effects as $applyId => $glyphEffect)
@@ -754,7 +754,7 @@ function spell()
if ($icons)
DB::Aowow()->query('UPDATE ?_spell s SET s.skillLine1 = ?d, s.iconIdAlt = ?d WHERE s.id = ?d', $icons['skill'], $icons['icon'], $applyId);
else
CLISetup::log('could not match '.$glyphEffect['name_loc0'].' ('.$glyphEffect['Id'].') with affected spells', CLISetup::LOG_WARN);
CLISetup::log('could not match '.$glyphEffect['name_loc0'].' ('.$glyphEffect['id'].') with affected spells', CLISetup::LOG_WARN);
}
// hide unused glyphs

View File

@@ -16,7 +16,7 @@ function talents()
// class: 0 => hunter pets
for ($i = 1; $i < 6; $i++)
DB::Aowow()->query(
'REPLACE INTO ?_talents SELECT t.Id, IF(tt.classMask <> 0, LOG(2, tt.classMask) + 1, 0), IF(tt.creaturefamilyMask <> 0, LOG(2, tt.creaturefamilyMask), tt.tabNumber), t.row, t.column, t.rank?d, ?d FROM dbc_talenttab tt JOIN dbc_talent t ON tt.Id = t.tabId WHERE t.rank?d <> 0',
'REPLACE INTO ?_talents SELECT t.id, IF(tt.classMask <> 0, LOG(2, tt.classMask) + 1, 0), IF(tt.creaturefamilyMask <> 0, LOG(2, tt.creaturefamilyMask), tt.tabNumber), t.row, t.column, t.rank?d, ?d FROM dbc_talenttab tt JOIN dbc_talent t ON tt.id = t.tabId WHERE t.rank?d <> 0',
$i, $i, $i
);

View File

@@ -32,7 +32,7 @@ function taxi() // path & nodes
{
if ($_['startNodeId'] == $p['endNodeId'] AND $_['endNodeId'] == $p['startNodeId'])
{
DB::Aowow()->query('DELETE FROM ?_taxipath WHERE Id = ?d', $j);
DB::Aowow()->query('DELETE FROM ?_taxipath WHERE id = ?d', $j);
unset($paths[$j]);
unset($paths[$i]);
break;
@@ -137,13 +137,13 @@ function taxi() // path & nodes
// fetch reactions per faction
$factions = DB::Aowow()->query('
SELECT
Id AS ARRAY_KEY,
id AS ARRAY_KEY,
IF(enemyFactionId1 = 1 OR enemyFactionId2 = 1 OR enemyFactionId3 = 1 OR enemyFactionId4 = 1 OR hostileMask & 0x3, -1, 1) AS reactA,
IF(enemyFactionId1 = 2 OR enemyFactionId2 = 2 OR enemyFactionId3 = 2 OR enemyFactionId4 = 2 OR hostileMask & 0x5, -1, 1) AS reactH
FROM
dbc_factiontemplate
WHERE
Id IN (?a)',
id IN (?a)',
array_column($fNodes, 'faction')
);

View File

@@ -49,7 +49,7 @@ function titles()
WHERE
qt.RewardTitle <> 0';
DB::Aowow()->query('REPLACE INTO ?_titles SELECT Id, 0, 0, 0, 0, 0, 0, 0, bitIdx, male_loc0, male_loc2, male_loc3, male_loc6, male_loc8, female_loc0, female_loc2, female_loc3, female_loc6, female_loc8 FROM dbc_chartitles');
DB::Aowow()->query('REPLACE INTO ?_titles SELECT id, 0, 0, 0, 0, 0, 0, 0, bitIdx, male_loc0, male_loc2, male_loc3, male_loc6, male_loc8, female_loc0, female_loc2, female_loc3, female_loc6, female_loc8 FROM dbc_chartitles');
// hide unused titles
DB::Aowow()->query('UPDATE ?_titles SET cuFlags = ?d WHERE id BETWEEN 85 AND 123 AND id NOT IN (113, 120, 121, 122)', CUSTOM_EXCLUDE_FOR_LISTVIEW);