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

  1. Add the commands to Data\Commands\LuaCommands.xml, inside <CommandSystem>:
    <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"/>
    The exchange command names are arbitrary, but the ID must match the Command value in Config.lua.
  2. Remove the -- in front of LoadModule("CustomItemExchange\\CustomItemExchange") in Main.lua.
  3. Edit Includes\CustomItemExchange\Config.lua.
  4. Click Reload LuaAPI.

No SQL needed. The module attaches OnCommandManager.

Configuration (Config.lua)

KeyValueMeaning
Enabletrue / falseTurns the module on / off.
ItemstableEach 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)tableCoins 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.
EquipmentCommandnumberID of the equipment exchange command (default 3010).
Equipmenttable of rulesEach 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.
TexttableThe 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 } },
}