比如,我再怪物爆物品触发端写,保存数据到INI里,根据物品制造ID为名字的INI文件。
怪物爆出物品的时候,不会立马创建文件,并储存数据到INI里,我等一会去打开文件夹里,就有了,这个肯定是引擎后面创建的!
--怪死亡爆物品时,启用直接进玩家包前回调(返回值决定是否物品直接进包裹)
--Actor:死亡对像 killActor:击杀者对像 item:物品对像
function DropItemToBag(Actor, killActor, item)
local a = s.share.getAllDays()
local sj = s.share.getYear(a).."年"..s.share.getMonth(a).."月"..s.share.getDay(a).."日 "..s.share.getAllTime()
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","编号","0",FORCE)
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","产出名字",item:getName(),FORCE)
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","产出区服",s.share.getServerName(),FORCE)
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","产出时间",sj,FORCE)
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","产出地点",Actor:getMapName().."("..Actor:getX()..","..Actor:getY()..")",FORCE)
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","产出怪物",Actor:getCharName(),FORCE)
s.ini.writeIni("\\LuaScripts\\id_ly\\"..item:getMakeIndex()..".ini","0","首位拾取者",killActor:getCharName(),FORCE)
return false
end
|