mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Misc/Fixes
* fixed stats when comparing items with scaling random enchantments * fixed BOM on compare.php * fixed multiple typos and notices
This commit is contained in:
@@ -123,7 +123,7 @@ class EnchantmentList extends BaseType
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getStatGain()
|
||||
public function getStatGain($addScalingKeys = false)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
@@ -134,6 +134,70 @@ class EnchantmentList extends BaseType
|
||||
if (isset($this->curTpl['dps']))
|
||||
$data['dps'] = $this->curTpl['dps'];
|
||||
|
||||
// scaling enchantments are saved as 0 to item_stats, thus return empty
|
||||
if ($addScalingKeys)
|
||||
{
|
||||
$spellStats = [];
|
||||
if ($this->relSpells)
|
||||
$spellStats = $this->relSpells->getStatGain();
|
||||
|
||||
for ($h = 1; $h <= 3; $h++)
|
||||
{
|
||||
$obj = (int)$this->curTpl['object'.$h];
|
||||
|
||||
switch ($this->curTpl['type'.$h])
|
||||
{
|
||||
case 3: // TYPE_EQUIP_SPELL Spells from ObjectX (use of amountX?)
|
||||
if (!empty($spellStats[$obj]))
|
||||
foreach ($spellStats[$obj] as $mod => $_)
|
||||
if ($str = Util::$itemMods[$mod])
|
||||
Util::arraySumByKey($data, [$str => 0]);
|
||||
|
||||
$obj = null;
|
||||
break;
|
||||
case 4: // TYPE_RESISTANCE +AmountX resistance for ObjectX School
|
||||
switch ($obj)
|
||||
{
|
||||
case 0: // Physical
|
||||
$obj = ITEM_MOD_ARMOR;
|
||||
break;
|
||||
case 1: // Holy
|
||||
$obj = ITEM_MOD_HOLY_RESISTANCE;
|
||||
break;
|
||||
case 2: // Fire
|
||||
$obj = ITEM_MOD_FIRE_RESISTANCE;
|
||||
break;
|
||||
case 3: // Nature
|
||||
$obj = ITEM_MOD_NATURE_RESISTANCE;
|
||||
break;
|
||||
case 4: // Frost
|
||||
$obj = ITEM_MOD_FROST_RESISTANCE;
|
||||
break;
|
||||
case 5: // Shadow
|
||||
$obj = ITEM_MOD_SHADOW_RESISTANCE;
|
||||
break;
|
||||
case 6: // Arcane
|
||||
$obj = ITEM_MOD_ARCANE_RESISTANCE;
|
||||
break;
|
||||
default:
|
||||
$obj = null;
|
||||
}
|
||||
break;
|
||||
case 5: // TYPE_STAT +AmountX for Statistic by type of ObjectX
|
||||
if ($obj < 2) // [mana, health] are on [0, 1] respectively and are expected on [1, 2] ..
|
||||
$obj++; // 0 is weaponDmg .. ehh .. i messed up somewhere
|
||||
|
||||
break; // stats are directly assigned below
|
||||
default: // TYPE_NONE dnd stuff; skip assignment below
|
||||
$obj = null;
|
||||
}
|
||||
|
||||
if ($obj !== null)
|
||||
if ($str = Util::$itemMods[$obj]) // check if we use these mods
|
||||
Util::arraySumByKey($data, [$str => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -1444,7 +1444,7 @@ class ItemList extends BaseType
|
||||
{
|
||||
$this->rndEnchIds[$eId] = array(
|
||||
'text' => $enchants->getField('name', true),
|
||||
'stats' => $enchants->getStatGain()
|
||||
'stats' => $enchants->getStatGain(true)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('invalid access');
|
||||
|
||||
@@ -631,6 +631,11 @@ class SearchPage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($items->iterate() as $itemId => $__)
|
||||
if (!empty($data[$itemId]['subitems']))
|
||||
foreach ($data[$itemId]['subitems'] as &$si)
|
||||
$si['enchantment'] = implode(', ', $si['enchantment']);
|
||||
|
||||
$result = array(
|
||||
'type' => TYPE_ITEM,
|
||||
'appendix' => ' (Item)',
|
||||
|
||||
@@ -29,6 +29,8 @@ class UtilityPage extends GenericPage
|
||||
|
||||
$this->page = $pageCall;
|
||||
$this->rss = isset($_GET['rss']);
|
||||
|
||||
if ($this->page != 'random')
|
||||
$this->name = Lang::main('utilities', array_search($pageCall, $this->validPages));
|
||||
|
||||
if ($this->page == 'most-comments')
|
||||
@@ -316,7 +318,7 @@ class UtilityPage extends GenericPage
|
||||
array_unshift($this->title, Lang::main('mostComments', 0));
|
||||
}
|
||||
|
||||
array_unshift($this->title, Lang::main('utilities', array_search($this->page, $this->validPages)));
|
||||
array_unshift($this->title, $this->name);
|
||||
}
|
||||
|
||||
protected function generatePath()
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
UPDATE aowow_dbversion SET `sql`= CONCAT(`sql, ' spawns');
|
||||
UPDATE aowow_dbversion SET `sql`= CONCAT(`sql`, ' spawns');
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
foreach ($list as $idx => $itr):
|
||||
echo ' <tr><th>'.($idx + 1).'</th><td><div>';
|
||||
|
||||
$end = array_pop(array_keys($itr));
|
||||
$_ = array_keys($itr);
|
||||
$end = array_pop($_);
|
||||
foreach ($itr as $k => $i): // itemItr
|
||||
switch ($i['side']):
|
||||
case 1: $wrap = '<span class="icon-alliance-padded">%s</span>'; break;
|
||||
|
||||
@@ -10,7 +10,7 @@ $f = $this->filter; // shorthand
|
||||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 1]]);
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 101]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
|
||||
Reference in New Issue
Block a user