> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/data/item/itemdrop.md).

# ItemDrop

This configuration file defines specific items that can drop from monsters with full control over their options. This is a **separate system** from normal monster drops (MonsterItem.txt).

## File Location

```
Data/Item/ItemDrop.xml
```

## Dependencies

| Depends On                                                        | Purpose                                                  |
| ----------------------------------------------------------------- | -------------------------------------------------------- |
| [ItemOptionRate.xml](/docs/data/item/itemoptionrate.md)           | Option indices reference rate tables here                |
| [ExcellentOptionRate.xml](/docs/data/item/excellentoptionrate.md) | Determines which excellent bits apply to each item range |
| [Item.xml](/docs/data/item/item.md)                               | Item definitions that can be dropped                     |
| [ItemOption.xml](/docs/data/item/itemoption.md)                   | Stat effects of the rolled options                       |

{% hint style="info" %}
This system is independent of the `ExcItemDropRate` attribute in [MapManager.xml](/docs/data/mapmanager.md). MapManager's rate only affects normal MonsterItem drops, not entries defined here.
{% endhint %}

## How It Works

When a monster dies, the server:

1. **Filters by map** - RuleDrop MapNumber (-1 = all maps)
2. **Filters by monster** - MonsterIndex (-1 = any monster)
3. **Filters by monster level** - MonsterMinLevel/MonsterMaxLevel
4. **Rolls against DropRate** - Chance out of 1,000,000
5. **Selects item** - If multiple items pass, weighted random by inverse DropRate
6. **Resolves options** - Uses ItemOptionRate.xml for each option type
7. **Drops item** - Creates the item on the ground

{% hint style="info" %}
**Weighted Selection**: When multiple items pass all filters, items with LOWER DropRate have HIGHER weight. This means rare items are more likely to be selected when the roll succeeds.
{% endhint %}

## Structure

```xml
<ItemDrop>
    <RuleDrop MapNumber="-1">
        <Item Cat="14" Index="13" Level="0"
              LevelOption="-1" SkillOption="-1" LuckOption="-1"
              JoLOption="-1" ExcOption="-1" SetOption="-1" SocketOption="-1"
              Duration="0" MonsterIndex="-1"
              MonsterMinLevel="25" MonsterMaxLevel="-1"
              DropRate="100" />
    </RuleDrop>
</ItemDrop>
```

## Attributes

### RuleDrop Container

| Attribute   | Type    | Values       | Description                      |
| ----------- | ------- | ------------ | -------------------------------- |
| `MapNumber` | int/`*` | -1 or map ID | Map filter (-1 or \* = all maps) |

### Item Attributes

#### Item Identification

| Attribute | Type | Description                                 |
| --------- | ---- | ------------------------------------------- |
| `Cat`     | int  | Item category (0-15)                        |
| `Index`   | int  | Item index within category (0-511)          |
| `Level`   | int  | Item level (0-15), used when LevelOption=-1 |

{% hint style="info" %}
**Item Index Calculation**: Internal index = `Cat * 512 + Index`. For example, Jewel of Bless (Cat=14, Index=13) = 14 \* 512 + 13 = 7181.
{% endhint %}

#### Option Indices

These reference sections in [ItemOptionRate.xml](/docs/data/item/itemoptionrate.md). Use -1 to disable that option type.

| Attribute      | Type | Description                                      |
| -------------- | ---- | ------------------------------------------------ |
| `LevelOption`  | int  | Level rate table index (-1 = use Level directly) |
| `SkillOption`  | int  | Skill option rate table index                    |
| `LuckOption`   | int  | Luck option rate table index                     |
| `JoLOption`    | int  | JoL (additional damage/defense) rate table index |
| `ExcOption`    | int  | Excellent options count rate table index         |
| `SetOption`    | int  | Set tier rate table index                        |
| `SocketOption` | int  | Socket count rate table index                    |

#### Common Option Index Values

| Value | Effect                                              |
| ----- | --------------------------------------------------- |
| -1    | Disabled - no option or use default value           |
| 0     | Common rates (from Index 0 in ItemOptionRate)       |
| 1     | Excellent rates (typically guaranteed/high quality) |
| 2     | Set rates                                           |
| 12-15 | Guaranteed 1-4 excellent options (for ExcOption)    |

{% hint style="warning" %}
**Skill Option Note**: If SkillOption resolves to "has skill" but the item doesn't support skills (SkillIndex=0 in Item.xml), the skill option is automatically removed.
{% endhint %}

#### Drop Filters

