> 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/setitemoption.md).

# SetItemOption

This configuration file defines the bonuses granted by set items based on how many pieces of the set are equipped.

## File Location

```
Data/Item/SetItemOption.xml
```

## Dependencies

| Depends On                                        | Purpose                              |
| ------------------------------------------------- | ------------------------------------ |
| [SetItemType.xml](/docs/data/item/setitemtype.md) | Maps items to set IDs (OptionIndex)  |
| [Item.xml](/docs/data/item/item.md)               | Item categories and slot definitions |

## How It Works

1. Player equips set items
2. Server counts pieces that share the same active set ID across all worn slots
3. For N equipped pieces, applies bonuses from PieceBonus1 through PieceBonus(N-1) cumulatively
4. When N-1 equals the count of PieceBonus entries that carry a valid option, FullSetBonus is also applied

{% hint style="info" %}
**Piece Count Logic**: PieceBonus1 activates at 2 pieces, PieceBonus2 at 3 pieces, and so on. The bonus number is one less than the piece count.
{% endhint %}

## Structure

```xml
<SetItemOptionList>
    <Set Index="1" Name="Warrior">
        <PieceBonus1 OptionIndex1="0" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus2 OptionIndex1="19" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus3 OptionIndex1="13" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus4 OptionIndex1="14" OptionValue1="5" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus5 OptionIndex1="10" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus6 OptionIndex1="1" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
        <FullSetBonus OptionIndex1="15" OptionValue1="5" OptionIndex2="17" OptionValue2="5"
                      OptionIndex3="0" OptionValue3="25" OptionIndex4="-1" OptionValue4="-1"
                      OptionIndex5="-1" OptionValue5="-1"/>
    </Set>
</SetItemOptionList>
```

## Attributes

### Set Element

| Attribute | Type   | Description                                                                     |
| --------- | ------ | ------------------------------------------------------------------------------- |
| `Index`   | int    | Set ID (1-254, referenced by [SetItemType.xml](/docs/data/item/setitemtype.md)) |
| `Name`    | string | Set name (used for display and logs, up to 31 characters)                       |

### PieceBonus1-6

Each `PieceBonus` node holds up to two option entries. Missing attributes default to -1.

| Attribute      | Type | Description                                          |
| -------------- | ---- | ---------------------------------------------------- |
| `OptionIndex1` | int  | First bonus type (-1 = none, see Option Types below) |
| `OptionValue1` | int  | First bonus value                                    |
| `OptionIndex2` | int  | Second bonus type (-1 = none)                        |
| `OptionValue2` | int  | Second bonus value                                   |

### FullSetBonus

Single node with up to five option entries, applied once when the full set is worn.

| Attribute                       | Type | Description             |
| ------------------------------- | ---- | ----------------------- |
| `OptionIndex1` - `OptionIndex5` | int  | Bonus types (-1 = none) |
| `OptionValue1` - `OptionValue5` | int  | Bonus values            |

## Option Types

This enum is separate from the one used by [ItemOption.xml](/docs/data/item/itemoption.md); see [OptionIndex Reference](/docs/data/item/optionindex-reference.md) for that list.

