# JewelOfHarmonyType

This configuration file defines which items can be used in the **Chaos Machine "Jewel of Harmony Item Smelt Mix"** to create Refining Stones. It sets minimum item level requirements for items to be eligible for smelting. This config does NOT affect applying Jewel of Harmony to items - that is controlled by item category checks in the source code.

## File Location

```
GameServer/Data/Item/JewelOfHarmonyType.xml
```

## Dependencies

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

| Depended On By           | Purpose                                     |
| ------------------------ | ------------------------------------------- |
| JewelOfHarmonyOption.xml | Provides option bonuses when JoH is applied |

## How It Works

### Chaos Machine Smelt Mix (What This Config Controls)

1. Player places an item in Chaos Machine and attempts "Jewel of Harmony Item Smelt Mix"
2. Server checks if item is in JewelOfHarmonyType.xml
3. If item is listed, verifies item level (e.g., +4) meets the Level requirement
4. If item is NOT listed but has eligible category, no level restriction applies
5. If eligible, breaks down the item into a Refining Stone:
   * Lower Refining Stone (14/43) for normal items
   * Higher Refining Stone (14/44) for excellent items
6. Refining Stones can be used in other JoH-related mixes

### Applying Jewel of Harmony (NOT Controlled by This Config)

When players use a Jewel of Harmony item to add options to equipment, eligibility is determined by:

* Item category (Cat 0-5 weapons/staves, Cat 6-11 armor)
* Exclusions: Bolts (4/7), Arrows (4/15), Socket items, Lucky items, Set items (unless enabled)
* **NO level requirement check** - items at +0 can receive JoH
* This process does NOT use JewelOfHarmonyType.xml

## Structure

```xml
<JewelOfHarmonyTypeList>
    <Item Category="0" Type="0" Level="4"/>
</JewelOfHarmonyTypeList>
```

## Attributes

| Attribute  | Type | Description                                                                      |
| ---------- | ---- | -------------------------------------------------------------------------------- |
| `Category` | int  | Item category (0-14)                                                             |
| `Type`     | int  | Item type index within category                                                  |
| `Level`    | int  | Minimum item level (+0 to +15) required to smelt this item into a Refining Stone |

### Item Index Calculation

```
ItemIndex = Category * 512 + Type
```

### Category Reference

| Category | Item Type      |
| -------- | -------------- |
| 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          |

## Examples

{% tabs %}
{% tab title="Standard +4 Requirement" %}

```xml
<!-- Swords must be +4 or higher to smelt -->
<Item Category="0" Type="0" Level="4"/>  <!-- Kris -->
<Item Category="0" Type="1" Level="4"/>  <!-- Short Sword -->
<Item Category="0" Type="2" Level="4"/>  <!-- Rapier -->

<!-- Axes must be +4 or higher to smelt -->
<Item Category="1" Type="0" Level="4"/>  <!-- Small Axe -->
<Item Category="1" Type="1" Level="4"/>  <!-- Hand Axe -->

<!-- Helms must be +4 or higher to smelt -->
<Item Category="7" Type="0" Level="4"/>  <!-- Bronze Helm -->
<Item Category="7" Type="2" Level="4"/>  <!-- Pad Helm -->
```

Most items require +4 enhancement before they can be smelted into Refining Stones.
{% endtab %}

{% tab title="Higher Level Requirement" %}

```xml
<!-- Require +7 for high-tier items -->
<Item Category="0" Type="22" Level="7"/>  <!-- Rune Blade -->
<Item Category="5" Type="10" Level="7"/>  <!-- Grand Soul Staff -->
```

High-tier items may require higher enhancement levels before smelting. This prevents players from easily farming Refining Stones from powerful items without significant enhancement investment.
{% endtab %}

{% tab title="No Restriction" %}
If an item is NOT listed in this file but has an eligible category, it can be smelted at any level (+0 and up):

```xml
<!-- If Gladius (0/3) is not in the file, it can be smelted at +0 -->
```

This allows admins to control which items require enhancement investment before smelting.
{% endtab %}
{% endtabs %}

## Important Behavior

{% hint style="danger" %}
**Common Misconception**: This config does NOT control applying Jewel of Harmony to items. It only controls which items can be **smelted in Chaos Machine** to create Refining Stones. The two processes are completely separate.
{% endhint %}

{% hint style="info" %}
**Level Check for Smelting**: When smelting an item in Chaos Machine, the item's current level (+0 to +15) must be >= the Level specified here. A Level="4" requirement means the item must be at least +4 enhanced to be smelted.
{% endhint %}

{% hint style="info" %}
**Smelt Mix Eligibility**: Items eligible for smelting are determined by category (Cat 0-4 weapons excluding bolts/arrows, Cat 5 staves, Cat 6-11 armor). The item must also not be a set item and must not already have JoH applied.
{% endhint %}

{% hint style="info" %}
**Not Listed = No Level Restriction for Smelting**: Items not in this file can still be smelted if their category is eligible. This file only adds level requirements for specific items. For example, if a weapon isn't listed, it can be smelted at +0.
{% endhint %}

{% hint style="warning" %}
**Refining Stone Quality**: The Chaos Machine creates Lower Refining Stone (14/43) from normal items and Higher Refining Stone (14/44) from excellent items. The quality depends on the source item, not this config.
{% endhint %}

## Common Issues

{% hint style="warning" %}
**Item Cannot Be Smelted in Chaos Machine**: Verify: (1) item category is eligible (Cat 0-5 weapons/staves or 6-11 armor), (2) if listed here, item is enhanced to required Level, (3) item is not a set item, (4) item doesn't already have JoH applied, (5) not bolts (4/7) or arrows (4/15).
{% endhint %}

{% hint style="warning" %}
**Wrong Category/Type**: Values must exactly match Item.xml. Use ItemIndex = Category \* 512 + Type to verify the correct values.
{% endhint %}

{% hint style="info" %}
**Confusion About JoH Application**: If items won't accept Jewel of Harmony when using it from inventory, this config file is NOT the cause. JoH application eligibility is hardcoded by category and does not check this file. Check for: socket items, lucky items (Cat 7-11 Type 62-72), items that already have JoH, set items (unless SetItemAcceptHarmonySwitch=1).
{% endhint %}

{% hint style="warning" %}
**Chaos Mix vs JoH Application**: This config controls the Chaos Machine "Smelt Mix" that creates Refining Stones. It does NOT control using Jewel of Harmony items to add options to equipment. Those are two completely different game systems.
{% endhint %}
