mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Itemsats
* fixed an translation issue on itemMod <=> statId causing wrong search results * fixed an sql-error breaking stat-based searches for items
This commit is contained in:
@@ -1825,7 +1825,7 @@ class ItemListFilter extends Filter
|
||||
|
||||
if ($select)
|
||||
{
|
||||
$this->extraOpts['is']['s'][] = ', IF(is.id IS NULL, 0, ('.implode(' + ', $select).') / '.$wtSum.') AS score';
|
||||
$this->extraOpts['is']['s'][] = ', IF(is.typeId IS NULL, 0, ('.implode(' + ', $select).') / '.$wtSum.') AS score';
|
||||
$this->extraOpts['is']['o'][] = 'score DESC';
|
||||
$this->extraOpts['i']['o'][] = null; // remove default ordering
|
||||
}
|
||||
|
||||
@@ -175,11 +175,21 @@ class SpellList extends BaseType
|
||||
case 29: // ModStat MiscVal:type
|
||||
if ($mv < 0) // all stats
|
||||
{
|
||||
for ($j = 0; $j < 5; $j++)
|
||||
Util::arraySumByKey($stats, [(ITEM_MOD_AGILITY + $j) => $pts]);
|
||||
for ($iMod = ITEM_MOD_AGILITY; $iMod <= ITEM_MOD_STAMINA; $iMod++)
|
||||
Util::arraySumByKey($stats, [iMod => $pts]);
|
||||
}
|
||||
else // one stat
|
||||
Util::arraySumByKey($stats, [(ITEM_MOD_AGILITY + $mv) => $pts]);
|
||||
else if ($mv == STAT_STRENGTH) // one stat
|
||||
Util::arraySumByKey($stats, [ITEM_MOD_STRENGTH => $pts]);
|
||||
else if ($mv == STAT_AGILITY)
|
||||
Util::arraySumByKey($stats, [ITEM_MOD_AGILITY => $pts]);
|
||||
else if ($mv == STAT_STAMINA)
|
||||
Util::arraySumByKey($stats, [ITEM_MOD_STAMINA => $pts]);
|
||||
else if ($mv == STAT_INTELLECT)
|
||||
Util::arraySumByKey($stats, [ITEM_MOD_INTELLECT => $pts]);
|
||||
else if ($mv == ITEM_MOD_SPIRIT)
|
||||
Util::arraySumByKey($stats, [ITEM_MOD_SPIRIT => $pts]);
|
||||
else // one bullshit
|
||||
trigger_error('AuraId 29 of spell #'.$this->id.' has wrong statId #'.$mv, E_USER_WARNING);
|
||||
|
||||
break;
|
||||
case 34: // Increase Health
|
||||
|
||||
1
setup/updates/1439840492_01.sql
Normal file
1
setup/updates/1439840492_01.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' item_stats');
|
||||
Reference in New Issue
Block a user