mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
expanded reagents for spells
This commit is contained in:
@@ -131,6 +131,8 @@ class ItemList extends BaseType
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert items to currency if possible
|
// convert items to currency if possible
|
||||||
|
if ($cItems)
|
||||||
|
{
|
||||||
$moneyItems = new CurrencyList(array(['itemId', $cItems]));
|
$moneyItems = new CurrencyList(array(['itemId', $cItems]));
|
||||||
$moneyItems->addGlobalsToJscript(Util::$pageTemplate);
|
$moneyItems->addGlobalsToJscript(Util::$pageTemplate);
|
||||||
|
|
||||||
@@ -159,11 +161,12 @@ class ItemList extends BaseType
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->vendors[$id] = $vendors;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->vendors = $itemz;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->vendors;
|
$result = $this->vendors;
|
||||||
|
|
||||||
// apply filter if given
|
// apply filter if given
|
||||||
@@ -178,7 +181,6 @@ class ItemList extends BaseType
|
|||||||
{
|
{
|
||||||
if ($npc && $npcId != $npc)
|
if ($npc && $npcId != $npc)
|
||||||
{
|
{
|
||||||
|
|
||||||
unset($data[$npcId]);
|
unset($data[$npcId]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -188,8 +190,6 @@ class ItemList extends BaseType
|
|||||||
$valid = false;
|
$valid = false;
|
||||||
foreach ($costs as $k => $qty)
|
foreach ($costs as $k => $qty)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ((!$tok || $k == $tok) && (!$cur || $k == -$cur))
|
if ((!$tok || $k == $tok) && (!$cur || $k == -$cur))
|
||||||
{
|
{
|
||||||
$valid = true;
|
$valid = true;
|
||||||
|
|||||||
@@ -1481,10 +1481,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
|
|||||||
if ($reagent[1] > 1)
|
if ($reagent[1] > 1)
|
||||||
$_ .= ' ('.$reagent[1].')';
|
$_ .= ' ('.$reagent[1].')';
|
||||||
|
|
||||||
if(!empty($reagents))
|
$_ .= empty($reagents) ? '<br />' : ', ';
|
||||||
$_ .= ', ';
|
|
||||||
else
|
|
||||||
$_ .= '<br />';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$xTmp[] = $_.'</div>';
|
$xTmp[] = $_.'</div>';
|
||||||
|
|||||||
@@ -372,6 +372,8 @@ $lang = array(
|
|||||||
'_radius' => "Radius",
|
'_radius' => "Radius",
|
||||||
'_interval' => "Interval",
|
'_interval' => "Interval",
|
||||||
'_inSlot' => "im Platz",
|
'_inSlot' => "im Platz",
|
||||||
|
'_collapseAll' => "Alle einklappen",
|
||||||
|
'_expandAll' => "Alle ausklappen",
|
||||||
|
|
||||||
'ppm' => "%s Auslösungen pro Minute",
|
'ppm' => "%s Auslösungen pro Minute",
|
||||||
'procChance' => "Procchance",
|
'procChance' => "Procchance",
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ $lang = array(
|
|||||||
'_spellDetails' => "Spell Details",
|
'_spellDetails' => "Spell Details",
|
||||||
'_cost' => "Cost",
|
'_cost' => "Cost",
|
||||||
'_range' => "Range",
|
'_range' => "Range",
|
||||||
'_castTime' => "Cast Time",
|
'_castTime' => "Cast time",
|
||||||
'_cooldown' => "Cooldown",
|
'_cooldown' => "Cooldown",
|
||||||
'_distUnit' => "yards",
|
'_distUnit' => "yards",
|
||||||
'_forms' => "Forms",
|
'_forms' => "Forms",
|
||||||
@@ -359,6 +359,8 @@ $lang = array(
|
|||||||
'_radius' => "Radius",
|
'_radius' => "Radius",
|
||||||
'_interval' => "Interval",
|
'_interval' => "Interval",
|
||||||
'_inSlot' => "in slot",
|
'_inSlot' => "in slot",
|
||||||
|
'_collapseAll' => "Collapse All",
|
||||||
|
'_expandAll' => "Expand All",
|
||||||
|
|
||||||
'ppm' => "%s procs per minute",
|
'ppm' => "%s procs per minute",
|
||||||
'procChance' => "Proc chance",
|
'procChance' => "Proc chance",
|
||||||
|
|||||||
@@ -330,6 +330,8 @@ $lang = array(
|
|||||||
'_radius' => "Radio",
|
'_radius' => "Radio",
|
||||||
'_interval' => "Intérvalo",
|
'_interval' => "Intérvalo",
|
||||||
'_inSlot' => "en la casilla",
|
'_inSlot' => "en la casilla",
|
||||||
|
'_collapseAll' => "Contraer todo",
|
||||||
|
'_expandAll' => "Expandier todo",
|
||||||
|
|
||||||
'ppm' => "%s procs por minuto",
|
'ppm' => "%s procs por minuto",
|
||||||
'procChance' => "Probabilidad de que accione",
|
'procChance' => "Probabilidad de que accione",
|
||||||
|
|||||||
@@ -330,6 +330,8 @@ $lang = array(
|
|||||||
'_radius' => "Rayon",
|
'_radius' => "Rayon",
|
||||||
'_interval' => "Intervalle",
|
'_interval' => "Intervalle",
|
||||||
'_inSlot' => "dans l'emplacement",
|
'_inSlot' => "dans l'emplacement",
|
||||||
|
'_collapseAll' => "Replier Tout",
|
||||||
|
'_expandAll' => "Déplier Tout",
|
||||||
|
|
||||||
'ppm' => "%s déclenchements par minute",
|
'ppm' => "%s déclenchements par minute",
|
||||||
'procChance' => "Chance",
|
'procChance' => "Chance",
|
||||||
|
|||||||
@@ -330,6 +330,8 @@ $lang = array(
|
|||||||
'_radius' => "Радиус действия",
|
'_radius' => "Радиус действия",
|
||||||
'_interval' => "Интервал",
|
'_interval' => "Интервал",
|
||||||
'_inSlot' => "в слот",
|
'_inSlot' => "в слот",
|
||||||
|
'_collapseAll' => "[Collapse All]",
|
||||||
|
'_expandAll' => "[Expand All]",
|
||||||
|
|
||||||
'ppm' => "Срабатывает %s раз в минуту",
|
'ppm' => "Срабатывает %s раз в минуту",
|
||||||
'procChance' => "Шанс срабатывания",
|
'procChance' => "Шанс срабатывания",
|
||||||
|
|||||||
@@ -135,17 +135,15 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
$costList = [];
|
$costList = [];
|
||||||
foreach ($_ as $npcId => $data)
|
foreach ($_ as $npcId => $data)
|
||||||
{
|
{
|
||||||
if (in_array(md5(serialize($data)), $handled)) // display every cost-combination only once
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$handled[] = md5(serialize($data));
|
|
||||||
|
|
||||||
$tokens = [];
|
$tokens = [];
|
||||||
$currency = [];
|
$currency = [];
|
||||||
foreach ($data as $c => $qty)
|
foreach ($data as $c => $qty)
|
||||||
{
|
{
|
||||||
if (is_string($c))
|
if (is_string($c))
|
||||||
|
{
|
||||||
|
unset($data[$c]); // unset miscData to prevent having two vendors /w the same cost being cached, because of different stock or rating-requirements
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($c < 0) // currency items (and honor or arena)
|
if ($c < 0) // currency items (and honor or arena)
|
||||||
$currency[] = -$c.','.$qty;
|
$currency[] = -$c.','.$qty;
|
||||||
@@ -153,7 +151,12 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
|
|||||||
$tokens[$c] = $c.','.$qty;
|
$tokens[$c] = $c.','.$qty;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cost = isset($_[0]) ? '[money='.$_[0] : '[money';
|
if (in_array(md5(serialize($data)), $handled)) // display every cost-combination only once
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$handled[] = md5(serialize($data));
|
||||||
|
|
||||||
|
$cost = isset($data[0]) ? '[money='.$data[0] : '[money';
|
||||||
|
|
||||||
if ($tokens)
|
if ($tokens)
|
||||||
$cost .= ' items='.implode(',', $tokens);
|
$cost .= ' items='.implode(',', $tokens);
|
||||||
|
|||||||
180
pages/spell.php
180
pages/spell.php
@@ -241,6 +241,158 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
|||||||
/* Main Content */
|
/* Main Content */
|
||||||
/****************/
|
/****************/
|
||||||
|
|
||||||
|
// chain reagents by method of accquisition
|
||||||
|
$reagentResult = [];
|
||||||
|
$enhanced = false;
|
||||||
|
$reagents = $spell->getReagentsForCurrent();
|
||||||
|
$appendReagentItem = function(&$reagentResult, $_iId, $_qty, $_mult, $_level, $_path, $alreadyUsed) use (&$appendCreateSpell)
|
||||||
|
{
|
||||||
|
if (in_array($_iId, $alreadyUsed))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$item = DB::Aowow()->selectRow('
|
||||||
|
SELECT name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, id, iconString, quality,
|
||||||
|
IF ( (spellId1 > 0 AND spellCharges1 < 0) OR
|
||||||
|
(spellId2 > 0 AND spellCharges2 < 0) OR
|
||||||
|
(spellId3 > 0 AND spellCharges3 < 0) OR
|
||||||
|
(spellId4 > 0 AND spellCharges4 < 0) OR
|
||||||
|
(spellId5 > 0 AND spellCharges5 < 0), 1, 0) AS consumed
|
||||||
|
FROM ?_items
|
||||||
|
WHERE id = ?d',
|
||||||
|
$_iId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$item)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $item['id']);
|
||||||
|
|
||||||
|
$_level++;
|
||||||
|
|
||||||
|
if ($item['consumed'])
|
||||||
|
$_qty++;
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'type' => TYPE_ITEM,
|
||||||
|
'typeId' => $item['id'],
|
||||||
|
'typeStr' => Util::$typeStrings[TYPE_ITEM],
|
||||||
|
'quality' => $item['quality'],
|
||||||
|
'name' => Util::localizedString($item, 'name'),
|
||||||
|
'icon' => $item['iconString'],
|
||||||
|
'qty' => $_qty * $_mult,
|
||||||
|
'path' => $_path.'.'.TYPE_ITEM.'-'.$item['id'],
|
||||||
|
'level' => $_level
|
||||||
|
);
|
||||||
|
|
||||||
|
$idx = count($reagentResult);
|
||||||
|
$reagentResult[] = $data;
|
||||||
|
$alreadyUsed[] = $item['id'];
|
||||||
|
|
||||||
|
if (!$appendCreateSpell($reagentResult, $item['id'], $data['qty'], $data['level'], $data['path'], $alreadyUsed))
|
||||||
|
$reagentResult[$idx]['final'] = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
$appendCreateSpell = function(&$reagentResult, $_iId, $_qty, $_level, $_path, $alreadyUsed) use (&$appendReagentItem)
|
||||||
|
{
|
||||||
|
$_level++;
|
||||||
|
// when results are found executes in <10ms
|
||||||
|
// when no results are found executes in ~0.35sec
|
||||||
|
// dafuque?!
|
||||||
|
// ""solution"": index effect1Id and effect1CreateItemId and pray, that tradeSpells only use the first index >.<
|
||||||
|
$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,
|
||||||
|
id AS ARRAY_KEY, iconString
|
||||||
|
FROM ?_spell
|
||||||
|
WHERE (effect1CreateItemId = ?d AND effect1Id = 24)',// OR
|
||||||
|
// (effect2CreateItemId = ?d AND effect2Id = 24) OR
|
||||||
|
// (effect3CreateItemId = ?d AND effect3Id = 24)',
|
||||||
|
$_iId//, $_iId, $_iId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$spells)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$didAppendSomething = false;
|
||||||
|
foreach ($spells as $sId => $row)
|
||||||
|
{
|
||||||
|
if (in_array(-$sId, $alreadyUsed))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Util::$pageTemplate->extendGlobalIds(TYPE_SPELL, $sId);
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'type' => TYPE_SPELL,
|
||||||
|
'typeId' => $sId,
|
||||||
|
'typeStr' => Util::$typeStrings[TYPE_SPELL],
|
||||||
|
'name' => Util::localizedString($row, 'name'),
|
||||||
|
'icon' => $row['iconString'],
|
||||||
|
'qty' => $_qty,
|
||||||
|
'path' => $_path.'.'.TYPE_SPELL.'-'.$sId,
|
||||||
|
'level' => $_level,
|
||||||
|
);
|
||||||
|
|
||||||
|
$reagentResult[] = $data;
|
||||||
|
$_aU = $alreadyUsed;
|
||||||
|
$_aU[] = -$sId;
|
||||||
|
|
||||||
|
$hasUnusedReagents = false;
|
||||||
|
for ($i = 1; $i < 9; $i++)
|
||||||
|
{
|
||||||
|
if ($row['reagent'.$i] <= 0 || $row['reagentCount'.$i] <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ($appendReagentItem($reagentResult, $row['reagent'.$i], $row['reagentCount'.$i], $data['qty'], $data['level'], $data['path'], $_aU))
|
||||||
|
{
|
||||||
|
$hasUnusedReagents = true;
|
||||||
|
$didAppendSomething = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$hasUnusedReagents) // no reagents were added, remove spell from result set
|
||||||
|
array_pop($reagentResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $didAppendSomething;
|
||||||
|
};
|
||||||
|
|
||||||
|
if ($reagents)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach ($spell->relItems->iterate() as $iId => $__)
|
||||||
|
{
|
||||||
|
if (!in_array($iId, array_keys($reagents)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'type' => TYPE_ITEM,
|
||||||
|
'typeId' => $iId,
|
||||||
|
'typeStr' => Util::$typeStrings[TYPE_ITEM],
|
||||||
|
'quality' => $spell->relItems->getField('quality'),
|
||||||
|
'name' => $spell->relItems->getField('name', true),
|
||||||
|
'icon' => $spell->relItems->getField('iconString'),
|
||||||
|
'qty' => $reagents[$iId][1],
|
||||||
|
'path' => TYPE_ITEM.'-'.$iId, // id of the html-element
|
||||||
|
'level' => 0 // depths in array, used for indentation
|
||||||
|
);
|
||||||
|
|
||||||
|
$idx = count($reagentResult);
|
||||||
|
$reagentResult[] = $data;
|
||||||
|
|
||||||
|
// start with self and current original item in usedEntries (spell < 0; item > 0)
|
||||||
|
if ($appendCreateSpell($reagentResult, $iId, $data['qty'], 0, $data['path'], [-$_id, $iId]))
|
||||||
|
$enhanced = true;
|
||||||
|
else
|
||||||
|
$reagentResult[$idx]['final'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// increment all indizes (by prepending null and removing it again)
|
||||||
|
array_unshift($reagentResult, null);
|
||||||
|
unset($reagentResult[0]);
|
||||||
|
|
||||||
$pageData = array(
|
$pageData = array(
|
||||||
'title' => $spell->getField('name', true),
|
'title' => $spell->getField('name', true),
|
||||||
'path' => json_encode($path, JSON_NUMERIC_CHECK),
|
'path' => json_encode($path, JSON_NUMERIC_CHECK),
|
||||||
@@ -256,7 +408,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
|||||||
'powerCost' => $spell->createPowerCostForCurrent(),
|
'powerCost' => $spell->createPowerCostForCurrent(),
|
||||||
'castTime' => $spell->createCastTimeForCurrent(false, false),
|
'castTime' => $spell->createCastTimeForCurrent(false, false),
|
||||||
'tools' => $spell->getToolsForCurrent(),
|
'tools' => $spell->getToolsForCurrent(),
|
||||||
'reagents' => $spell->getReagentsForCurrent(),
|
'reagents' => [$enhanced, $reagentResult],
|
||||||
'name' => $spell->getField('name', true),
|
'name' => $spell->getField('name', true),
|
||||||
'icon' => $spell->getField('iconString'),
|
'icon' => $spell->getField('iconString'),
|
||||||
'stack' => $spell->getField('stackAmount'),
|
'stack' => $spell->getField('stackAmount'),
|
||||||
@@ -334,31 +486,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare Reagents
|
|
||||||
if ($pageData['page']['reagents'])
|
|
||||||
{
|
|
||||||
$_ = $pageData['page']['reagents'];
|
|
||||||
$pageData['page']['reagents'] = [];
|
|
||||||
|
|
||||||
foreach ($spell->relItems->iterate() as $itemId => $__)
|
|
||||||
{
|
|
||||||
if (empty($_[$itemId]))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$pageData['page']['reagents'][] = array(
|
|
||||||
'name' => $spell->relItems->getField('name', true),
|
|
||||||
'quality' => $spell->relItems->getField('quality'),
|
|
||||||
'entry' => $itemId,
|
|
||||||
'count' => $_[$itemId][1],
|
|
||||||
);
|
|
||||||
|
|
||||||
unset($_[$itemId]);
|
|
||||||
|
|
||||||
if (empty($_))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spell scaling
|
// spell scaling
|
||||||
$scaling = array_merge(
|
$scaling = array_merge(
|
||||||
array(
|
array(
|
||||||
@@ -941,7 +1068,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
|||||||
|
|
||||||
unset($foo); // clear reference
|
unset($foo); // clear reference
|
||||||
|
|
||||||
|
|
||||||
/**************/
|
/**************/
|
||||||
/* Extra Tabs */
|
/* Extra Tabs */
|
||||||
/**************/
|
/**************/
|
||||||
|
|||||||
191
template/bricks/reagentList.tpl
Normal file
191
template/bricks/reagentList.tpl
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
<h3>{$lang.reagents}</h3>
|
||||||
|
|
||||||
|
{if $enhanced}
|
||||||
|
<style type="text/css">
|
||||||
|
.iconlist-col {ldelim} float: left; width: 31%; margin-right: 2%; {rdelim}
|
||||||
|
.iconlist {ldelim} border-collapse: collapse; margin-top: 4px; {rdelim}
|
||||||
|
.iconlist ul {ldelim} margin: 0!important; padding: 0!important; {rdelim}
|
||||||
|
.iconlist ul li {ldelim} list-style-position: inside; list-style-type: square; padding-left: 13px; {rdelim}
|
||||||
|
.iconlist th {ldelim} min-width: 18px; white-space: nowrap; {rdelim}
|
||||||
|
.iconlist td {ldelim} padding: 4px 0 6px 0; {rdelim}
|
||||||
|
.iconlist var {ldelim} font-size: 1px; {rdelim}
|
||||||
|
.iconlist .iconsmall {ldelim} margin-right: 4px; {rdelim}
|
||||||
|
.iconlist a.disclosure-on, .iconlist a.disclosure-off {ldelim} font-weight: normal; text-decoration: underline; {rdelim}
|
||||||
|
.iconlist .iconlist ul li {ldelim} padding-left: 10px; {rdelim}
|
||||||
|
.iconlist .iconlist th, .iconlist .iconlist td {ldelim} font-size: 11px; {rdelim}
|
||||||
|
.iconlist-col table th li {ldelim} list-style-position: outside; padding: 0; margin-left: 20px; {rdelim}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">//<![CDATA[
|
||||||
|
function iconlist_showhide(spn) {ldelim}
|
||||||
|
var
|
||||||
|
tr,
|
||||||
|
table,
|
||||||
|
trs,
|
||||||
|
s;
|
||||||
|
|
||||||
|
tr = spn;
|
||||||
|
|
||||||
|
while ((tr.parentNode) && tr.tagName.toUpperCase() != 'TR') {ldelim}
|
||||||
|
tr = tr.parentNode;
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
table = tr;
|
||||||
|
|
||||||
|
while ((table.parentNode) && table.tagName.toUpperCase() != 'TABLE') {ldelim}
|
||||||
|
table = table.parentNode;
|
||||||
|
{rdelim}
|
||||||
|
trs = table.getElementsByTagName('tr');
|
||||||
|
|
||||||
|
var opening = spn.className.indexOf('disclosure-off') >= 0;
|
||||||
|
var isSpell = tr.id.substr(tr.id.lastIndexOf('.')+1, 1) == '6';
|
||||||
|
var isItem = tr.id.substr(tr.id.lastIndexOf('.')+1, 1) == '3';
|
||||||
|
|
||||||
|
if (opening) {ldelim}
|
||||||
|
if (isSpell) {ldelim} //find any other open spells on this branch and close them
|
||||||
|
for (var x = 0; x < trs.length; x++)
|
||||||
|
if (trs[x].id.indexOf(tr.id.substr(0,tr.id.lastIndexOf('-'))) == 0) {ldelim} //sister spell
|
||||||
|
ns = trs[x].getElementsByTagName('div');
|
||||||
|
for (var y = 0; y < ns.length; y++)
|
||||||
|
if (ns[y].className == 'iconlist-tree disclosure-on')
|
||||||
|
iconlist_showhide(ns[y]);
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
if (isItem) {ldelim} //expanding item to spells, so cross out item
|
||||||
|
tr.style.textDecoration = 'line-through';
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
for (var x = 0; x < trs.length; x++) {ldelim}
|
||||||
|
if ((trs[x].id.indexOf(tr.id) == 0) && (trs[x].id.substr(tr.id.length+1).indexOf('.') < 0)) {ldelim}
|
||||||
|
trs[x].style.display = '';
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
spn.className = 'iconlist-tree disclosure-on';
|
||||||
|
|
||||||
|
if (isItem) {ldelim} //check to see if there is one spell for this item.. if so, expand it
|
||||||
|
var spellCount = 0; var lastTr = 0;
|
||||||
|
for (var x = 0; x < trs.length; x++) {ldelim}
|
||||||
|
if ((trs[x].id.indexOf(tr.id+'.6') == 0) && (trs[x].id.lastIndexOf('-') == tr.id.length + 2)) {ldelim}
|
||||||
|
spellCount++;
|
||||||
|
lastTr = x;
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
if (spellCount == 1) {ldelim}
|
||||||
|
ns = trs[lastTr].getElementsByTagName('div');
|
||||||
|
for (var y = 0; y < ns.length; y++) {ldelim}
|
||||||
|
if (ns[y].className == 'iconlist-tree disclosure-off') {ldelim}
|
||||||
|
iconlist_showhide(ns[y]);
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
{rdelim}
|
||||||
|
else {ldelim}
|
||||||
|
for (var x = 0; x < trs.length; x++) {ldelim}
|
||||||
|
if ((trs[x].id.indexOf(tr.id) == 0) && (trs[x].id != tr.id)) {ldelim}
|
||||||
|
trs[x].style.display = 'none';
|
||||||
|
trs[x].style.textDecoration = '';
|
||||||
|
ns = trs[x].getElementsByTagName('div');
|
||||||
|
for (var y = 0; y < ns.length; y++) {ldelim}
|
||||||
|
if (ns[y].className == 'iconlist-tree disclosure-on') {ldelim}
|
||||||
|
ns[y].className = 'iconlist-tree disclosure-off';
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
spn.className = 'iconlist-tree disclosure-off';
|
||||||
|
tr.style.textDecoration = '';
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
function iconlist_expandall(tableid,doexpand) {ldelim}
|
||||||
|
var table = document.getElementById(tableid);
|
||||||
|
var trs = table.getElementsByTagName('tr');
|
||||||
|
|
||||||
|
if (doexpand) {ldelim}
|
||||||
|
iconlist_expandall(tableid,false);
|
||||||
|
var firstSpells = new Array();
|
||||||
|
for (var x = 0; x < trs.length; x++) {ldelim}
|
||||||
|
if (!trs[x].id) {ldelim}
|
||||||
|
continue;
|
||||||
|
{rdelim}
|
||||||
|
if (trs[x].style.display == 'none') {ldelim}
|
||||||
|
continue;
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
if (trs[x].id.substr(trs[x].id.lastIndexOf('.')+1,1) == '6') {ldelim} //is spell
|
||||||
|
var skipOut = false;
|
||||||
|
var thisItem = trs[x].id.substr(0,trs[x].id.lastIndexOf('.'));
|
||||||
|
|
||||||
|
for (var y = 0; y < firstSpells.length; y++) {ldelim}
|
||||||
|
if (firstSpells[y] == thisItem) {ldelim}
|
||||||
|
skipOut = true;
|
||||||
|
break;
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
if (skipOut) {ldelim}
|
||||||
|
continue;
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
firstSpells.push(thisItem);
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
var spn = document.getElementById('spn.'+trs[x].id);
|
||||||
|
if (spn && spn.className.indexOf('disclosure-off') >= 0) {ldelim}
|
||||||
|
iconlist_showhide(spn);
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
else {ldelim}
|
||||||
|
for (var x = 0; x < trs.length; x++) {ldelim}
|
||||||
|
if (!trs[x].id) {ldelim}
|
||||||
|
continue;
|
||||||
|
{rdelim}
|
||||||
|
if (trs[x].id.indexOf('.') != trs[x].id.lastIndexOf('.')) {ldelim}
|
||||||
|
continue;
|
||||||
|
{rdelim}
|
||||||
|
|
||||||
|
var spn = document.getElementById('spn.'+trs[x].id);
|
||||||
|
if (spn && spn.className.indexOf('disclosure-on') >= 0) {ldelim}
|
||||||
|
iconlist_showhide(spn);
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
{rdelim}
|
||||||
|
//]]></script>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<table class="iconlist" id="reagent-list-generic">
|
||||||
|
{if $enhanced}
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th align="left">
|
||||||
|
<input type="button" style="font-size: 11px; margin-right: 0.5em" onclick="iconlist_expandall('reagent-list-generic',true);" value="{$lang._expandAll}">
|
||||||
|
<input type="button" style="font-size: 11px; margin-right: 0.5em" onclick="iconlist_expandall('reagent-list-generic',false);" value="{$lang._collapseAll}">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
|
{foreach from=$reagents key='k' item='itr'}
|
||||||
|
{strip}<tr id="reagent-list-generic.{$itr.path}"{if $itr.level} style="display: none"{/if}>
|
||||||
|
<th align="right" id="iconlist-icon{$k}"></th>
|
||||||
|
<td{if $itr.level} style="padding-left: {$itr.level}em"{/if}>
|
||||||
|
{if !empty($itr.final) && $enhanced}
|
||||||
|
<div class="iconlist-tree" style="width: 15px; float: left"> </div>
|
||||||
|
{elseif $enhanced}
|
||||||
|
<div class="iconlist-tree disclosure-off" onclick="iconlist_showhide(this);" style="padding-left: 0; cursor: pointer; width: 15px; float: left" id="spn.reagent-list-generic.{$itr.path}"> </div>
|
||||||
|
{/if}
|
||||||
|
<span class="q{if $itr.type == $smarty.const.TYPE_ITEM}{$itr.quality}{/if}"><a href="?{$itr.typeStr}={$itr.typeId}">{$itr.name}</a></span>{if $itr.qty > 1} ({$itr.qty}){/if}
|
||||||
|
</td>
|
||||||
|
</tr>{/strip}
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<script type="text/javascript">//<![CDATA[
|
||||||
|
{foreach from=$reagents key='k' item='itr'}
|
||||||
|
$WH.ge('iconlist-icon{$k}').appendChild(g_{$itr.typeStr}s.createIcon({$itr.typeId}, 0, {$itr.qty}));
|
||||||
|
{/foreach}
|
||||||
|
//]]></script>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
{if $lvData.page.reagents}
|
{if $lvData.page.reagents}
|
||||||
{if $lvData.page.tools}<div style="float: left; margin-right: 75px">{/if}
|
{if $lvData.page.tools}<div style="float: left; margin-right: 75px">{/if}
|
||||||
{include file='bricks/reagentList.tpl' reagent=$lvData.page.reagents}
|
{include file='bricks/reagentList.tpl' reagents=$lvData.page.reagents[1] enhanced=$lvData.page.reagents[0]}
|
||||||
{if $lvData.page.tools}</div>{/if}
|
{if $lvData.page.tools}</div>{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user