Items/Armor

* fixed handling of additional Armor
This commit is contained in:
Sarjuuk
2018-04-28 10:53:45 +02:00
parent efd68bdb5f
commit 000a3208c0
2 changed files with 6 additions and 8 deletions

View File

@@ -640,10 +640,10 @@ class ItemList extends BaseType
if ($interactive) if ($interactive)
$spanI = 'class="q2 tip" onmouseover="$WH.Tooltip.showAtCursor(event, $WH.sprintf(LANG.tooltip_armorbonus, '.$this->curTpl['armorDamageModifier'].'), 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'; $spanI = 'class="q2 tip" onmouseover="$WH.Tooltip.showAtCursor(event, $WH.sprintf(LANG.tooltip_armorbonus, '.$this->curTpl['armorDamageModifier'].'), 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"';
$x .= '<span '.$spanI.'><!--addamr'.$this->curTpl['armorDamageModifier'].'--><span>'.Lang::item('armor', [intVal($this->curTpl['armor'] - $this->curTpl['armorDamageModifier'])]).'</span></span><br />'; $x .= '<span '.$spanI.'><!--addamr'.$this->curTpl['armorDamageModifier'].'--><span>'.Lang::item('armor', [$this->curTpl['armor']]).'</span></span><br />';
} }
else if (($this->curTpl['armor'] - $this->curTpl['armorDamageModifier']) > 0) else if ($this->curTpl['armor'])
$x .= '<span><!--amr-->'.Lang::item('armor', [intVal($this->curTpl['armor'] - $this->curTpl['armorDamageModifier'])]).'</span><br />'; $x .= '<span><!--amr-->'.Lang::item('armor', [$this->curTpl['armor']]).'</span><br />';
// Block (note: block value from field block and from field stats or parsed from itemSpells are displayed independently) // Block (note: block value from field block and from field stats or parsed from itemSpells are displayed independently)
if ($this->curTpl['tplBlock']) if ($this->curTpl['tplBlock'])
@@ -1606,7 +1606,7 @@ class ItemList extends BaseType
'frores' => $this->curTpl['resFrost'], 'frores' => $this->curTpl['resFrost'],
'shares' => $this->curTpl['resShadow'], 'shares' => $this->curTpl['resShadow'],
'arcres' => $this->curTpl['resArcane'], 'arcres' => $this->curTpl['resArcane'],
'armorbonus' => $this->curTpl['armorDamageModifier'], 'armorbonus' => max(0, intVal($this->curTpl['armorDamageModifier'])),
'armor' => $this->curTpl['armor'], 'armor' => $this->curTpl['armor'],
'dura' => $this->curTpl['durability'], 'dura' => $this->curTpl['durability'],
'itemset' => $this->curTpl['itemset'], 'itemset' => $this->curTpl['itemset'],
@@ -1647,9 +1647,6 @@ class ItemList extends BaseType
$json['feratkpwr'] = $fap; $json['feratkpwr'] = $fap;
} }
if ($this->curTpl['armorDamageModifier'] > 0)
$json['armor'] -= $this->curTpl['armorDamageModifier'];
if ($this->curTpl['class'] == ITEM_CLASS_ARMOR || $this->curTpl['class'] == ITEM_CLASS_WEAPON) if ($this->curTpl['class'] == ITEM_CLASS_ARMOR || $this->curTpl['class'] == ITEM_CLASS_WEAPON)
$json['gearscore'] = Util::getEquipmentScore($json['level'], $this->getField('quality'), $json['slot'], $json['nsockets']); $json['gearscore'] = Util::getEquipmentScore($json['level'], $this->getField('quality'), $json['slot'], $json['nsockets']);
else if ($this->curTpl['class'] == ITEM_CLASS_GEM) else if ($this->curTpl['class'] == ITEM_CLASS_GEM)
@@ -1785,7 +1782,7 @@ class ItemListFilter extends Filter
38 => [FILTER_CR_NUMERIC, 'is.rgdatkpwr', NUM_CAST_INT, true ], // rgdatkpwr 38 => [FILTER_CR_NUMERIC, 'is.rgdatkpwr', NUM_CAST_INT, true ], // rgdatkpwr
39 => [FILTER_CR_NUMERIC, 'is.rgdhitrtng', NUM_CAST_INT, true ], // rgdhitrtng 39 => [FILTER_CR_NUMERIC, 'is.rgdhitrtng', NUM_CAST_INT, true ], // rgdhitrtng
40 => [FILTER_CR_NUMERIC, 'is.rgdcritstrkrtng', NUM_CAST_INT, true ], // rgdcritstrkrtng 40 => [FILTER_CR_NUMERIC, 'is.rgdcritstrkrtng', NUM_CAST_INT, true ], // rgdcritstrkrtng
41 => [FILTER_CR_NUMERIC, 'is.armor' , NUM_CAST_INT, true ], // armor 41 => [FILTER_CR_NUMERIC, 'is.armor', NUM_CAST_INT, true ], // armor
42 => [FILTER_CR_NUMERIC, 'is.defrtng', NUM_CAST_INT, true ], // defrtng 42 => [FILTER_CR_NUMERIC, 'is.defrtng', NUM_CAST_INT, true ], // defrtng
43 => [FILTER_CR_NUMERIC, 'is.block', NUM_CAST_INT, true ], // block 43 => [FILTER_CR_NUMERIC, 'is.block', NUM_CAST_INT, true ], // block
44 => [FILTER_CR_NUMERIC, 'is.blockrtng', NUM_CAST_INT, true ], // blockrtng 44 => [FILTER_CR_NUMERIC, 'is.blockrtng', NUM_CAST_INT, true ], // blockrtng

View File

@@ -0,0 +1 @@
UPDATE aowow_dbversion SET `sql` = CONCAT(IFNULL(`sql`, ''), ' item_stats');