diff --git a/db/import-tmpl/item_group_db.yml b/db/import-tmpl/item_group_db.yml
index 4d01af5ffc..7c4c4f9be8 100644
--- a/db/import-tmpl/item_group_db.yml
+++ b/db/import-tmpl/item_group_db.yml
@@ -32,6 +32,7 @@
# Duration Makes the item a rental item which will expire within the given amount in minutes. Not intended for use with stackable items. (Default: 0)
# Announced If player obtains this item it will be broadcasted to the server. (Default: false)
# UniqueId Makes the given item(s) have a Unique ID. (Default: UniqueId from item_db)
+# Stacked Whether stackable items are given stacked or not. (Default: true)
# Named Inscribes the item with the obtainer's name. (Default: false)
# Bound Binds the obtained item. (Default: None)
# Clear Remove the given item. (Optional)
diff --git a/db/item_group_db.yml b/db/item_group_db.yml
index 782a054748..4b2b388b89 100644
--- a/db/item_group_db.yml
+++ b/db/item_group_db.yml
@@ -32,6 +32,7 @@
# Duration Makes the item a rental item which will expire within the given amount in minutes. Not intended for use with stackable items. (Default: 0)
# Announced If player obtains this item it will be broadcasted to the server. (Default: false)
# UniqueId Makes the given item(s) have a Unique ID. (Default: false)
+# Stacked Whether stackable items are given stacked or not. (Default: true)
# Named Inscribes the item with the obtainer's name. (Default: false)
# Bound Binds the obtained item. (Default: None)
# Clear Remove the given item. (Optional)
diff --git a/db/pre-re/item_group_db.yml b/db/pre-re/item_group_db.yml
index dcb2c597b2..6debd1af75 100644
--- a/db/pre-re/item_group_db.yml
+++ b/db/pre-re/item_group_db.yml
@@ -32,6 +32,7 @@
# Duration Makes the item a rental item which will expire within the given amount in minutes. Not intended for use with stackable items. (Default: 0)
# Announced If player obtains this item it will be broadcasted to the server. (Default: false)
# UniqueId Makes the given item(s) have a Unique ID. (Default: UniqueId from item_db)
+# Stacked Whether stackable items are given stacked or not. (Default: true)
# Named Inscribes the item with the obtainer's name. (Default: false)
# Bound Binds the obtained item. (Default: None)
# Clear Remove the given item. (Optional)
diff --git a/db/re/item_group_db.yml b/db/re/item_group_db.yml
index 805d029083..2633ba1183 100644
--- a/db/re/item_group_db.yml
+++ b/db/re/item_group_db.yml
@@ -32,6 +32,7 @@
# Duration Makes the item a rental item which will expire within the given amount in minutes. Not intended for use with stackable items. (Default: 0)
# Announced If player obtains this item it will be broadcasted to the server. (Default: false)
# UniqueId Makes the given item(s) have a Unique ID. (Default: UniqueId from item_db)
+# Stacked Whether stackable items are given stacked or not. (Default: true)
# Named Inscribes the item with the obtainer's name. (Default: false)
# Bound Binds the obtained item. (Default: None)
# Clear Remove the given item. (Optional)
@@ -890,6 +891,7 @@ Body:
- Item: Aquarius_Diadem_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: ARCHER_CARD_BOX
SubGroups:
- SubGroup: 0
@@ -948,6 +950,7 @@ Body:
- Item: Aries_Scroll_
Amount: 10
UniqueId: true
+ Stacked: false
- Group: ASGARD_SCROLL
SubGroups:
- SubGroup: 1
@@ -4028,6 +4031,7 @@ Body:
- Item: Capricon_Di_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: CAPRI_CROWN_SCROLL
SubGroups:
- SubGroup: 1
@@ -4084,6 +4088,7 @@ Body:
- Item: Capri_Crown_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: CARACAS_RING_BOX
SubGroups:
- SubGroup: 0
@@ -5852,9 +5857,7 @@ Body:
- Item: Malang_Sp_Can
Rate: 800
- Item: Egrade_Coin
- Rate: 50
- - Item: Egrade_Coin
- Rate: 150
+ Rate: 200
- SubGroup: 3
List:
- Item: Malang_Sp_Can
@@ -6704,7 +6707,7 @@ Body:
Rate: 156
- Item: LexAeternaStone_Middle
Rate: 156
- - Item: BlueAuraEffect_Middle
+ - Item: ShadowEffect_Middle
Rate: 156
- Item: ATKStone_Middle
Rate: 234
@@ -8195,6 +8198,7 @@ Body:
- Item: Energetic_Pisces_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: ENERGETIC_PISCES_SCROLL
SubGroups:
- SubGroup: 1
@@ -9185,6 +9189,7 @@ Body:
- Item: Gemi_Crown_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: GEMI_DIADEM_SCROLL
SubGroups:
- SubGroup: 1
@@ -9225,6 +9230,7 @@ Body:
- Item: Gemi_Diadem_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: GEMSTONE
SubGroups:
- SubGroup: 1
@@ -12497,6 +12503,7 @@ Body:
- Item: Lovely_Aquarius_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: LOVELY_AQUARIUS_SCROLL
SubGroups:
- SubGroup: 1
@@ -15619,6 +15626,7 @@ Body:
- Item: Pisces_Diadem_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: PISCES_DIADEM_SCROLL
SubGroups:
- SubGroup: 1
@@ -16373,9 +16381,6 @@ Body:
- Item: Blacksmith_Blessing
Rate: 580
Amount: 4
- - Item: Blacksmith_Blessing
- Rate: 1500
- Amount: 2
- Item: Unbreak_Weap_Box
Rate: 2500
- Item: Unbreak_Def_Box
@@ -16438,6 +16443,7 @@ Body:
- Item: Sagittarius_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: SAGITTAR_DIADEM_SCROLL
SubGroups:
- SubGroup: 1
@@ -16489,6 +16495,7 @@ Body:
- Item: Sagittar_Diadem_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: SAHKKAT_BOX
SubGroups:
- SubGroup: 0
@@ -19249,6 +19256,7 @@ Body:
- Item: Taurus_Crown_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: TAURUS_DIADEM_SCROLL
SubGroups:
- SubGroup: 1
@@ -19293,6 +19301,7 @@ Body:
- Item: Taurus_Diadem_Scroll
Amount: 10
UniqueId: true
+ Stacked: false
- Group: TCG_CARD_SCROLL
SubGroups:
- SubGroup: 0
@@ -20276,8 +20285,6 @@ Body:
Amount: 10
- Item: Golden_Treasure_Box
Amount: 11
- - Item: Red_Booster
- Amount: 10
- Item: Sealed_Pharaoh_Scroll
- Group: UNLIMITED_BOX_II_10
SubGroups:
diff --git a/doc/item_group.txt b/doc/item_group.txt
index 80cfa96390..eb47253fe4 100644
--- a/doc/item_group.txt
+++ b/doc/item_group.txt
@@ -29,7 +29,7 @@ The table below explains which fields are accessed in each.
+===============+=================+====================+================+
| Duration | no | no | YES |
+===============+=================+====================+================+
-| GUID | no | no | YES |
+| UniqueId | no | no | YES |
+===============+=================+====================+================+
| Bound | no | no | YES |
+===============+=================+====================+================+
@@ -151,10 +151,10 @@ Duration: Makes the item a rental item, which will be expire in the given amount
---------------------------------------
-GUID: Makes the given item(s) with Unique ID. Item will be stacked ONLY each group
+UniqueId: Makes the given item(s) with Unique ID. Item will be stacked ONLY each group
when it obtained. Cannot be stacked with same item, even it's stackable item.
Example, there is Box (just call it Apple_Box) that contains 3x Apples with
- GUID = 1. When Apples appear it will stack for each 3 even another 3x Apples
+ UniqueId = 1. When Apples appear it will stack for each 3 even another 3x Apples
are appeared by same box. So it will be filled in inventory as:
3x Apples | 3x Apples | so on... | nx Apples (normal)
diff --git a/doc/yaml/db/item_group_db.yml b/doc/yaml/db/item_group_db.yml
index 74d44ec9ae..0110c9e891 100644
--- a/doc/yaml/db/item_group_db.yml
+++ b/doc/yaml/db/item_group_db.yml
@@ -15,6 +15,7 @@
# Duration Makes the item a rental item which will expire within the given amount in minutes. Not intended for use with stackable items. (Default: 0)
# Announced If player obtains this item it will be broadcasted to the server. (Default: false)
# UniqueId Makes the given item(s) have a Unique ID. (Default: UniqueId from item_db)
+# Stacked Whether stackable items are given stacked or not. (Default: true)
# Named Inscribes the item with the obtainer's name. (Default: false)
# Bound Binds the obtained item. (Default: None)
# Clear Remove the given item. (Optional)
diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp
index f8a12148a5..42911cb4ca 100644
--- a/src/map/itemdb.cpp
+++ b/src/map/itemdb.cpp
@@ -1301,14 +1301,14 @@ static void itemdb_pc_get_itemgroup_sub(map_session_data *sd, bool identify, std
uint16 get_amt = 0;
- if (itemdb_isstackable(data->nameid) && !data->GUID)
+ if (itemdb_isstackable(data->nameid) && data->isStacked)
get_amt = data->amount;
else
get_amt = 1;
tmp.amount = get_amt;
- // Do loop for non-stackable item / stackable item with GUID
+ // Do loop for non-stackable item
for (uint16 i = 0; i < data->amount; i += get_amt) {
char flag = 0;
tmp.unique_id = data->GUID ? pc_generate_unique_id(sd) : 0; // Generate GUID
@@ -1587,8 +1587,11 @@ uint64 ItemGroupDatabase::parseBodyNode(const YAML::Node &node) {
std::string group_name_constant = "IG_" + group_name;
int64 constant;
- if (!script_get_constant(group_name_constant.c_str(), &constant) || constant < IG_BLUEBOX || constant >= IG_MAX) {
- this->invalidWarning(node["Group"], "Invalid group %s.\n", group_name.c_str());
+ if (!script_get_constant(group_name_constant.c_str(), &constant) || constant < IG_BLUEBOX) {
+ if (strncasecmp(group_name.c_str(), "IG_", 3) != 0)
+ this->invalidWarning(node["Group"], "Invalid group %s.\n", group_name.c_str());
+ else
+ this->invalidWarning(node["Group"], "Invalid group %s. Note that 'IG_' is automatically appended to the group name.\n", group_name.c_str());
return 0;
}
@@ -1751,6 +1754,18 @@ uint64 ItemGroupDatabase::parseBodyNode(const YAML::Node &node) {
entry->GUID = item->flag.guid;
}
+ if (this->nodeExists(listit, "Stacked")) {
+ bool isStacked;
+
+ if (!this->asBool(listit, "Stacked", isStacked))
+ continue;
+
+ entry->isStacked = isStacked;
+ } else {
+ if (!entry_exists)
+ entry->isStacked = true;
+ }
+
if (this->nodeExists(listit, "Named")) {
bool named;
diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp
index 99e1bd2e2b..fbed07e35a 100644
--- a/src/map/itemdb.hpp
+++ b/src/map/itemdb.hpp
@@ -835,6 +835,7 @@ struct s_item_group_entry
amount; /// Amount of item will be obtained
bool isAnnounced, /// Broadcast if player get this item
GUID, /// Gives Unique ID for items in each box opened
+ isStacked, /// Whether stackable items are given stacked
isNamed; /// Named the item (if possible)
uint8 bound; /// Makes the item as bound item (according to bound type)
};
diff --git a/src/map/map-server.vcxproj b/src/map/map-server.vcxproj
index c4e0f7d421..fb2fcf87d9 100644
--- a/src/map/map-server.vcxproj
+++ b/src/map/map-server.vcxproj
@@ -305,7 +305,6 @@
-