作用

玩家通过聊天命令将物品兑换为 coin:

  • /bless 50:兑换 50 个 Jewel of Bless(每种可堆叠物品对应一条命令)。
  • /exchange:兑换背包中符合某条装备规则的所有物品。

每件物品可得的 coin 数量取决于账号的 VIP 等级。系统先扣除物品,再发放 coin,因此如果扣除物品失败就不会发放 coin。已穿戴的物品以及有使用期限的物品永远不会被兑换。

启用方法

  1. 将命令添加到 Data\Commands\LuaCommands.xml 的 <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"/>
    兑换命令的名称可以随意,但 ID 必须与 Config.lua 中的 Command 值一致。
  2. 去掉 Main.lua 中 LoadModule("CustomItemExchange\\CustomItemExchange") 前面的 --。
  3. 修改 Includes\CustomItemExchange\Config.lua。
  4. 点击 重新加载 LuaAPI。

无需 SQL。模块挂接 OnCommandManager。

配置(Config.lua)

键值含义
Enabletrue / false开启 / 关闭模块。
Items表每一行是一种可堆叠物品:Command(LuaCommands.xml 中的命令 ID)、Item = { group, index }(依据 Data\Item\ItemList.xml)、Name(向玩家显示的名称)、Coin(COIN_WCOIN、COIN_GOBLIN_POINT 或 COIN_RUUD)、Rate、Enable(可选;false = 关闭该行)。
Rate(每行中)表每件物品按 VIP 等级可得的 coin 数量,例如 { [-1] = 6, [1] = 10, [2] = 16 }。-1 = 非 VIP。表中没有的 VIP 等级使用 -1 的值。
EquipmentCommand数字装备兑换命令的 ID(默认 3010)。
Equipment规则表每件装备使用第一条匹配的规则。字段:Item(不填 = 所有物品;带 Item 的规则优先判断)、MinLevel、MaxLevel、Skill(0/1)、Luck(0/1)、ExcCount(Excellent 属性条数)、Ancient(0/1)、Coin、Rate。
Text表各条通知文字(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 } },
}