The item upgrade jewel system lets a player drag a jewel (item of type 19, index 210 to 240) onto an item in the inventory to change that item into another item, add attributes, or both. For example: upgrade a normal armor set to a high-grade armor, or add Excellent options to a ring. Everything is declared in the XML file, with no client changes needed (jewels 19,210 to 19,219 are already in the client's item list).
Requirements
PluginPlushas been purchased andData\Plugin\Plugin.inihasPluginPlus = 1(see PluginPlus).Enable="1"inData\Plugin\JewelUpgradeSystem.xml. WhenEnable="0"no rule from the file is loaded and the jewel does nothing (the jewel is not consumed).- Jewels 19,210 - 19,240 must exist in
Data\Item\ItemList.xml(and in the client's item list so the name / picture display correctly).
How it works
- The player drags a jewel onto an item in the inventory (worn items are not changed).
- If the item is in
IgnoreItemListor no rule matches: the message "cannot be upgraded with this jewel" is shown, and the jewel is NOT consumed. - The first matching
<Item>rule in file order (under that jewel) is used. If the rule has a result item (RewardCat/RewardIndex): the result item must exist inItemList.xml(otherwise the rule is skipped) and the inventory must have enough free space for the new item's size, otherwise an out-of-space message is shown and the jewel is NOT consumed. - The server rolls 1-100: greater than
Successis a failure. Each attempt (success or failure) consumes 1 jewel. - Success: the old item is deleted, and the new item (keeping the old item's serial, Harmony, additional option and expiry time) is placed in the first free slot of the inventory.
- Each attempt is written to the GameServer log (type
jewel).
Configuration
File: Data\Plugin\JewelUpgradeSystem.xml. Do not write comments inside tags.
JewelUpgradeSystem, IgnoreItemList, Jewel tags
| Key | Value | Default | Meaning |
|---|---|---|---|
JewelUpgradeSystem / Enable | 0 / 1 | 0 | Turn the system off / on. |
IgnoreItemList / Item / Cat, Index | number | 0, 0 | Items that can NEVER be upgraded with jewels (type + index). |
Jewel / Cat | 19 | 0 | Type of the jewel, always 19. |
Jewel / Index | 210 to 240 | 0 | Jewel index. Each jewel should be declared once; if the same jewel is declared again, its rules are added to that jewel. |
Item tag: item matching conditions
Under each jewel there are several <Item> tags (rules). The FIRST matching rule in file order is used. An item can appear in several rules with different conditions.
| Key | Value | Default | Meaning |
|---|---|---|---|
Type | number, or -1 | -1 | The item's Type attribute in ItemList.xml. -1 = ignored. |
KindA | number, or -1 | -1 | The item's KindA attribute in ItemList.xml. -1 = ignored. |
KindB | number, or -1 | -1 | The item's KindB attribute in ItemList.xml. -1 = ignored. |
Cat, Index | number, or -1 | -1 | Type + index of the item. If either is -1 = matches all items. |
MinLevel | 0-15 | 0 | Minimum item level. |
MaxLevel | 0-15 | 15 | Maximum item level. |
MinExcOpt | number | 0 | Minimum number of Excellent lines on the item. |
MaxExcOpt | number | 9 | Maximum number of Excellent lines on the item. |
SetItem | -1 / 0 / 1 | -1 | -1 = not checked; 0 = the item must NOT be a set (Ancient) item; 1 = the item MUST be a set item. |
Item tag: result
| Key | Value | Default | Meaning |
|---|---|---|---|
Success | 0-100 | 0 | Success rate as n/100 (100 = always succeeds). Missing attribute = 0 = always fails. |
RewardCat, RewardIndex | number, or -1 | -1 | The result item. If either is -1 = the result is the item itself (only attributes change). If the result item is not in ItemList.xml, the rule is skipped. |
RewardLevel | 0-15 | 0 | Level of the result item (values outside the range are forced into 0-15). For Errtel, this is the rank. |
RewardItemDurability | number, -1, 0 | 0 | 0 = calculated automatically from the result item; -1 = 255; another number = that durability. |
ResetExcOptions | 0 / 1 | 0 | 1 = remove the item's Excellent lines before adding RewardExc; 0 = keep them. Excellent lines are always removed when the result item is of a different type (KindA), or is a wing made from a non-wing item. |
FailPenalty | -1, 0, 1-15 | -1 | Penalty on failure (the jewel is always lost): -1 = nothing; 0 = the item is destroyed; 1-15 = for an item with a level from 1 to 15: if the level ≤ the value it goes back to +0, if the level is greater it drops by a random amount from 0 to (value - 1) levels. |
RewardSetItem | -1, 0, 1-4 | 0 | Set (Ancient) option of the result item, only when that item has a set: -1 = random; 0 = keep the old item's set option; 1-4 = set option tier 1 to 4 (with a stat option of +5 or +10). |
RewardExc | number | 0 | Excellent lines of the result item (only ONE of the cases below applies, in this order): greater than 0 = add that many NEW Excellent lines (4th-level wings: level lines; wings: wing Excellent lines); 0 = remove the Excellent lines (socket items stay unchanged); -1 = keep unchanged; another value (for example -2) = use RewardSocket. |
RewardSocket | number, -2 | 0 | Only used when RewardExc is not -1, 0 or greater than 0. Declaring a non-zero RewardSocket together with RewardExc greater than 0 is wrong: the rule is skipped at load time (the log reports an error). Socket items: number of sockets added (at most 5 sockets), -2 = up to 5 sockets. Pentagram: number of slots opened (1-5), -2 = a random number of slots 1-5. Errtel: creates a new Errtel option (rank = RewardLevel). |
RewardElement (or ElementalItem) | -1, 0-5 | -1 | Element of the result item (Pentagram and Errtel, used together with RewardSocket): 0 = keep the existing element (an item with no element receives a random element); 1 Fire, 2 Water, 3 Earth, 4 Wind, 5 Darkness; -1 = random. |
Exc | string, for example 3;5 | empty | Optional, only for Legendary weapons / shields: the Legendary option lines of the result item, separated by ; (at most 2 numbers); -2 = 1-2 random lines; -3;N = N random lines (at most 2). If declared and the result item is Legendary, it is used before RewardExc. |
-2) picks 1-5 slots with equal probability.Configuration example
Excerpt from the sample file (the sample file declares the same two rules for jewels 19,210 to 19,219):
<JewelUpgradeSystem Enable="1">
<IgnoreItemList>
<Item Cat="0" Index="41" />
<Item Cat="4" Index="7" />
</IgnoreItemList>
<Jewel Cat="19" Index="210">
<Item Type="-1" KindA="-1" KindB="-1" Cat="0" Index="13" MinLevel="0" MaxLevel="8" MinExcOpt="0" MaxExcOpt="9" SetItem="0" Success="10" ResetExcOptions="0" FailPenalty="0" RewardCat="13" RewardIndex="8" RewardLevel="9" RewardItemDurability="-1" RewardSetItem="1" RewardExc="2" RewardSocket="0" RewardElement="0" />
<Item Type="-1" KindA="-1" KindB="-1" Cat="-1" Index="-1" MinLevel="10" MaxLevel="15" MinExcOpt="0" MaxExcOpt="9" SetItem="0" Success="100" ResetExcOptions="0" FailPenalty="-1" RewardCat="13" RewardIndex="9" RewardLevel="9" RewardItemDurability="-1" RewardSetItem="1" RewardExc="2" RewardSocket="0" RewardElement="0" />
</Jewel>
</JewelUpgradeSystem>
Rule 1: item 0,13 at level 0-8, not a set item: 10% success, on failure the item is destroyed, on success it becomes item 13,8 at level 9, with a tier 1 set option and 2 extra Excellent lines. Rule 2: any item at level 10-15 that is not a set item: always succeeds, becoming item 13,9 at level 9 with the same result. Adjust these numbers to the items on your server.
Messages (Lang)
The green messages sent to the player are in the group Group Type="45" (Jewel Upgrade) of the Data\Lang\*.xml files:
| ID | Content (English) | When |
|---|---|---|
| 1 | Jewel upgrade succeeded. | Success |
| 2 | Jewel upgrade failed. | Failure, no penalty |
| 3 | Jewel upgrade failed. The item was destroyed. | Failure, FailPenalty="0" |
| 4 | Jewel upgrade failed. The item level was reduced by %d. | Failure, the item level is reduced |
| 5 | This item cannot be upgraded with this jewel. | Item is in IgnoreItemList or no rule matches |
| 6 | Not enough space in the inventory for the upgraded item. | The inventory lacks space for the new item |
Notes
- Jewels 19,230 - 19,240 also fall within the range of the per-item option jewels of Per-item option jewels (ExtendedOptionSystem) (that system's sample file uses 19,230 to 19,286). When a jewel is used, the server evaluates item upgrade jewels first: a jewel declared in
JewelUpgradeSystem.xmlbelongs to this system; only a jewel not declared here passes on to the option jewel system. Do not declare the same jewel in both files. - After an upgrade, the item's own options (by serial, from Per-item option jewels (ExtendedOptionSystem)) are resent to the client.
Reloading the configuration
Press Reload plugin in the GameServer control panel (no restart needed). The log writes the line Loaded JewelUpgradeSystem.xml: ... jewel(s), ... rule(s), ... ignored item(s), Enable, Shop Plugin PluginPlus.