ItemStack Configuration
This configuration file defines which items can be stacked in inventory and their maximum stack sizes, with optional item transformation when reaching max stack.
File Location#
Data/Item/ItemStack.xml
Dependencies#
| Depends On | Purpose |
|---|---|
| Item.xml | Item definitions |
| Depended On By | Purpose |
|---|---|
| ItemValue.xml | Uses stack count for price calculation |
How It Works#
- When items are picked up, purchased, or moved into inventory, the server checks ItemStack
- If the item has a matching entry and another stack of the same Index, Level, and SocketOptionBonus already exists, units are merged into that stack
- The stack count shown in inventory grows up to MaxStack
- When the stack reaches exactly MaxStack and a CreateIndex is configured, the merged stack is consumed and a new item of the target type/level is generated in its place
- Stacks can be split manually with the in-game stack-split action (ctrl + right click)
Structure#
New Format (Recommended)#
<Item Type="14" Index="13" Level="*" MaxStack="255"
CreateType="*" CreateIndex="*" Name="Jewel of Bless"/>
Old Format (Backward Compatible)#
<Item Index="7181" MaxStack="255" CreateIndex="*"/>
Attributes#
| Attribute | Type | Description |
|---|---|---|
Type | int | Item category (0-15). New format only |
Index | int | Type-relative index 0-511 (new format), or fully calculated index Type*512+TypeOffset (old format) |
Level | string | * for all levels, or a specific level 0-15. A specific-level entry takes priority over the * entry for the same Index |
MaxStack | int | Maximum stack size. Hard cap is 255 because the runtime count is stored in one byte |
CreateType | string | * for no transformation, or the category of the item created when the stack fills |
CreateIndex | int | Type-relative index of the created item. Only used when CreateType is not * |
CreateLevel | string | * to copy the source stack's level, or a fixed 0-15 level for the created item |
Name | string | Human-readable comment (optional, not parsed) |
Index Calculation (Old Format)#
Index = Type * 512 + TypeOffset
Category Reference#
| Category | Item Type | Stackable |
|---|---|---|
| 0-5 | Weapons (Swords, Axes, Maces, Spears, Bows/Crossbows, Staves) | No, except Bolt (4,7) and Arrow (4,15) |
| 6 | Shields | No |
| 7-11 | Armor (Helm, Armor, Pants, Gloves, Boots) | No |
| 12 | Wings, Jewel of Chaos, Orbs, Scrolls, Fragments | Yes (per-entry) |
| 13 | Rings, Pendants, Quest Items, Map Fragments | Yes (per-entry) |
| 14 | Potions, Jewels (Bless/Soul/Life/Creation), Boxes, Event Items | Yes (per-entry) |
| 15 | Pentagram items, Errtels, Socket Seeds | Yes (per-entry) |
Examples#
<!-- Jewels stack to 255, no transformation -->
<Item Type="14" Index="13" Level="*" MaxStack="255"
CreateType="*" CreateIndex="*" Name="Jewel of Bless"/>
<Item Type="14" Index="14" Level="*" MaxStack="255"
CreateType="*" CreateIndex="*" Name="Jewel of Soul"/>
When CreateType="*", items simply stack without transforming.
<!-- Box of Kundun - different levels are different items -->
<Item Type="14" Index="11" Level="0" MaxStack="20"
CreateType="*" CreateIndex="*" Name="Box of Kundun +1"/>
<Item Type="14" Index="11" Level="1" MaxStack="20"
CreateType="*" CreateIndex="*" Name="Box of Kundun +2"/>
<Item Type="14" Index="11" Level="2" MaxStack="20"
CreateType="*" CreateIndex="*" Name="Box of Kundun +3"/>
Each level stacks separately.
<!-- 5 Mithril Fragments → 1 Mithril -->
<Item Type="12" Index="48" Level="*" MaxStack="5"
CreateType="12" CreateIndex="52" Name="Mithril Fragment"/>
<!-- 5 Symbol of Kundun → 1 Lost Map -->
<Item Type="14" Index="29" Level="*" MaxStack="5"
CreateType="14" CreateIndex="28" Name="Symbol of Kundun"/>
When the player picks up or merges the 5th fragment, the stack is consumed and a single new Mithril (or Lost Map) item is produced.
<!-- Potions stack without transformation -->
<Item Type="14" Index="0" Level="*" MaxStack="255"
CreateType="*" CreateIndex="*" Name="Apple"/>
<Item Type="14" Index="1" Level="*" MaxStack="255"
CreateType="*" CreateIndex="*" Name="Small Healing Potion"/>
When CreateType="*", items simply stack without converting to another item.
<!-- Bolts and Arrows: explicitly exempt from the equipment non-stack rule -->
<Item Type="4" Index="7" Level="*" MaxStack="255" CreateType="*" CreateIndex="*" Name="Bolt" />
<Item Type="4" Index="15" Level="*" MaxStack="255" CreateType="*" CreateIndex="*" Name="Arrow" />
The engine exempts Bolts (Type 4 Index 7) and Arrows (Type 4 Index 15) from the category 0-11 equipment non-stack rule. These DO stack up to 255 in inventory.