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

  • PluginPlus has been purchased and Data\Plugin\Plugin.ini has PluginPlus = 1 (see PluginPlus).
  • Enable="1" in Data\Plugin\JewelUpgradeSystem.xml. When Enable="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

  1. The player drags a jewel onto an item in the inventory (worn items are not changed).
  2. If the item is in IgnoreItemList or no rule matches: the message "cannot be upgraded with this jewel" is shown, and the jewel is NOT consumed.
  3. 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 in ItemList.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.
  4. The server rolls 1-100: greater than Success is a failure. Each attempt (success or failure) consumes 1 jewel.
  5. 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.
  6. 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

KeyValueDefaultMeaning
JewelUpgradeSystem / Enable0 / 10Turn the system off / on.
IgnoreItemList / Item / Cat, Indexnumber0, 0Items that can NEVER be upgraded with jewels (type + index).
Jewel / Cat190Type of the jewel, always 19.
Jewel / Index210 to 2400Jewel 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.

KeyValueDefaultMeaning
Typenumber, or -1-1The item's Type attribute in ItemList.xml. -1 = ignored.
KindAnumber, or -1-1The item's KindA attribute in ItemList.xml. -1 = ignored.
KindBnumber, or -1-1The item's KindB attribute in ItemList.xml. -1 = ignored.
Cat, Indexnumber, or -1-1Type + index of the item. If either is -1 = matches all items.
MinLevel0-150Minimum item level.
MaxLevel0-1515Maximum item level.
MinExcOptnumber0Minimum number of Excellent lines on the item.
MaxExcOptnumber9Maximum 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

KeyValueDefaultMeaning
Success0-1000Success rate as n/100 (100 = always succeeds). Missing attribute = 0 = always fails.
RewardCat, RewardIndexnumber, or -1-1The 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.
RewardLevel0-150Level of the result item (values outside the range are forced into 0-15). For Errtel, this is the rank.
RewardItemDurabilitynumber, -1, 000 = calculated automatically from the result item; -1 = 255; another number = that durability.
ResetExcOptions0 / 101 = 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-1Penalty 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-40Set (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).
RewardExcnumber0Excellent 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.
RewardSocketnumber, -20Only 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-1Element 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.
Excstring, for example 3;5emptyOptional, 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.
Difference: TSWMU has no separate upgrade-limit table per item; a random Pentagram slot count (-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:

IDContent (English)When
1Jewel upgrade succeeded.Success
2Jewel upgrade failed.Failure, no penalty
3Jewel upgrade failed. The item was destroyed.Failure, FailPenalty="0"
4Jewel upgrade failed. The item level was reduced by %d.Failure, the item level is reduced
5This item cannot be upgraded with this jewel.Item is in IgnoreItemList or no rule matches
6Not 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.xml belongs 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.