mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Core/CharStats
* unify stat handling. If there are discrepancies left at least they are now centralized. - health should no longer pretend to be mana - stats are no longer capped to 32.7k points as items can have multiple of the same stat and handily exceed smallints * weight scale fixes: - "repair cost" is no longer a weight scale option. Why was it one in the first place? Also it wasn't even accessible before. (that was a bug) - "bonus armor" is now searchable and only applied to armor pieces * removed unused parsed stats from itemsets
This commit is contained in:
@@ -213,22 +213,16 @@ SqlGen::register(new class extends SetupScript
|
||||
/* calc statbonuses */
|
||||
/********************/
|
||||
|
||||
$gains = $spells = $mods = [];
|
||||
$spells = [];
|
||||
|
||||
for ($i = 1; $i < 9; $i++)
|
||||
if ($setData['spellId'.$i] > 0 && $setData['itemCount'.$i] > 0)
|
||||
$spells[$i] = [$setData['spellId'.$i], $setData['itemCount'.$i]];
|
||||
|
||||
$bonusSpells = new SpellList(array(['s.id', array_column($spells, 0)]));
|
||||
$mods = $bonusSpells->getStatGain();
|
||||
|
||||
$spells = array_pad($spells, 8, [0, 0]);
|
||||
|
||||
for ($i = 1; $i < 9; $i++)
|
||||
if ($setData['itemCount'.$i] > 0 && !empty($mods[$setData['spellId'.$i]]))
|
||||
$gains[$setData['itemCount'.$i]] = $mods[$setData['spellId'.$i]];
|
||||
|
||||
$row['bonusParsed'] = serialize($gains);
|
||||
foreach (array_column($spells, 0) as $idx => $spellId)
|
||||
$row['spell'.($idx+1)] = $spellId;
|
||||
foreach (array_column($spells, 1) as $idx => $nItems)
|
||||
|
||||
Reference in New Issue
Block a user