Effect

Each equipped item that reaches a certain level (+level) adds stats to the character. Example: Bloodangel Sword +13 adds 200 damage, and at +15 it adds 500 damage (replacing the +13 amount). The stats of all equipment are added together, and recalculated when the character enters the game and each time equipment is equipped, unequipped or moved.

How to enable

  1. Remove the -- in front of LoadModule("ItemOptionExpand\\ItemOptionExpand") in Main.lua.
  2. Edit Includes\ItemOptionExpand\Config.lua.
  3. Press Reload LuaAPI.

No SQL is needed. The module attaches OnCharacterEntry, OnItemEquip, OnItemUnEquip, OnItemMove. Stats are put into the shared stat table (OptionBonus), so other modules can add stats at the same time.

Configuration (Config.lua, table ItemOptionExpandConfig)

KeyValueMeaning
Enabletrue / falseEnable / disable the module.
ShowMessagetrue / falseTells the player which stats are in effect when they change.
Itemstable of rowsOne row per item and level.

The fields in one row of Items:

FieldMeaning
Item = { group, index }The item, according to Data\Item\ItemList.xml.
LevelThe minimum item level for this row.
ClassOptional: applies only to this character class (the CLASS_* constants); -1 or left empty = all classes.
the remaining fieldsThe added stats, named according to the character stat table, for example AddDamage, AddDefense, AddMaxHP, AddMaxMP, AddDamageDecrease, AddIgnoreDefenseRate, AddDoubleDamageRate, AddTripleDamageRate, MulDamage, ExpRate.

An item uses the row with the highest Level that does not exceed its level: a +14 item uses the +13 row, a +15 item uses the +15 row.

ItemOptionExpandConfig.Items = {
	{ Item = { 0, 42 }, Level = 13, AddDamage = 200 },
	{ Item = { 0, 42 }, Level = 15, AddDamage = 500 },
	{ Item = { 7, 98 }, Level = 15, AddMaxHP = 500, AddDamage = 20 },
}
The shipped Config.lua file has two rows pointing to item 0-156, which is not in ItemList.xml (marked NOT IN ItemList.xml). Edit the group / stats or delete those two rows.

The names of the added stats (45 names, with the prefix Add / Mul, plus CombatPower and ExpRate) are listed in full under the function Player.GetOptionTable on the reference page "Player: reading basic information".