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

# 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 engine-level item category checks.

## File Location

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

## Dependencies

| Depends On                      | Purpose                           |
| ------------------------------- | --------------------------------- |
| [Item](/docs/data/item/item.md) | Item definitions by Category/Type |

| Related                                                                 | Purpose                                                                                                                        |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| [JewelOfHarmonyOption](/docs/data/item/jewelofharmonyoption.md)         | Defines the options and bonuses applied by Jewel of Harmony / Jewel of Elevation (separate system; does NOT consult this file) |
| [ItemOption](/docs/data/item/itemoption.md)                             | Related option fields stored on items                                                                                          |
| [Item Option Index Reference](/docs/data/item/optionindex-reference.md) | Reference for the option-index conventions used on items                                                                       |

## How It Works

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

1. Player places exactly one eligible item in the Chaos Machine and chooses "Jewel of Harmony Item Smelt Mix"
2. Server enforces these checks on the item in the box:
   * Must not be a Set item
   * Must not already have a JoH option applied
   * If the item's Category/Type appears in this file, its enhancement level must be at least the Level attribute
   * If the item is NOT listed in this file, it passes the level check automatically (no level restriction)
3. The mix success rate is read from server config (separate rate for normal vs. excellent items)
4. On success, the item is consumed and a Refining Stone is produced:
   * Lower Refining Stone (14/43) if the source item is NOT excellent
   * Higher Refining Stone (14/44) if the source item IS excellent
5. On failure, the Chaos Box is cleared and no stone is produced

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

When players use a Jewel of Harmony to add options to equipment, eligibility is determined by the item's Category directly, not by this file:

* Weapon: Categories 0-4, excluding items 4/7 and 4/15 (ammunition)
* Staff: Category 5
* Armor: Categories 6-11
* Rejected: items already carrying a JoH option, Socket items, Lucky items (Category 7-11 with Type 62-72), Set items (unless `SetItemAcceptHarmonySwitch=1`)
* NO enhancement level requirement is enforced here; items at +0 can receive JoH
* See [JewelOfHarmonyOption](/docs/data/item/jewelofharmonyoption.md) for the option pool and level-based option filtering

## 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**: The Chaos Machine smelt code only enforces three rules on the input item: not a Set item, not already JoH'd, and (if listed in this file) meets the listed Level. There is NO category filter at the smelt step, so in practice eligibility is controlled by which entries you add to this file.
{% endhint %}

{% hint style="info" %}
**Not Listed = No Level Restriction for Smelting**: An item that is not listed in this file still passes the level check and can be smelted at +0. Listing an item here is the ONLY way to impose a minimum enhancement level on smelting it.
{% 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) if the item's Category/Type is listed in this file, the item is enhanced to at least the listed Level; (2) the item is not a Set item; (3) the item does not already have a JoH option applied; (4) exactly one item is in the Chaos Box.
{% 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 used from inventory, this config file is NOT the cause. JoH application eligibility is determined by the item's Category and does not consult this file. Check for: Socket items, Lucky items (Category 7-11, Type 62-72), items that already carry a JoH option, Set items (unless `SetItemAcceptHarmonySwitch=1`), ammunition slots 4/7 and 4/15. See [JewelOfHarmonyOption](/docs/data/item/jewelofharmonyoption.md).
{% 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 %}