| Index | Name                              | Effect                                                                  |
| ----- | --------------------------------- | ----------------------------------------------------------------------- |
| 0     | Add Strength                      | +value to bonus Strength                                                |
| 1     | Add Dexterity                     | +value to bonus Agility                                                 |
| 2     | Add Energy                        | +value to bonus Energy                                                  |
| 3     | Add Vitality                      | +value to bonus Vitality                                                |
| 4     | Add Leadership                    | +value to bonus Command                                                 |
| 5     | Add Min Physical Damage           | +value to both-hand minimum physical damage                             |
| 6     | Add Max Physical Damage           | +value to both-hand maximum physical damage                             |
| 7     | Multiply Magic Damage             | +value% of current magic min and max damage                             |
| 8     | Add Physical Damage               | +value to both-hand min AND max physical damage                         |
| 9     | Multiply Attack Success Rate      | +value% of current attack success rate                                  |
| 10    | Add Defense                       | +value to defense                                                       |
| 11    | Add Max Life                      | +value to bonus HP                                                      |
| 12    | Add Max Mana                      | +value to bonus MP                                                      |
| 13    | Add Max BP                        | +value to bonus AG                                                      |
| 14    | Add BP Recovery                   | +value to AG recovery per tick                                          |
| 15    | Add Critical Damage Rate          | +value% critical rate                                                   |
| 16    | Add Critical Damage               | +value flat critical damage                                             |
| 17    | Add Excellent Damage Rate         | +value% excellent rate                                                  |
| 18    | Add Excellent Damage              | +value flat excellent damage                                            |
| 19    | Add Skill Damage                  | +value flat damage on skill attacks                                     |
| 20    | Add Double Damage Rate            | +value% double damage chance                                            |
| 21    | Add Ignore Defense Rate           | +value% ignore defense                                                  |
| 22    | Multiply Shield Defense           | +value% of current defense when a shield is in the off-hand             |
| 23    | Multiply Two-Hand Physical Damage | +value% of current physical damage when a two-handed weapon is equipped |

### Conditional Options (Division-Based)

These apply the bonus as `Stat / value`, added to the target damage or defense figure on both hands where applicable. When OptionValue is 0 the bonus is skipped instead of dividing by zero.

| Index | Name                             | Effect                                                        |
| ----- | -------------------------------- | ------------------------------------------------------------- |
| 24    | Add Physical Damage by Strength  | +(Strength / value) to both-hand physical min and max damage  |
| 25    | Add Physical Damage by Dexterity | +(Dexterity / value) to both-hand physical min and max damage |
| 26    | Add Defense by Dexterity         | +(Dexterity / value) to defense                               |
| 27    | Add Defense by Vitality          | +(Vitality / value) to defense                                |
| 28    | Add Magic Damage by Energy       | +(Energy / value) to magic min and max damage                 |

### Elemental Resistance

| Index | Name                     | Effect                      |
| ----- | ------------------------ | --------------------------- |
| 29    | Add Ice Resistance       | +value ice resistance       |
| 30    | Add Poison Resistance    | +value poison resistance    |
| 31    | Add Lightning Resistance | +value lightning resistance |
| 32    | Add Fire Resistance      | +value fire resistance      |
| 33    | Add Earth Resistance     | +value earth resistance     |
| 34    | Add Wind Resistance      | +value wind resistance      |
| 35    | Add Water Resistance     | +value water resistance     |

{% hint style="warning" %}
**Division Options (24-28)**: The bonus is `Stat / value`. OptionValue=10 with 200 STR adds +20 damage. A higher value yields a smaller bonus.
{% endhint %}

## Examples

{% tabs %}
{% tab title="Warrior Set" %}

```xml
<Set Index="1" Name="Warrior">
    <!-- 2 pieces: +10 STR -->
    <PieceBonus1 OptionIndex1="0" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 3 pieces: +10 Skill Damage -->
    <PieceBonus2 OptionIndex1="19" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 4 pieces: +20 Max AG -->
    <PieceBonus3 OptionIndex1="13" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 5 pieces: +5 AG Recovery -->
    <PieceBonus4 OptionIndex1="14" OptionValue1="5" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 6 pieces: +20 Defense -->
    <PieceBonus5 OptionIndex1="10" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 7 pieces: +10 AGI -->
    <PieceBonus6 OptionIndex1="1" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- Full set: +5% Crit Rate, +5% Exc Rate, +25 STR -->
    <FullSetBonus OptionIndex1="15" OptionValue1="5" OptionIndex2="17" OptionValue2="5"
                  OptionIndex3="0" OptionValue3="25" OptionIndex4="-1" OptionValue4="-1"
                  OptionIndex5="-1" OptionValue5="-1"/>
</Set>
```

