用ABLUA的说话函数写个修复装备的命令
石器时代一直存在装备损坏这一说,到了高版本,装备就会显示耐久度的百分比了,在石器时代SF里总是找NPC很麻烦,为了方便玩家,直接用LUA做成命令,让玩家随时随地可以修复装备。
代码如下:
function CharTalkFunction( charaindex, message, color)
local field = other.getString(message, " ", 1)
if field == "@修复装备" then
--0到8是指装备栏的全部位置
for i =0, 8 do
--获取装备栏的道具索引
local itemindex = char.getItemIndex(charaindex, i)
if itemindex> -1 then
--把最小耐久度修改成最大耐久度的值
item.setInt(itemindex, "最小度", item.getInt(itemindex, "最大度"))
--更新数据
item.UpdataItemOne(charaindex, itemindex)
end
end
char.TalkToCli(charaindex, -1, "身上的装备全部修复完毕!", "黄色")
return 1
end
return 0
end

