--死亡物品掉落回调
function on_DieDropItem(actor, itme)
local item_list = {}
local item_list1 = {}
local ItemName = itme:getName()
local MonsterName = actor:getCharName()
local ItemMap = itme:getFromMap()
local MakeName = itme:getFromMaker()
local MakeTime = itme:getFromTime()
local MonX = actor:getX()
local MonY = actor:getY()
for line1 in io.lines("D:\\共享目录\\公告物品列表.txt") do --需要公告的装备保存TXT,一行一个装备
local str1 = line1
table.insert(item_list1,str1)
end
for i,k in pairs(item_list1) do
if k == ItemName then
local Msgfile1 = io.open("D:\\共享目录\\全服掉落提醒.txt","w") -- local Msg1 = "恭喜:["..s.share.getServerName().."·"..MakeName.."]在["..ItemMap.."("..MonX..","..MonY..")]击杀["..MonsterName.."]爆出:"..ItemName.."\n"
io.output(Msgfile1)
io.write(Msg1)
io.close(Msgfile1)
local Msgfile2 = io.open("D:\\共享目录\\全服掉落提醒.txt","a") --记录时间TXT
local Msg2 = os.time().."\n"
io.output(Msgfile2)
io.write(Msg2)
io.close(Msgfile2)
end
end
哪个大神 教教如何修改 可以吗? |