EventItemBag
Event Item Bag system for defining loot tables with weighted drops, item options, and nested bag references
The EventItemBag system allows you to define reusable loot tables for monsters, events, and special items. When triggered, bags randomly select items from their pool based on configured rates and rules.
File Locations
Bag Registry: GameServer/Data/EventItemBagManager.xml Bag Definitions: GameServer/Data/EventItemBag/###␣-␣Name.xml
The registry maps bag indices to trigger conditions (item type, monster class, or special value), while individual bag XML files define the actual loot tables.
Dependencies
Option rate indices used by extended bag Item entries (Option0-6)
Required for the Count attribute to take effect on stackable items
Used when SetItemDropRate triggers a random set item drop
File Naming Convention
Bag files must follow this exact pattern:
###␣-␣Name.xml###= Three-digit bag index (000-999) matching EventItemBagManager.xml␣= Single space-= Hyphen␣= Single spaceName.xml= Descriptive name with .xml extension
Examples:
000 - Box of Luck.xml012 - Blood Castle 1.xml051 - Game Master Box.xml
EventItemBagManager.xml Structure
Maps bag indices to trigger conditions.
Index
int
Bag index (must match filename ###)
ItemIndex
int or *
Item type that triggers this bag (e.g., 7179 = Box of Luck). Use * for wildcard
ItemLevel
int or *
Item level required to trigger. Use * for any level
MonsterClass
int or *
Monster class that drops this bag. Use * for any monster
SpecialValue
int or *
Event-specific trigger ID. Use * for any value
At least one of ItemIndex+ItemLevel, MonsterClass, or SpecialValue must be specified. The system checks these in order when determining which bag to use.
Trigger Examples
Bag Configuration Formats
Bags support two formats: Simple and Extended.
Simple Format
Randomly selects one item from a flat list. All items have equal probability.
Extended Format
Weighted drops with sections, class requirements, and advanced options.
If both <Drop> entries and <ExtendedBag> exist in the same file, the Extended format takes priority and Simple drops are ignored.
BagConfig Attributes
Common configuration for both formats.
Name
string
-
Bag name (for reference only)
DropZen
int
0
Zen amount to drop if item roll fails
ItemDropRate
int
100
Rate out of 100 for item drop chance. If check fails (random >= rate), drops DropZen instead. 100 = always try item, 0 = always drop zen
ItemDropCount
int
1
Simple format only: Number of drop attempts. Each attempt rolls ItemDropRate for item vs zen. Extended format ignores this and uses BagInfo DropRate instead
SetItemDropRate
int
0
Rate out of 10000 for random set item instead of bag item (e.g., 100 = 1%)
ItemDropType
int
0
0 = Fixed options, 1 = Randomize Skill/Luck and scale Option+3 inversely
Fireworks
int
0
Simple format: 1 = Send fireworks effect after all drops complete, 0 = No effect. Extended format: Ignored, use OptionValue & 1 in DropInfo instead
Simple format: ItemDropCount creates multiple drop attempts. Each attempt rolls ItemDropRate independently - you could get a mix of items and zen. Example: Count=5, Rate=50 might drop 3 items and 2 zen piles.
Extended format: ItemDropCount is IGNORED. Use multiple BagInfo entries if you want multiple drops.
Simple Format: Drop Entries
Flat list of items with equal probability.
Cat
int
Item category (0-15)
ItemIndex
int
Item index within category
MinLevel
int
Minimum item level (0-15)
MaxLevel
int
Maximum item level (0-15). If same as MinLevel, fixed level. If higher, random level in range
Skill
int or *
0 = No skill, 1 = Force skill, * = Use ItemOptionRate default rate logic
Luck
int or *
0 = No luck, 1 = Force luck, * = Use ItemOptionRate default rate logic
Option
int or *
Fixed Option+X level (0-7 or 0-28). 0 = No option, * = Use ItemOptionRate default rate logic
Exc
int or *
Number of excellent options to force generate (0-6), * = Use ItemOptionRate default rate logic
Set
int or *
0 = No set, 1 = Force set generation, * = Use ItemOptionRate default rate logic
Socket
int or *
0 = Use ItemOptionRate index 0 for socket generation, 1-5 = Force N sockets (0xFE placeholders), * = Use ItemOptionRate default rate logic
Count
int
Stack size to assign when the item drops. 0 or omitted = default behavior (stack of 1). Only applies to items registered as stackable in ItemStack.xml. See ItemStack
ItemDropType Behavior
When ItemDropType="1":
Skill: Randomized (50% chance)
Luck: Randomized (50% chance)
Option: Scaled inversely by MaxItemOption. Higher option values become less likely
Exc: If any excellent option is set, forces Skill=1
Use ItemDropType="1" for natural monster drops with variable quality. Use ItemDropType="0" for fixed event rewards.
Extended Format: BagInfo
Defines weighted drop pools with class requirements.
Index
int
BagInfo index (must be unique within file, arbitrary number)
DropRate
int
Rate out of 10000 for this bag to activate (e.g., 10000 = 100%, 5000 = 50%)
IMPORTANT: Each BagInfo is processed independently. If you define multiple BagInfo entries, EACH one rolls its DropRate and can drop items. This allows a single bag to drop multiple items. Most bags should only have ONE BagInfo with DropRate=10000 for guaranteed single drop.
Extended Format: DropInfo
Defines sections within a BagInfo. One section is randomly selected based on weights and class requirements.
Section
int
ItemSection Id to use if selected
SectionRate
int
Weight for weighted random selection. Higher = more likely
Money
int
Zen amount to drop if section is selected but has no valid items
OptionValue
int
Bitflags: Bit 0 (+1) = Send fireworks for this drop, Bit 1 (+2) = Check party member classes instead of just bag opener. Can combine (e.g., 3 = fireworks + party check)
RequireClass
string
Space-separated minimum ChangeUp requirement per class: DW DK FE MG DL SU RF. Value is minimum (ChangeUp+1). 0=block, 1=allow base class, 2=require 1st ChangeUp+, 3=require 2nd ChangeUp+, 4=require 3rd ChangeUp+
Class Requirement Format
Position mapping:
Dark Wizard (0=blocked, 1=base class, 2=1st ChangeUp+, 3=2nd ChangeUp+, 4=3rd ChangeUp+)
Dark Knight
Fairy Elf
Magic Gladiator
Dark Lord
Summoner
Ragefighter
Example: "1 0 0 0 0 0 0" = Only Dark Wizards, base class and above (any ChangeUp) Example: "2 2 0 0 0 0 0" = Only DW/DK with at least 1st class quest completed Example: "3 3 3 0 0 0 0" = Only DW/DK/FE with at least 2nd class quest completed
If multiple DropInfo entries match the player's class, they compete via SectionRate weights. If none match, NO drop occurs (the DropInfo is skipped entirely). The Money attribute is only used if a DropInfo IS selected but its ItemSection is empty or invalid.
Extended Format: ItemSection
Defines item pools referenced by DropInfo sections.
ItemSection attributes:
Id= Section identifier (referenced by DropInfo)
Item attributes:
Index
int
Item index (full index, e.g., 6277 = 12*512 + 277)
Level
int
Base item level (0-15)
Grade
int
Excellent option bitmask to use if Option4 rate generates 0 excellent options (fallback value when no excellent options roll)
Option0
int or *
Level generation rate index. * = Use default. See ItemOptionRate GetItemOption0
Option1
int or *
Skill option rate index. * = Use default. See ItemOptionRate GetItemOption1
Option2
int or *
Luck option rate index. * = Use default. See ItemOptionRate GetItemOption2
Option3
int or *
Option+X rate index. * = Use default. See ItemOptionRate GetItemOption3
Option4
int or *
Excellent option rate index. * = Use default. See ItemOptionRate GetItemOption4
Option5
int or *
Set option rate index. * = Use default. See ItemOptionRate GetItemOption5
Option6
int or *
Socket option rate index. * = Use default. See ItemOptionRate GetItemOption6
Duration
int
Time-limited item duration in seconds. 0 = Permanent. 1209600 = 14 days
Count
int
Stack size to assign when the item drops. 0 or omitted = default behavior (stack of 1). Only applies to items registered as stackable in ItemStack.xml. See ItemStack
Option0-6 reference ItemOptionRate.xml indices, not direct values. Use * to apply default rate logic, or specify an index for custom rates.
Option Index System
All Option0-6 attributes reference rate tables in ItemOptionRate.xml:
Option0: Level adjustment (can increase/decrease base level)
Option1: Skill (0% or 100% chance depending on rate)
Option2: Luck (0% or 100% chance depending on rate)
Option3: Add option level (0-7 or 0-28, rate-based)
Option4: Excellent options (generates 0-6 exc options by rate)
Option5: Set bonus (generates set attribute by rate)
Option6: Socket slots (generates 0-5 sockets by rate)
See ItemOptionRate for rate index definitions.
Stack Count (Count Attribute)
Both simple bag <Drop> rows and extended bag <Item> rows accept a Count attribute that controls the stack size of the dropped item.
Rules
If
Countis omitted or0, the item drops with the default durability/stack value of 1 (unchanged behavior).If
Countis greater than 0 and the item is registered as stackable in ItemStack.xml, the item's stack count is set to that value.If the item is not registered as stackable in ItemStack.xml,
Countis ignored and the item drops with a stack of 1. SettingCounton a non-stackable item has no effect.The stack count is stored in the same byte field as durability. For items where
Count > 1, the durability field carries the count value to the client.Maximum value is 255 (stored as a single byte).
Items that stack (jewels, potions, etc.) are defined in GameServer/Data/Item/ItemStack.xml. You can only use Count to control how many of a stackable item drop at once. Using Count on equipment or other non-stackable items does nothing.
Do not set Count higher than the item's MaxStack value defined in ItemStack.xml. The game does not enforce a cap at drop time, but the client may display or handle values above MaxStack incorrectly.
Examples
Simple bag dropping 10 Jewels of Bless at once:
Extended bag dropping 5 Jewels of Soul at once:
Important Behavior
GetItem vs DropItem (Extended Format)
GetItem (used when bag opens into inventory):
Processes BagInfo entries until ONE succeeds
Returns the first item that passes all checks
Ignores remaining BagInfo entries after first success
Result: Maximum 1 item per bag open
DropItem (used when bag drops items on ground):
Processes ALL BagInfo entries
Each BagInfo that passes DropRate check drops an item
Result: Can drop multiple items if multiple BagInfo entries succeed
This difference allows tiered loot: when opened in inventory you get ONE item, but when dropped on ground (e.g., event reward) you can configure multiple guaranteed drops using multiple BagInfo entries with DropRate=10000.
Selection Algorithm
Simple Format:
Repeat
ItemDropCounttimes:Roll random 0-99, if >=
ItemDropRate, dropDropZenzen and continue to next iterationRoll random 0-9999, if <
SetItemDropRate, drop random set item and continueOtherwise, pick random item from Drop list (equal probability) and drop it
If
Fireworks=1, send fireworks effect after all drops
Extended Format:
For EACH BagInfo (can process multiple BagInfo per bag open):
Roll random 0-9999, if >=
DropRate, skip this BagInfo entirelyBuild list of DropInfo entries matching player class/ChangeUp requirements
If no DropInfo matches class, skip this BagInfo (no drop)
Select one DropInfo by weighted random (
SectionRate)Find ItemSection with matching Section Id
If section doesn't exist or is empty, drop
MoneyzenOtherwise, pick random item from section (equal probability)
Generate item options using Option0-6 rate indices via ItemOptionRate
If
OptionValue & 1, send fireworks effect for this drop
Process continues for all BagInfo entries (can drop multiple items if multiple BagInfo pass their DropRate)
Class Requirement Checking
OptionValue & 2 = 0: Check only the player opening the bag
OptionValue & 2 = 2: Check all party members. If any party member matches, that DropInfo is eligible
This allows party-wide class rewards where any qualifying member triggers the drop.
Nested Bags
To reference another bag from a drop, add a <Drop> entry pointing to an item that has its own bag definition:
If item 14/13 has a bag definition in EventItemBagManager.xml, opening it triggers that bag's logic.
This creates tiered rewards: outer box drops inner box, which drops final items. Useful for progressive reward systems.
Examples
Fixed rewards with equal probability.
Result: Always drops Jewel of Bless. No randomness.
Random item quality using ItemDropType="1".
Result: Randomly picks one item. Skill/Luck are randomized, Option is inversely scaled (higher values rarer), Exc forces Skill=1.
Different items based on character class.
Result: Dark Wizards get item 6277, Dark Knights get 6278. Other classes get nothing (Money=0).
Different probabilities for reward tiers using SectionRate weights.
Result: ONE item per open. 70% chance of common reward (section 1), 25% rare with fireworks (section 2), 5% epic with fireworks (section 3). The SectionRate values create weighted random selection: 7000/(7000+2500+500) = 70% for section 1.
Dropping a bundle of stackable items using the Count attribute.
Simple bag example - drops 10 Jewels of Bless per open:
Extended bag example - drops 5 Jewels of Soul from an event reward:
Result: Drops a single item slot containing 5 Jewels of Soul. The item must be registered as stackable in ItemStack.xml (Cat 14 / Index 14 = Jewel of Soul). Without a matching ItemStack entry, Count is ignored and 1 jewel drops instead.
Common Issues
Bag doesn't trigger: Check EventItemBagManager.xml. Verify Index matches filename, and at least one trigger condition (ItemIndex+Level, MonsterClass, or SpecialValue) is set correctly.
Class-specific section not working: RequireClass values are minimum (ChangeUp+1) requirements. Use 1 for base class (ChangeUp 0), 2 for 1st ChangeUp or higher, 3 for 2nd ChangeUp or higher, 4 for 3rd ChangeUp. Using 0 blocks that class entirely.
Items have wrong options: Option0-6 are indices into ItemOptionRate.xml, not direct values. Using 0 means "use rate index 0", not "no option". Use * for default behavior.
Extended bag ignored: If both <Drop> and <ExtendedBag> exist, only ExtendedBag is used. Remove <Drop> entries or move them to a separate bag file.
Count attribute not working: Count only applies to items registered in ItemStack.xml. If the item has no entry in ItemStack.xml, or if its entry covers non-stackable categories (0-11), Count is silently ignored and the item drops as a single unit. Verify the item appears in GameServer/Data/Item/ItemStack.xml with a MaxStack greater than 1.
Filename mismatch: Bag files must exactly match ###␣-␣Name.xml pattern with correct index. File 001-Box.xml or 1 - Box.xml will NOT load. Must be 001 - Box.xml.
Last updated