From 60533ff27a15a8a3377cb16ebd9614d004e2e09d Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 15 Dec 2013 22:07:10 +0100 Subject: [PATCH] - source:discovery in infobox for spells - implemented search for crafted items (requires sql) --- includes/types/item.class.php | 41 ++++++++++++----------------------- localization/locale_dede.php | 3 ++- localization/locale_enus.php | 1 + localization/locale_eses.php | 3 ++- localization/locale_frfr.php | 3 ++- localization/locale_ruru.php | 3 ++- pages/spell.php | 11 +++++++--- 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 2cff4610..e1fa211e 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -22,11 +22,9 @@ class ItemList extends BaseType protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY FROM ?_items i'; protected $queryOpts = array( - 'is' => [ 's' => ', 1 as score', 'j' => '?_item_stats AS `is` ON `is`.`id` = `i`.`id`', 'h' => 'score > 0', 'o' => 'score DESC'], - // 'iet' => [['ire'], 'j' => 'item_enchantment_template AS `iet` ON IF (`ire`.`id` > 0, `iet`.`entry` = `i`.`randomProperty`, `iet`.`entry` = `i`.`randomSuffix`)'], - // 'ire' => [['iet'], 'j' => '?_itemrandomenchant AS `ire` ON ABS(ire.id) = iet.ench'], - // 'idi' => ['s' => itemDisplayInfo] - 'i' => [ 'o' => 'i.quality DESC, i.itemLevel DESC'] + 'is' => ['s' => ', 1 as score', 'j' => '?_item_stats AS `is` ON `is`.`id` = `i`.`id`', 'h' => 'score > 0', 'o' => 'score DESC'], + 's' => ['j' => ['?_spell AS `s` ON s.effect1CreateItemId = i.id', true], 'g' => 'i.id'], + 'i' => ['o' => 'i.quality DESC, i.itemLevel DESC'] ); public function __construct($conditions = [], $applyFilter = false, $miscData = null) @@ -871,7 +869,7 @@ class ItemList extends BaseType { for ($j = $i; $j < count($setSpells); $j++) { - if($setSpells[$j]['bonus'] >= $setSpells[$i]['bonus']) + if ($setSpells[$j]['bonus'] >= $setSpells[$i]['bonus']) continue; $tmp = $setSpells[$i]; @@ -1425,7 +1423,7 @@ class ItemListFilter extends Filter // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses private $ubFilter = []; protected $enums = array( - 99 => array( // profession + 99 => array( // profession | recycled for 86, 87 null, 171, 164, 185, 333, 202, 129, 755, 165, 186, 197, true, false, 356, 182, 773 ), 66 => array( // profession specialization @@ -1445,23 +1443,6 @@ class ItemListFilter extends Filter 14 => -1, 15 => -1 ), - 87 => array( // reagent for profession - 1 => 171, - 2 => 164, - 3 => 185, - 4 => 333, - 5 => 202, - 6 => 129, - 7 => 755, - 8 => 165, - 9 => 186, - 10 => 197, - 11 => true, - 12 => false, - 13 => 356, - 14 => 182, - 15 => 773, - ), 152 => array( // class-specific null, 1, 2, 3, 4, 5, 6, 7, 8, 9, null, 11, true, false ), @@ -1719,8 +1700,14 @@ class ItemListFilter extends Filter $this->formData['extraCols'][] = $cr[0]; return ['AND', ['armordamagemodifier', $cr[2], $cr[1]], ['class', ITEM_CLASS_ARMOR]]; - case 86: // craftedprof [profession] -/* todo */ return [1]; + case 86: // craftedprof [enum] + $_ = @$this->enums[99][$cr[1]]; // recycled enum + if (is_bool($_)) + return ['i.source', '1:', $_ ? null : '!']; + else if (is_int($_)) + return ['s.skillLine1', $_]; + + break; case 16: // dropsin [zone] /* todo */ return [1]; case 105: // dropsinnormal [heroicdungeon-any] @@ -1801,7 +1788,7 @@ class ItemListFilter extends Filter case 85: // objectivequest [side] /* todo */ return [1]; case 87: // reagentforability [enum] - $_ = @$this->enums[$cr[0]][$cr[1]]; + $_ = @$this->enums[99][$cr[1]]; // recycled enum if ($_ !== null) { $ids = []; diff --git a/localization/locale_dede.php b/localization/locale_dede.php index f639ab7d..4c2703de 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -375,6 +375,7 @@ $lang = array( '_collapseAll' => "Alle einklappen", '_expandAll' => "Alle ausklappen", + 'discovered' => "Durch Geistesblitz erlernt", 'ppm' => "%s Auslösungen pro Minute", 'procChance' => "Procchance", 'starter' => "Basiszauber", @@ -409,7 +410,7 @@ $lang = array( 'base' => "%s im Zusammenhang mit %s anzeigen", 'link' => " oder ", 'recipes' => "Rezeptgegenstände", - 'crafted' => "Hergestellte Gegenstände" + 'crafted' => "Hergestellte Gegenstände" ), 'cat' => array( 7 => "Klassenfertigkeiten", diff --git a/localization/locale_enus.php b/localization/locale_enus.php index a72628d9..3220596b 100644 --- a/localization/locale_enus.php +++ b/localization/locale_enus.php @@ -362,6 +362,7 @@ $lang = array( '_collapseAll' => "Collapse All", '_expandAll' => "Expand All", + 'discovered' => "Learned via discovery", 'ppm' => "%s procs per minute", 'procChance' => "Proc chance", 'starter' => "Starter spell", diff --git a/localization/locale_eses.php b/localization/locale_eses.php index 9c808a78..b388aa58 100644 --- a/localization/locale_eses.php +++ b/localization/locale_eses.php @@ -333,6 +333,7 @@ $lang = array( '_collapseAll' => "Contraer todo", '_expandAll' => "Expandier todo", + 'discovered' => "Aprendido via descubrimiento", 'ppm' => "%s procs por minuto", 'procChance' => "Probabilidad de que accione", 'starter' => "Hechizo inicial", @@ -367,7 +368,7 @@ $lang = array( 'base' => "Muestra %s relacionados con %s", 'link' => " u ", 'recipes' => "objetos de receta", - 'crafted' => "objetos fabricados" + 'crafted' => "objetos fabricados" ), 'cat' => array( 7 => "Habilidades", diff --git a/localization/locale_frfr.php b/localization/locale_frfr.php index 449a0b79..8a03f206 100644 --- a/localization/locale_frfr.php +++ b/localization/locale_frfr.php @@ -333,6 +333,7 @@ $lang = array( '_collapseAll' => "Replier Tout", '_expandAll' => "Déplier Tout", + 'discovered' => "Appris via une découverte", 'ppm' => "%s déclenchements par minute", 'procChance' => "Chance", 'starter' => "Sortilège initiaux", @@ -367,7 +368,7 @@ $lang = array( 'base' => "Montre %s reliés à %s", 'link' => " ou ", 'recipes' => "les recettes", - 'crafted' => "les objets fabriqués" + 'crafted' => "les objets fabriqués" ), 'cat' => array( 7 => "Techniques", diff --git a/localization/locale_ruru.php b/localization/locale_ruru.php index 12efb888..b25ec4f5 100644 --- a/localization/locale_ruru.php +++ b/localization/locale_ruru.php @@ -333,6 +333,7 @@ $lang = array( '_collapseAll' => "[Collapse All]", '_expandAll' => "[Expand All]", + 'discovered' => "Изучается путём освоения местности", 'ppm' => "Срабатывает %s раз в минуту", 'procChance' => "Шанс срабатывания", 'starter' => "Начальное заклинание", @@ -367,7 +368,7 @@ $lang = array( 'base' => "Показать %s, относящиеся к профессии %s", 'link' => " или ", 'recipes' => "рецепты", - 'crafted' => "производимые предметы" + 'crafted' => "производимые предметы" ), 'cat' => array( 7 => "Способности", diff --git a/pages/spell.php b/pages/spell.php index 4bdaf05c..d2591ffc 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -223,9 +223,14 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) } } - // flag starter spell - if (isset($spell->sources[$spell->id]) && array_key_exists(10, $spell->sources[$spell->id])) - $infobox[] = '[li]'.Lang::$spell['starter'].'[/li]'; + // accquisition.. + if ($_ = @$spell->sources[$spell->id]) + { + if (array_key_exists(10, $_)) // ..starter spell + $infobox[] = '[li]'.Lang::$spell['starter'].'[/li]'; + else if (array_key_exists(7, $_)) // ..discovery + $infobox[] = '[li]'.Lang::$spell['discovered'].'[/li]'; + } // training cost if ($cost = DB::Aowow()->selectCell('SELECT spellcost FROM npc_trainer WHERE spell = ?d', $spell->id))