The per-item option jewel system: the player drags a jewel onto an item in the inventory to add or upgrade one option on that very item (for example: freeze enemies, increase double damage, increase EXP...). Each jewel corresponds to ONE option; each use of a jewel is one attempt to raise the option to the next level, with its own success rate and a penalty type on failure. The jewel is always consumed once attempted. The item tooltip shows these extra option lines.

Requirements

  • PluginPlus has been purchased and Data\Plugin\Plugin.ini has PluginPlus = 1 (see PluginPlus).
  • Enable="1" in Data\Plugin\ExtendedOptionSystem.xml. Turning the system off does not remove options already on items; it only stops applying them.
  • Every jewel in <JewelMapping> must first be added to Data\Item\ItemList.xml and the client's item list (the sample file uses jewels of type 19, indexes 230 to 286).
  • The game database must have the table item_ext_option: run the SQL file shipped with the update once. Options are stored by item serial (columns SerialServer, Serial, OptionIndex, OptionId, Level). Items without a serial cannot receive options. Stackable items cannot receive them either.
  • The client needs a new Main.dll to show the option lines on the tooltip (the server sends them through packet 82 B3). Option names on the tooltip come from the ItemOptionSystem section in Data\Lang\*.xml.

How it works

  1. The player drags a jewel onto an item in the inventory.
  2. The server checks whether the item can receive an option (system-wide deny rules, jewel-specific deny rules, items with a serial...). If it cannot: Lang message 0, and the jewel is kept.
  3. The server takes the item's current option level (none = no level yet), picks the next <Option> row and rolls 1-100: less than or equal to SuccessRate is a success. Already at the highest level: Lang message 0, and the jewel is kept. The item already has the maximum number of options and the jewel would add a new option: Lang message 1, and the jewel is kept.
  4. Success: the option rises to the new level (Lang message 2 with the level). Failure: the FailType of that row is applied; the jewel is always lost.

The <Option> rows of a jewel are sorted by Value ascending when loaded; the Level label is only for reference. Each jewel reads at most 10 <Option> rows (10 levels); the 11th row onward is dropped.

Configuration

File: Data\Plugin\ExtendedOptionSystem.xml. Do not write comments inside tags. Lists (DenyKindA...) are separated by the ; character.

ExtendedOptionSystem tag

