666
This commit is contained in:
parent
5b03ff693f
commit
810b7b8b91
12
dbg1118.lua
12
dbg1118.lua
@ -104,7 +104,12 @@ function ui.init(parent, __data__, __update__)
|
||||
|
||||
|
||||
GUI:addOnClickEvent(Button_2, function()
|
||||
SL:SendNetMsg(1118, 1, 2, 0, 'gmexecute(actor,"ReloadManage",11)')
|
||||
--SL:SendNetMsg(1118, 1, 2, 0, 'gmexecute(actor,"ReloadManage",11)')
|
||||
tblccc = {}
|
||||
SL:Print("Click.re=222 .1111cl_G",jhxbbgame.progress_bars)
|
||||
jhxbbgame.s2f("cl_G.bin",jhxbbgame.any2lua(cc))
|
||||
tblccc = nil
|
||||
SL:Print("Click.re=222 .cl_G",jhxbbgame.progress_bars)
|
||||
end)
|
||||
|
||||
GUI:addOnClickEvent(Button_3, function()
|
||||
@ -131,6 +136,11 @@ function ui.init(parent, __data__, __update__)
|
||||
return Scene
|
||||
end
|
||||
|
||||
local oldnetworkCtlSendMsg = global.networkCtl.SendMsg
|
||||
function global.networkCtl.SendMsg(...)
|
||||
SL:Print(".networkCtl.SendMsg= ",...)
|
||||
oldnetworkCtlSendMsg(...)
|
||||
end
|
||||
-- 采集UI隐藏 (内部调用)
|
||||
function MainCollect_HideCollectUI()
|
||||
SL:Print("Click.MainCollect_HideCollectUI= ")
|
||||
|
||||
19
equipeff.lua
19
equipeff.lua
@ -4,7 +4,7 @@ function takeonex(actor, -- object
|
||||
itemName, --string ÎïÆ·Ãû
|
||||
makeindex --integer
|
||||
)
|
||||
local idx = zbcfg.idx(actor, item)
|
||||
local idx = tonumber(zbcfg.idx(actor, item))
|
||||
jhxbbgame.log(actor,"take.onex = ", itemName, where,idx)
|
||||
if takeonex6 then
|
||||
takeonex6(actor, item, where, itemName, makeindex)
|
||||
@ -22,21 +22,28 @@ function takeoffex(actor, -- object
|
||||
|
||||
zbcfg.reload(actor,13,idx)
|
||||
|
||||
--jhxbbgame.log(actor,"take.offex = ", itemName, where, idx)
|
||||
jhxbbgame.log(actor,"take.offex = ", itemName, where, idx)
|
||||
end
|
||||
|
||||
|
||||
function delayequipchg(actor, tp, offidx)
|
||||
tp = oldtoint(tp) or 777
|
||||
offidx = oldtoint(offidx) or 0
|
||||
tp = oldtoint(tp) or VarInt(actor,"N$reload_tp")
|
||||
offidx = VarInt(actor,"N$reload_offidx")
|
||||
SetVarStr(actor,"N$reload_offidx",0)
|
||||
--jhxbbgame.log(actor, ".delayequipchg.init = ")
|
||||
makebodyitemindexs(actor, nil, 1+tp*100, offidx)
|
||||
end
|
||||
function zbcfg.reload(actor,tp,offidx)
|
||||
--jhxbbgame.log(actor,"zbcfg.reload = ", tp, offidx)
|
||||
|
||||
tp = tp or 666
|
||||
offidx = offidx or 0
|
||||
delayequipchg(actor,tp,offidx)
|
||||
--jhxbbgame.delayone(actor, 588, "delayequipchg",","..tp..","..offidx)
|
||||
SetVarStr(actor,"N$reload_tp",tp)
|
||||
if offidx > 0 then
|
||||
SetVarStr(actor,"N$reload_offidx",offidx)
|
||||
end
|
||||
--delayequipchg(actor,tp,offidx)
|
||||
jhxbbgame.delayone(actor, 588, "delayequipchg")
|
||||
end
|
||||
|
||||
|
||||
|
||||
10
kfsystem.lua
10
kfsystem.lua
@ -590,7 +590,7 @@ function kuafusys.endact(sysact,ca)
|
||||
xbb.log(nil,"------------kuafusys.endact",
|
||||
ca.actname,#ca.ranks,#ca.joineds,
|
||||
kuafusys.act2playupid,kuafusys.act2monkillplayid)
|
||||
|
||||
kuafusys.run = kuafusys.nonerun
|
||||
xbb.log(nil,"------------kuafusys.endactjoineds",tbl2json(ca.joineds))
|
||||
local jfok = {}
|
||||
local jfnotok = {}
|
||||
@ -644,8 +644,9 @@ function kuafusys.endact(sysact,ca)
|
||||
sendpass[kuafusys.act2playupid] = true
|
||||
kuafusys.clearbxeff(actor)
|
||||
kuafusys.pubmsg(ca, "恭喜"..tostring(getbaseinfo(actor, 1)).."获得限时称号奖励!")
|
||||
xbb.bfcall(actor,"kuafusys_bxtop",{u=1})
|
||||
deprivetitle(actor, "宝箱称号")
|
||||
confertitle(actor, "宝箱称号", 1)
|
||||
xbb.bfcall(actor,"kuafusys_bxtop",{u=1})
|
||||
kuafusys.primsg(actor, ca,"恭喜获得限时称号奖励")
|
||||
end
|
||||
local actor = getplayerbyid(kuafusys.act2monkillplayid)
|
||||
@ -749,8 +750,9 @@ function kuafusys.endact(sysact,ca)
|
||||
if actor then
|
||||
cc = "!"
|
||||
kuafusys.pubmsg(ca, "恭喜"..tostring(getbaseinfo(actor, 1)).."获得限时称号奖励!")
|
||||
xbb.bfcall(actor,"kuafusys_jdtop",{j=1})
|
||||
deprivetitle(actor, "据点称号")
|
||||
confertitle(actor, "据点称号", 1)
|
||||
xbb.bfcall(actor,"kuafusys_jdtop",{j=1})
|
||||
kuafusys.primsg(actor, ca,"恭喜获得限时称号奖励")
|
||||
end
|
||||
end
|
||||
@ -816,12 +818,14 @@ function kuafusys.endact(sysact,ca)
|
||||
ca.ranks = {}
|
||||
end
|
||||
function kuafusys_bxtop(actor,cfg)
|
||||
deprivetitle(actor, "宝箱称号")
|
||||
confertitle(actor, "宝箱称号", 1)
|
||||
jhxbbgame.log(actor, getbaseinfo(actor,1),":宝箱称号")
|
||||
end
|
||||
|
||||
|
||||
function kuafusys_jdtop(actor,cfg)
|
||||
deprivetitle(actor, "据点称号")
|
||||
confertitle(actor, "据点称号", 1)
|
||||
jhxbbgame.log(actor, getbaseinfo(actor,1),":据点称号")
|
||||
end
|
||||
|
||||
590
lib996.lua
Normal file
590
lib996.lua
Normal file
@ -0,0 +1,590 @@
|
||||
local SetofPlayer = {
|
||||
set=setbaseinfo,
|
||||
params={
|
||||
level = 6, --角色等级
|
||||
job = 7, --角色职业 (0-战 1-法 2-道)
|
||||
sex = 8, --角色性别
|
||||
curhp = 9, --角色当前HP
|
||||
curmp = 11, --角色当前MP
|
||||
ac = 15, --角色物防下限
|
||||
ac2 = 16, --角色物防上限
|
||||
mac = 17, --角色魔防下限
|
||||
mac2 = 18, --角色魔防上限
|
||||
dc = 19, --角色物攻下限
|
||||
dc2 = 20, --角色物攻上限
|
||||
mc = 21, --角色魔攻下限
|
||||
mc2 = 22, --角色魔攻上限
|
||||
sc = 23, --角色道攻下限
|
||||
sc2 = 24, --角色道攻上限
|
||||
lucky = 25, --角色幸运值
|
||||
hpadd = 26, --角色HP恢复
|
||||
mpadd = 27, --角色MP恢复
|
||||
poison_add = 28, --角色中毒恢复
|
||||
poison_avoid = 29, --毒物躲避
|
||||
magic_avoid = 30, --角色魔法躲避
|
||||
accuracy = 31, --角色准确
|
||||
agile = 32, --角色敏捷
|
||||
hair = 33, --发型
|
||||
renew_level = 39, --转生等级(仅人物)
|
||||
exp_rate = 40, --杀怪经验倍数(仅人物)
|
||||
exp_time = 41, --杀怪经验时间(仅人物)
|
||||
drop_rate = 43, --人物杀怪爆率倍数(仅人物)
|
||||
pkvalue = 46, --PK点
|
||||
}
|
||||
}
|
||||
|
||||
local CallofPlayer = {
|
||||
SendMsg=jhxbbgame.sendmsg,
|
||||
}
|
||||
|
||||
local GetofPlayer = {
|
||||
get=getbaseinfo,
|
||||
params={
|
||||
isplayer = -1, --是否玩家
|
||||
isdie = 0, --是否死亡(true:死亡状态)
|
||||
name = 1, --角色名 (返回值字符型)
|
||||
id = 2, --角色唯一ID (返回值字符型)
|
||||
mapid = 3, --角色当前地图ID (返回值字符型)
|
||||
x = 4, --角色X坐标
|
||||
y = 5, --角色Y坐标
|
||||
level = 6, --角色等级
|
||||
job = 7, --角色职业 (0-战 1-法 2-道)
|
||||
sex = 8, --角色性别
|
||||
curhp = 9, --角色当前HP
|
||||
maxhp = 10, --角色当前MAXHP
|
||||
curmp = 11, --角色当前MP
|
||||
maxmp = 12, --角色当前MAXMP
|
||||
curexp = 13, --角色当前Exp
|
||||
maxexp = 14, --角色当前MaxExp
|
||||
ac = 15, --角色物防下限
|
||||
ac2 = 16, --角色物防上限
|
||||
mac = 17, --角色魔防下限
|
||||
mac2 = 18, --角色魔防上限
|
||||
dc = 19, --角色物攻下限
|
||||
dc2 = 20, --角色物攻上限
|
||||
mc = 21, --角色魔攻下限
|
||||
mc2 = 22, --角色魔攻上限
|
||||
sc = 23, --角色道攻下限
|
||||
sc2 = 24, --角色道攻上限
|
||||
lucky = 25, --角色幸运值
|
||||
hpadd = 26, --角色HP恢复
|
||||
mpadd = 27, --角色MP恢复
|
||||
poison_add = 28, --角色中毒恢复
|
||||
poison_avoid = 29, --毒物躲避
|
||||
magic_avoid = 30, --角色魔法躲避
|
||||
accuracy = 31, --角色准确
|
||||
agile = 32, --角色敏捷
|
||||
hair = 33, --发型
|
||||
bag_num = 34, --背包物品数量(仅人物)
|
||||
team_num = 35, --队伍成员数量(仅人物)
|
||||
guild = 36, --行会名(仅人物)
|
||||
isboos = 37, --是否会长(仅人物)
|
||||
pets_num = 38, --宠物数量
|
||||
renew_level = 39, --转生等级(仅人物)
|
||||
exp_rate = 40, --杀怪经验倍数(仅人物)
|
||||
exp_time = 41, --杀怪经验时间(仅人物)
|
||||
delay_call_time = 42, --显示延时TIMERECALL还剩多少秒(仅人物)
|
||||
drop_rate = 43, --人物杀怪爆率倍数(仅人物)
|
||||
revive_time = 44, --复活时间
|
||||
map_title = 45, --地图名MAPTITLE
|
||||
pkvalue = 46, --PK点
|
||||
isnewhuman = 47, --是否新人(仅人物)
|
||||
issaferect = 48, --是否安全区
|
||||
isstall = 49, --是否摆摊中(仅人物)
|
||||
istrade = 50, --是否交易中(仅人物)
|
||||
custom_attr = 51, --自定义扩展属性,需要提供 参数3:属性ID(cfg_att_score.xls设置:1-91,200~249)
|
||||
behavior = 52, --穿人/怪方式 0=恢复/1=穿人/2=穿怪/3=穿人穿怪
|
||||
login = 53, --登录状态,0:正常,1:断线重连(仅人物)
|
||||
userid = 54, --主人UserId
|
||||
idx = 55, --Idx
|
||||
color = 56, --颜色(0~255)
|
||||
fashion = 58, --时装显示状态(仅人物) 0=不显示 1=显示
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
local fastkv = {}
|
||||
local freecnt=0
|
||||
release_print("--------------------init:")
|
||||
function GetPlayerCache(actor)
|
||||
local mydata = {_uid=getbaseinfo(actor,2),a=actor}
|
||||
|
||||
for key, value in pairs(fastkv) do
|
||||
--release_print("ipairs:",key,value.a)
|
||||
if value._uid == mydata._uid and value.a ~= actor then
|
||||
--release_print("remove:",key,value.a)
|
||||
fastkv[key] = nil
|
||||
freecnt = freecnt + 1
|
||||
if freecnt > 100 then
|
||||
fastkv = {}
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
--release_print("Add:",actor)
|
||||
fastkv[actor] =mydata
|
||||
return mydata
|
||||
end
|
||||
|
||||
local mt = {}
|
||||
for key, value in pairs(CallofPlayer) do
|
||||
mt[key]=function(player,...)
|
||||
local actor = player._aid
|
||||
return value(actor,...)
|
||||
end
|
||||
end
|
||||
|
||||
local metaTable = {
|
||||
|
||||
__index = function(player, key)
|
||||
local actor = player._aid
|
||||
local mykv = fastkv[actor] or GetPlayerCache(actor)
|
||||
local ret = mykv[key]
|
||||
if ret == nil then
|
||||
local idx = GetofPlayer.params[key]
|
||||
if idx then
|
||||
ret = GetofPlayer.get(actor,idx)
|
||||
mykv[key] = ret
|
||||
else
|
||||
ret = mt[key]
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end,
|
||||
__newindex = function(player, key, value)
|
||||
local actor = player._aid
|
||||
local mykv = fastkv[actor] or GetPlayerCache(actor)
|
||||
print("Setting a new element via __newindex: ",actor,mykv._uid, key, value)
|
||||
local idx = SetofPlayer.params[key]
|
||||
if idx then
|
||||
SetofPlayer.set(actor,idx,value)
|
||||
mykv[key] = value
|
||||
else
|
||||
print("fail.: ",actor,mykv._uid, key, value)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
setmetatable(metaTable, {__index=function (...)
|
||||
print("getMetaTable __index: ",...)
|
||||
end})
|
||||
Player = {}
|
||||
|
||||
function Player:reset(keys)
|
||||
local actor = self._aid
|
||||
local mykv = fastkv[actor] or GetPlayerCache(actor)
|
||||
for i = 1, #keys, 1 do
|
||||
mykv[keys[i]] = nil
|
||||
end
|
||||
end
|
||||
function Player:resetpos()
|
||||
Player:reset({"x","y","map"})
|
||||
end
|
||||
|
||||
local bindplayers = {}
|
||||
function Player.new(actor)
|
||||
local self = setmetatable({_aid = actor}, metaTable)
|
||||
return self
|
||||
end
|
||||
|
||||
function Player.get(actor)
|
||||
local self = setmetatable({_aid = actor}, metaTable)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
ConstCfg = {
|
||||
|
||||
--全局信息
|
||||
global = {
|
||||
openday = 1, --开服天数
|
||||
opendate = 2, --开服时间
|
||||
mergecount = 3, --合服次数
|
||||
mergedate = 4, --合服时间
|
||||
serverip = 5, --服务器IP
|
||||
actornum = 6, --玩家数量
|
||||
maxbagnum = 7, --背包最大数量
|
||||
},
|
||||
|
||||
--设置人物,怪物,base字段
|
||||
gbase = {
|
||||
isplayer = -1, --是否玩家
|
||||
isdie = 0, --是否死亡(true:死亡状态)
|
||||
name = 1, --角色名 (返回值字符型)
|
||||
id = 2, --角色唯一ID (返回值字符型)
|
||||
mapid = 3, --角色当前地图ID (返回值字符型)
|
||||
x = 4, --角色X坐标
|
||||
y = 5, --角色Y坐标
|
||||
level = 6, --角色等级
|
||||
job = 7, --角色职业 (0-战 1-法 2-道)
|
||||
sex = 8, --角色性别
|
||||
curhp = 9, --角色当前HP
|
||||
maxhp = 10, --角色当前MAXHP
|
||||
curmp = 11, --角色当前MP
|
||||
maxmp = 12, --角色当前MAXMP
|
||||
curexp = 13, --角色当前Exp
|
||||
maxexp = 14, --角色当前MaxExp
|
||||
ac = 15, --角色物防下限
|
||||
ac2 = 16, --角色物防上限
|
||||
mac = 17, --角色魔防下限
|
||||
mac2 = 18, --角色魔防上限
|
||||
dc = 19, --角色物攻下限
|
||||
dc2 = 20, --角色物攻上限
|
||||
mc = 21, --角色魔攻下限
|
||||
mc2 = 22, --角色魔攻上限
|
||||
sc = 23, --角色道攻下限
|
||||
sc2 = 24, --角色道攻上限
|
||||
lucky = 25, --角色幸运值
|
||||
hpadd = 26, --角色HP恢复
|
||||
mpadd = 27, --角色MP恢复
|
||||
poison_add = 28, --角色中毒恢复
|
||||
poison_avoid = 29, --毒物躲避
|
||||
magic_avoid = 30, --角色魔法躲避
|
||||
accuracy = 31, --角色准确
|
||||
agile = 32, --角色敏捷
|
||||
hair = 33, --发型
|
||||
bag_num = 34, --背包物品数量(仅人物)
|
||||
team_num = 35, --队伍成员数量(仅人物)
|
||||
guild = 36, --行会名(仅人物)
|
||||
isboos = 37, --是否会长(仅人物)
|
||||
pets_num = 38, --宠物数量
|
||||
renew_level = 39, --转生等级(仅人物)
|
||||
exp_rate = 40, --杀怪经验倍数(仅人物)
|
||||
exp_time = 41, --杀怪经验时间(仅人物)
|
||||
delay_call_time = 42, --显示延时TIMERECALL还剩多少秒(仅人物)
|
||||
drop_rate = 43, --人物杀怪爆率倍数(仅人物)
|
||||
revive_time = 44, --复活时间
|
||||
map_title = 45, --地图名MAPTITLE
|
||||
pkvalue = 46, --PK点
|
||||
isnewhuman = 47, --是否新人(仅人物)
|
||||
issaferect = 48, --是否安全区
|
||||
isstall = 49, --是否摆摊中(仅人物)
|
||||
istrade = 50, --是否交易中(仅人物)
|
||||
custom_attr = 51, --自定义扩展属性,需要提供 参数3:属性ID(cfg_att_score.xls设置:1-91,200~249)
|
||||
behavior = 52, --穿人/怪方式 0=恢复/1=穿人/2=穿怪/3=穿人穿怪
|
||||
login = 53, --登录状态,0:正常,1:断线重连(仅人物)
|
||||
userid = 54, --主人UserId
|
||||
idx = 55, --Idx
|
||||
color = 56, --颜色(0~255)
|
||||
fashion = 58, --时装显示状态(仅人物) 0=不显示 1=显示
|
||||
},
|
||||
|
||||
--获取人物,怪物,base字段
|
||||
sbase = {
|
||||
level = 6, --设置等级
|
||||
job = 7, --职业
|
||||
sex = 8, --性别
|
||||
curhp = 9, --当前HP
|
||||
curmp = 11, --当前MP
|
||||
ac = 15, --物防下限
|
||||
ac2 = 16, --物防上限
|
||||
mac = 17, --魔防下限
|
||||
mac2 = 18, --魔防上限
|
||||
dc = 19, --物攻下限
|
||||
dc2 = 20, --物攻上限
|
||||
mc = 21, --魔攻下限
|
||||
mc2 = 22, --魔攻上限
|
||||
sc = 23, --道攻下限
|
||||
sc2 = 24, --道攻上限
|
||||
lucky = 25, --幸运值
|
||||
hpadd = 26, --HP恢复
|
||||
mpadd = 27, --MP恢复
|
||||
poison_add = 28, --中毒恢复
|
||||
poison_avoid = 29, --毒物躲避
|
||||
magic_avoid = 30, --魔法躲避
|
||||
accuracy = 31, --准确
|
||||
agile = 32, --敏捷
|
||||
hair = 33, --发型
|
||||
renew_level = 39, --转生等级(仅人物)
|
||||
exp_rate = 40, --杀怪经验倍数(仅人物)
|
||||
exp_time = 41, --杀怪经验时间(仅人物)
|
||||
drop_rate = 43, --人物杀怪爆率倍数(仅人物)
|
||||
pkvalue = 46, --人物PK点(仅人物)
|
||||
behavior = 50, --行为方式,只针对宠物,包含多个行为时,求和(1:禁止攻击玩家,2:不可被攻击,4:优先攻击 玩家攻击对象,8:优先攻击 玩家受击对象 )
|
||||
mutiny = 51, --叛变(仅怪物)
|
||||
through = 52, --穿人/怪方式 0=恢复/1=穿人/2=穿怪/3=穿人穿怪
|
||||
color = 56, --颜色(0~255)
|
||||
fashion = 57 --时装显示状态(仅人物) 0=不显示 1=显示
|
||||
},
|
||||
|
||||
--永久属性
|
||||
forever_attr = {
|
||||
dc = 1, --攻击下限(0~65535)
|
||||
dc2 = 2, --攻击上限(0~65535)
|
||||
mc = 3, --魔法下限(0~65535)
|
||||
mc2 = 4, --魔法上限(0~65535)
|
||||
sc = 5, --道术下限(0~65535)
|
||||
sc2 = 6, --道术上限(0~65535)
|
||||
ac = 7, --防御下限(0~65535)
|
||||
ac2 = 8, --防御上限(0~65535)
|
||||
mac = 9, --魔防下限(0~65535)
|
||||
mac2 = 10, --魔防上限(0~65535)
|
||||
maxhp = 11, --生命值(支持21亿)
|
||||
maxmp = 12, --魔法值(支持21亿)
|
||||
accuracy = 13, --准确(支持21亿)
|
||||
agile = 14, --躲避就是准确(支持21亿)
|
||||
},
|
||||
|
||||
--自定义属性
|
||||
custom_attr = {
|
||||
attr200 = 200, --减少受到来自怪物的固定伤害
|
||||
},
|
||||
|
||||
--人物模式
|
||||
--第三个参数无敌,隐身,禁止攻击时没有使用.
|
||||
--如果是禁锢时,第三个参数表示禁锢范围
|
||||
pmode = {
|
||||
god = 1, --无敌
|
||||
unsee = 2, --隐身
|
||||
hp = 3, --HP
|
||||
mp = 4, --MP
|
||||
dc2 = 5, --攻击力
|
||||
mc2 = 6, --魔法力
|
||||
sc2 = 7, --道术力
|
||||
ias = 8, --攻击速度
|
||||
ban_act = 9, --禁止攻击
|
||||
lock = 10, --锁定
|
||||
trap = 11, -- 禁锢(释放一个类似困魔咒的光圈,敌对人物或怪物只能在这个圈子里移动,无法走出圈子外面,所有传送失效,不能小退)
|
||||
frost = 12, -- 冰冻
|
||||
stick = 13, -- 蛛网
|
||||
nopalsy = 14, -- 防麻痹
|
||||
mptrap = 15, -- 防禁锢
|
||||
nofrost = 16, -- 防冰冻
|
||||
nostick = 17, -- 防蛛网
|
||||
palsy = 18, -- 麻痹
|
||||
protect = 19, -- 护身
|
||||
inblood = 20, -- 吸血
|
||||
inblue = 21, -- 吸蓝
|
||||
lucent = 22, -- 隐身(类似隐身戒指)
|
||||
realive = 23, -- 复活
|
||||
norealive = 24, -- 破复活
|
||||
},
|
||||
|
||||
--攻击模式
|
||||
amode = {
|
||||
qt = 0, --全体攻击
|
||||
hp = 1, --和平攻击
|
||||
fq = 2, --夫妻攻击
|
||||
st = 3, --师徒攻击
|
||||
bz = 4, --编组攻击
|
||||
hh = 5, --行会攻击
|
||||
hm = 6, --红名攻击
|
||||
gg = 7, --国家攻击
|
||||
},
|
||||
|
||||
--怪物表
|
||||
stdmoninfo = {
|
||||
name = 1, --怪物名 (返回值字符型)
|
||||
color = 2, --怪物名颜色
|
||||
},
|
||||
|
||||
--货币
|
||||
money = {
|
||||
gold = 1, --元宝
|
||||
yb = 2, --玉币
|
||||
bdgold = 3, --金条
|
||||
bdyb = 4, --绑定玉币
|
||||
lf = 7, --灵符
|
||||
cent = 11, --充值点 1rmb = 1充值点
|
||||
},
|
||||
|
||||
--物品信息
|
||||
iteminfo = {
|
||||
id = 1, --唯一ID
|
||||
idx = 2, --物品ID
|
||||
curdura = 3, --剩余持久
|
||||
maxdura = 4, --最大持久
|
||||
overlap = 5, --叠加数量
|
||||
bind = 6, --绑定状态值
|
||||
},
|
||||
|
||||
--物品基础信息
|
||||
stditeminfo = {
|
||||
idx = 0, --0:idx
|
||||
name = 1, --1:名称
|
||||
stdmode = 2, --2:StdMode
|
||||
shape = 3, --3:Shape
|
||||
weight = 4, --4:重量
|
||||
anicount = 5, --5:AniCount
|
||||
maxdura = 6, --6:最大持久
|
||||
overlap = 7, --7:叠加数量
|
||||
price = 8, --8:价格(price)
|
||||
need = 9, --9:使用条件
|
||||
needlevel = 10, --10:使用等级
|
||||
custom25 = 11, --11:道具表自定义常量(25列)
|
||||
custom26 = 12, --12:道具表自定义常量(26列)
|
||||
},
|
||||
|
||||
--技能
|
||||
skill = {
|
||||
level = 1, --技能等级
|
||||
superlevel = 2, --技能强化等级
|
||||
proficiency = 3, --熟练度
|
||||
},
|
||||
|
||||
--公告
|
||||
notice = {
|
||||
own = 1, --发送给自己
|
||||
all = 2, --发送给全服
|
||||
guild = 3, --发送给行会
|
||||
map = 4, --发送给地图
|
||||
team = 5, --发送给组队
|
||||
},
|
||||
|
||||
--隐藏穿戴物品
|
||||
unseen_equip = {
|
||||
attr = { --隐藏属性
|
||||
rule = 63, --隐藏装备绑定规则
|
||||
idx = 50000, --隐藏装备Idx
|
||||
where = 100, --穿戴位置
|
||||
},
|
||||
},
|
||||
|
||||
--获取沙巴克信息返回值
|
||||
castle = {
|
||||
info = { --castleinfo
|
||||
name = 1, --沙城名称
|
||||
guildname = 2, --沙城行会名称
|
||||
guildmgr = 3, --沙城城主
|
||||
day = 4, --占领天数,返回number
|
||||
state = 5, --当前是否在攻沙状态,返回Bool
|
||||
guilddeputy = 6, --沙城多个副城主 (返回类型table)
|
||||
},
|
||||
identity = { --castleidentity
|
||||
no = 0, --非沙巴克成员
|
||||
yes = 1, --沙巴克成员
|
||||
boos = 2, --沙巴克老大
|
||||
}
|
||||
},
|
||||
|
||||
--stdmode 与 where 的映射关系
|
||||
stdmodewheremap = {
|
||||
[10] = {0}, --衣服(男)
|
||||
[11] = {0}, --衣服(女)
|
||||
[5] = {1}, --武器(男)
|
||||
[6] = {1}, --武器(女)
|
||||
[30] = {2}, --勋章
|
||||
[19] = {3}, --项链
|
||||
[20] = {3}, --项链
|
||||
[21] = {3}, --项链
|
||||
[15] = {4}, --头盔
|
||||
[24] = {5, 6}, --手镯
|
||||
[26] = {5, 6}, --手镯
|
||||
[22] = {7, 8}, --戒指
|
||||
[23] = {7, 8}, --戒指
|
||||
[25] = {9}, --符、毒药
|
||||
[54] = {10}, --腰带
|
||||
[64] = {10}, --腰带
|
||||
[52] = {11}, --靴子
|
||||
[62] = {11}, --靴子
|
||||
[53] = {12}, --宝石、魔血石
|
||||
[63] = {12}, --宝石、魔血石
|
||||
[7] = {12}, --宝石、魔血石
|
||||
[16] = {13}, --斗笠
|
||||
[65] = {14}, --军鼓
|
||||
[28] = {15}, --马牌
|
||||
[48] = {16}, --盾牌
|
||||
[50] = {55}, --面巾
|
||||
|
||||
[66] = {17}, --时装衣服(男)
|
||||
[67] = {17}, --时装衣服(男)
|
||||
[68] = {18}, --时装衣服(女)
|
||||
[69] = {18}, --时装衣服(女)
|
||||
[71] = {19}, --时装斗笠
|
||||
[75] = {20}, --时装项链
|
||||
[76] = {20}, --时装项链
|
||||
[77] = {20}, --时装项链
|
||||
[78] = {21}, --时装头盔
|
||||
[79] = {22, 23}, --时装手镯
|
||||
[80] = {22, 23}, --时装手镯
|
||||
[81] = {24, 25}, --时装戒指
|
||||
[82] = {24, 25}, --时装戒指
|
||||
[83] = {26}, --时装勋章
|
||||
[84] = {27}, --时装腰带
|
||||
[85] = {27}, --时装腰带
|
||||
[86] = {28}, --时装靴子
|
||||
[87] = {28}, --时装靴子
|
||||
[88] = {29}, --时装宝石
|
||||
[89] = {29}, --时装宝石
|
||||
|
||||
[100] = {30}, --首饰盒位置1
|
||||
[101] = {31}, --首饰盒位置2
|
||||
[102] = {32}, --首饰盒位置3
|
||||
[103] = {33}, --首饰盒位置4
|
||||
[104] = {34}, --首饰盒位置5
|
||||
[105] = {35}, --首饰盒位置6
|
||||
[106] = {36}, --首饰盒位置7
|
||||
[107] = {37}, --首饰盒位置8
|
||||
[108] = {38}, --首饰盒位置9
|
||||
[109] = {39}, --首饰盒位置10
|
||||
[110] = {40}, --首饰盒位置11
|
||||
[111] = {41}, --首饰盒位置12
|
||||
|
||||
[90] = {42}, --时装马牌
|
||||
[91] = {43}, --时装符印
|
||||
[92] = {44}, --时装军鼓
|
||||
[93] = {45}, --时装盾牌
|
||||
[94] = {46}, --时装面巾
|
||||
|
||||
--自定义装备位
|
||||
[219] = {71}, --无双装备
|
||||
[220] = {72}, --无双装备
|
||||
[221] = {73}, --无双装备
|
||||
[222] = {74}, --无双装备
|
||||
[223] = {75}, --无双装备
|
||||
[224] = {76}, --无双装备
|
||||
[225] = {77}, --无双装备
|
||||
[226] = {78}, --无双装备
|
||||
[10009] = {79}, --无双装备
|
||||
[10010] = {80}, --无双装备
|
||||
[10011] = {81}, --无双装备
|
||||
|
||||
[10021] = {82}, --官职装备
|
||||
[10022] = {83}, --官职装备
|
||||
[10023] = {84}, --官职装备
|
||||
[10024] = {85}, --官职装备
|
||||
[10025] = {86}, --官职装备
|
||||
[10026] = {87}, --官职装备
|
||||
[10027] = {88}, --官职装备
|
||||
[10028] = {89}, --官职装备
|
||||
|
||||
[10031] = {90}, --侍女装备
|
||||
[10032] = {91}, --侍女装备
|
||||
[10033] = {92}, --侍女装备
|
||||
[10034] = {93}, --侍女装备
|
||||
[10035] = {94}, --侍女装备
|
||||
},
|
||||
|
||||
activitystate = {
|
||||
closing = 0, --关闭中
|
||||
opening = 1, --进行中
|
||||
ended = 2, --已结束
|
||||
},
|
||||
|
||||
flag = {
|
||||
no = 0,
|
||||
yes = 1,
|
||||
},
|
||||
|
||||
first_login_addskill = {
|
||||
--初次登陆给予的技能id
|
||||
25, --半月弯刀
|
||||
7, --攻杀剑术
|
||||
12, --刺杀剑术
|
||||
27, --野蛮冲撞
|
||||
26, --烈火剑法
|
||||
25, --半月弯刀
|
||||
},
|
||||
|
||||
binding = 354, --绑定物品规则
|
||||
daysec = 86400, --一天的秒数
|
||||
attrtime = 123456789, --附加属性时间
|
||||
bagcellnum = 126, --固定背包有120个格子
|
||||
warehousecellnum = 216, --仓库开启格子数量
|
||||
-- pickuptime = 1000, --物品掉落只有自己可捡取时间
|
||||
|
||||
DEBUG = false, --调试模式
|
||||
}
|
||||
|
||||
return ConstCfg
|
||||
14
texbb.lua
14
texbb.lua
@ -169,6 +169,8 @@ end
|
||||
function jhxbbgame.login(...)
|
||||
local ags = { ... }
|
||||
local actor = ags[1]
|
||||
local myself = Player:new(actor)
|
||||
myself:SendMsg("哈哈"..myself.x,9)
|
||||
local stxt = getbaseinfo(actor, 1) .. ".test.login."
|
||||
--setgmlevel(ags[1], 10)
|
||||
--changemode(ags[1], 1, 999999999)
|
||||
@ -272,14 +274,14 @@ sv1118.msgproc[1118] = function(actor, msgid, n1, n2, n3, sMsg)
|
||||
if n1 ~= 10 and n1 ~= 0 and (getconst(actor, "<$SERVERNAME>") or "")=="" then
|
||||
|
||||
--jhxbbgame.makedbg()
|
||||
|
||||
release_print(jhxbbgame.makekf and jhxbbgame.makekf(), ".专属装备.mk => ",jhxbbgame.make and jhxbbgame.make())
|
||||
local a = jhxbbgame.makekf and jhxbbgame.makekf()
|
||||
release_print(#a, ".专属装备.mk => ",jhxbbgame.make and 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
|
||||
-- gmexecute(actor, "clearbag")
|
||||
-- for key, value in pairs(zbcfg.idxs) do
|
||||
-- gives(actor,value)
|
||||
-- end
|
||||
clearitemmap("0",0,0,999,"´«Ææ±¦Ïä")
|
||||
|
||||
-- callscriptex(actor,
|
||||
|
||||
921
xbbdbg.lua
Normal file
921
xbbdbg.lua
Normal file
@ -0,0 +1,921 @@
|
||||
require("Envir/wlua/verfx/lib996.lua")
|
||||
|
||||
function jhxbbgame.s2f(f,s,m)
|
||||
local wsz = -1
|
||||
m = m or "w+"
|
||||
local w, e = io.open(f, m)
|
||||
|
||||
if w then
|
||||
w:write(s)
|
||||
w:close()
|
||||
wsz = #s
|
||||
else
|
||||
wsz = e
|
||||
end
|
||||
return wsz
|
||||
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
|
||||
|
||||
jhxbbgame.dbgout = jhxbbgame.log
|
||||
|
||||
local function aab()
|
||||
|
||||
zbcfg._CD=json2tbl(
|
||||
[[{
|
||||
"兽族嘶吼":30,
|
||||
"末路黄泉":180,
|
||||
"潜龙王御敌指环":180,
|
||||
"天堂有路":1,
|
||||
"奴隶之戒":0,
|
||||
"疾风之戒":60,
|
||||
"横行霸道":300,
|
||||
"暗龙之戒":180,
|
||||
"鸣龙王御敌指环":3600,
|
||||
"听天由命":180,
|
||||
"龙神之战斗锤":300,
|
||||
|
||||
|
||||
"恶魔爪牙":0,
|
||||
"教皇之争":0,
|
||||
"杀戮之甲":0,
|
||||
"暗龙王御敌指环":0,
|
||||
"镇魂链甲":0,
|
||||
"地狱无门":360,
|
||||
"怒火中烧":0,
|
||||
"滴水穿石":0,
|
||||
"天龙王御敌指环":0,
|
||||
"刹那之间":0,
|
||||
"寒冰之契":0,
|
||||
"猝亡之戒":0,
|
||||
|
||||
"目空一切":0,
|
||||
"刹那之失":10,
|
||||
"玲珑八面":0,
|
||||
"极度深寒":15,
|
||||
"死神之拒":10,
|
||||
"来世再做我的英雄":0,
|
||||
"目空一切[史诗]":0,
|
||||
"刹那之失[史诗]":10,
|
||||
"玲珑八面[史诗]":0,
|
||||
"极度深寒[史诗]":15,
|
||||
"死神之拒[史诗]":10,
|
||||
"来世再做我的英雄[史诗]":0,
|
||||
|
||||
"抵抗的决心":180,
|
||||
"暗龙王的毒液":180,
|
||||
"千里暮云带":10,
|
||||
"龙骨吞噬者":20,
|
||||
"烈焰之石":30,
|
||||
"雷霆之石":15,
|
||||
"暗黑魔之趾":60,
|
||||
"九天繁星衣":120,
|
||||
"凛冬铁壁带":60,
|
||||
"寂雪之冠":30,
|
||||
"寂静星魔铠":60,
|
||||
"千年冰甲":60,
|
||||
"末日灵魂披风":120,
|
||||
"黑暗君王袍":60,
|
||||
"幽冥魔护带":60,
|
||||
"叹息之咒怨":120,
|
||||
"天启守护者之链":60,
|
||||
"霜魔低语":60,
|
||||
"荒漠统领之链":30,
|
||||
"雪夜狼踪履":30,
|
||||
"霜蹄驭者扣":120,
|
||||
"九尾千金裘":60,
|
||||
"焰足蜥行履":60,
|
||||
"凛冬之寒":30,
|
||||
"魔音使者之杖":300,
|
||||
"俩生纷争之杖":300,
|
||||
"蛰伏之影":60,
|
||||
"腐化晶核":60,
|
||||
"幽暗骨守之衣":50,
|
||||
"炎蜥噬雷刃":60,
|
||||
"骨龙之心":300,
|
||||
"赤焰蛛带":60,
|
||||
"炎狱魔猪之皮":60,
|
||||
"夜幕霸主之铠":60,
|
||||
"冰龙神卫之冠":60,
|
||||
"冰霜王者靴":60,
|
||||
"邪法低语带":60,
|
||||
"霜寒龙吟刀":60,
|
||||
"狂暴龙炎之心":300,
|
||||
"火焰领主之冠":300,
|
||||
"天狐掩月盔":60,
|
||||
"天启之姿":60,
|
||||
"荒野奔腾之斧":60,
|
||||
"天启皇者带":60,
|
||||
"血肉震荡者":120,
|
||||
"邪恶星界衣":60,
|
||||
"暗影孤鸿长剑":120,
|
||||
"炼狱炎蝠之袍":60,
|
||||
"寒霜之吻":60,
|
||||
"魔影祭祀之靴":60,
|
||||
"暗幕破晓者":60,
|
||||
"虹魔之拥":30,
|
||||
"冰魄战甲":60,
|
||||
"蛮蹄护心铠":60,
|
||||
"沉默暗影裘":60,
|
||||
"狂暴雷霆之靴":60,
|
||||
"幽冥之怨":60,
|
||||
"死水沼泽靴":60,
|
||||
"横行沼泽带":60,
|
||||
"炎狱行者靴":60,
|
||||
"天狼蛛牙":60,
|
||||
"幽影编织者":60,
|
||||
"钢牙追猎者":60,
|
||||
"沉默血痕带":60,
|
||||
"双生魔影袍":300,"魔影护卫者之冠":60}]]
|
||||
)
|
||||
zbcfg.idxs = {"天龙王御敌指环","潜龙王御敌指环","坠天使之心","暗龙王御敌指环","鸣龙王御敌指环",
|
||||
"横行霸道","目空一切","目空一切[史诗]","极度深寒","极度深寒[史诗]"
|
||||
,"来世再做我的英雄","来世再做我的英雄[史诗]","炎君赤羽衣","末日灵魂披风"
|
||||
,"时空沙漏","燃烧的图腾","财神","疾风之戒","滴水穿石","罪孽深重","正邪两立","猝亡之戒"}
|
||||
|
||||
release_print("-------------------dbg:zbcfg.idxs")
|
||||
function jhxbbgame.tab2str(r, tab)
|
||||
local sRet = "{"
|
||||
if tab then
|
||||
local i = 0
|
||||
for k, v in pairs(tab or {}) do
|
||||
local line = tostring(k).."="..jhxbbgame.any2str2(r, v) ..(i > 0 and "," or "")
|
||||
sRet = sRet .. (line)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
sRet = sRet .. "}"
|
||||
return sRet
|
||||
end
|
||||
|
||||
function jhxbbgame.any2str2(ret, ...)
|
||||
local sRet = ""
|
||||
local tbl = { ... }
|
||||
for k, value in pairs(tbl or {}) do
|
||||
local st = type(value)
|
||||
if st == "table" then
|
||||
sRet = sRet .. jhxbbgame.tab2str(ret, value)
|
||||
else
|
||||
sRet = sRet .. tostring(value)
|
||||
end
|
||||
if ret then
|
||||
sRet = sRet .. "\n\r"
|
||||
end
|
||||
end
|
||||
return sRet
|
||||
end
|
||||
|
||||
function jhxbbgame.any2str(...)
|
||||
return jhxbbgame.any2str2(false, ...)
|
||||
end
|
||||
function isValidVariableName(str)
|
||||
if string.match(str, "^%d") then -- 检查是否以数字开头
|
||||
return false
|
||||
end
|
||||
return string.match(str, "^%a[%w_]*$") ~= nil -- 检查是否是字母开头,后面跟字母、数字或下划线
|
||||
end
|
||||
|
||||
tblccc= nil
|
||||
function jhxbbgame.any2lua(...)
|
||||
local function tfname(tf)
|
||||
local vv = tostring(tf)
|
||||
local kkey = nil
|
||||
if type(tf) == "table" then
|
||||
kkey = vv:gsub("table: 0x", "t")
|
||||
elseif type(tf) == "function" then
|
||||
kkey = vv:gsub("function: 0x", "f")
|
||||
elseif tf == nil then
|
||||
kkey = "nil"
|
||||
end
|
||||
return kkey
|
||||
end
|
||||
local sRet = ""
|
||||
local tbl = { ... }
|
||||
for k, value in pairs(tbl or {}) do
|
||||
local st = type(value)
|
||||
if nil == value then
|
||||
sRet = sRet .. st
|
||||
elseif tblccc == value then
|
||||
elseif st == "table" then
|
||||
sRet = sRet .. "{\n"--string.format("{--%s(%d)\n",tfname(value),jhxbbgame.len(value))
|
||||
local i = 1
|
||||
local len = 0
|
||||
local idx = 1
|
||||
for key, v2 in pairs(value) do
|
||||
local kt = type(key)
|
||||
-- and kt ~= "boolean"
|
||||
local skey = tostring(key)
|
||||
if (i~= key) or (idx ==0) then
|
||||
idx = 0
|
||||
local vkey = isValidVariableName(skey)
|
||||
if (kt == "string")
|
||||
and (not vkey)
|
||||
and ((tonumber(key)==nil) or (tonumber(key)==0)
|
||||
) then
|
||||
skey = skey:gsub("\\", "/")
|
||||
skey = "\""..skey.."\""
|
||||
vkey = false
|
||||
elseif (kt == "boolean") then
|
||||
vkey = false
|
||||
end
|
||||
if not vkey then
|
||||
skey = "["..skey.."]"
|
||||
end
|
||||
key = skey.."="
|
||||
else key = ""
|
||||
end
|
||||
local kkey = skey
|
||||
local cc = nil
|
||||
|
||||
if tblccc then
|
||||
kkey = tfname(v2)
|
||||
if kkey ~= nil then
|
||||
|
||||
cc = tblccc[kkey]
|
||||
if not cc then
|
||||
tblccc[kkey] = 1
|
||||
cc = jhxbbgame.any2lua(v2)
|
||||
else
|
||||
cc = kkey
|
||||
end
|
||||
else cc = jhxbbgame.any2lua(v2)
|
||||
end
|
||||
|
||||
else cc = jhxbbgame.any2lua(v2)
|
||||
|
||||
end
|
||||
|
||||
local add = key..cc
|
||||
if i > 1 then
|
||||
add = ","..add
|
||||
end
|
||||
sRet = sRet ..add
|
||||
len = len + #add
|
||||
i = i + 1
|
||||
if len > 80 then
|
||||
sRet = sRet .."\r"
|
||||
len = 0
|
||||
end
|
||||
end
|
||||
sRet = sRet .. "}"
|
||||
elseif st == "function" then
|
||||
local vv = tostring(value)
|
||||
sRet = sRet ..vv:gsub(": ", '(a')..")end"
|
||||
elseif st == "string" then
|
||||
if value:find("\n") then
|
||||
value = value:gsub("%[%[%]%]", '""')
|
||||
value = "[["..value.."]]"
|
||||
else
|
||||
value = value:gsub("\\", "/")
|
||||
value = "\""..value.."\""
|
||||
end
|
||||
sRet = sRet .. value
|
||||
else
|
||||
sRet = sRet .. tostring(value)
|
||||
end
|
||||
sRet = sRet .. ","
|
||||
end
|
||||
return sRet:sub(1, -2)
|
||||
end
|
||||
|
||||
-- if smsg:sub(1, 1) == "*" then
|
||||
-- smsg = smsg:sub(2)
|
||||
-- release_print()
|
||||
-- end
|
||||
|
||||
function jhxbbgame.allcall(actor, fun)
|
||||
if isplayer(actor) then
|
||||
if checkkuafu(actor) and checkkuafuserver() then
|
||||
--release_print("本服通知触发跨服QF")
|
||||
kfbackcall(21, getbaseinfo(actor, 2), fun)
|
||||
return
|
||||
end
|
||||
local funs = fun:split(",")
|
||||
jhxbbgame.log(actor, "allcall.= ", fun, type(_G[fun]))
|
||||
local fn = funs[1]
|
||||
table.remove(funs,1)
|
||||
_G[fn](actor,unpack(funs))
|
||||
end
|
||||
end
|
||||
function jhxbbgame.log2(...)
|
||||
end
|
||||
|
||||
function jhxbbgame.log(...)
|
||||
local arg = { ... }
|
||||
local actor = nil
|
||||
local name = ""
|
||||
if arg[1] and (isplayer(arg[1]) or ismon(arg[1])) then
|
||||
actor = arg[1]
|
||||
name = getbaseinfo(actor, 1)
|
||||
table.remove(arg,1)
|
||||
end
|
||||
|
||||
local smsg = ""
|
||||
for key, value in pairs(arg or {}) do
|
||||
smsg = smsg..tostring(value or "nil")..","
|
||||
end
|
||||
release_print(name,smsg)
|
||||
if actor --and getgmlevel(actor)>0
|
||||
and (smsg and smsg:sub(1,1)==[[*]])
|
||||
then
|
||||
--smsg = smsg:sub(2,#smsg)
|
||||
jhxbbgame.sendmsg(actor,smsg)
|
||||
|
||||
end
|
||||
return smsg
|
||||
end
|
||||
|
||||
function jhxbbgame.dbgout(actor,...)
|
||||
jhxbbgame.log(actor,"*",...)
|
||||
end
|
||||
|
||||
function jhxbbgame.dbgoutr(...)
|
||||
release_print(jhxbbgame.any2str(true, ...))
|
||||
end
|
||||
|
||||
|
||||
function jhxbbgame.in2ii(iname)
|
||||
return tonumber(getstditeminfo(iname,0))
|
||||
end
|
||||
|
||||
|
||||
|
||||
--jhxbbgame.s2f("jhxbbgame.lua", "local game = "..jhxbbgame.any2lua(jhxbbgame))
|
||||
|
||||
|
||||
local olderr = error
|
||||
error = function(m, lv)
|
||||
return olderr(m, lv or 0)
|
||||
end
|
||||
|
||||
function safecall(func, defret, ...)
|
||||
local aret = nil
|
||||
local pass, result, errinfo = pcall(func, ...)
|
||||
if pass then
|
||||
return result, nil
|
||||
else
|
||||
jhxbbgame.log("safecall.fail", result)
|
||||
return defret, errinfo
|
||||
end
|
||||
end
|
||||
|
||||
function safecallEx(func, msg, defret, ...)
|
||||
local aret = nil
|
||||
local pass,result, errinfo = pcall(func, ...)
|
||||
if pass then
|
||||
return result, nil
|
||||
else
|
||||
jhxbbgame.log("safecall.fail", result)
|
||||
return msg..tostring(errinfo), defret, result
|
||||
end
|
||||
end
|
||||
|
||||
function jhxbbgame.makekf()
|
||||
local namesact = { "群骑竞赛", "夺宝战场", "杀戮证道", "据点争夺", "跨服沙巴克","辉煌的凤栖寺院", "泽坤的恩赐", }
|
||||
|
||||
|
||||
local wf = function (key,fn)
|
||||
local content = io.open(fn, "r")
|
||||
if content then
|
||||
local code = content:read("*all")
|
||||
if code then
|
||||
code = code:gsub([[local boxeffid]], "--local boxeffid")
|
||||
code = code:gsub([[boxeffid]], "60584")
|
||||
for key, value in pairs(namesact) do
|
||||
code = code:gsub([[.actname == "]]..value, ".i == "..key)
|
||||
code = code:gsub(key..[[" then]], key.." then")
|
||||
code = code:gsub(key..[[" and]], key.." and")
|
||||
|
||||
end
|
||||
content:close()
|
||||
return code
|
||||
end
|
||||
else
|
||||
release_print("Fail...",fn)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
return wf(nil,"wlua\\verfx\\kfsystem.lua")
|
||||
|
||||
end
|
||||
local function makecd()
|
||||
zbcfg.CD = {}
|
||||
local cdcnt = 0
|
||||
local lu = ""
|
||||
for key, value in pairs(zbcfg._CD) do
|
||||
value = tonumber(value)
|
||||
if value > 0 then
|
||||
lu = "U"..149-cdcnt
|
||||
zbcfg.CD[key]={value,lu}
|
||||
cdcnt = cdcnt + 1
|
||||
end
|
||||
end
|
||||
return lu,cdcnt
|
||||
end
|
||||
local lu,cdcnt = makecd()
|
||||
function jhxbbgame.make()
|
||||
local w = io.open("wlua\\trigger\\zszb.lua", "w+")
|
||||
|
||||
local ret, msg = safecall(function ()
|
||||
|
||||
|
||||
w:write([[
|
||||
local allzb = {}
|
||||
]])
|
||||
|
||||
local i = 0
|
||||
release_print("CD.Var========= ", i)
|
||||
local savecd = {}
|
||||
for key, value in pairs(zbcfg.CD) do
|
||||
local s = getstditeminfo(key,0) or ""
|
||||
if s ~= "" then
|
||||
savecd[s]=value
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- table.sort(savecd,function (a, b)
|
||||
-- return a.k > b.k
|
||||
-- end)
|
||||
savecd=jhxbbgame.any2lua(savecd)
|
||||
|
||||
local lidxsa = {}
|
||||
for key, value in pairs(zbcfg.idxs) do
|
||||
lidxsa[key]=getstditeminfo(value,0)
|
||||
end
|
||||
local lidxs=jhxbbgame.any2lua(lidxsa)
|
||||
|
||||
local zz = jhxbbgame.zb
|
||||
local wf = function (key,fn)
|
||||
local content = io.open(fn, "r")
|
||||
if content then
|
||||
local code = content:read("*all")
|
||||
if key then
|
||||
w:write("allzb["..key.."] = function ()\n\r")
|
||||
end
|
||||
code = code:gsub("jhxbbgame.GetRate%(", "(math.random(1,10000)<=")
|
||||
for key2, value in pairs(lidxsa) do
|
||||
code = code:gsub("zbcfg.idxs%["..key2.."%]", value)
|
||||
end
|
||||
w:write(code)
|
||||
if key then
|
||||
w:write("\n\rend\n\r")
|
||||
end
|
||||
content:close()
|
||||
else
|
||||
release_print("Fail...",fn)
|
||||
end
|
||||
end
|
||||
w:write("zbcfg.CD = "..savecd.."\n")
|
||||
w:write("zbcfg.idxs = "..lidxs.."\n")
|
||||
w:write([[release_print("-----------res--------:zbcfg.idxs")]])
|
||||
w:write("--"..cdcnt.."/"..lu.."\r")
|
||||
|
||||
wf(nil,"wlua\\verfx\\equipeff.lua")
|
||||
--jhxbbgame.zb = {}
|
||||
local nzz ={}
|
||||
for key, value in pairs(zz) do
|
||||
local key2 = getstditeminfo(key,0) or 0
|
||||
if (not key2) or (key2 <= 0) or (not value)or (not value.fn) then
|
||||
release_print("无效的专属装备名字...",key,value)
|
||||
else
|
||||
local cfff = {k=tonumber(key2),fn=value.fn}
|
||||
nzz[#nzz+1]=cfff
|
||||
end
|
||||
end
|
||||
|
||||
release_print("#nzz:"..#nzz)
|
||||
table.sort(nzz,function (a, b)
|
||||
return a.k > b.k
|
||||
end)
|
||||
zz = nzz
|
||||
for key, value in pairs(zz) do
|
||||
--release_print(value.k,key)
|
||||
wf(value.k,value.fn)
|
||||
end
|
||||
|
||||
|
||||
w:write([[
|
||||
jhxbbgame.zb = {}
|
||||
for key, value in pairs(allzb) do
|
||||
jhxbbgame.zb[key]=value()
|
||||
end
|
||||
zbcfg.build()
|
||||
release_print("专属装备.ok",jhxbbgame.len(zbcfg.CD),(zbcfg.CD[50376]and zbcfg.CD[50376][2])or nil)
|
||||
|
||||
]])
|
||||
return "OK"
|
||||
end)
|
||||
w:close()
|
||||
return tostring(ret)..tostring(msg)
|
||||
end
|
||||
|
||||
jhxbbgame.zb = {}
|
||||
for k, v in pairs(getenvirfilelist()) do
|
||||
if string.match(v, "%.([^%.]+)$") == "lua" then
|
||||
if string.match(v, "wlua\\专属") then
|
||||
local mode_path = string.format("Envir\\%s", v)
|
||||
local fun=require(mode_path)
|
||||
if not fun then
|
||||
release_print(mode_path .. ":加载专属失败 ")
|
||||
else
|
||||
local vv = string.gsub(v, "wlua\\专属\\", "")
|
||||
vv = string.gsub(vv, ".lua", "")
|
||||
if string.match(v, "wlua\\专属") then
|
||||
--release_print(vv .. ":加载专属 ")
|
||||
fun.fn = v
|
||||
vv = string.gsub(vv, "专属\\", "")
|
||||
jhxbbgame.zb[vv] = fun
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
release_print("专属装备:=>",safecall(zbcfg.build),jhxbbgame.zb[1])
|
||||
|
||||
|
||||
function zbcfg.makelua()
|
||||
for key, value in pairs(zbcfg.CD) do
|
||||
local fn = "wlua\\专属\\"..key..".lua"
|
||||
local w = io.open(fn, "r")
|
||||
if w == nil then
|
||||
jhxbbgame.log("fn:",fn)
|
||||
fn = fn:gsub("\\专属","\\专属\\tmp")
|
||||
jhxbbgame.s2f(fn,[[--专属装备 by jhxbb
|
||||
local cfg = {
|
||||
}
|
||||
|
||||
cfg[1] = function(actor, -- object 玩家对象
|
||||
Target, -- object 受击对象
|
||||
Hiter, -- object 攻击对象
|
||||
MagicId, -- integer 技能ID
|
||||
Damage, -- integer 伤害
|
||||
Model, -- integer 引擎64_23.10.24新增 当前攻击模式
|
||||
vdata
|
||||
)
|
||||
local v = 1
|
||||
if jhxbbgame.GetRate(100) then
|
||||
jhxbbgame.log(Target, "]]..key..[[ = ", vdata.tmax_hp * 0.01)
|
||||
|
||||
jhxbbgame.HintEff(actor, "]]..key..[[")
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return cfg
|
||||
]])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
--zbcfg.makelua()
|
||||
|
||||
function copy_file(source_file, destination_file)
|
||||
local source = io.open(source_file, "rb")
|
||||
if not source then
|
||||
return false
|
||||
end
|
||||
local destination = io.open(destination_file, "wb")
|
||||
if not destination then
|
||||
--print("无法打开目标文件")
|
||||
source:close()
|
||||
return false
|
||||
end
|
||||
local content = source:read("*all")
|
||||
destination:write(content)
|
||||
source:close()
|
||||
destination:close()
|
||||
return true
|
||||
end
|
||||
|
||||
copy_file("data\\cfg_buff2.xls","data\\cfg_buff.xls")
|
||||
-- copy_file("wlua/verfx/tesxbb.lua","wlua/clmsgs/tesxbb.lua")
|
||||
-- copy_file("wlua/verfx/ui1118.lua","wlua/ui/ui1118.lua")
|
||||
|
||||
|
||||
function jhxbbgame.BodyItem(actor, bidx)
|
||||
local ret = (getconst(actor, "<$USEITEMNAME[" .. bidx .. "]>"))
|
||||
if not ret or ret =="" then
|
||||
return nil
|
||||
else
|
||||
return ret
|
||||
end
|
||||
end
|
||||
|
||||
function zbcfg.idx(actor,item)
|
||||
return getiteminfo(actor,item,2)
|
||||
end
|
||||
function jhxbbgame.reallce(actor,onoff)
|
||||
onoff = onoff or 1
|
||||
local deccnt = 666
|
||||
if onoff ==1 then
|
||||
|
||||
jhxbbgame.HintEff(actor,"setskilldeccd")
|
||||
SetVarInt(actor,"N$cd烈火剑法",1)
|
||||
SetVarInt(actor,"N$cd野蛮冲撞",1)
|
||||
SetVarInt(actor,"N$cd彻地钉",1)
|
||||
SetVarInt(actor,"N$cd双龙斩",1)
|
||||
SetVarInt(actor,"N$cd狮子吼",1)
|
||||
SetVarInt(actor,"N$cd龙影剑法",1)
|
||||
SetVarInt(actor,"N$cd雷霆剑法",1)
|
||||
SetVarInt(actor,"N$cd逐日剑法",1)
|
||||
SetVarInt(actor,"N$cd开天斩",1)
|
||||
SetVarInt(actor,"N$cd擒龙手",1)
|
||||
SetVarInt(actor,"N$cd纵横剑术",1)
|
||||
SetVarInt(actor,"N$cd十步一杀",1)
|
||||
else
|
||||
deccnt = 0
|
||||
jhxbbgame.HintEff(actor,"skillrestcd")
|
||||
end
|
||||
|
||||
setskilldeccd(actor,"烈火剑法","=",deccnt)
|
||||
setskilldeccd(actor,"野蛮冲撞","=",deccnt)
|
||||
setskilldeccd(actor,"彻地钉","=",deccnt)
|
||||
setskilldeccd(actor,"双龙斩","=",deccnt)
|
||||
setskilldeccd(actor,"狮子吼","=",deccnt)
|
||||
setskilldeccd(actor,"龙影剑法","=",deccnt)
|
||||
setskilldeccd(actor,"雷霆剑法","=",deccnt)
|
||||
setskilldeccd(actor,"逐日剑法","=",deccnt)
|
||||
setskilldeccd(actor,"开天斩","=",deccnt)
|
||||
setskilldeccd(actor,"擒龙手","=",deccnt)
|
||||
setskilldeccd(actor,"纵横剑术","=",deccnt)
|
||||
setskilldeccd(actor,"十步一杀","=",deccnt)
|
||||
end
|
||||
function jhxbbgame.GetRate(ratetag)
|
||||
return true
|
||||
end
|
||||
|
||||
function math.round(num)
|
||||
return num >= 0 and math.floor(num + 0.5) or math.ceil(num - 0.5)
|
||||
end
|
||||
|
||||
function math.sign(num)
|
||||
if num > 0 then
|
||||
return 1
|
||||
elseif num < 0 then
|
||||
return -1
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
local oldhumanhp = humanhp
|
||||
function humanhp2(actor,...)
|
||||
jhxbbgame.log(actor,"*humanhp",...)
|
||||
--oldhumanhp(actor,...)
|
||||
end
|
||||
local oldaddhpper = addhpper
|
||||
function addhpper2(actor,...)
|
||||
jhxbbgame.log(actor,"*addhpper",...)
|
||||
--oldaddhpper(actor,...)
|
||||
end
|
||||
local oldstartup= startup
|
||||
function dbgstartup(sysobj)
|
||||
release_print("startup",getstditeminfo("霜蹄驭者扣",0))
|
||||
|
||||
if not checkkuafuserver() then
|
||||
genmon("k0108",6,11,"练功师",1,1,233)
|
||||
genmon("k0108",9,11,"一大陆-僵尸洞",1,1,233)
|
||||
|
||||
end
|
||||
genmon("0",139,153,"练功师",0,1,233)
|
||||
genmon("0",143,157,"练功师",0,1,233)
|
||||
|
||||
if oldstartup then
|
||||
oldstartup(sysobj)
|
||||
end
|
||||
end
|
||||
startup = dbgstartup
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
local function test(actor)
|
||||
if npcid == 34 then
|
||||
say(actor, [[
|
||||
[@main]
|
||||
<Img|move=0|hidemain=1|img=public/bg_npc_01.png|loadDelay=1|bg=1|reset=1|show=0>
|
||||
<Layout|x=545|y=0|width=80|height=80|link=@exit>
|
||||
<Button|x=546|y=0|nimg=public/1900000510.png|pimg=public/1900000511.png|link=@exit>
|
||||
<PageView|children={1,3,2}|x=297.0|y=49.0|width=450|height=200|direction=1|color=255>
|
||||
<Layout|id=1|x=206.0|y=193.0|color=251>
|
||||
<Layout|id=3|x=361.0|y=349.0|color=254>
|
||||
<Layout|id=2|x=265.0|y=245.0|color=253>
|
||||
]])
|
||||
return
|
||||
end
|
||||
edcode = require("Envir/wlua/edcode.lua")
|
||||
local function compress(data)
|
||||
return edcode:CompressDeflate(data)
|
||||
end
|
||||
|
||||
local function decompress(data)
|
||||
return edcode:DecompressDeflate(data)
|
||||
end
|
||||
|
||||
-- jhxbbgame.encom = compress
|
||||
-- jhxbbgame.endecom = decompress
|
||||
local function t2(...)
|
||||
-- 测试
|
||||
local original_data = jhxbbgame.ui.ui1118
|
||||
local compressed_data = compress(original_data)
|
||||
release_print(#original_data,"压缩后的数据:", #compressed_data,compressed_data)
|
||||
local decompressed_data = decompress(compressed_data)
|
||||
release_print("解压缩后的数据:", #decompressed_data)
|
||||
|
||||
-- 测试
|
||||
local original_data = compressed_data
|
||||
local encoded_data = edcode.ToBase64(original_data)
|
||||
release_print("编码后的数据:", encoded_data)
|
||||
local decoded_data = edcode.FromBase64(encoded_data)
|
||||
release_print("解码后的数据:", decoded_data)
|
||||
release_print(".zbcfg.load() =2 ",jhxbbgame.any2lua(dd),jhxbbgame.any2lua(cc))
|
||||
release_print(".zbcfg.load() =2.::",jhxbbgame.any2lua(dd1),jhxbbgame.any2lua(cc1))
|
||||
release_print("解码后的数据:", decoded_data)
|
||||
end
|
||||
|
||||
end
|
||||
test()
|
||||
end
|
||||
require("Envir/wlua/equipeff.lua")
|
||||
local cc= {}
|
||||
local dd= {}
|
||||
for key, value in pairs(jhxbbgame.zb) do
|
||||
local s1 = getstditeminfo(key,2) or 0
|
||||
|
||||
local a=0
|
||||
if s1 >= 300 then
|
||||
a = 71 + (s1 - 300)
|
||||
dd[a] = s1
|
||||
else
|
||||
cc[s1] = (cc[s1] or 0)+1
|
||||
end
|
||||
end
|
||||
local cc1= {}
|
||||
local dd1= {}
|
||||
for key, value in pairs(zbcfg.idxs) do
|
||||
local s1 = getstditeminfo(value,2) or 0
|
||||
|
||||
local a=0
|
||||
if s1 >= 300 then
|
||||
a = 71 + (s1 - 300)
|
||||
dd1[a] = s1
|
||||
else
|
||||
cc1[s1] = (cc1[s1] or 0)+1
|
||||
end
|
||||
end
|
||||
|
||||
for key, value in pairs(dd) do
|
||||
table.remove(cc,value)
|
||||
end
|
||||
local eqidxtab = {
|
||||
}
|
||||
|
||||
for key, value in pairs(zbcfg.eqpos) do
|
||||
eqidxtab[value] = "<$USEITEMID[" .. value .. "]>"
|
||||
end
|
||||
|
||||
jhxbbgame.eqidxtab = eqidxtab
|
||||
aab()
|
||||
jhxbbgame.s2f("wlua/verfx/aaa.lua",jhxbbgame.any2lua(eqidxtab))
|
||||
--jhxbbgame.msgsv.reg(require("Envir/wlua/合服礼包.lua"))
|
||||
function jhxbbgame.makedbg()
|
||||
|
||||
jhxbbgame.localdata=jhxbbgame.recfile({dbg1118=jhxbbgame.ui.dbg1118,
|
||||
--ui=jhxbbgame.any2lua(jhxbbgame.ui),
|
||||
--dbg=jhxbbgame.f2s("wlua/verfx/dbgsvbuding.lua")
|
||||
dbgsv=jhxbbgame.f2s("wlua/verfx/texbb.lua")
|
||||
},true)
|
||||
|
||||
jhxbbgame.s2f("wlua/verfx/lst.txt",tbl2json(jhxbbgame.localdata))
|
||||
jhxbbgame.log("*jhxbbgame.makedbg()")
|
||||
end
|
||||
|
||||
--require("Envir/wlua/verfx/dbgsvbuding.lua")
|
||||
local rr = require("Envir/wlua/verfx/texbb.lua")
|
||||
jhxbbgame.msgsv.reg(rr)
|
||||
|
||||
--
|
||||
jhxbbgame.reloadui("dbg1118",nil,jhxbbgame.f2s("wlua/verfx/dbg1118.lua"))
|
||||
|
||||
jhxbbgame.makedbg()
|
||||
local kfcode = jhxbbgame.makekf("wlua/verfx/kfsystem.lua",1)
|
||||
--local w = io.open("wlua\\clmsgs\\kuafusysproc.lua", "w+")
|
||||
--w:write(code)
|
||||
--w:close()
|
||||
jhxbbgame.reloadui("kuafusysproc",kfcode,nil)
|
||||
local wret = jhxbbgame.s2f([[\wlua\clmsgs\kuafusysproc.lua]],kfcode)
|
||||
jhxbbgame.log("*jhxbbgame.111111()--------",#kfcode, wret)
|
||||
local oldhumanhp = humanhp
|
||||
function humanhp22(actor,operate,nvalue,effid,delay,hiter,isSend,isRob)
|
||||
jhxbbgame.log(actor,"*humanhp",operate,nvalue)
|
||||
end
|
||||
|
||||
function makeposfile()
|
||||
local function getCirclePoints(x0, y0, r)
|
||||
local points = {}
|
||||
local step = math.pi / 8 -- 每次增加的角度
|
||||
local function add(xy)
|
||||
points[xy.x.."_"..xy.y] = {x=xy.x,y=xy.y}
|
||||
|
||||
end
|
||||
for a = 0, 2 * math.pi, step do
|
||||
local x1 = math.floor(x0 + r * math.cos(a) + 0.5)
|
||||
local y1 = math.floor(y0 + r * math.sin(a) + 0.5)
|
||||
if (x1 - x0)^2 + (y1 - y0)^2 <= r^2 then
|
||||
add({x = x1, y = y1})
|
||||
end
|
||||
add({x = x0 - (x1 - x0), y = y1})
|
||||
add({x = x1, y = y0 - (y1 - y0)})
|
||||
add({x = x0 - (x1 - x0), y = y0 - (y1 - y0)})
|
||||
end
|
||||
local ret = {}
|
||||
for key, value in pairs(points) do
|
||||
ret[#ret+1] = value
|
||||
end
|
||||
return ret
|
||||
end
|
||||
local function name(i)
|
||||
local aa = tbl2json(getCirclePoints(0,0,i))
|
||||
aa= string.gsub(aa, ":", "=")
|
||||
aa= string.gsub(aa, "\"", "")
|
||||
aa= string.gsub(aa, "]", "")
|
||||
aa= string.gsub(aa, "%[", "")
|
||||
return aa
|
||||
end
|
||||
local w = io.open("wlua\\trigger\\rpos.lua", "w+")
|
||||
w:write("jhxbbgame.rpos ={","[2]={"..name(2)
|
||||
.."},","[4]={"..
|
||||
(name(4)).."},","[6]={"..
|
||||
(name(6)).."}}")
|
||||
w:close()
|
||||
|
||||
SL:HTTPRequestGet("https://www.baidu.com/", function (success, response)
|
||||
|
||||
SL:Print("HTTPRequestGet...",success, response)
|
||||
-- success: boolean 请求是否成功
|
||||
-- response: string 请求返回数据
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
-- local qfitem ={{Index=11,pic=22},{Index=11,pic=3}}
|
||||
-- table.sort(qfitem,function(a,b)
|
||||
-- return a.pic < b.pic
|
||||
-- end)
|
||||
|
||||
-- print(jhxbbgame.any2lua(qfitem))
|
||||
|
||||
|
||||
-- function myOtherCoroutine()
|
||||
-- print("协程开始执行")
|
||||
-- coroutine.yield()
|
||||
-- print("协程恢复执行")
|
||||
-- end
|
||||
--print("-------------------玲珑八面",getstditeminfo("玲珑八面[史诗]",0))
|
||||
-- local co = coroutine.create(myOtherCoroutine);
|
||||
-- print(coroutine.status(co));
|
||||
-- coroutine.resume(co);
|
||||
-- print(coroutine.status(co));
|
||||
|
||||
|
||||
|
||||
function aaafafaaa()
|
||||
local cd = os.time()
|
||||
local function _run(actor)
|
||||
if jhxbbgame.GetRate(2500) then
|
||||
local curtime = os.time()
|
||||
if curtime > cd then
|
||||
--cd = curtime + 5
|
||||
local x = getbaseinfo(actor,4)
|
||||
local y = getbaseinfo(actor,5)
|
||||
local eff = {{1,470},{7,527,5000},{10,511},{5,458}}
|
||||
local e =eff[2]--[math.random(#eff)]
|
||||
rangeharm(actor,
|
||||
x,
|
||||
y,
|
||||
8,
|
||||
0,
|
||||
e[1],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
e[2],
|
||||
999)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user