Items/Summary

* Fixed itemset bonus calculation for sets with interchangeable items.
 * Fixed multiple items for the same slot activating set boni
This commit is contained in:
Sarjuuk
2025-03-07 15:48:48 +01:00
parent 460f4857ad
commit 50a5ccbaf6
3 changed files with 10 additions and 4 deletions

View File

@@ -296,15 +296,17 @@ CLISetup::registerSetup("sql", new class extends SetupScript
$sorted[$k][$data['slot']] = $data;
}
foreach ($sorted as $i => $set)
$i = 0;
foreach ($sorted as $set)
{
ksort($set);
$vRow = $row;
$this->getDataFromSet($vRow, $set);
// is virtual set
if ($i)
// only assign a virtual setId to followup sets or the ItemSummary tool can't find the setboni
// is this the correct way..?
if ($i++)
$vRow['id'] = --$virtualId;
DB::Aowow()->query('INSERT INTO ?_itemset (?#) VALUES (?a)', array_keys($vRow), array_values($vRow));

View File

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

View File

@@ -2483,6 +2483,7 @@ Summary.prototype = {
if (g_items[p]) {
var
s = g_items[p].jsonequip.itemset,
t = g_items[p].jsonequip.slot,
_ = g_itemsets[s];
if (_) {
@@ -2491,7 +2492,9 @@ Summary.prototype = {
if (itemsetpcs[s] == null) {
itemsetpcs[s] = {};
}
itemsetpcs[s][p] = 1;
// aowow: group by slot, not itemId, to avoid multiple items of the same slot activating boni
// itemsetpcs[s][p] = 1;
itemsetpcs[s][t] = 1;
itemsetbak[s] = _;
}
}