KeyValueDefaultMeaning
Enable0 / 10Turn the system off / on.
ReduceEffectDurationseconds, ≥ 15Effect duration of options 0 and 1 (reduce the opponent's max HP / attack speed). Also applies to options 0 and 1 granted by ItemOptionSystem_Exc.xml while this system is on.
ReduceEffectMaxRate0-99 (%)50Highest % that options 0 and 1 can reach when stacked from all items.

GlobalRestrictions tag

Applied once for the whole system, with higher priority than the deny rules of each individual jewel. Leave empty = nothing denied.

KeyValueDefaultMeaning
DenyKindAlist of numbersemptyThe KindA values of items that are forbidden from receiving any option.
DenyKindBlist of numbersemptyThe KindB values of items that are forbidden from receiving any option.
MaxOptionCount1-1010Maximum number of options on one item (general fallback value).

OptionCountLimit / Item tag

A list of optional rules that override MaxOptionCount for specific item groups.

KeyValueDefaultMeaning
KindAnumber, or -1-1The item's KindA that must match; -1 = all items.
KindBnumber, or -1-1The item's KindB that must match; -1 = all items.
Typenumber, or -1-1The type (Cat in ItemList.xml) that must match; -1 = all types.
MaxOptionCount1-10the MaxOptionCount value of GlobalRestrictionsThe limit when the rule matches.

When several rules match, the most specific rule (the one with the most fields other than -1) wins; on a tie, the earlier rule wins. A rule whose three fields are all -1 is never considered a match. If no rule matches, the MaxOptionCount of GlobalRestrictions is used.

JewelMapping / Jewel tag

KeyValueDefaultMeaning
Cat, Indexnumber0, 0Type + index of the jewel (in ItemList.xml).
OptionIdnumber 0-560The option number that the jewel grants / upgrades (see the list table below). A value out of range: the jewel is skipped and the log reports an error. One OptionId should be granted by only one jewel; if duplicated, the saved option uses the first jewel.
Enable0 / 11Turn this jewel off / on individually.
BuffIndexnumber0Buff ID that the option applies; 0 = no buff.
BuffEffectTypenumber0Effect type of the buff; 0 = none.

A jewel with no <Option> row is skipped and the log reports an error.

Restrictions tag (child of Jewel, optional)

Decides which items may receive options from this jewel.

KeyValueDefaultMeaning
AllowExcellent0 / 11Allow use on Excellent items.
AllowSocket0 / 11Allow use on socket items.
AllowAncient0 / 11Allow use on set (Ancient) items.
AllowMastery0 / 11Allow use on Mastery items.
AllowLegendary0 / 11Allow use on Legendary items.
DenyKindAlist of numbersemptyThe KindA values of items that are forbidden from receiving options from this jewel.
DenyKindBlist of numbersemptyThe KindB values of items that are forbidden from receiving options from this jewel.

Option tag (each row is one level)

KeyValueDefaultMeaning
Levelnumber0Only a label; the level order follows Value ascending.
Valuereal number0The option value at this level. It must be strictly INCREASING between rows, otherwise duplicate / lower rows can never be reached. The highest value is the cap.
SuccessRate0-1000Rate (%) of reaching this level.
FailType0-30On failure: 0 = the jewel is lost, the item is unchanged; 1 = the option is removed from the item; 2 = the item is destroyed (the option in the DB is also removed); 3 = drops to the previous level (at the first level the option is removed). If the item does not yet have this option (trying level 1), then 1 and 3 only lose the jewel.
OptionProbabilityreal number0% chance that the option triggers, shown on the tooltip as "(Chance %d%%)"; 0 = only show the value.
BuffValuenumber0Buff value at this level; 0 = off.
BuffProbabilitynumber0Buff rate at this level; 0 = off.
BuffDurationnumber0Buff duration at this level; 0 = off.

Option number list (OptionId)

Shares the list and effects with Data\Plugin\ItemOptionSystem_Exc.xml (see Fixed options (ItemOptionSystem_Exc)).

OptionIdEffect
0Reduce the target's max HP by Value % for ReduceEffectDuration seconds
1Reduce the target's attack speed by Value % for ReduceEffectDuration seconds
2Freeze the enemy for 5 seconds
3Stun the enemy for 3 seconds
4Auto Combo (Value is the % chance)
5Double damage
6Increase attack power
7Increase total HP
8Increase defense
9Reduce damage taken
10Increase AG
11Kill a monster in one hit
12Kill a player in one hit (PvP)
13Damage reflection
14Effect for 5 seconds, negates poison reflection
15When hit, fully restore HP
16When hit (PvP), become invisible for 3 seconds
17When hit, the attacker dies instantly (PvP)
18When hit, the target loses 10% of current HP (PvP)
19When hit, a chance to reflect the total damage (PvP)
20Excellent damage resistance
21Critical damage resistance
22Double damage resistance
23Increase the chance of resisting true damage (True Damage)
24Increase Combo damage
25Absorb PvP damage
26Increase the chance of Excellent damage
27Increase the chance of Critical damage
28Increase the chance of true damage (True Damage)
29Increase the chance of dealing triple damage
30Increase the chance of resisting triple damage
31Invincible for Value seconds when hit by a player or monster, no re-roll while in effect
32Blind the enemy
33Increase all stats
34Ignore SD
35Increase skill damage
36Paralyze the enemy for Value seconds (OptionProbability is the % chance, 0 uses the character class's paralysis rate)
37Increase hit rate by Value points (PvM and PvP)
38Increase SD resistance (1-100)
39Stun resistance (1-100)
40Reduce Combo damage
41Increase Triple Damage
42Increase elemental damage
43Increase elemental defense
46Stun (4th skill tree)
48Complete invincibility
49Increase Chaos mix rate +Value
50Increase EXP +Value
51Increase item drop rate +Value
52Hunt Point bonus +Value
53Max SD bonus
54Attack speed bonus
55Elemental critical rate bonus
56PvE damage bonus

Numbers 44, 45, 47 have no effect in the file's list. Numbers 36, 44, 45, 47 have no jewel in the sample file. [TO VERIFY: the effect description of each number is taken from the comments in the XML file; it needs to be cross-checked against the code in ItemOptionSystem.cpp if you want to describe each value precisely (unit: % or points)]

Configuration example

<ExtendedOptionSystem Enable="1" ReduceEffectDuration="5" ReduceEffectMaxRate="50">
	<GlobalRestrictions DenyKindA="0;9;12;" DenyKindB="56;" MaxOptionCount="10" />
	<OptionCountLimit>
		<Item KindA="5" KindB="-1" Type="-1" MaxOptionCount="5" />
	</OptionCountLimit>
	<JewelMapping>
		<Jewel Cat="19" Index="232" OptionId="2" BuffIndex="0" BuffEffectType="0" Enable="1">
			<Restrictions AllowExcellent="1" AllowSocket="1" AllowAncient="1" AllowMastery="1" AllowLegendary="1" DenyKindA="" DenyKindB="" />
			<Option Level="1" Value="1" SuccessRate="90" FailType="3" OptionProbability="5" BuffValue="0" BuffProbability="0" BuffDuration="0" />
			<Option Level="2" Value="2" SuccessRate="70" FailType="3" OptionProbability="10" BuffValue="0" BuffProbability="0" BuffDuration="0" />
			<Option Level="3" Value="3" SuccessRate="50" FailType="3" OptionProbability="15" BuffValue="0" BuffProbability="0" BuffDuration="0" />
		</Jewel>
	</JewelMapping>
</ExtendedOptionSystem>

Jewel 19,232 grants option 2 (freeze): level 1 succeeds 90%, level 2 is 70%, level 3 is 50%; on failure the option drops one level.

Included sample file

The sample file declares 53 jewels: type 19, indexes 230 to 286 (except 266, 274, 275, 277), index = 230 + OptionId, each jewel with 1 to 5 levels (about 267 <Option> rows). Among them, the option 0 jewel has a buff (BuffIndex="1"). The sample configuration forbids KindA 0, 9, 12 and KindB 56 from receiving options, limits each item to at most 10 options, and items with KindA="5" to only 5 options. Adjust SuccessRate and Value to suit your server.

Messages (Lang)

The ExtendedOption section in Data\Lang\*.xml:

IDContent (English)When
0This jewel cannot be used on this item.The item cannot receive the option, or the option is already at the highest level
1This item cannot receive more options.The item already has the maximum number of options
2Option upgrade succeeded. Option level: %d.Success (%d = new level, the first row is 1)
3Option upgrade failed. The jewel was lost.Failure, FailType 0
4Option upgrade failed. The option was removed from the item.Failure, the option is removed
5Option upgrade failed. The item was destroyed.Failure, FailType 2
6Option upgrade failed. Option level dropped to %d.Failure, level lowered

Notes

  • Jewels 19,230 - 19,240 also fall within the range of Item upgrade jewels (JewelUpgradeSystem). The server evaluates item upgrade jewels first; only jewels not declared there are handled by this system. Do not declare the same jewel in both files.
  • When an item is moved to the warehouse, traded or moved to another slot, the server resends the option list so the tooltip is always correct. The options of items in the warehouse are loaded when the warehouse is opened.

Reloading the configuration

Press Reload plugin in the GameServer control panel: the file is reloaded and the server resends the item options to everyone online, and also recalculates character stats.