lib996++
This commit is contained in:
parent
5ce82329ee
commit
6b92d60324
73
equipeff.lua
73
equipeff.lua
@ -1,3 +1,4 @@
|
||||
local zbcfg = zbcfg
|
||||
function takeonex(actor, -- object 玩家对象
|
||||
item, --object 物品对象
|
||||
where, --integer 穿/脱位置
|
||||
@ -27,6 +28,7 @@ end
|
||||
|
||||
|
||||
function delayequipchg(actor, tp, offidx)
|
||||
local jhxbbgame = jhxbbgame
|
||||
tp = oldtoint(tp) or VarInt(actor,"N$reload_tp")
|
||||
offidx = VarInt(actor,"N$reload_offidx")
|
||||
SetVarStr(actor,"N$reload_offidx",0)
|
||||
@ -34,6 +36,7 @@ function delayequipchg(actor, tp, offidx)
|
||||
makebodyitemindexs(actor, nil, 1+tp*100, offidx)
|
||||
end
|
||||
function zbcfg.reload(actor,tp,offidx)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--jhxbbgame.log(actor,"zbcfg.reload = ", tp, offidx)
|
||||
|
||||
tp = tp or 666
|
||||
@ -50,6 +53,7 @@ end
|
||||
bodyitem_index = {}
|
||||
local oldpkpoint = {}
|
||||
function pkpointchanged(actor, pkv)
|
||||
local jhxbbgame = jhxbbgame
|
||||
pkv = pkv or 0
|
||||
-- local old = oldpkpoint[actor] or 0
|
||||
-- if old ~= pkv and pkv > old then
|
||||
@ -66,6 +70,7 @@ function zbcfg.NowRecalcAbil(actor)
|
||||
end
|
||||
|
||||
function zbcfg.initex(actor, items)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local cnt = 0
|
||||
local vdata = { timecur = jhxbbgame.ticksec() }
|
||||
for key, value in pairs(items) do
|
||||
@ -78,6 +83,7 @@ function zbcfg.initex(actor, items)
|
||||
return cnt
|
||||
end
|
||||
function zbcfg.init(actor, items)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local cnt = 0
|
||||
local zlcnt = 0
|
||||
local kkv = 0
|
||||
@ -204,6 +210,7 @@ function zbcfg.init(actor, items)
|
||||
end
|
||||
|
||||
function zbcfg.uninit(actor, idx,itemName)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--delayequipchg(actor,222)
|
||||
local vdata = { timecur = jhxbbgame.ticksec() }
|
||||
local value = zbcfg.zbx[idx]
|
||||
@ -222,6 +229,7 @@ function zbcfg.uninit(actor, idx,itemName)
|
||||
end
|
||||
|
||||
function zbcfg.GetBodyItem(actor, i, cnt,log)
|
||||
local jhxbbgame = jhxbbgame
|
||||
cnt = cnt or 1
|
||||
local uid = getbaseinfo(actor, 2)
|
||||
local Itma = bodyitem_index[uid]
|
||||
@ -252,6 +260,7 @@ zbcfg.eqpos = {77,111,74,108,112,101,105,109,79
|
||||
|
||||
|
||||
function zbcfg.cdpass(actor, vdata, mode, tp)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local cfg = zbcfg.CD[vdata.zb]
|
||||
local cd = (cfg and (cfg[1])) or 0
|
||||
--release_print("cdpass.cd = ", cd,tbl2json(cfg))
|
||||
@ -270,6 +279,7 @@ function zbcfg.cdpass(actor, vdata, mode, tp)
|
||||
end
|
||||
|
||||
function zbcfg.cdupdate(actor, vdata, mode)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local cfg = zbcfg.CD[vdata.zb];
|
||||
local cd = (cfg and cfg[1]) or 0
|
||||
if cd > 0 then
|
||||
@ -282,6 +292,7 @@ function zbcfg.cdupdate(actor, vdata, mode)
|
||||
end
|
||||
|
||||
function zbcfg.die(actor)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local vdata = {
|
||||
timecur = jhxbbgame.ticksec(),
|
||||
max_hp = getbaseinfo(actor, 10),
|
||||
@ -306,6 +317,7 @@ function zbcfg.die(actor)
|
||||
end
|
||||
|
||||
function zbcfg.Realive(actor,m)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local vdata = {
|
||||
timecur = jhxbbgame.ticksec(),
|
||||
max_hp = getbaseinfo(actor, 10),
|
||||
@ -333,6 +345,7 @@ end
|
||||
|
||||
zbcfg.ResetVarAtLogin = { "D99" }
|
||||
function zbcfg.login(actor)
|
||||
local jhxbbgame = jhxbbgame
|
||||
svautoplay.die(actor)
|
||||
jhxbbgame.log(actor,"x"..getbaseinfo(actor, 2),getconst(actor, "<$USERACCOUNT>"),getbaseinfo(actor, 1), "zbcfg.login---------------")
|
||||
zbcfg.reload(actor,333, -1)
|
||||
@ -346,6 +359,7 @@ function zbcfg.login(actor)
|
||||
end
|
||||
|
||||
function sendability(actor, bb)
|
||||
local jhxbbgame = jhxbbgame
|
||||
-- if false and getgmlevel(actor) > 1 then
|
||||
-- jhxbbgame.log(actor,
|
||||
-- "sendability:专属=",
|
||||
@ -360,6 +374,7 @@ function sendability(actor, bb)
|
||||
end
|
||||
|
||||
function kflogin(actor)
|
||||
local jhxbbgame = jhxbbgame
|
||||
jhxbbgame.bfcall(actor, "kflogined", {})
|
||||
release_print(actor, ".kflogin **= ")
|
||||
--login(actor)
|
||||
@ -370,6 +385,7 @@ function kflogin(actor)
|
||||
end
|
||||
|
||||
function kuafuend(actor)
|
||||
local jhxbbgame = jhxbbgame
|
||||
SetVarInt(actor,"N$kftime", os.time())
|
||||
kuafusys.kend(actor)
|
||||
jhxbbgame.ShowTopBtn(actor)
|
||||
@ -378,6 +394,7 @@ function kuafuend(actor)
|
||||
end
|
||||
|
||||
function bfsyscall19(actor, arg1, arg2)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local role_name = getbaseinfo(actor, 1)
|
||||
release_print("收到通知", role_name, arg1, arg2)
|
||||
local cfg = json2tbl(arg1) or {15,0}
|
||||
@ -386,6 +403,7 @@ function bfsyscall19(actor, arg1, arg2)
|
||||
end
|
||||
|
||||
function makebodyitemindexs(actor, r, tp, offidx)
|
||||
local jhxbbgame = jhxbbgame
|
||||
offidx = tonumber(offidx) or 0
|
||||
tp = tonumber(tp) or 17
|
||||
if checkkuafu(actor) and not checkkuafuserver() then
|
||||
@ -457,6 +475,7 @@ function makebodyitemindexs(actor, r, tp, offidx)
|
||||
end
|
||||
|
||||
function getbodyitemindexs(actor, mode)
|
||||
local jhxbbgame = jhxbbgame
|
||||
mode = mode or 1
|
||||
local uid = getbaseinfo(actor, 2)
|
||||
local pbodyitem_index = bodyitem_index[uid]
|
||||
@ -471,6 +490,7 @@ function getbodyitemindexs(actor, mode)
|
||||
end
|
||||
|
||||
function bfsyscall18(actor, arg1, arg2)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local role_name = getbaseinfo(actor, 1)
|
||||
--release_print("收到通知", role_name, arg1, arg2)
|
||||
ontimer18(actor)
|
||||
@ -478,6 +498,7 @@ end
|
||||
|
||||
--每秒执行,跨服也执行
|
||||
function ontimer18(actor)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--setofftimer(actor, 18)
|
||||
|
||||
if checkkuafuserver()--~=checkkuafu(actor)
|
||||
@ -520,6 +541,7 @@ function ontimer18(actor)
|
||||
end
|
||||
|
||||
function boomRange(player, r, eff)
|
||||
local jhxbbgame = jhxbbgame
|
||||
r = tonumber(r)
|
||||
local map_id = getbaseinfo(player, 3)
|
||||
local x = getbaseinfo(player, 4)
|
||||
@ -549,6 +571,7 @@ function boomRange(player, r, eff)
|
||||
end
|
||||
|
||||
function canpush(actor, target,hiter, magid,result)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--jhxbbgame.log(hiter,"*hiter",result)
|
||||
-- jhxbbgame.log(target,"->target")
|
||||
local ret = jhxbbgame.canpush(hiter, target)
|
||||
@ -562,6 +585,7 @@ end
|
||||
|
||||
|
||||
function jhxbbgame.canpush(self, tag)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local sr,tr = getbaseinfo(self, 39) , getbaseinfo(tag, 39)
|
||||
local sl,tl = getbaseinfo(self, 6) , getbaseinfo(tag, 6)
|
||||
local boret = (sr > tr)
|
||||
@ -573,6 +597,7 @@ function jhxbbgame.canpush(self, tag)
|
||||
return boret
|
||||
end
|
||||
function magtagfunc27(actor, target)
|
||||
local jhxbbgame = jhxbbgame
|
||||
if isnotnull(target) then
|
||||
if zbcfg.GetBodyItem(actor, zbcfg.idxs[7]) then
|
||||
makeposion(target, 5, 1)
|
||||
@ -583,6 +608,7 @@ function magtagfunc27(actor, target)
|
||||
end
|
||||
|
||||
function magtag11111func1003(actor, target)
|
||||
local jhxbbgame = jhxbbgame
|
||||
if isnotnull(target) then
|
||||
if isplayer(actor) then
|
||||
local cnt = tonumber(jhxbbgame.CInt(actor, "<$ATTR[74]>")) * 2
|
||||
@ -593,6 +619,7 @@ function magtag11111func1003(actor, target)
|
||||
end
|
||||
|
||||
function magtagfunc66111(actor, target)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--极度深寒 开天斩50%几率强制冰冻目标1秒
|
||||
if isnotnull(target) then
|
||||
--jhxbbgame.HintEff(target, "极度深寒.神器")
|
||||
@ -600,6 +627,7 @@ function magtagfunc66111(actor, target)
|
||||
end
|
||||
|
||||
function magtagfunc71(actor, target)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--擒龙手
|
||||
if isnotnull(target)
|
||||
and jhxbbgame.canpush(actor, target) then
|
||||
@ -610,6 +638,7 @@ function magtagfunc71(actor, target)
|
||||
end
|
||||
end
|
||||
function magtagfunc2012(actor, target)
|
||||
local jhxbbgame = jhxbbgame
|
||||
if isnotnull(target) then
|
||||
if isplayer(actor) then
|
||||
-- local cnt = tonumber(jhxbbgame.CInt(actor, "<$ATTR[74]>")) * 2
|
||||
@ -620,6 +649,7 @@ function magtagfunc2012(actor, target)
|
||||
end
|
||||
|
||||
function addwd(actor, time, hint)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--changemode(actor,1,1)
|
||||
if isplayer(actor) then
|
||||
time = tonumber(time)
|
||||
@ -637,6 +667,7 @@ end
|
||||
|
||||
--技能释放
|
||||
function beginmagic(actor, skillId, skillName, target, x, y)
|
||||
local jhxbbgame = jhxbbgame
|
||||
beginmagic6(actor, skillId, skillName, target, x, y)
|
||||
if "xdt316" == getbaseinfo(actor,3) and (skillId == 6 or skillId == 51) then
|
||||
return false
|
||||
@ -680,6 +711,7 @@ function beginmagic(actor, skillId, skillName, target, x, y)
|
||||
jhxbbgame.SettimeSec(actor, "U019", 180, vdata.timecur)
|
||||
delbuff(actor, 31126)
|
||||
jhxbbgame.SettimeSec(actor, "N$移动掉血", 0)
|
||||
jhxbbgame.SettimeSec(actor, "N$束缚中", 0)
|
||||
|
||||
delbuff(actor, 31124)
|
||||
delbuff(actor, 31118)
|
||||
@ -758,6 +790,7 @@ local MDposxy = {}
|
||||
|
||||
local cdmon3 = {}
|
||||
function FnPosDamage(sysobj, Hiter)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local cnt = posDamage[Hiter] or 0
|
||||
local pos = MDposxy[Hiter]
|
||||
if cnt >= 1 and (pos) then
|
||||
@ -778,6 +811,7 @@ end
|
||||
local strdamageing = 0
|
||||
local strdamageingcnt = 0
|
||||
function struckdamage(actor, Hiter, Target, MagicId, Damage)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--struckdamage6(actor, Hiter, Target, MagicId, Damage)
|
||||
|
||||
|
||||
@ -995,15 +1029,15 @@ function attackdamage(actor, -- object
|
||||
return Damage
|
||||
end
|
||||
local xbb = jhxbbgame
|
||||
local hp = isplayer(Hiter)
|
||||
-- local stime = gettcount64()
|
||||
kuafusys.pking(Target, actor,Damage)
|
||||
if isplayer(Hiter)
|
||||
and hasbuff(Hiter, 31119) then
|
||||
if hp
|
||||
and jhxbbgame.timeSecAt(Hiter, "N$束缚中") then
|
||||
xbb.sendmsg(Hiter, "束缚中!攻击无效")
|
||||
xbb.log(Hiter, "*束缚中.攻击无效= ")
|
||||
return 0
|
||||
end
|
||||
local hp = isplayer(Hiter)
|
||||
-- if isplayer(actor)
|
||||
-- and ismon(Target)
|
||||
-- --and hasbuff(actor, 31119)
|
||||
@ -1060,18 +1094,19 @@ function attackdamage(actor, -- object
|
||||
vdata.selfy = getbaseinfo(actor, 5)
|
||||
--release_print("attack.111.damage = ", Damage, MagicId)
|
||||
|
||||
if attdamageing == vdata.timecur then
|
||||
attdamageingcnt = attdamageingcnt + 1
|
||||
-- if attdamageing == vdata.timecur then
|
||||
-- attdamageingcnt = attdamageingcnt + 1
|
||||
-- jhxbbgame.log(actor, "*SkipAtt. - ",attdamageingcnt, zbcfg.last,
|
||||
-- MagicId,zbcfg.last2)
|
||||
--jhxbbgame.GMLog(Hiter, ".怪物被攻击.13= ", Model, MagicId,getbaseinfo(Target,12))
|
||||
|
||||
return Damage
|
||||
end
|
||||
-- return Damage
|
||||
-- end
|
||||
--jhxbbgame.GMLog(Hiter, ".怪物被攻击.15= ", Model, MagicId,getbaseinfo(Target,12))
|
||||
|
||||
|
||||
local function k95(aretdam)
|
||||
local jhxbbgame = jhxbbgame
|
||||
if tm and xbb.MonCanBuf(Target) then
|
||||
if getflagstatus(actor, 103) == 1 and
|
||||
(vdata.thp / vdata.tmax_hp)>=0.96 then
|
||||
@ -1081,7 +1116,6 @@ function attackdamage(actor, -- object
|
||||
end
|
||||
return aretdam
|
||||
end
|
||||
attdamageing = vdata.timecur
|
||||
if tp then
|
||||
if xbb.timeSecAt(Target, "D96", vdata.timecur) then
|
||||
xbb.sendmsg(Target, "九天繁星衣免疫中")
|
||||
@ -1107,12 +1141,13 @@ function attackdamage(actor, -- object
|
||||
cnt = cnt + 1
|
||||
end
|
||||
local vv = VarInt(actor, "U018")
|
||||
vv = vv + getbaseinfo(actor, 51, 232)/ 100
|
||||
if vv > 0 then
|
||||
vv = vdata.thp*(vv / 100)
|
||||
--local hpv =
|
||||
xbb.DecHP(Target, vv)
|
||||
|
||||
--jhxbbgame.log(Hiter, "*对人切割百分比= ", vv, hpv)
|
||||
--jhxbbgame.GMLog(Hiter, "*对人切割百分比= ", vv, getbaseinfo(actor, 51, 232))
|
||||
end
|
||||
end
|
||||
elseif tm then
|
||||
@ -1214,12 +1249,12 @@ function attackdamage(actor, -- object
|
||||
end
|
||||
end
|
||||
|
||||
if attdamageingcnt > 0 then
|
||||
xbb.log(actor, "*SkipAtt.end. - ", attdamageingcnt,zbcfg.last,
|
||||
MagicId,zbcfg.last2)
|
||||
attdamageingcnt = 0
|
||||
end
|
||||
attdamageing = 0
|
||||
-- if attdamageingcnt > 0 then
|
||||
-- xbb.log(actor, "*SkipAtt.end. - ", attdamageingcnt,zbcfg.last,
|
||||
-- MagicId,zbcfg.last2)
|
||||
-- attdamageingcnt = 0
|
||||
-- end
|
||||
-- attdamageing = 0
|
||||
--release_print("attack.ret.damage = ",Damage,cnt)
|
||||
if vdata.pwRate and vdata.pwRate ~= 1 then
|
||||
retdam = math.max(math.min(retdam * vdata.pwRate, 1000 * 10000), 0)
|
||||
@ -1234,10 +1269,12 @@ function attackdamage(actor, -- object
|
||||
end
|
||||
|
||||
function zbcfg.idx(actor, item)
|
||||
local jhxbbgame = jhxbbgame
|
||||
return getiteminfo(actor, item, 2)
|
||||
end
|
||||
|
||||
function zbcfg.build()
|
||||
local jhxbbgame = jhxbbgame
|
||||
zbcfg.zbx = {}
|
||||
zbcfg.zbd = {}
|
||||
zbcfg.zbr = {}
|
||||
@ -1289,6 +1326,7 @@ function attackdamagebb(actor, -- object
|
||||
end
|
||||
|
||||
function zbcfg.run(actor, r)
|
||||
local jhxbbgame = jhxbbgame
|
||||
r = r or 1
|
||||
--jhxbbgame.log(actor,"*run",getconst(actor,"<$MAP>"))
|
||||
|
||||
@ -1304,10 +1342,12 @@ function zbcfg.run(actor, r)
|
||||
end
|
||||
|
||||
function attacklong(actor, Target, Hiter, MagicId)
|
||||
local jhxbbgame = jhxbbgame
|
||||
|
||||
end
|
||||
|
||||
function humanhpex(actor, monster_guid)
|
||||
local jhxbbgame = jhxbbgame
|
||||
if monster_guid then
|
||||
local mapID = getbaseinfo(actor, 3)
|
||||
local monobj = getmonbyuserid(mapID, monster_guid)
|
||||
@ -1323,6 +1363,7 @@ function humanhpex(actor, monster_guid)
|
||||
end
|
||||
end
|
||||
function qixinxin(actor,a)
|
||||
local jhxbbgame = jhxbbgame
|
||||
local vdata ={}
|
||||
vdata.m = getbaseinfo(actor, 3)
|
||||
vdata.selfx = getbaseinfo(actor, 4)
|
||||
@ -1342,6 +1383,7 @@ function qixinxin(actor,a)
|
||||
end
|
||||
|
||||
function modaodao(actor,Target)
|
||||
local jhxbbgame = jhxbbgame
|
||||
--SetVarInt(actor, "N$魔刀千刃CD", 0)
|
||||
local vdata ={}
|
||||
vdata.selfx = getbaseinfo(actor, 4)
|
||||
@ -1373,6 +1415,7 @@ function modaodao(actor,Target)
|
||||
sendluamsg(actor, 0xeff, 0, 0, 23, tbl2json(cfg))
|
||||
end
|
||||
function attack(actor, Target, Hiter, MagicId)
|
||||
local jhxbbgame = jhxbbgame
|
||||
|
||||
local vdata = { timecur = jhxbbgame.ticksec() }
|
||||
local gb = getbaseinfo
|
||||
|
||||
26
kfsystem.lua
26
kfsystem.lua
@ -3,7 +3,7 @@ local b2i = { [false] = 0, [true] = 1 }
|
||||
local waittimesec = 3*60
|
||||
|
||||
local namesact = { [0] = "跨服", "群骑竞赛", "夺宝战场", "杀戮证道", "据点争夺", "跨服沙巴克","辉煌的凤栖寺院", "泽坤的恩赐", }
|
||||
local tims = { [0] = { (12 * 60 + 0), (23 * 60 + 30) }
|
||||
local tims = { [0] = { (14 * 60 + 0), (23 * 60 + 30) }
|
||||
, { (16 * 60 + 30), (16 * 60 + 50) }--群骑竞赛
|
||||
, { (18 * 60 + 10), (18 * 60 + 25) }--夺宝战场
|
||||
,nil--, { (20 * 60 + 00), (20 * 60 + 10) }--杀戮证道
|
||||
@ -13,10 +13,10 @@ local tims = { [0] = { (12 * 60 + 0), (23 * 60 + 30) }
|
||||
, { (19 * 60 + 00), (19 * 60 + 50) }--泽坤的恩赐 周日21:00:00
|
||||
|
||||
}
|
||||
local txcl = {[0]="12:00-23:30",
|
||||
local txcl = {[0]="14:00-23:30",
|
||||
"每天16:30-16:50",--群骑竞赛
|
||||
"每天18:10-18:25",--夺宝战场
|
||||
"",--"每天20:00-20:10",--杀戮证道
|
||||
"关闭",--"每天20:00-20:10",--杀戮证道
|
||||
"每周一三五19:00-19:20",--据点争夺
|
||||
"每周二四六19:00-19:50",--跨服沙巴克
|
||||
"每天20:00-20:50",--辉煌的凤栖寺院
|
||||
@ -37,7 +37,7 @@ local boxeffid = 60584
|
||||
local maps = { { "xdt306", 283, 283 }, { "xdt293", 26, 52 }, { "xdt292", 33, 35 },
|
||||
{ "xdt294", 83, 90 }, { "kf3", 650, 300 }, { "xdt292", 33, 35 }, { "xdt316" }, { "xdt292", 33, 35 }, }
|
||||
|
||||
local avtime = {[0]=0, 60, 120, -20, 600, 600, 60*30, 600 }
|
||||
local avtime = {[0]=0, 60, 120, -20, 600, 600, 60*10, 600 }
|
||||
local jfmaps ={[0]={},{ "xdt306" }, { "xdt293" }, { "xdt292" },
|
||||
{ "xdt294","jddd"}, { "kf3", "kf0150" }, { "xdt297",
|
||||
"xdt298",
|
||||
@ -88,11 +88,11 @@ local jlitems = {
|
||||
"代购币#10&绑定元宝#38888&绑定金币#5888888&书页#10#339&布料#10#339&龙玉勋章#1#339",
|
||||
},
|
||||
[5] = {
|
||||
"代购币#10&绑定元宝#98888&绑定金币#18888888&书页#40#339&布料#40#339&龙玉勋章#1#339",
|
||||
"代购币#10&绑定元宝#38888&绑定金币#5888888&书页#10#339&布料#10#339&龙玉勋章#1#339",
|
||||
"代购币#10&绑定元宝#98888&绑定金币#18888888&书页#40#339&布料#40#339&龙玉勋章#10#339",
|
||||
"代购币#10&绑定元宝#38888&绑定金币#5888888&书页#10#339&布料#10#339&龙玉勋章#10#339",
|
||||
},
|
||||
[6] = {
|
||||
"代购币#10&绑定元宝#38888&绑定金币#5888888&书页#10#339&布料#10#339&龙玉勋章#1#339",
|
||||
"代购币#10&绑定元宝#38888&绑定金币#5888888&书页#10#339&布料#10#339&龙玉勋章#10#339",
|
||||
},
|
||||
[7] = {
|
||||
"代购币#10&绑定元宝#38888&绑定金币#5888888&书页#10#339&布料#10#339&龙玉勋章#1#339",
|
||||
@ -121,6 +121,7 @@ kuafusys = {
|
||||
},
|
||||
curact = nil
|
||||
}
|
||||
local kuafusys = kuafusys
|
||||
local recfile="QuestDiary/跨服报名.ini"
|
||||
function kuafusys.read(actor,k)
|
||||
local ss = tostring(getconst(actor, "<$USERNAME>"))..math.floor(os.time()/86400)
|
||||
@ -289,10 +290,10 @@ end
|
||||
function kuafusys_mail(actor,a)
|
||||
jhxbbgame.log(actor,"------------.kuafusys_mail.",tbl2json(a))
|
||||
if a and a.t and a.u then
|
||||
local aactor = getplayerbyid(a.u)
|
||||
if aactor then
|
||||
--local aactor = getplayerbyid(a.u)
|
||||
--if aactor then
|
||||
sendmail(a.u, 1, a.t, a.tt, a.i)
|
||||
end
|
||||
--end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1745,7 +1746,12 @@ function kuafusys.nextcen(actor, c,pass)
|
||||
ca.mon= ca.mon + 1
|
||||
end
|
||||
if 296+ca.mon == 304 then
|
||||
local spd = kuafusys.getdataEx(actor, ca.i)
|
||||
if spd.pd.mapjoin == 0 then
|
||||
jhxbbgame.sendmsg(actor, "您的还未达成活跃,回城后无法再进入活动地图!")
|
||||
else
|
||||
kuafusys.gohome(actor)
|
||||
end
|
||||
else
|
||||
map(actor, "xdt"..(296+ca.mon))
|
||||
end
|
||||
|
||||
144
lib996.lua
144
lib996.lua
@ -33,10 +33,6 @@ local SetofPlayer = {
|
||||
}
|
||||
}
|
||||
|
||||
local CallofPlayer = {
|
||||
SendMsg=jhxbbgame.sendmsg,
|
||||
}
|
||||
|
||||
local GetofPlayer = {
|
||||
get=getbaseinfo,
|
||||
params={
|
||||
@ -103,27 +99,80 @@ local GetofPlayer = {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
local CallofPlayer = {
|
||||
SendMsg=jhxbbgame.sendmsg,
|
||||
MKPosion=makeposion,
|
||||
IncHP=jhxbbgame.IncHP,
|
||||
DecHP=jhxbbgame.DecHP,
|
||||
}
|
||||
|
||||
local Player = {}
|
||||
|
||||
PlayerCache = {Cache = {},freecnt=0}
|
||||
local PlayerCache = PlayerCache
|
||||
|
||||
|
||||
function Player:reset(keys)
|
||||
local kvtab = {}
|
||||
for key1, value in pairs(self._kv) do
|
||||
local b = false
|
||||
for i = 1, #keys, 1 do
|
||||
local key = keys[i]
|
||||
if key1 == key then
|
||||
b = true
|
||||
break
|
||||
end
|
||||
--rawset(self,key,nil)
|
||||
end
|
||||
if not b then
|
||||
kvtab[key1] = value
|
||||
end
|
||||
end
|
||||
self._kv = kvtab
|
||||
end
|
||||
function Player:resetpos()
|
||||
self:reset({"x","y","map"})
|
||||
end
|
||||
|
||||
function PlayerCache.new(actor)
|
||||
local self = setmetatable({_kv={},uid=getbaseinfo(actor,2),_aid = actor}, PlayerCache)
|
||||
|
||||
for key, value in pairs(Player) do
|
||||
--self[key]=value
|
||||
rawset(self,key,value)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function PlayerCache.get(actor)
|
||||
return PlayerCache:Get(actor)
|
||||
end
|
||||
|
||||
function PlayerCache:Add(actor)
|
||||
local cp = self.new(actor)
|
||||
|
||||
for key, value in pairs(self.Cache) do
|
||||
--release_print("ipairs:",key,value.a)
|
||||
if value._uid == mydata._uid and value.a ~= actor then
|
||||
if value._uid == cp._uid and value.a ~= actor then
|
||||
--release_print("remove:",key,value.a)
|
||||
fastkv[key] = nil
|
||||
freecnt = freecnt + 1
|
||||
if freecnt > 100 then
|
||||
fastkv = {}
|
||||
self.Cache[key] = nil
|
||||
self.freecnt = self.freecnt + 1
|
||||
if self.freecnt > 100 then
|
||||
self.freecnt = 0
|
||||
self.Cache = {}
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
--release_print("Add:",actor)
|
||||
fastkv[actor] =mydata
|
||||
return mydata
|
||||
self.Cache[actor] = cp
|
||||
return cp
|
||||
end
|
||||
|
||||
function PlayerCache:Get(actor)
|
||||
return self.Cache[actor] or self:Add(actor)
|
||||
end
|
||||
|
||||
local mt = {}
|
||||
@ -134,64 +183,47 @@ for key, value in pairs(CallofPlayer) do
|
||||
end
|
||||
end
|
||||
|
||||
local metaTable = {
|
||||
|
||||
__index = function(player, key)
|
||||
PlayerCache.__index = function(player, key)
|
||||
local function name(...)
|
||||
local actor = player._aid
|
||||
local mykv = fastkv[actor] or GetPlayerCache(actor)
|
||||
local ret = mykv[key]
|
||||
if ret == nil then
|
||||
local idx = GetofPlayer.params[key]
|
||||
local value = nil
|
||||
if idx then
|
||||
ret = GetofPlayer.get(actor,idx)
|
||||
mykv[key] = ret
|
||||
value = GetofPlayer.get(actor,idx)
|
||||
else
|
||||
ret = mt[key]
|
||||
value = mt[key]
|
||||
end
|
||||
--rawset(player,key,ret)
|
||||
player._kv[key] = value
|
||||
return value
|
||||
end
|
||||
return ret
|
||||
end,
|
||||
__newindex = function(player, key, value)
|
||||
return player._kv[key] or name()
|
||||
end
|
||||
|
||||
PlayerCache.__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)
|
||||
print("Setting a new element via __newindex: ",actor,player.uid, key, value)
|
||||
local idx = SetofPlayer.params[key]
|
||||
if idx then
|
||||
SetofPlayer.set(actor,idx,value)
|
||||
mykv[key] = value
|
||||
player._kv[key] = value
|
||||
--rawset(player,key,value)
|
||||
else
|
||||
print("fail.: ",actor,mykv._uid, key, value)
|
||||
idx = GetofPlayer.params[key]
|
||||
if idx then
|
||||
print("ReadOnly.: ",actor,player.uid, key, value)
|
||||
else
|
||||
print("undefined.: ",actor,player.uid, key, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
setmetatable(metaTable, {__index=function (...)
|
||||
setmetatable(PlayerCache, {__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 = {
|
||||
|
||||
12
texbb.lua
12
texbb.lua
@ -169,8 +169,11 @@ end
|
||||
function jhxbbgame.login(...)
|
||||
local ags = { ... }
|
||||
local actor = ags[1]
|
||||
local myself = Player.new(actor)
|
||||
local myself = PlayerCache.get(actor)
|
||||
myself:SendMsg("벗벗"..myself.x,9)
|
||||
release_print("-----myself:",tbl2json(myself))
|
||||
myself:resetpos()
|
||||
release_print("---1.myself:",tbl2json(myself))
|
||||
local stxt = getbaseinfo(actor, 1) .. ".test.login."
|
||||
--setgmlevel(ags[1], 10)
|
||||
--changemode(ags[1], 1, 999999999)
|
||||
@ -334,7 +337,14 @@ sv1118.msgproc[1118] = function(actor, msgid, n1, n2, n3, sMsg)
|
||||
"&앱쥣瀧[찮]#100&침痢暇벙#100&心췻돨질산柯#100&拱膠裂쥣#200"
|
||||
--gives(actor,ii)
|
||||
changenamecolor(actor,math.random(1,255))
|
||||
confertitle(actor, "称号:凤凰")
|
||||
|
||||
local myself = PlayerCache.get(actor)
|
||||
|
||||
myself:resetpos()
|
||||
|
||||
myself:MKPosion(5,myself.x % 5)
|
||||
myself:SendMsg(myself.name..":哈哈:"..myself.x,9)
|
||||
-- package.loaded["Envir/wlua/북륩쟉관.lua"] = nil
|
||||
-- jhxbbgame.msgsv.reg(require("Envir/wlua/북륩쟉관.lua"))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user