适用版本??: 新武侠世界 仿官
获取函数:
--珍兽进阶影响(珍兽血脉觉醒)
local nPetData = x900009_GetPetDataBase(sceneId,selfId,petGUID_H,petGUID_L);
--珍兽血脉觉醒
local nJinJieGrade,nJinJieLevel,nCurNeedExp = Lua_GetPetJinJieData(nPetData[6]);
注释:nJinJieGrade | 觉醒阶级
| nJinJieLevel | 觉醒的等级 | |
读取的TXT数据的函数:
--**********************************
--读取珍兽数据
--**********************************
function x900009_GetPetDataBase(sceneId,selfId,hid,nid)
local HuamanID = LuaFnGetAccountName(sceneId,selfId)
local ObjID = GetMissionData(sceneId,selfId,MD_HUMANDATABASE)
local handle = openfile("./ServerBD/PetEquip/"..HuamanID.."_"..ObjID.."LID"..tostring(nid)..".txt", "r")
local nPetData = {}
if handle and nil ~= handle then
local nLineData = ""
for i = 1,13 do
nLineData = read(handle, "*l")
if nLineData == nil then
nLineData = 0 --这里防止异常错误
end
--珍兽装备数据
if i >= 1 and i <= 5 then
local pos1,pos2,nEquipID,nEquipAdpt_1,nEquipAdpt_2 = strfind(nLineData,"(.*)\t(.*)\t(.*)")
if pos1 ~= nil and pos2 ~=nil then
nPetData[i] = {tonumber(nEquipID),tonumber(nEquipAdpt_1),tonumber(nEquipAdpt_2)}
else
nPetData[i] = {0,0,0}
end
else
--其他额外数据
nPetData[i] = tonumber(nLineData);
end
end
closefile(handle)
else
for i = 1,13 do
if i >= 1 and i <= 5 then
nPetData[i] = {0,0,0}
else
nPetData[i] = 0;
end
end
end
--重置数据
return nPetData
end
|