|
发表于 2024-8-30 13:31:30
|
显示全部楼层
核心代码:
- -- 法师宝宝
- if getbaseinfo(actor,7) == 1 then
- local A = {}
- local ncount = getbaseinfo(actor, 38)
- for i = 0, ncount - 1 do
- local mon = getslavebyindex(actor, i)
- local monName = getbaseinfo(mon, 1)
- local currentLevel = getslavelevel(mon)
- local maxHp = getbaseinfo(mon,10)
- local currentHp = getbaseinfo(mon,9)
- local montbl = {}
- montbl[monName] = {currentLevel,0,currentHp,maxHp}
- table.insert(A,montbl)
- end
- local bbInfo = getplaydef(actor,constant.t_current_bb_info)
- local B = {}
- if bbInfo ~= "" then
- B = json2tbl(bbInfo)
- end
- -- 设置时间
- for i = 1, #A do
- local keyA, valueA = next(A[i])
- local found = false
- for j = 1, #B do
- local keyB, valueB = next(B[j])
- if keyA == keyB and valueB[2] ~= nil then
- A[i][keyA][2] = valueB[2]
- table.remove(B, j)
- found = true
- break
- end
- end
- if not found then
- A[i][keyA][2] = os.time()
- end
- end
- if getflagstatus(actor,constant.login_call_bb) == 0 then
- setplaydef(actor,constant.t_current_bb_info,tbl2json(A))
- setplaydef(actor,constant.u_bb_begin_time,os.time())
- end
- end
复制代码 |
|