stoneage8.5/服务器端lua文件/ablua/item/itemMax.lua

27 lines
980 B
Lua
Raw Normal View History

2020-06-22 17:49:02 +08:00
function useitemmax(itemindex, charaindex, toindex, haveitemindex)
local data = other.atoi(item.getChar(itemindex, "<EFBFBD>ֶ<EFBFBD>"))
if (char.getInt(charaindex,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬")~=2 and data == 3)
or (char.getInt(charaindex,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬")~=0 and data == 2) then
char.TalkToCli(charaindex, -1,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD>ɫ")
return
end
if char.getInt(charaindex,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬") == 2 then
char.setInt(charaindex,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬",6);
char.DelItem(charaindex, haveitemindex)
char.TalkToCli(charaindex, -1,"<EFBFBD><EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", "<EFBFBD><EFBFBD>ɫ")
char.UpCahrData(charaindex,"p");
elseif char.getInt(charaindex,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬") == 6 then
char.TalkToCli(charaindex, -1,"<EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", "<EFBFBD><EFBFBD>ɫ")
else
char.DelItem(charaindex, haveitemindex)
char.setInt(charaindex,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬",2);
char.TalkToCli(charaindex, -1,"<EFBFBD><EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", "<EFBFBD><EFBFBD>ɫ")
char.UpCahrData(charaindex,"p");
end
end
function main()
item.addLUAListFunction( "ITEM_USEITEMMAX", "useitemmax", "")
end