ItemStack
Defines which items can stack and their maximum stack sizes
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
GameServer/Data/Item/ItemStack.xmlDependencies
Item.xml
Item definitions
ItemValue.xml
Uses stack count for price calculation
How It Works
When items are picked up or received, server checks ItemStack
If item is stackable, multiple items combine into one slot
Stack count shown in inventory (up to MaxStack)
Optionally, when MaxStack is reached, item transforms to another
Structure
New Format (Recommended)
Old Format (Backward Compatible)
Attributes
Type
int
Item category (0-15) - New format only
Index
int
Item type within category, or calculated index in old format
Level
string
* for all levels, or 0-15 for specific level
MaxStack
int
Maximum stack size (1-255)
CreateType
string
* for no transform, or category of created item
CreateIndex
int
Index of created item (when MaxStack reached)
CreateLevel
string
* for same level, or specific level for created item
Name
string
Human-readable name (optional)
Index Calculation (Old Format)
Category Reference
0-5
Weapons (cannot stack)
6
Shields (cannot stack)
7-11
Armor (cannot stack)
12
Wings, Scrolls, Orbs
13
Rings, Pendants, Quest Items
14
Potions, Jewels, Consumables
15
Scrolls, Books
Examples
When CreateType="*", items simply stack without transforming.
Each level stacks separately.
When player obtains 5th fragment, stack converts to the target item.
When CreateType="*", items simply stack without converting to another item.
WARNING: Despite having MaxStack=255, Bolts and Arrows do NOT actually stack in inventory. Type 4 is in the hardcoded non-stackable range (0-11). These entries only affect shop price calculation logic. Do not expect these to combine into stacks.
Important Behavior
Equipment Cannot Stack: Categories 0-11 (weapons, shields, armor) are hardcoded to never stack regardless of configuration. While Bolts (Type 4, Index 7) and Arrows (Type 4, Index 15) are defined in ItemStack.xml with MaxStack=255, they do NOT actually stack in inventory because Type 4 is in the non-stackable range. The config entries exist only for special shop price calculation logic.
Level Matching: When Level is specified, only items of that exact level stack together. Level="*" allows all levels to stack together.
Price Calculation: ItemValue.xml multiplies Value by stack count for stackable items.
Max Stack 255: Stack count is stored as a single byte, limiting maximum to 255.
Transformation Timing: Item transforms when the MaxStack is reached, not when exceeding it.
Common Issues
Item Not Stacking: Verify it's in category 12-15. Equipment categories (0-11) cannot stack regardless of configuration. Note that Bolts and Arrows (Type 4) are configured with MaxStack values but do NOT actually stack - these entries only affect shop pricing logic.
Wrong Transformation: Check CreateType/CreateIndex calculation. The created item must exist in Item.xml.
Old vs New Format: Don't mix formats in the same entry. Use either Type+Index (new) or single Index (old).
Last updated