Purpose
Players exchange items for coins using chat commands:
/bless 50: exchange 50 Jewel of Bless (each stackable item type has its own command)./exchange: exchange every item in the inventory that matches an equipment rule.
The number of coins per item depends on the account's VIP level. The system takes the items first and pays the coins afterwards, so no coins are paid if the items cannot be taken. Equipped items and items with an expiry date are never exchanged.
How to enable
- Add the commands to
Data\Commands\LuaCommands.xml, inside<CommandSystem>:
The exchange command names are arbitrary, but the<Command ID="3001" name="bless" Description="Jewel of Bless exchange" Authority="0"/> <Command ID="3002" name="soul" Description="Jewel of Soul exchange" Authority="0"/> <Command ID="3003" name="life" Description="Jewel of Life exchange" Authority="0"/> <Command ID="3004" name="creation" Description="Jewel of Creation exchange" Authority="0"/> <Command ID="3005" name="chaos" Description="Jewel of Chaos exchange" Authority="0"/> <Command ID="3006" name="guardian" Description="Jewel of Guardian exchange" Authority="0"/> <Command ID="3007" name="harmony" Description="Jewel of Harmony exchange" Authority="0"/> <Command ID="3008" name="greaterstone" Description="Greater Spirit Stone exchange" Authority="0"/> <Command ID="3009" name="topstone" Description="Top Grade Spirit Stone exchange" Authority="0"/> <Command ID="3010" name="exchange" Description="Equipment exchange" Authority="0"/>IDmust match theCommandvalue inConfig.lua. - Remove the
--in front ofLoadModule("CustomItemExchange\\CustomItemExchange")inMain.lua. - Edit
Includes\CustomItemExchange\Config.lua. - Click Reload LuaAPI.
No SQL needed. The module attaches OnCommandManager.
Configuration (Config.lua)
| Key | Value | Meaning |
|---|---|---|
Enable | true / false | Turns the module on / off. |
Items | table | Each row is one stackable item: Command (command ID in LuaCommands.xml), Item = { group, index } (per Data\Item\ItemList.xml), Name (name shown to the player), Coin (COIN_WCOIN, COIN_GOBLIN_POINT or COIN_RUUD), Rate, Enable (optional; false = turns this row off). |
Rate (in each row) | table | Coins per item by VIP level, for example { [-1] = 6, [1] = 10, [2] = 16 }. -1 = no VIP. A VIP level that is not in the table uses the value of -1. |
EquipmentCommand | number | ID of the equipment exchange command (default 3010). |
Equipment | table of rules | Each piece of equipment uses the first rule that matches. Fields: Item (omitted = any item; rules with Item are checked first), MinLevel, MaxLevel, Skill (0/1), Luck (0/1), ExcCount (number of Excellent options), Ancient (0/1), Coin, Rate. |
Text | table | The notice messages (Title, Done, NotEnough, Usage, Busy, EquipTitle, EquipDone, EquipNothing). |
CustomItemExchangeConfig.Items = {
{ Command = 3001, Item = { 14, 13 }, Name = "Jewel of Bless", Coin = COIN_RUUD,
Rate = { [-1] = 6, [1] = 10, [2] = 16, [3] = 20, [4] = 30 } },
}