# SocketItemType

This configuration file defines which items can have sockets and the maximum number of sockets each item type can have.

## File Location

```
GameServer/Data/Item/SocketItemType.xml
```

## Dependencies

| Depends On | Purpose                          |
| ---------- | -------------------------------- |
| Item.xml   | Item definitions by Section/Type |

| Depended On By       | Purpose                                               |
| -------------------- | ----------------------------------------------------- |
| ItemOptionRate.xml   | SocketOptions section determines socket count on drop |
| SocketItemOption.xml | Provides bonuses for socket seeds                     |

## How It Works

1. When an item drops with socket options (via ItemOptionRate SocketOptions section)
2. Server checks if item is listed in SocketItemType
3. If listed, the item can have 1 to MaxSocket sockets
4. Each socket can hold one seed sphere for bonuses

## Structure

```xml
<SocketItemTypeList>
    <Item Section="0" Type="26" MaxSocket="3"/>
    <Item Section="0" Type="37" MaxSocket="5"/>
</SocketItemTypeList>
```

## Attributes

| Attribute   | Type | Range | Description                     |
| ----------- | ---- | ----- | ------------------------------- |
| `Section`   | int  | 0-14  | Item category                   |
| `Type`      | int  | 0-511 | Item type index within category |
| `MaxSocket` | int  | 1-5   | Maximum number of sockets       |

### Item Index Calculation

```
ItemIndex = Section * 512 + Type
```

### Section Reference

| Section | Category           |
| ------- | ------------------ |
| 0       | Swords             |
| 1       | Axes               |
| 2       | Maces/Scepters     |
| 3       | Spears             |
| 4       | Bows/Crossbows     |
| 5       | Staffs             |
| 6       | Shields            |
| 7       | Helms              |
| 8       | Armor              |
| 9       | Pants              |
| 10      | Gloves             |
| 11      | Boots              |
| 12      | Wings/Orbs/Spheres |
| 13      | Pets/Rings/Misc    |
| 14      | Jewels/Misc        |
| 15      | Scrolls            |

{% hint style="info" %}
Socket items are primarily weapons (0-5) and armor pieces (6-11). Sections 12-15 (wings, pets, jewels, scrolls) typically do not support sockets in standard configurations.
{% endhint %}

## Examples

{% tabs %}
{% tab title="Weapon" %}

```xml
<!-- Socket Swords -->
<Item Section="0" Type="26" MaxSocket="3"/>  <!-- Flameberge -->
<Item Section="0" Type="27" MaxSocket="3"/>  <!-- Sword Breaker -->
<Item Section="0" Type="28" MaxSocket="3"/>  <!-- Rune Bastard Sword -->

<!-- Socket Staffs -->
<Item Section="5" Type="30" MaxSocket="3"/>
<Item Section="5" Type="31" MaxSocket="3"/>
<Item Section="5" Type="37" MaxSocket="5"/>
```

{% hint style="info" %}
Some entries in SocketItemType.xml (like Section 0 Types 36/37) may not correspond to items in the default Item.xml. These are placeholders for custom server items or future additions.
{% endhint %}
{% endtab %}

{% tab title="Armor Set" %}

```xml
<!-- Socket Armor Pieces (all MaxSocket=3) -->
<Item Section="7" Type="45" MaxSocket="3"/>  <!-- Helm -->
<Item Section="8" Type="45" MaxSocket="3"/>  <!-- Armor -->
<Item Section="9" Type="45" MaxSocket="3"/>  <!-- Pants -->
<Item Section="10" Type="45" MaxSocket="3"/> <!-- Gloves -->
<Item Section="11" Type="45" MaxSocket="3"/> <!-- Boots -->
```

{% endtab %}

{% tab title="Shields" %}

```xml
<!-- Socket Shields -->
<Item Section="6" Type="17" MaxSocket="3"/>
<Item Section="6" Type="18" MaxSocket="3"/>
<Item Section="6" Type="19" MaxSocket="3"/>
```

{% endtab %}
{% endtabs %}

## Important Behavior

{% hint style="info" %}
**Socket Count Determination**: The actual socket count on a dropped item is determined by ItemOptionRate.xml SocketOptions section. This file only defines the MAXIMUM possible.
{% endhint %}

{% hint style="info" %}
**Empty vs No Socket**: An item with sockets will have socket slots (0xFE = empty slot). Items not in this list cannot have any sockets (0xFF = no socket).
{% endhint %}

{% hint style="warning" %}
**Socket Count Capping**: When sockets are generated via MakeSocketOption function, the actual socket count is `min(requested_count, MaxSocket)`. If ItemOptionRate requests 5 sockets but MaxSocket is 3, the item will only get 3 sockets.
{% endhint %}

## Common Issues

{% hint style="warning" %}
**Item Not Getting Sockets**: Verify both: (1) item is listed here with MaxSocket > 0, AND (2) ItemOptionRate SocketOptions has non-zero rates for the appropriate index.
{% endhint %}

{% hint style="danger" %}
**Wrong Section/Type**: Double-check values match Item.xml exactly. Mismatched values mean the item won't be recognized as socketable.
{% endhint %}
