- source:discovery in infobox for spells

- implemented search for crafted items (requires sql)
This commit is contained in:
Sarjuuk
2013-12-15 22:07:10 +01:00
parent e7429d53d7
commit 60533ff27a
7 changed files with 31 additions and 34 deletions

View File

@@ -23,9 +23,7 @@ class ItemList extends BaseType
protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY FROM ?_items i'; protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY FROM ?_items i';
protected $queryOpts = array( protected $queryOpts = array(
'is' => ['s' => ', 1 as score', 'j' => '?_item_stats AS `is` ON `is`.`id` = `i`.`id`', 'h' => 'score > 0', 'o' => 'score DESC'], '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`)'], 's' => ['j' => ['?_spell AS `s` ON s.effect1CreateItemId = i.id', true], 'g' => 'i.id'],
// 'ire' => [['iet'], 'j' => '?_itemrandomenchant AS `ire` ON ABS(ire.id) = iet.ench'],
// 'idi' => ['s' => itemDisplayInfo]
'i' => ['o' => 'i.quality DESC, i.itemLevel DESC'] 'i' => ['o' => 'i.quality DESC, i.itemLevel DESC']
); );
@@ -1425,7 +1423,7 @@ class ItemListFilter extends Filter
// usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses
private $ubFilter = []; private $ubFilter = [];
protected $enums = array( 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 null, 171, 164, 185, 333, 202, 129, 755, 165, 186, 197, true, false, 356, 182, 773
), ),
66 => array( // profession specialization 66 => array( // profession specialization
@@ -1445,23 +1443,6 @@ class ItemListFilter extends Filter
14 => -1, 14 => -1,
15 => -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 152 => array( // class-specific
null, 1, 2, 3, 4, 5, 6, 7, 8, 9, null, 11, true, false 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]; $this->formData['extraCols'][] = $cr[0];
return ['AND', ['armordamagemodifier', $cr[2], $cr[1]], ['class', ITEM_CLASS_ARMOR]]; return ['AND', ['armordamagemodifier', $cr[2], $cr[1]], ['class', ITEM_CLASS_ARMOR]];
case 86: // craftedprof [profession] case 86: // craftedprof [enum]
/* todo */ return [1]; $_ = @$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] case 16: // dropsin [zone]
/* todo */ return [1]; /* todo */ return [1];
case 105: // dropsinnormal [heroicdungeon-any] case 105: // dropsinnormal [heroicdungeon-any]
@@ -1801,7 +1788,7 @@ class ItemListFilter extends Filter
case 85: // objectivequest [side] case 85: // objectivequest [side]
/* todo */ return [1]; /* todo */ return [1];
case 87: // reagentforability [enum] case 87: // reagentforability [enum]
$_ = @$this->enums[$cr[0]][$cr[1]]; $_ = @$this->enums[99][$cr[1]]; // recycled enum
if ($_ !== null) if ($_ !== null)
{ {
$ids = []; $ids = [];

View File

@@ -375,6 +375,7 @@ $lang = array(
'_collapseAll' => "Alle einklappen", '_collapseAll' => "Alle einklappen",
'_expandAll' => "Alle ausklappen", '_expandAll' => "Alle ausklappen",
'discovered' => "Durch Geistesblitz erlernt",
'ppm' => "%s Auslösungen pro Minute", 'ppm' => "%s Auslösungen pro Minute",
'procChance' => "Procchance", 'procChance' => "Procchance",
'starter' => "Basiszauber", 'starter' => "Basiszauber",
@@ -409,7 +410,7 @@ $lang = array(
'base' => "<small>%s im Zusammenhang mit <b>%s</b> anzeigen</small>", 'base' => "<small>%s im Zusammenhang mit <b>%s</b> anzeigen</small>",
'link' => " oder ", 'link' => " oder ",
'recipes' => "<a href=\"?items=9.%s\">Rezeptgegenstände</a>", 'recipes' => "<a href=\"?items=9.%s\">Rezeptgegenstände</a>",
'crafted' => "<a href=\"?items&filter=cr=86;crs=%s\">Hergestellte Gegenstände</a>" 'crafted' => "<a href=\"?items&filter=cr=86;crs=%s;crv=0\">Hergestellte Gegenstände</a>"
), ),
'cat' => array( 'cat' => array(
7 => "Klassenfertigkeiten", 7 => "Klassenfertigkeiten",

View File

@@ -362,6 +362,7 @@ $lang = array(
'_collapseAll' => "Collapse All", '_collapseAll' => "Collapse All",
'_expandAll' => "Expand All", '_expandAll' => "Expand All",
'discovered' => "Learned via discovery",
'ppm' => "%s procs per minute", 'ppm' => "%s procs per minute",
'procChance' => "Proc chance", 'procChance' => "Proc chance",
'starter' => "Starter spell", 'starter' => "Starter spell",

View File

@@ -333,6 +333,7 @@ $lang = array(
'_collapseAll' => "Contraer todo", '_collapseAll' => "Contraer todo",
'_expandAll' => "Expandier todo", '_expandAll' => "Expandier todo",
'discovered' => "Aprendido via descubrimiento",
'ppm' => "%s procs por minuto", 'ppm' => "%s procs por minuto",
'procChance' => "Probabilidad de que accione", 'procChance' => "Probabilidad de que accione",
'starter' => "Hechizo inicial", 'starter' => "Hechizo inicial",
@@ -367,7 +368,7 @@ $lang = array(
'base' => "<small>Muestra %s relacionados con <b>%s</b></small>", 'base' => "<small>Muestra %s relacionados con <b>%s</b></small>",
'link' => " u ", 'link' => " u ",
'recipes' => "<a href=\"?items=9.%s\">objetos de receta</a>", 'recipes' => "<a href=\"?items=9.%s\">objetos de receta</a>",
'crafted' => "<a href=\"?items&filter=cr=86;crs=%s\">objetos fabricados</a>" 'crafted' => "<a href=\"?items&filter=cr=86;crs=%s;crv=0\">objetos fabricados</a>"
), ),
'cat' => array( 'cat' => array(
7 => "Habilidades", 7 => "Habilidades",

View File

@@ -333,6 +333,7 @@ $lang = array(
'_collapseAll' => "Replier Tout", '_collapseAll' => "Replier Tout",
'_expandAll' => "Déplier Tout", '_expandAll' => "Déplier Tout",
'discovered' => "Appris via une découverte",
'ppm' => "%s déclenchements par minute", 'ppm' => "%s déclenchements par minute",
'procChance' => "Chance", 'procChance' => "Chance",
'starter' => "Sortilège initiaux", 'starter' => "Sortilège initiaux",
@@ -367,7 +368,7 @@ $lang = array(
'base' => "<small>Montre %s reliés à <b>%s</b></small>", 'base' => "<small>Montre %s reliés à <b>%s</b></small>",
'link' => " ou ", 'link' => " ou ",
'recipes' => "les <a href=\"?items=9.%s\">recettes</a>", 'recipes' => "les <a href=\"?items=9.%s\">recettes</a>",
'crafted' => "les <a href=\"?items&filter=cr=86;crs=%s\">objets fabriqués</a>" 'crafted' => "les <a href=\"?items&filter=cr=86;crs=%s;crv=0\">objets fabriqués</a>"
), ),
'cat' => array( 'cat' => array(
7 => "Techniques", 7 => "Techniques",

View File

@@ -333,6 +333,7 @@ $lang = array(
'_collapseAll' => "[Collapse All]", '_collapseAll' => "[Collapse All]",
'_expandAll' => "[Expand All]", '_expandAll' => "[Expand All]",
'discovered' => "Изучается путём освоения местности",
'ppm' => "Срабатывает %s раз в минуту", 'ppm' => "Срабатывает %s раз в минуту",
'procChance' => "Шанс срабатывания", 'procChance' => "Шанс срабатывания",
'starter' => "Начальное заклинание", 'starter' => "Начальное заклинание",
@@ -367,7 +368,7 @@ $lang = array(
'base' => "<small>Показать %s, относящиеся к профессии <b>%s</b></small>", 'base' => "<small>Показать %s, относящиеся к профессии <b>%s</b></small>",
'link' => " или ", 'link' => " или ",
'recipes' => "<a href=\"?items=9.%s\">рецепты</a>", 'recipes' => "<a href=\"?items=9.%s\">рецепты</a>",
'crafted' => "<a href=\"?items&filter=cr=86;crs=%s\">производимые предметы</a>" 'crafted' => "<a href=\"?items&filter=cr=86;crs=%s;crv=0\">производимые предметы</a>"
), ),
'cat' => array( 'cat' => array(
7 => "Способности", 7 => "Способности",

View File

@@ -223,9 +223,14 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// flag starter spell // accquisition..
if (isset($spell->sources[$spell->id]) && array_key_exists(10, $spell->sources[$spell->id])) if ($_ = @$spell->sources[$spell->id])
{
if (array_key_exists(10, $_)) // ..starter spell
$infobox[] = '[li]'.Lang::$spell['starter'].'[/li]'; $infobox[] = '[li]'.Lang::$spell['starter'].'[/li]';
else if (array_key_exists(7, $_)) // ..discovery
$infobox[] = '[li]'.Lang::$spell['discovered'].'[/li]';
}
// training cost // training cost
if ($cost = DB::Aowow()->selectCell('SELECT spellcost FROM npc_trainer WHERE spell = ?d', $spell->id)) if ($cost = DB::Aowow()->selectCell('SELECT spellcost FROM npc_trainer WHERE spell = ?d', $spell->id))