| Attribute          | Type    | Default  | Description                                                                                                                                                                                                     |
| ------------------ | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Duration`         | int     | 0        | Item duration in seconds (0 = permanent)                                                                                                                                                                        |
| `MonsterIndex`     | int/`*` | -1       | Monster class ID (-1 or \* = any monster)                                                                                                                                                                       |
| `MonsterMinLevel`  | int/`*` | -1       | Minimum monster level (-1 or \* = no minimum)                                                                                                                                                                   |
| `MonsterMaxLevel`  | int/`*` | -1       | Maximum monster level (-1 or \* = no maximum)                                                                                                                                                                   |
| `DropRate`         | int/`*` | Required | Chance out of 1,000,000. `-1` or `*` skips the rate roll (always passes) and contributes the smallest possible weight (1) to the weighted selection, so the entry is only picked when no weighted entry passes. |
| `DropRateBonusAL1` | int     | 0        | Percent bonus to `DropRate` when the looter's `AccountLevel` is VIP tier 1. Final rate is capped at 1,000,000. Ignored when `DropRate` is `-1`/`*`.                                                             |
| `DropRateBonusAL2` | int     | 0        | Percent bonus to `DropRate` for VIP tier 2. Same rules as `DropRateBonusAL1`.                                                                                                                                   |
| `DropRateBonusAL3` | int     | 0        | Percent bonus to `DropRate` for VIP tier 3. Same rules as `DropRateBonusAL1`.                                                                                                                                   |

#### Stack Quantity (stackable items only)

A single drop can spawn a stack (for example 2-5 Jewels) instead of one item. All attributes are optional; omitting them all drops a single item (the original behavior). These apply only to items flagged stackable in [ItemStack.xml](/docs/data/item/itemstack.md). On a non-stackable item they are ignored at load time and the item drops singly.

| Attribute                 | Type | Range          | Default         | Effect                                                                                                                                                                                                                      |
| ------------------------- | ---- | -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `QuantityMin`             | int  | 1+             | 1               | Stack floor. Values below 1 are raised to 1.                                                                                                                                                                                |
| `QuantityMax`             | int  | `QuantityMin`+ | = `QuantityMin` | Stack ceiling. The dropped count is a random roll between `QuantityMin` and `QuantityMax` inclusive. For a fixed amount set both equal (or set only `QuantityMin`). Values below `QuantityMin` are raised to `QuantityMin`. |
| `QuantityPerMonsterLevel` | int  | 0+             | 0               | Flat amount added per monster level above `MonsterMinLevel`. Adds `value * (monsterLevel - MonsterMinLevel)`, never negative. When `MonsterMinLevel` is `-1` the base is treated as 0.                                      |
| `QuantityBonusAL1`        | int  | 0+             | 0               | Flat amount added when the looter's `AccountLevel` is VIP tier 1. 0 = no bonus.                                                                                                                                             |
| `QuantityBonusAL2`        | int  | 0+             | 0               | Flat amount added for VIP tier 2.                                                                                                                                                                                           |
| `QuantityBonusAL3`        | int  | 0+             | 0               | Flat amount added for VIP tier 3.                                                                                                                                                                                           |

The final stack is `roll(QuantityMin..QuantityMax) + QuantityPerMonsterLevel * max(0, monsterLevel - MonsterMinLevel) + QuantityBonusAL[looter tier]`, then clamped to the item's max stack size in [ItemStack.xml](/docs/data/item/itemstack.md) and to 255.

## DropRate Scale

| DropRate | Percentage | Example Use                |
| -------- | ---------- | -------------------------- |
| 1000000  | 100%       | Testing / guaranteed drops |
| 100000   | 10%        | Very common drops          |
| 10000    | 1%         | Common drops               |
| 1000     | 0.1%       | Uncommon drops             |
| 100      | 0.01%      | Rare drops                 |
| 10       | 0.001%     | Very rare drops            |

{% hint style="info" %}
**Crywolf Penalty**: When Crywolf is in the Balgass-occupied state and the penalty is active, the following jewels roll an extra check that can nullify the drop: Jewel of Chaos, Jewel of Bless, Jewel of Soul, Jewel of Life, Jewel of Creation, and Jewel of Guardian. The penalty percentage is configured on the Crywolf side.
{% endhint %}

## Examples

{% tabs %}
{% tab title="Jewel Drops" %}

```xml
<!-- Jewel of Bless from monsters level 25+ -->
<Item Cat="14" Index="13" Level="0"
      LevelOption="-1" SkillOption="-1" LuckOption="-1"
      JoLOption="-1" ExcOption="-1" SetOption="-1" SocketOption="-1"
      Duration="0" MonsterIndex="-1"
      MonsterMinLevel="25" MonsterMaxLevel="-1"
      DropRate="100" />

