【提问】求一个法师诱惑之光宝宝的脚本
求一个复古法师诱惑宝宝的脚本,人物下线宝宝可保留10分钟10分钟之后宝宝死亡的脚本,有没有大神分享一下核心代码:
-- 法师宝宝
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 = {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)
local found = false
for j = 1, #B do
local keyB, valueB = next(B)
if keyA == keyB and valueB ~= nil then
A = valueB
table.remove(B, j)
found = true
break
end
end
if not found then
A = 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 swayer 发表于 2024-8-30 13:31
核心代码:
这是lua写法吧,给个txt的呗 不会lua
页:
[1]