> For the complete documentation index, see [llms.txt](https://changelog.matrixemulator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://changelog.matrixemulator.com/welcome/server/muserver/data/custom/customjewel.md).

# CustomJewel

<mark style="color:green;">Registers items that function as custom "jewels", applicable to another item to try to add/upgrade an option (with a success chance and a failure effect). Maximum of 15 different jewels. The file has 4 blocks.</mark>

### <mark style="color:yellow;">Block 0 — the jewel and which item it can be used on</mark>

<table data-header-hidden data-search="false"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Column</strong></td><td><strong>Accepted values</strong></td><td><strong>What it is</strong></td></tr><tr><td>Index</td><td>Number from <code>0</code> to <code>14</code></td><td>Identifies this jewel (binds with blocks 1 and 2).</td></tr><tr><td>Item Index</td><td>Number (pre-combined item code)</td><td>Which item, when used (clicked/dragged), acts as this jewel.</td></tr><tr><td>Min Level / Max Level</td><td>Number</td><td>Level range (+how much) of the accepted target item.</td></tr><tr><td>Need Skill</td><td><code>0</code>, <code>1</code> or <code>*</code></td><td>Requires (or not) the target item to already have the Skill option. <code>*</code> = ignores.</td></tr><tr><td>Need Luck</td><td><code>0</code>, <code>1</code> or <code>*</code></td><td>Requires (or not) the target item to already have the Luck option. <code>*</code> = ignores.</td></tr><tr><td>Min JoLife / Max JoLife</td><td>Number, or <code>*</code></td><td>Accepted range of the additional option (%) already present on the target item. <code>*</code> = no requirement.</td></tr><tr><td>Min Excell / Max Excell</td><td>Number, or <code>*</code></td><td>Accepted range of the amount of excellent options already present on the target item. <code>*</code> = no requirement.</td></tr><tr><td>Max Ancient</td><td>Number, or <code>*</code></td><td>Requires the target item to have, at most, this ancient/set level. <code>*</code> = no requirement.</td></tr><tr><td>NeedMin Socket / NeedMax Socket</td><td>Number, or <code>*</code></td><td>Accepted range of the amount of sockets on the target item. <code>*</code> = no requirement.</td></tr><tr><td>Enable Weapon / Armor / Wing / Ring / Pet</td><td><code>0</code> or <code>1</code></td><td>In which item categories this jewel can be used.</td></tr><tr><td>Rate %_AL0 – %_AL3</td><td>Number (%)</td><td>Success chance, by Free/VIP1/VIP2/VIP3 account.</td></tr><tr><td>Sale Price</td><td>Number</td><td>Selling price of the jewel in the shop (if sold by an NPC).</td></tr><tr><td>Model</td><td>Text in quotation marks</td><td>Name of the jewel's model/texture.</td></tr></tbody></table>

### <mark style="color:yellow;">Block 1 — effect upon success</mark>

<table data-header-hidden data-search="false"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Column</strong></td><td><strong>Accepted values</strong></td><td><strong>What it is</strong></td></tr><tr><td>Index</td><td>Number of a jewel from block 0</td><td>Which jewel this effect belongs to.</td></tr><tr><td>Level</td><td>Number</td><td>How much it adds to the level (+how much) of the target item.</td></tr><tr><td>Skill / Luck</td><td><code>0</code> or <code>1</code></td><td>Adds (or not) the Skill/Luck option to the target item.</td></tr><tr><td>Option3</td><td>Number</td><td>How much it adds to the additional option (%) of the target item.</td></tr><tr><td>NewOption</td><td>Number, in bits</td><td>Excellent option(s) added to the target item.</td></tr><tr><td>SetOption</td><td>Number</td><td>Level of ancient/set added.</td></tr><tr><td>SocketOption</td><td>Number</td><td>Amount of sockets added.</td></tr><tr><td>Option380</td><td><code>0</code> or <code>1</code></td><td>Adds (or not) the special "380" option.</td></tr></tbody></table>

### <mark style="color:yellow;">Block 2 — effect upon failure</mark>

<mark style="color:orange;">Same columns as block 1, but applied when the attempt fails (usually to remove something from the item, instead of adding).</mark>

### <mark style="color:yellow;">Block 3 — item conversion when using the jewel</mark>

| **Column** | **Accepted values**             | **What it is**                                                                                                                                         |
| ---------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Index      | Number                          | Identifies the conversion line.                                                                                                                        |
| Old Item   | Number (pre-combined item code) | Source item.                                                                                                                                           |
| New Item   | Number (pre-combined item code) | Item into which the `Old Item` transforms when using this jewel.                                                                                       |
| Option     | `0`, `1` or `2`                 | `0` = resets the item's options upon conversion. `1` = keeps the current options. `2` = keeps the current options and also adds the effect of block 1. |

### <mark style="color:yellow;">Notes</mark>

* The `Rate` in block 0 is the success chance — the effect of block 1 is only applied if the roll succeeds; otherwise, block 2 (failure) is applied.
* The conversion in block 3 only applies to the `Item Index` that matches the `Old Item` configured there — it is not a general rule, it is item-by-item.
* A jewel without a corresponding line in any block (1, 2 or 3) simply does not have that effect.