<!-- Jewel of Chaos from level 12+ -->
<Item Cat="12" Index="15" Level="0"
      LevelOption="-1" SkillOption="-1" LuckOption="-1"
      JoLOption="-1" ExcOption="-1" SetOption="-1" SocketOption="-1"
      Duration="0" MonsterIndex="-1"
      MonsterMinLevel="12" MonsterMaxLevel="-1"
      DropRate="100" />
```

All option indices are -1 because jewels don't have options.
{% endtab %}

{% tab title="Level-Scaled Items" %}

```xml
<!-- Scroll of Archangel - level scales with monster level -->
<Item Cat="13" Index="16" Level="1" ...
      MonsterMinLevel="-1" MonsterMaxLevel="32" DropRate="100" />
<Item Cat="13" Index="16" Level="2" ...
      MonsterMinLevel="33" MonsterMaxLevel="45" DropRate="100" />
<Item Cat="13" Index="16" Level="3" ...
      MonsterMinLevel="46" MonsterMaxLevel="57" DropRate="100" />
<Item Cat="13" Index="16" Level="4" ...
      MonsterMinLevel="58" MonsterMaxLevel="68" DropRate="100" />
```

Different item levels drop based on monster level ranges.
{% endtab %}

{% tab title="Boss-Specific Drop" %}

```xml
<!-- Invitation to Santa Village - only from monster 466 -->
<Item Cat="13" Index="66" Level="0"
      LevelOption="-1" SkillOption="-1" LuckOption="-1"
      JoLOption="-1" ExcOption="-1" SetOption="-1" SocketOption="-1"
      Duration="0" MonsterIndex="466"
      MonsterMinLevel="-1" MonsterMaxLevel="-1"
      DropRate="100" />
```

Using MonsterIndex to restrict drops to a specific monster.
{% endtab %}

{% tab title="Excellent Equipment" %}

```xml
<!-- Excellent sword with randomized options -->
<Item Cat="0" Index="5" Level="0"
      LevelOption="1" SkillOption="1" LuckOption="1"
      JoLOption="1" ExcOption="1" SetOption="-1" SocketOption="-1"
      Duration="0" MonsterIndex="-1"
      MonsterMinLevel="50" MonsterMaxLevel="-1"
      DropRate="50" />
```

* LevelOption=1: Uses excellent level rates (guaranteed +0)
* SkillOption=1: Guaranteed skill
* LuckOption=1: Low luck chance (1% for luck)
* JoLOption=1: No JoL bonus (guaranteed 0)
* ExcOption=1: 75% one exc, 25% two exc
  {% endtab %}

{% tab title="Map-Specific" %}

```xml
<!-- Drops only in Icarus (map 10) -->
<RuleDrop MapNumber="10">
    <Item Cat="12" Index="0" Level="0"
          LevelOption="0" SkillOption="0" LuckOption="0"
          JoLOption="0" ExcOption="-1" SetOption="-1" SocketOption="-1"
          Duration="0" MonsterIndex="-1"
          MonsterMinLevel="-1" MonsterMaxLevel="-1"
          DropRate="500" />
</RuleDrop>
```

Using RuleDrop MapNumber to restrict drops to specific maps.
{% endtab %}
{% endtabs %}

## Important Behavior

{% hint style="info" %}
**Separate from MonsterItem.txt**: This system runs independently from the normal monster drop system. Items configured here are additional drop chances, not replacements.
{% endhint %}

{% hint style="info" %}
**Multiple Items Passing**: If multiple items pass all filters and their DropRate rolls, ONE is randomly selected. Items with lower DropRate have higher selection weight (inverse weighting).
{% endhint %}

{% hint style="warning" %}
**Option Index -1 vs 0**: Using -1 disables that option type entirely. Using 0 uses the "Common" rate table from ItemOptionRate.xml, which typically has low chances for good options.
{% endhint %}

## Common Issues

{% hint style="warning" %}
**Item Not Dropping**: Check all filters - MapNumber, MonsterIndex, MonsterMinLevel, MonsterMaxLevel must ALL match. A single mismatch prevents the drop.
{% endhint %}

{% hint style="warning" %}
**Wrong Item Level**: If you set Level="5" but LevelOption="0", the level will be randomized using Common rates (mostly +0). Use LevelOption="-1" to use the Level value directly.
{% endhint %}

{% hint style="danger" %}
**Duration Confusion**: Duration is in SECONDS, not minutes. A value of 3600 = 1 hour. Use 0 for permanent items.
{% endhint %}

{% hint style="warning" %}
**Excellent Options Not Appearing**: ExcOption controls the COUNT of options. The actual option types are determined by ExcellentOptionRate.xml based on item index ranges.
{% endhint %}