{% endtab %}

{% tab title="Simple 2-Piece Set" %}

```xml
<Set Index="24" Name="Fase">
    <!-- 2 pieces: +100 HP -->
    <PieceBonus1 OptionIndex1="11" OptionValue1="100" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 3 pieces: +100 MP -->
    <PieceBonus2 OptionIndex1="12" OptionValue1="100" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- No more piece bonuses -->
    <PieceBonus3 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus4 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus5 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus6 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- Full set: +100 Defense -->
    <FullSetBonus OptionIndex1="10" OptionValue1="100" OptionIndex2="-1" OptionValue2="-1"
                  OptionIndex3="-1" OptionValue3="-1" OptionIndex4="-1" OptionValue4="-1"
                  OptionIndex5="-1" OptionValue5="-1"/>
</Set>
```

{% endtab %}

{% tab title="Conditional Bonus" %}

```xml
<Set Index="10" Name="Rave">
    <!-- 2 pieces: +20 Skill Damage -->
    <PieceBonus1 OptionIndex1="19" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 3 pieces: +10% Double Damage Rate -->
    <PieceBonus2 OptionIndex1="20" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus3 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus4 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus5 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <PieceBonus6 OptionIndex1="-1" OptionValue1="-1" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- Full set: +30% Two-Hand Damage, +5% Ignore Defense -->
    <FullSetBonus OptionIndex1="23" OptionValue1="30" OptionIndex2="21" OptionValue2="5"
                  OptionIndex3="-1" OptionValue3="-1" OptionIndex4="-1" OptionValue4="-1"
                  OptionIndex5="-1" OptionValue5="-1"/>
</Set>
```

Option 23 (Two-Hand Damage) only applies if player has a two-handed weapon equipped.
{% endtab %}
{% endtabs %}

## Important Behavior

{% hint style="info" %}
**Cumulative Bonuses**: With N equipped pieces the server applies PieceBonus1 through PieceBonus(N-1) in order. With 4 pieces, you get PieceBonus1 + PieceBonus2 + PieceBonus3.
{% endhint %}

{% hint style="info" %}
**Full Set Detection**: The full set bonus triggers when the equipped piece count is one greater than the number of PieceBonus entries that have a valid option. A set that fills PieceBonus1 through PieceBonus6 therefore unlocks its FullSetBonus at 7 equipped pieces. A set that fills only PieceBonus1 and PieceBonus2 unlocks it at 3 equipped pieces.
{% endhint %}

{% hint style="warning" %}
**Shield / Two-Hand Requirements**: Option 22 requires a shield item in the off-hand slot (category 6). Option 23 requires either hand to hold a two-handed weapon. If the requirement is not met the bonus is silently skipped.
{% endhint %}

{% hint style="info" %}
**Full Set Flag**: When the full set condition is met, the server flags the character as wearing a full set. Custom systems and plugins can read this flag to grant extra effects.
{% endhint %}

{% hint style="info" %}
**Duplicate Weapon and Ring Rule**: If both weapon slots (or both ring slots) hold the same item index that also contributes to the same set, only one of the two counts toward the piece total.
{% endhint %}

## Common Issues

{% hint style="warning" %}
**Bonuses Not Stacking**: Remember piece bonuses are cumulative. If 4-piece bonus seems weak, check that you're accounting for 2+3+4 piece bonuses combined.
{% endhint %}

{% hint style="warning" %}
**OptionIndex -1**: Using -1 disables that bonus slot. All unused PieceBonus entries and FullSetBonus slots should use -1.
{% endhint %}

{% hint style="danger" %}
**Invalid Index**: Set Index must be in 1-254 and match references declared in [SetItemType.xml](/docs/data/item/setitemtype.md) OptionIndex values. Entries outside that range are dropped at load time. Index 0 and 255 are reserved ("no set" markers).
{% endhint %}
