diff --git a/includes/class.item.php b/includes/class.item.php
index c4a4e8a9..7c20b712 100644
--- a/includes/class.item.php
+++ b/includes/class.item.php
@@ -286,8 +286,8 @@ class ItemList extends BaseType
else
$x .= '
';
- // Weapon Stats
- if ($this->curTpl['delay'] > 0)
+ // Weapon/Ammunition Stats
+ if (in_array($this->curTpl['class'], [ITEM_CLASS_WEAPON, ITEM_CLASS_AMMUNITION]))
{
$speed = $this->curTpl['delay'] / 1000;
$dmgmin1 = $this->curTpl['dmg_min1'] + $this->curTpl['dmg_min2'];
@@ -295,7 +295,7 @@ class ItemList extends BaseType
$dps = $speed ? ($dmgmin1 + $dmgmax1) / (2 * $speed) : 0;
// regular weapon
- if ($this->curTpl['class'] != ITEM_CLASS_AMMUNITION)
+ if ($this->curTpl['class'] == ITEM_CLASS_WEAPON)
{
$x .= '
';
$x .= '| '.sprintf($this->curTpl['dmg_type1'] ? Lang::$item['damageMagic'] : Lang::$item['damagePhys'], $this->curTpl['dmg_min1'].' - '.$this->curTpl['dmg_max1'], Lang::$game['sc'][$this->curTpl['dmg_type1']]).' | ';
@@ -486,7 +486,7 @@ class ItemList extends BaseType
// required spell
if ($this->curTpl['requiredspell'])
- $x .= '
'.Lang::$game['requires'].' '.Spell::getName($this->curTpl['requiredspell']).'';
+ $x .= '
'.Lang::$game['requires'].' '.SpellList::getName($this->curTpl['requiredspell']).'';
// required reputation w/ faction
if ($this->curTpl['RequiredReputationFaction'])
@@ -548,7 +548,6 @@ class ItemList extends BaseType
$x .= ''.$bonus.'
';
// Item Set
- $tmpX = '';
$pieces = [];
$itemset = DB::Aowow()->selectRow('
SELECT
@@ -572,23 +571,22 @@ class ItemList extends BaseType
$equivalents = ItemList::getEquivalentSetPieces($itemset['item'.$i]);
$pieces[] = ''.ItemList::getName($itemset['item'.$i]).'';
}
- $tmpX .= implode('
', $pieces);
- $x .= '
'.Util::localizedString($itemset, 'name').' (0/'.$num.')';
+ $xSet = '
'.Util::localizedString($itemset, 'name').' (0/'.$num.')';
if ($itemset['skillID']) // bonus requires skill to activate
{
- $name = DB::Aowow()->selectRow('SELECT * FROM ?_skill WHERE skillID=?d', $itemset['skillID']);
- $x .= '
'.Lang::$game['requires'].' '.Util::localizedString($name, 'name').'';
+ $name = DB::Aowow()->selectRow('SELECT * FROM ?_skill WHERE skillID=?d', $itemset['skillID']);
+ $xSet .= '
'.Lang::$game['requires'].' '.Util::localizedString($name, 'name').'';
if ($itemset['skillLevel'])
- $x .= ' ('.$itemset['skillLevel'].')';
+ $xSet .= ' ('.$itemset['skillLevel'].')';
- $x .= '
';
+ $xSet .= '
';
}
// list pieces
- $x .= ''.$tmpX.'
';
+ $xSet .= ''.implode('
', $pieces).'
';
// get bonuses
$setSpellsAndIdx = [];
@@ -611,7 +609,7 @@ class ItemList extends BaseType
}
// sort and list bonuses
- $x .= '';
+ $xSet .= '';
for ($i = 0; $i < count($itemset['spells']); $i++)
{
for ($j = $i; $j < count($itemset['spells']); $j++)
@@ -623,11 +621,11 @@ class ItemList extends BaseType
$itemset['spells'][$i] = $itemset['spells'][$j];
$itemset['spells'][$j] = $tmp;
}
- $x .= '('.$itemset['spells'][$i]['bonus'].') '.Lang::$item['set'].': '.$itemset['spells'][$i]['tooltip'].'';
+ $xSet .= '('.$itemset['spells'][$i]['bonus'].') '.Lang::$item['set'].': '.$itemset['spells'][$i]['tooltip'].'';
if ($i < count($itemset['spells']) - 1)
- $x .= '
';
+ $xSet .= '
';
}
- $x .= '';
+ $xSet .= '';
}
// recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp
@@ -658,6 +656,10 @@ class ItemList extends BaseType
// misc (no idea, how to organize the
better)
$xMisc = [];
+ // itemset: pieces and boni
+ if (isset($xSet))
+ $xMisc[] = $xSet;
+
// funny, yellow text at the bottom, omit if we have a recipe
if ($this->curTpl['description'] && !isset($xCraft))
$xMisc[] = '"'.Util::localizedString($this->curTpl, 'description').'"';
@@ -900,7 +902,7 @@ class ItemList extends BaseType
// $js .= Util::setRatingLevel($level, $type, $value);
// $js .= ')';
if ($interactive)
- $js = ' ('.printf(Util::$changeLevelString, Util::setRatingLevel($level, $type, $value)).'))';
+ $js = ' ('.sprintf(Util::$changeLevelString, Util::setRatingLevel($level, $type, $value)).'))';
else
$js = " (".Util::setRatingLevel($level, $type, $value).")";
diff --git a/includes/class.spell.php b/includes/class.spell.php
index 051a7279..ae9803c3 100644
--- a/includes/class.spell.php
+++ b/includes/class.spell.php
@@ -475,8 +475,8 @@ class SpellList extends BaseType
$periode = 3000;
$tick = $duration / $periode;
- $min = abs($base + 1) * tick;
- $max = abs($base + $add) * tick;
+ $min = abs($base + 1) * $tick;
+ $max = abs($base + $add) * $tick;
$equal = $min == $max;
if (in_array($op, $signs) && is_numeric($oparg) && is_numeric($base))
@@ -1004,7 +1004,7 @@ class SpellList extends BaseType
$reagents[] = array(
'id' => $this->curTpl['reagent'.$j],
- 'name' => Util::getItemName($this->curTpl['reagent'.$j]),
+ 'name' => ItemList::getName($this->curTpl['reagent'.$j]),
'count' => $this->curTpl['reagentCount'.$j] // if < 0 : require, but don't use
);
}
@@ -1016,7 +1016,7 @@ class SpellList extends BaseType
{
// Tools
if ($this->curTpl['tool'.$i])
- $tools[$i-1] = array('itemId' => $this->curTpl['tool'.$i], 'name' => Util::getItemName($this->curTpl['tool'.$i]));
+ $tools[$i-1] = array('itemId' => $this->curTpl['tool'.$i], 'name' => ItemList::getName($this->curTpl['tool'.$i]));
// TotemCategory
if ($this->curTpl['toolCategory'.$i])
@@ -1170,6 +1170,16 @@ class SpellList extends BaseType
if ($reqWrapper2)
$x .= "
";
+ // append created items (may need improvement)
+ for ($i = 1; $i <= 3; $i++)
+ {
+ if ($cId = $this->curTpl['effect'.$i.'CreateItemId'])
+ {
+ $x .= '
'.(new ItemList(array(['i.entry', (int)$cId])))->renderTooltip();
+ break;
+ }
+ }
+
$this->tooltips[$this->id] = $x;
}
diff --git a/power/aowowPower.js b/power/aowowPower.js
index e8e3821b..c1958e20 100644
--- a/power/aowowPower.js
+++ b/power/aowowPower.js
@@ -271,7 +271,7 @@ if (typeof $WowheadPower == "undefined") {
locale = $WH.g_getLocaleFromDomain(domain);
/* edit start */
- if (in_array(['fr', 'de', 'es', 'ru', 'en'], domain) == -1) {
+ if ($WH.in_array(['fr', 'de', 'es', 'ru', 'en'], domain) == -1) {
for (i in document.scripts) {
if (!document.scripts[i].src)
continue;