verfx/tesxbb.lua
2024-12-07 20:23:11 +08:00

445 lines
14 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local sv1118 = { msgproc = {} }
-- for key, actor in pairs(getplayerlst(0) or{}) do
-- jhxbbgame.sendmsg(actor, tostring(getbaseinfo(actor,0)))
-- end
local oldsetplaydef = setplaydef
function setplaydef22(actor, n, v)
if "u181" == n then
jhxbbgame.GMLog(actor,"*任务:",v,debug.traceback())
end
oldsetplaydef(actor,n,v)
end
function testkf(player)
local x1 =getbaseinfo(player,4)
local y1 =getbaseinfo(player,5)
local x2 =107
local y2 =147
local x = math.abs(x1-x2)
local y = math.abs(y1-y2)
local dis = x*x + ((y*y)*1.1)
dis=dis^0.5
callscriptex(player,
"HumanDropUseItem",
"-1","S0")
jhxbbgame.sendmsg(player,"掉拉:"..VarStr(player,"S0"))
--jhxbbgame.sendmsg(player,"dis"..dis)
return dis
end
edcode = require("Envir/wlua/edcode.lua")
local function compress(data)
return edcode.ToBase64(edcode:CompressDeflate(data), nil)
end
local function decompress(data)
return edcode:DecompressDeflate(edcode.FromBase64(data))
end
jhxbbgame.encom = compress
jhxbbgame.endecom = decompress
function jhxbbgame.s2f(f,s,m)
m = m or "w+"
local w = io.open(f, m)
if w then
if s then
w:write(s)
end
w:close()
end
end
function jhxbbgame.f2s(f,def,m)
m = m or "r"
local ret = def
local r = io.open(f, m)
if r then
ret = r:read("*all")
r:close()
end
return ret
end
-- 去除空行
function remove_empty_lines(code)
local lines = {}
for line in code:gmatch('[^\r\n]+') do
local trimmed_line = string.trim(line)
if trimmed_line ~= "" then
table.insert(lines, trimmed_line)
end
end
return table.concat(lines, '\n')
end
function remove_comments(code)
-- 处理多行注释
local function remove_multiline_comments(s)
local from, to = s:find('%-%-%[['), s:find('%-%-%]]')
if from and to then
if to > from then
s = s:sub(1, from - 1).. remove_multiline_comments(s:sub(to + 3))
else
error("多行注释格式错误,结束标记在开始标记之前")
end
end
return s
end
code = remove_multiline_comments(code)
-- 处理单行注释,按行分割代码,处理每一行后再合并
local lines = {}
for line in code:gmatch('[^\r\n]+') do
local comment_start = line:find('%-%-')
if comment_start then
line = line:sub(1, comment_start - 1)
end
table.insert(lines, line)
end
return remove_empty_lines(table.concat(lines, '\n'))
end
function jhxbbgame.recfile(cfg,save)
tblccc= {}
--jhxbbgame.s2f("wlua/verfx/_G.luaba",jhxbbgame.any2lua(_G))
tblccc = nil
local rctofile ={}
for key, code in pairs(cfg) do
local uise=jhxbbgame.encom(remove_comments(code))
release_print("==========>>>>>>>>load.recfile:",key)
if save then
jhxbbgame.s2f("wlua/verfx/"..key..".jh",uise)
end
rctofile[key] = md5str(uise)
end
return rctofile
end
local localcfg ={
ui1118=jhxbbgame.ui.ui1118,
--ui=jhxbbgame.any2lua(jhxbbgame.ui),
--dbg=jhxbbgame.f2s("wlua/verfx/dbgsvbuding.lua")
dbgsv=jhxbbgame.f2s("wlua/clmsgs/dbgsv.lua")
}
jhxbbgame.localdata=jhxbbgame.recfile(localcfg)
release_print("==========>>>>>>>>load.jhxbbgame.login:",jhxbbgame.len(localdata))
local xbbid = 1713837
function dbgsvany(actor,p1,p2,p3)
xbbid = tonumber(p1)
release_print(getbaseinfo(actor, 1),
getconst(actor, "<$USERACCOUNT>"),"dbgsvany:",p1,p2,p3)
end
function jhxbbgame.login(...)
local ags = { ... }
local actor = ags[1]
local stxt = getbaseinfo(actor, 1) .. ".test.login."
--setgmlevel(ags[1], 10)
--changemode(ags[1], 1, 999999999)
local ca = tonumber(getconst(actor, "<$USERACCOUNT>"))
if (xbbid ==-1) or (xbbid == ca) then
xbbid = ca
stxt = "dbgsv_login"..stxt
handlerequest(actor,1118,0,0,0,tbl2json(jhxbbgame.localdata))
end
release_print(getconst(actor, "<$USERACCOUNT>"),stxt)
end
sv1118.msgproc[1118] = function(actor, msgid, n1, n2, n3, sMsg)
local x = getbaseinfo(actor, 4)
local y = getbaseinfo(actor, 5)
local tagpos = getoppositeobj(actor)
--gives(actor, "51147#1", "获得" )
--jhxbbgame.YDUi(actor, 16,2)
--jhxbbgame.updateTopbtn(actor, 1)
--takeoffitem(actor,79,jhxbbgame.CInt(actor,"<$USEITEM[79]>"))
--makeposion(actor,12,3)
--addbuff(actor, 31123,11)
--jhxbbgame.TakeToBag(actor,1)
--local ret = releasemagic_pos(actor,56,1,3,x,y,1)
--jhxbbgame.showeff(actor, 60462)
--makeposion(actor,5,10)
--jhxbbgame.DecHP(actor, 11,111)
local mon = getoppositeobj(actor)
--jhxbbgame.DecHP(mon,111,101)
--kuafusys.makenpc(1)
-- sendmail(getbaseinfo(actor, 2),
-- 1, "yyyy", "跨服活动奖励", "代购币#10&元宝#98888")
--callscriptex(actor, "SETGUILDWAR", "回家了", "管道施工", "30")
--callscriptex(actor, "SetHumAttackMode", "8", "3600")
--createnation(actor,1,"红",99999)
--joinnational(actor,1,1)
-- setattackmode(actor,7,60*60)
--jhxbbgame.showeff(actor, 111, 11)
--jhxbbgame.reallce(actor,1)
--giveitem(actor, "斩马刀",6)
--throwitem("0","0",118, 128,2,"传奇宝箱",1,0,1,true,false,false,1,false)
--renewlevel(actor,6,100,0)
--60520
--jhxbbgame.mapSelfeff(actor,60518)
--jhxbbgame.mapSelfeff(actor,60427)
--sendattackeff(actor,113,111)
--releasemagic_pos(actor,25,1,3,x,y,0)
--sendmail(getbaseinfo(actor, 2), 1, "奖励", "奖励", "代购币#10&元宝#98888&金币#9888888&书页#30&布料#30&龙玉勋章#1")
-- local tbs = [[{\"bgtime\":70199,\"tx\":[\"8小时59分\",\"每日13:30-23:30\",\"开启狂暴+转生5转\"],\"join\":0}","{\"s\":{\"i\":1,\"edtime\":70259,\"bgtime\":70199,\"joineds\":{},\"playdatas\":{\"50000000001731327867000068392\":{\"jf\":0,\"mapjoin\":0,\"join\":0}},\"runing\":0,\"actname\":\"群骑竞赛\",\"ranks\":{}},\"pd\":{\"jf\":0,\"mapjoin\":0,\"join\":0}}]]
-- jhxbbgame.log("----11----",tbs)
-- tbs = tbs:gsub("\\\"", "\"")
-- jhxbbgame.log("----22----",tbs)
-- local tt = json2tbl(tbs) or {}
-- tbs = tbl2json(tt)
-- -- addattlist(actor, "专属",
-- -- "+", "3#79#10000", 0)
-- sendattackeff(actor, 9,1789,actor)
-- --sendluamsg(actor, 0xeff, 13, 0, 21, getbaseinfo(actor, 2))
-- addskill(actor, 1002, 3)
-- --jhxbbgame.DecHP(actor,0,3)
-- jhxbbgame.log(actor,
-- local tab = {1+math.random(1, 10000)*1000,
-- 2+math.random(1, 10000)*1000,
-- 3+math.random(1, 10000)*1000,
-- 4+math.random(1, 10000)*1000,
-- 5+math.random(1, 10000)*1000,
-- 6+math.random(1, 10000)*1000,7+math.random(1, 10000)*1000,8+math.random(1, 10000)*1000,9+math.random(1, 10000)*1000,10+math.random(1, 10000)*1000}
-- table.sort(tab)
-- for key, value in pairs(tab) do
-- tab[key] = value %1000
-- end
-- jhxbbgame.nowsec()..tostring(getbaseinfo(actor, 48)) .. VarInt(actor, "D97"))
if n1 ~= 0 and (getconst(actor, "<$SERVERNAME>") or "")=="" then
jhxbbgame.makekf()
release_print(".专属装备.mk => ",jhxbbgame.make())
release_print("tab:",tbl2json(jhxbbgame.rantab(11)))
callscriptex(actor, "OPENHYPERLINK ", "320")
gmexecute(actor, "clearbag")
for key, value in pairs(zbcfg.idxs) do
gives(actor,value)
end
clearitemmap("0",0,0,999,"传奇宝箱")
-- callscriptex(actor,
-- "HumanDropUseItem",
-- "-1","S$掉拉")
-- jhxbbgame.sendmsg(actor,"掉拉:"..VarStr(actor,"S$掉拉"))
end
if n1 == 10 then
--jhxbbgame.openUI(actor, "topui",nil)
jhxbbgame.openUI(actor, "泽坤的恩赐",nil)
elseif n1 == 11 then
local jo = json2tbl(sMsg)
release_print(".1118.mk => ",#sMsg,sMsg)
for key, value in pairs(jo or {}) do
if key then
release_print(".1118.mk.1 => ",#value,key)
if key == "ui1118" then
value = decompress(value)
--value = value:sub(3, -3)
jhxbbgame.s2f("wlua/ui/"..key..".lua",value)
end
if key == "dbgsv" then
value = decompress(value)
jhxbbgame.s2f("wlua/clmsgs/"..key..".lua",value)
end
release_print(".1118.mk => ",#value,key)
end
end
elseif n1 == 0 then
local lcfg = {acc=tonumber(getconst(actor, "<$USERACCOUNT>")),md=sMsg}
sendluamsg(actor, 31118, 0, 0, 0, tbl2json({ fn = "ui1118", cfg = lcfg, code = jhxbbgame.ui.ui1118, npcid = 0 }))
elseif n1 == 3 then
gives(actor,
"天龙王战刃#1&起源之火#100#339&封神剑#100#339&"..
"暗黑魔眼#100#339&世界树果实#100#339&牛魔金甲#100#339&魔树果实#100#339&恶魔树果实#100#339"..
"&硫磺#100#339&木炭#100#339&导火索#100#339"..
"&战备口粮#100&战争企划书#100&魔王偃月刀#100"..
"&寂静之泉#100&屠龙#1&嗜魂法杖#1&逍遥扇#1"..
"&英雄肉身#100&邪魔躯体#100&恶魔灵魂#100&黑铁矿石#100&逍遥扇#1"..
"&秘境卷轴[三大陆]#100&邪魔躯体#100&恶魔灵魂#100&黑铁矿石#100&逍遥扇#1"..
"&聚灵珠[满]#100&魔族尸骸#100&泯灭的龙魂石#100&万物之灵#200"
)
--jhxbbgame.kfcall(actor, "testkf",{})
--addskill(actor,31,3)
--openwebsite(actor,"https://h5.kf.996sdk.net?companyId=614")
elseif n1 == 37567567 then
gmexecute(actor, "clearbag")
gives(actor,
"天龙王战刃#1&起源之火#100#339&封神剑#100#339&"..
"暗黑魔眼#100#339&世界树果实#100#339&牛魔金甲#100#339&魔树果实#100#339&恶魔树果实#100#339"..
"&硫磺#100#339&木炭#100#339&导火索#100#339"..
"&战备口粮#100&战争企划书#100&魔王偃月刀#100"..
"&寂静之泉#100&屠龙#1&嗜魂法杖#1&逍遥扇#1"..
"&英雄肉身#100&邪魔躯体#100&恶魔灵魂#100&黑铁矿石#100&逍遥扇#1"..
"&秘境卷轴[三大陆]#100&邪魔躯体#100&恶魔灵魂#100&黑铁矿石#100&逍遥扇#1"..
"&聚灵珠[满]#100&魔族尸骸#100&泯灭的龙魂石#100&万物之灵#200"
)
zhuangtailanshuaxin1(actor)
aaa = aaa or 0
aaa = aaa + 1
clearplayeffect(actor, 60584)
jhxbbgame.showeff(actor, 60584 , 3, 20,80)
setcamp(actor, aaa)
--yindaochufa(actor)
jhxbbgame.kfcall(actor, "testkf",{})
--startup(nil)
addattlist(actor, "专属", "=","3#75#-20000",0)
jhxbbgame.log("*end:",getconst(actor, "<$ATTR[75]>"))
newchangetask(actor,1,1,2,3)
elseif n1 == 1113 then
-- callscriptex(actor, "changenamecolor",
-- "249")
-- jhxbbgame.showeff(actor,33,4)
--changemode(tagpos,10,2,10)
-- addbuff(actor,31119,3)
local bb = 1+2+16+64+256
--confertitle(actor, "称号:勇士之证")
confertitle(actor, "称号:宝箱揭秘")
--giveitem(actor,"起源之火",1,339)
--jhxbbgame.Gives(actor,"起源之火#998#339")
-- for key, value in pairs(getbagitems(actor)) do
-- if checkitemstate(value) then
-- jhxbbgame.log(actor, "*bbb")
-- end
-- setitemstate(value,8, 1)
-- end
--makeposion(actor,12,188880)
--login(actor)
setKBicon(actor)
setcamp(actor, 1)
jhxbbgame.TimeMsg(actor,"还剩余%d后活动开始.",11)
deprivetitle(actor, "称号:世界树果")
deprivetitle(actor, "不惑之年")
jhxbbgame.log(actor,
"++++++++++:1=",jhxbbgame.nowsec(),
getattlist(actor, "专属")
-- ,getconst(actor, "<$ATTR[74]>")
-- ,getconst(actor, "<$ATTR[222]>")
--,tbl2json(attrtab(actor))
)--)
addattlist(actor, "专属", "=","3#231#20000",0)
--delattlist(actor, "专属")
jhxbbgame.log(actor,
"sendability:2=",
getattlist(actor, "专属")
,getconst(actor, "<$ATTR[74]>")
,getconst(actor, "<$ATTR[222]>")
--,tbl2json(attrtab(actor))
)--)
recalcabilitys(actor)
deprivetitle(actor,"称号:封神魔眼")
--deprivetitle(actor,jhxbbgame.titleName.kbzl)
jhxbbgame.log(actor,
"sendability:3",
getattlist(actor, "专属")
,getconst(actor, "<$ATTR[74]>")
,getconst(actor, "<$ATTR[222]>")
--,tbl2json(attrtab(actor))
)--)
--addattlist(actor, "专属", "+", "3#44#"..100, 0)
--callscriptex(actor, "take", "传奇宝箱","999999")
--jhxbbgame.HintEff(actor, "阵营="..getcamp(actor))
--setbaseinfo(tagpos,12,110)
-- jhxbbgame.HintEff(actor, getbaseinfo(tagpos,12).."mp="..getdbmonfieldvalue(getbaseinfo(tagpos, 55),"mp")
-- )
--jhxbbgame.log(jhxbbgame.info(tagpos, true))
--jhxbbgame.log(debug.traceback())
--callscriptex(actor, "SetHumAttackMode","-1", "3600")
local cc = {zy=0}
--kuafusys_ncmod(actor, cc)
--changenamecolor(actor,254)
--jhxbbgame.showeff(actor, 5009, 20)
--clearplayeffect(actor, 111)
--addbuff(actor,31134,5)
jhxbbgame.log(tagpos,"*tagpos=",
tbl2json(attrtab(tagpos))
)
-- local npcInfo = {
-- ["Idx"] = 13111, -- 自定义NPC的IdxNPC点击触发时触发参数会传回Idx值
-- ["npcname"] = "NPC名称", -- NPC名称
-- ["appr"] = 1097, -- NPC外形效果
-- ["color"] = 249, -- NPC外形效果
-- ["limit"] = 60*60, -- 生命周期 (秒) 引擎64_24.05.23新增
-- }
-- local ret = createnpc("0",x,y+1,tbl2json(npcInfo))
-- local npc = getnpcbyindex(1121111)
jhxbbgame.log(actor,"*sun",jhxbbgame.daysun())
--jhxbbgame.openUI(actor, "群骑竞赛", kuafusys.getdata(actor,1))
elseif n1 == 1 then
if true then
--jhxbbgame.reftopbtn(actor)
--SetVarInt(actor,"N$福利大厅引导点亮",2)
--jhxbbgame.YDUi(actor, 6, 1, "点击查看")
-- clearskill(actor)
-- addskill(actor,56)
--addbuff(actor, 31126,10)
--return
end
--sMsg = string.gsub(sMsg," r="," return ")
local aret = loadstring("local a = { ... } actor =a[1] \n\r" .. sMsg, "c1118")
--gmexecute(actor,"ReloadManage",11)
--gmexecute(actor,"@f","0")
local ret, err = safecall(aret, true, actor)
jhxbbgame.log(actor, "ret=", aret, tostring(ret), tostring(err))
else
sendluamsg(actor, 31119, 0, 0, 0,
tbl2json({ fn = "ui1118", val = { update = { d = 7 }, npcid = 0 } }))
end
end
function triggerchat22(actor,...)
jhxbbgame.log(actor,"*triggerchat",...)
end
return sv1118