From b3369d0b3f24c51fdbf558f27f13c145046bb17a Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Mon, 13 Feb 2017 02:13:43 +0100 Subject: [PATCH] Items/Currency * do not display unique-limited amount on item if currency token * display as cap on currency page instead --- includes/types/item.class.php | 3 ++- setup/tools/sqlgen/currencies.func.php | 4 ++-- setup/updates/1486948902_01.sql | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 setup/updates/1486948902_01.sql diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 6448bc67..c029a822 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -529,7 +529,8 @@ class ItemList extends BaseType { $x .= '
'.Lang::item('unique'); - if ($this->curTpl['maxCount'] > 1) + // not for currency tokens + if ($this->curTpl['maxCount'] > 1 && $this->curTpl['bagFamily'] != 8192) $x .= ' ('.$this->curTpl['maxCount'].')'; } else if ($_flags & ITEM_FLAG_UNIQUEEQUIPPED) diff --git a/setup/tools/sqlgen/currencies.func.php b/setup/tools/sqlgen/currencies.func.php index 7a2d43ec..d08d4c79 100644 --- a/setup/tools/sqlgen/currencies.func.php +++ b/setup/tools/sqlgen/currencies.func.php @@ -31,8 +31,8 @@ function currencies(array $ids = []) $moneyItems = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, itemId FROM dbc_currencytypes{ WHERE id IN (?a)}', $ids ?: DBSIMPLE_SKIP); - // apply names - $moneyNames = DB::World()->select('SELECT it.entry AS ARRAY_KEY, name AS name_loc0, name_loc2, name_loc3, name_loc6, name_loc8 FROM item_template it LEFT JOIN locales_item li ON li.entry = it.entry WHERE it.entry IN (?a)', $moneyItems); + // apply names & cap + $moneyNames = DB::World()->select('SELECT it.entry AS ARRAY_KEY, name AS name_loc0, name_loc2, name_loc3, name_loc6, name_loc8, it.maxCount AS cap FROM item_template it LEFT JOIN locales_item li ON li.entry = it.entry WHERE it.entry IN (?a)', $moneyItems); foreach ($moneyItems as $cId => $itemId) { if (!empty($moneyNames[$itemId])) diff --git a/setup/updates/1486948902_01.sql b/setup/updates/1486948902_01.sql new file mode 100644 index 00000000..b89e5ab3 --- /dev/null +++ b/setup/updates/1486948902_01.sql @@ -0,0 +1 @@ +UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' currencies');