item_handler[302] = function(user, item_id)
local list1 = {28318, 28318, 28318} -- 可以回收的装备id
local list2 = {1204, 1031, 1038} -- 回收奖励
local boolx = false
local info = dpx.item.info(user.cptr, game.ItemSpace.INVENTORY, 9)
if info then
for _, _equip in pairs(list1) do
if info.id == _equip then
boolx = true
break
end
end
if boolx then
math.randomseed(tostring(os.time()):reverse():sub(1, 7))
dpx.item.delete(user.cptr, game.ItemSpace.INVENTORY, 9, 1)
local n = math.random(1, #list2)
local count = math.random(1, 10) -- 回收奖励数量随机1-10个
dpx.item.add(user.cptr, list2[n], count)
end
else
dpx.item.add(user.cptr, item_id, 1)
user:SendNotiPacketMessage("请确保装备栏第一格的装备正确", 1)
end
end
© 版权声明
THE END
暂无评论内容