Tác dụng
Người chơi đổi vật phẩm lấy coin bằng lệnh chat:
/bless 50: đổi 50 Jewel of Bless (mỗi loại vật phẩm xếp chồng có một lệnh)./exchange: đổi mọi vật phẩm trong túi khớp một quy tắc trang bị.
Số coin mỗi vật phẩm phụ thuộc cấp VIP của tài khoản. Hệ thống lấy vật phẩm trước, trả coin sau, nên không trả coin nếu không lấy được vật phẩm. Đồ đang mặc và đồ có hạn sử dụng không bao giờ bị đổi.
Cách bật
- Thêm các lệnh vào
Data\Commands\LuaCommands.xml, bên trong<CommandSystem>:
Tên lệnh đổi tùy ý, nhưng<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"/>IDphải khớp với giá trịCommandtrongConfig.lua. - Bỏ dấu
--trướcLoadModule("CustomItemExchange\\CustomItemExchange")trongMain.lua. - Sửa
Includes\CustomItemExchange\Config.lua. - Bấm Nạp lại LuaAPI.
Không cần SQL. Module gắn OnCommandManager.
Cấu hình (Config.lua)
| Khóa | Giá trị | Ý nghĩa |
|---|---|---|
Enable | true / false | Bật / tắt module. |
Items | bảng | Mỗi dòng là một vật phẩm xếp chồng: Command (ID lệnh trong LuaCommands.xml), Item = { group, index } (theo Data\Item\ItemList.xml), Name (tên hiện cho người chơi), Coin (COIN_WCOIN, COIN_GOBLIN_POINT hoặc COIN_RUUD), Rate, Enable (không bắt buộc; false = tắt dòng này). |
Rate (trong mỗi dòng) | bảng | Số coin trên mỗi vật phẩm theo cấp VIP, ví dụ { [-1] = 6, [1] = 10, [2] = 16 }. -1 = không VIP. Cấp VIP không có trong bảng dùng giá trị của -1. |
EquipmentCommand | số | ID lệnh đổi trang bị (mặc định 3010). |
Equipment | bảng quy tắc | Mỗi trang bị dùng quy tắc đầu tiên khớp. Trường: Item (không ghi = mọi vật phẩm; quy tắc có Item được xét trước), MinLevel, MaxLevel, Skill (0/1), Luck (0/1), ExcCount (số dòng Excellent), Ancient (0/1), Coin, Rate. |
Text | bảng | Các câu thông báo (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 } },
}