> 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

Defines set bonuses for piece count and full set completion

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="136" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus2 OptionIndex1="134" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus3 OptionIndex1="103" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus4 OptionIndex1="131" OptionValue1="5" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus5 OptionIndex1="83" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
        <PieceBonus6 OptionIndex1="137" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
        <FullSetBonus OptionIndex1="84" OptionValue1="5" OptionIndex2="92" OptionValue2="5"
                      OptionIndex3="136" 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

Set bonuses draw from the **same option pool as per-item options** - the values listed in [OptionIndex Reference](/docs/data/item/optionindex-reference.md) (80-161). Anything the server can apply to an item it can also apply as a set bonus, including PvP damage/defense, Max SD, SD recovery, experience rate, damage reflect/reduction and attack/wizardry speed (option 97). There is no movement-speed option in the shared pool - movement speed cannot be granted as a set bonus.

Display text for each option comes from [ItemOptionNames.xml](/docs/data/item/itemoptionnames.md) Type 0.

Commonly used ids for sets:

| OptionIndex                 | Effect                                                            |
| --------------------------- | ----------------------------------------------------------------- |
| 136 / 137 / 138 / 139 / 140 | Strength / Agility / Vitality / Energy / Command                  |
| 128 / 129                   | Min / Max physical damage                                         |
| 80                          | Physical damage (min and max)                                     |
| 96                          | +% wizardry damage                                                |
| 130                         | +% attack success rate                                            |
| 83                          | Defense                                                           |
| 119 / 120                   | Max HP / Max MP                                                   |
| 103 / 131                   | Max AG / AG recovery                                              |
| 84 / 132                    | Critical damage rate / critical damage                            |
| 92 / 133                    | Excellent damage rate / excellent damage                          |
| 134                         | Skill damage                                                      |
| 116 / 102                   | Double damage rate / ignore defense rate                          |
| 141 / 142                   | +% defense with a shield / +% damage with a two-handed weapon     |
| 143-147                     | Damage or defense scaled by a stat (`Stat / value`)               |
| 148-154                     | Ice / Poison / Lightning / Fire / Earth / Wind / Water resistance |

{% hint style="warning" %}
**Stat-scaled options (143-147)**: The bonus is `Stat / value`. OptionValue=10 with 200 STR adds +20 damage. A higher value yields a smaller bonus. OptionValue=0 skips the bonus.
{% endhint %}

{% hint style="danger" %}
**Options 100, 101 and 105** (wing HP / wing MP / wing Command) scale by the *item's* level and have no item to read when applied as a set bonus, so they are ignored here. Use 119, 120 and 140 instead.
{% endhint %}

## Examples

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

```xml
<Set Index="1" Name="Warrior">
    <!-- 2 pieces: +10 STR -->
    <PieceBonus1 OptionIndex1="136" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 3 pieces: +10 Skill Damage -->
    <PieceBonus2 OptionIndex1="134" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 4 pieces: +20 Max AG -->
    <PieceBonus3 OptionIndex1="103" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 5 pieces: +5 AG Recovery -->
    <PieceBonus4 OptionIndex1="131" OptionValue1="5" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 6 pieces: +20 Defense -->
    <PieceBonus5 OptionIndex1="83" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 7 pieces: +10 AGI -->
    <PieceBonus6 OptionIndex1="137" OptionValue1="10" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- Full set: +5% Crit Rate, +5% Exc Rate, +25 STR -->
    <FullSetBonus OptionIndex1="84" OptionValue1="5" OptionIndex2="92" OptionValue2="5"
                  OptionIndex3="136" 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="119" OptionValue1="100" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 3 pieces: +100 MP -->
    <PieceBonus2 OptionIndex1="120" 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="83" 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="134" OptionValue1="20" OptionIndex2="-1" OptionValue2="-1"/>
    <!-- 3 pieces: +10% Double Damage Rate -->
    <PieceBonus2 OptionIndex1="116" 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="142" OptionValue1="30" OptionIndex2="102" OptionValue2="5"
                  OptionIndex3="-1" OptionValue3="-1" OptionIndex4="-1" OptionValue4="-1"
                  OptionIndex5="-1" OptionValue5="-1"/>
</Set>
```

Option 142 (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 141 requires a shield item in the off-hand slot (category 6). Option 142 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 %}
