From c3bae7fe5e648cfc91bbd4d87958e9147d2f13f7 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 4 Jul 2024 21:27:21 +0200 Subject: [PATCH] Localization/zhCN * add lost string lookups --- pages/object.php | 4 ++-- pages/quest.php | 4 ++-- pages/spell.php | 34 +++++++++++++++++----------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pages/object.php b/pages/object.php index 735d6ffd..93c90f78 100644 --- a/pages/object.php +++ b/pages/object.php @@ -236,10 +236,10 @@ class ObjectPage extends GenericPage if ($ll['encounterId']) $relBoss = [$ll['npcId'], Lang::profiler('encounterNames', $ll['encounterId'])]; // difficulty dummy - else if ($c = DB::Aowow()->selectRow('SELECT `id`, `name_loc0`, `name_loc2`, `name_loc3`, `name_loc6`, `name_loc8` FROM ?_creature WHERE `difficultyEntry1` = ?d OR `difficultyEntry2` = ?d OR `difficultyEntry3` = ?d', $ll['npcId'], $ll['npcId'], $ll['npcId'])) + else if ($c = DB::Aowow()->selectRow('SELECT `id`, `name_loc0`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc6`, `name_loc8` FROM ?_creature WHERE `difficultyEntry1` = ?d OR `difficultyEntry2` = ?d OR `difficultyEntry3` = ?d', $ll['npcId'], $ll['npcId'], $ll['npcId'])) $relBoss = [$c['id'], Util::localizedString($c, 'name')]; // base creature - else if ($c = DB::Aowow()->selectRow('SELECT `id`, `name_loc0`, `name_loc2`, `name_loc3`, `name_loc6`, `name_loc8` FROM ?_creature WHERE `id` = ?d', $ll['npcId'])) + else if ($c = DB::Aowow()->selectRow('SELECT `id`, `name_loc0`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc6`, `name_loc8` FROM ?_creature WHERE `id` = ?d', $ll['npcId'])) $relBoss = [$c['id'], Util::localizedString($c, 'name')]; } diff --git a/pages/quest.php b/pages/quest.php index e56a276a..0cd0335f 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -289,7 +289,7 @@ class QuestPage extends GenericPage $_ = $chain[0][0]; while ($_) { - if ($_ = DB::Aowow()->selectRow('SELECT id AS typeId, IF(id = nextQuestIdChain, 1, 0) AS error, name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, reqRaceMask FROM ?_quests WHERE nextQuestIdChain = ?d', $_['typeId'])) + if ($_ = DB::Aowow()->selectRow('SELECT `id` AS `typeId`, IF(`id` = `nextQuestIdChain`, 1, 0) AS `error`, `name_loc0`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc6`, `name_loc8`, `reqRaceMask` FROM ?_quests WHERE `nextQuestIdChain` = ?d', $_['typeId'])) { if ($_['error']) { @@ -312,7 +312,7 @@ class QuestPage extends GenericPage $_ = end($chain)[0]; while ($_) { - if ($_ = DB::Aowow()->selectRow('SELECT id AS typeId, IF(id = nextQuestIdChain, 1, 0) AS error, name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, reqRaceMask, nextQuestIdChain AS _next FROM ?_quests WHERE id = ?d', $_['_next'])) + if ($_ = DB::Aowow()->selectRow('SELECT `id` AS `typeId`, IF(`id` = `nextQuestIdChain`, 1, 0) AS `error`, `name_loc0`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc6`, `name_loc8`, `reqRaceMask`, `nextQuestIdChain` AS `_next` FROM ?_quests WHERE `id` = ?d', $_['_next'])) { if ($_['error']) // error already triggered break; diff --git a/pages/spell.php b/pages/spell.php index 9a36306a..e62f975c 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -1300,11 +1300,11 @@ class SpellPage extends GenericPage if (in_array($_iId, $alreadyUsed)) return false; - $item = DB::Aowow()->selectRow(' - SELECT name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, i.id, ic.name AS iconString, quality - FROM ?_items i - LEFT JOIN ?_icons ic ON ic.id = i.iconId - WHERE i.id = ?d', + $item = DB::Aowow()->selectRow( + 'SELECT `name_loc0`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc6`, `name_loc8`, i.`id`, ic.`name` AS `iconString`, `quality` + FROM ?_items i + LEFT JOIN ?_icons ic ON ic.`id` = i.`iconId` + WHERE i.`id` = ?d', $_iId ); @@ -1341,18 +1341,18 @@ class SpellPage extends GenericPage { $_level++; // assume that tradeSpells only use the first index to create items, so this runs somewhat efficiently >.< - $spells = DB::Aowow()->select(' - SELECT reagent1, reagent2, reagent3, reagent4, reagent5, reagent6, reagent7, reagent8, - reagentCount1, reagentCount2, reagentCount3, reagentCount4, reagentCount5, reagentCount6, reagentCount7, reagentCount8, - name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, - iconIdBak, - s.id AS ARRAY_KEY, ic.name AS iconString - FROM ?_spell s - JOIN ?_icons ic ON s.iconId = ic.id - WHERE (effect1CreateItemId = ?d AND effect1Id = 24)',// OR - // (effect2CreateItemId = ?d AND effect2Id = 24) OR - // (effect3CreateItemId = ?d AND effect3Id = 24)', - $_iId //, $_iId, $_iId + $spells = DB::Aowow()->select( + 'SELECT `reagent1`, `reagent2`, `reagent3`, `reagent4`, `reagent5`, `reagent6`, `reagent7`, `reagent8`, + `reagentCount1`, `reagentCount2`, `reagentCount3`, `reagentCount4`, `reagentCount5`, `reagentCount6`, `reagentCount7`, `reagentCount8`, + `name_loc0`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc6`, `name_loc8`, + `iconIdBak`, + s.`id` AS ARRAY_KEY, ic.`name` AS `iconString` + FROM ?_spell s + JOIN ?_icons ic ON s.`iconId` = ic.`id` + WHERE (`effect1CreateItemId` = ?d AND `effect1Id` = ?d)',// OR + // (`effect2CreateItemId` = ?d AND `effect2Id` = ?d) OR + // (`effect3CreateItemId` = ?d AND `effect3Id` = ?d)', + $_iId, SPELL_EFFECT_CREATE_ITEM //, $_iId, SPELL_EFFECT_CREATE_ITEM, $_iId, SPELL_EFFECT_CREATE_ITEM ); if (!$spells)