修改绝学绑定武林秘籍装备

This commit is contained in:
admin 2026-06-24 02:59:53 +08:00
parent dbf00fd647
commit 88f8c49ffe
7 changed files with 232 additions and 85 deletions

View file

@ -63,7 +63,6 @@ VarCfg.Player.int.cd["
VarCfg.Player.str = {} ---* 鯤소湛씹str VarCfg.Player.str = {} ---* 鯤소湛씹str
VarCfg.Player.str["<EFBFBD>艱담竟"] = "STR_<EFBFBD>艱담竟" VarCfg.Player.str["<EFBFBD>艱담竟"] = "STR_<EFBFBD>艱담竟"
VarCfg.Player.str["妗頓淃졍"] = "STR_妗頓淃졍" VarCfg.Player.str["妗頓淃졍"] = "STR_妗頓淃졍"
VarCfg.Player.str["绝学修炼"] = "STR_绝学修炼"
VarCfg.Player.str["냥낀샘쏜"] = "STR_냥낀샘쏜" VarCfg.Player.str["냥낀샘쏜"] = "STR_냥낀샘쏜"
VarCfg.Player.str["작념쉽쟨"] = "STR_작념쉽쟨" VarCfg.Player.str["작념쉽쟨"] = "STR_작념쉽쟨"
VarCfg.Player.str["逞괜분綾"] = "STR_逞괜분綾" ---* 逞괜분綾貫零썩傑션쩌 VarCfg.Player.str["逞괜분綾"] = "STR_逞괜분綾" ---* 逞괜분綾貫零썩傑션쩌
@ -116,6 +115,10 @@ VarCfg.item.int = {} ---*
VarCfg.item.int["歌혤조뺏"] = "INT_歌혤조뺏" VarCfg.item.int["歌혤조뺏"] = "INT_歌혤조뺏"
VarCfg.item.int["嶠포<EFBFBD>"] = "INT_嶠포<EFBFBD>" VarCfg.item.int["嶠포<EFBFBD>"] = "INT_嶠포<EFBFBD>"
VarCfg.item.int["看괵깃街"] = "INT_看괵깃街" VarCfg.item.int["看괵깃街"] = "INT_看괵깃街"
VarCfg.item.int["绝学修炼_1"] = "INT_绝学修炼_1"
VarCfg.item.int["绝学修炼_2"] = "INT_绝学修炼_2"
VarCfg.item.int["绝学修炼_3"] = "INT_绝学修炼_3"
VarCfg.item.int["绝学修炼_4"] = "INT_绝学修炼_4"
---* 빙짬독산 ---* 빙짬독산
VarCfg.item.int["빙짬독산_역폘"] = "INT_빙짬독산역폘" VarCfg.item.int["빙짬독산_역폘"] = "INT_빙짬독산역폘"

View file

@ -32,10 +32,17 @@ end
JueXueXiuLianOBJ.qz = JueXueXiuLianOBJ_for() JueXueXiuLianOBJ.qz = JueXueXiuLianOBJ_for()
---* 加入上线同步数据 ---* 加入上线同步数据
-- Player.sycCfg[JueXueXiuLianOBJ._name] = JueXueXiuLianOBJ.cfg Player.sycCfg[JueXueXiuLianOBJ._name] = JueXueXiuLianOBJ.cfg
JueXueXiuLianOBJ.CaChe = {} JueXueXiuLianOBJ.bookPos = 9
JueXueXiuLianOBJ.bookName = "嶠주쵤석"
JueXueXiuLianOBJ.bookVarKeys = {
VarCfg.item.int["없欺錦조_1"],
VarCfg.item.int["없欺錦조_2"],
VarCfg.item.int["없欺錦조_3"],
VarCfg.item.int["없欺錦조_4"],
}
function JueXueXiuLianOBJ:up(actor, p1, p2, p3, data) function JueXueXiuLianOBJ:up(actor, p1, p2, p3, data)
@ -43,13 +50,21 @@ function JueXueXiuLianOBJ:up(actor, p1, p2, p3, data)
return return
end end
local id = data[1].id if not data or not data[1] then
if not data or not id then return
end
local id = data[1].id
if not id then
return return
end end
local open = Player.getkeycount(actor, VarCfg.Player.str["绝学修炼"], id) or nil
if not open then local bookItem = self:getBookItem(actor)
if not bookItem then
return
end
local open = self:getBookJueXue(bookItem, id)
if open <= 0 then
Func.sendmsg9(actor, "该位置您未没有解锁!") Func.sendmsg9(actor, "该位置您未没有解锁!")
return return
end end
@ -58,7 +73,7 @@ function JueXueXiuLianOBJ:up(actor, p1, p2, p3, data)
setflagstatus(actor, VarCfg.Falg_fangshua, 1) setflagstatus(actor, VarCfg.Falg_fangshua, 1)
local xilian_id = self:xilian(actor, id) local xilian_id = self:xilian(actor, id)
local _oldid = Player.getkeycount(actor, VarCfg.Player.str["绝学修炼"], id) local _oldid = self:getBookJueXue(bookItem, id)
if self.cfg.juexue[_oldid] and self.cfg.juexue[_oldid].buff then if self.cfg.juexue[_oldid] and self.cfg.juexue[_oldid].buff then
if hasbuff(actor, self.cfg.juexue[_oldid].buff) then if hasbuff(actor, self.cfg.juexue[_oldid].buff) then
delbuff(actor, self.cfg.juexue[_oldid].buff) delbuff(actor, self.cfg.juexue[_oldid].buff)
@ -66,7 +81,7 @@ function JueXueXiuLianOBJ:up(actor, p1, p2, p3, data)
end end
Player.setkeycount(actor, VarCfg.Player.str["绝学修炼"], id, xilian_id) self:setBookJueXue(actor, bookItem, id, xilian_id)
if self.cfg.juexue[xilian_id].buff then if self.cfg.juexue[xilian_id].buff then
if not hasbuff(actor, self.cfg.juexue[xilian_id].buff) then if not hasbuff(actor, self.cfg.juexue[xilian_id].buff) then
@ -74,9 +89,6 @@ function JueXueXiuLianOBJ:up(actor, p1, p2, p3, data)
end end
end end
Func.sendmsg9(actor, string.format("[绝学修炼]:#70|恭喜您洗练成功,获得:#255|%s#215|!", self.cfg.juexue[xilian_id].name)) Func.sendmsg9(actor, string.format("[绝学修炼]:#70|恭喜您洗练成功,获得:#255|%s#215|!", self.cfg.juexue[xilian_id].name))
---* 刷新缓存
self:get_CaChe(actor)
end end
end end
@ -85,14 +97,21 @@ function JueXueXiuLianOBJ:jiesuo(actor, p1, p2, p3, data)
return return
end end
if not data or not data[1] then
return
end
local id = data[1].id local id = data[1].id
if not data or not id then if not id then
return return
end end
local open = Player.getkeycount(actor, VarCfg.Player.str["绝学修炼"], id) or nil local bookItem = self:getBookItem(actor)
if not bookItem then
return
end
local open = self:getBookJueXue(bookItem, id)
if open then if open > 0 then
Func.sendmsg9(actor, "您已经解锁了该绝学修炼位置!") Func.sendmsg9(actor, "您已经解锁了该绝学修炼位置!")
return return
end end
@ -107,15 +126,12 @@ function JueXueXiuLianOBJ:jiesuo(actor, p1, p2, p3, data)
setflagstatus(actor, VarCfg.Falg_fangshua, 1) setflagstatus(actor, VarCfg.Falg_fangshua, 1)
local xilian_id = self:xilian(actor, id) local xilian_id = self:xilian(actor, id)
Player.setkeycount(actor, VarCfg.Player.str["绝学修炼"], id, xilian_id) self:setBookJueXue(actor, bookItem, id, xilian_id)
if self.cfg.juexue[xilian_id].buff then if self.cfg.juexue[xilian_id].buff then
if not hasbuff(actor, self.cfg.juexue[xilian_id].buff) then if not hasbuff(actor, self.cfg.juexue[xilian_id].buff) then
addbuff(actor, self.cfg.juexue[xilian_id].buff) addbuff(actor, self.cfg.juexue[xilian_id].buff)
end end
end end
---* 刷新缓存
self:get_CaChe(actor)
end end
end end
@ -146,41 +162,83 @@ function JueXueXiuLianOBJ:xilian(actor, id)
return tonumber(result1) return tonumber(result1)
end end
function JueXueXiuLianOBJ:getBookItem(actor, tips)
local bookItem = GetItemByPos(actor, self.bookPos)
if not bookItem or bookItem == "0" then
if tips ~= false then
Func.sendmsg9(actor, "헝邱톡덖嶠주쵤석!")
end
return nil
end
local itemName = getiteminfo(actor, bookItem, ConstCfg.iteminfo.name)
if itemName ~= self.bookName then
if tips ~= false then
Func.sendmsg9(actor, "헝邱톡덖嶠주쵤석!")
end
return nil
end
return bookItem
end
function JueXueXiuLianOBJ:getBookJueXue(bookItem, id)
local key = self.bookVarKeys[id]
if not key then
return 0
end
return Item.getint(bookItem, key) or 0
end
function JueXueXiuLianOBJ:getBookJueXueTbl(actor)
local bookItem = self:getBookItem(actor, false)
local tbl = {}
if not bookItem then
return tbl
end
for i, key in ipairs(self.bookVarKeys or {}) do
tbl[i] = Item.getint(bookItem, key) or 0
end
return tbl
end
function JueXueXiuLianOBJ:setBookJueXue(actor, bookItem, id, juexueId)
local key = self.bookVarKeys[id]
if not key then
return
end
Item.setint(actor, bookItem, key, juexueId or 0)
end
function JueXueXiuLianOBJ:get_juexue(actor, id) function JueXueXiuLianOBJ:get_juexue(actor, id)
if not id then if not id then
return return
end end
local juexueCfg = Player.getkeytbl(actor, VarCfg.Player.str["绝学修炼"]) or {} local juexueCfg = self:getBookJueXueTbl(actor)
local tbl = {} local tbl = {}
for i, v in pairs(juexueCfg or {}) do for i, v in pairs(juexueCfg or {}) do
if id and id ~= i then if id ~= i and v > 0 and self.cfg.juexue[v] then
tbl[self.cfg.juexue[v].calss] = true tbl[self.cfg.juexue[v].calss] = true
end end
end end
return tbl return tbl
end end
function JueXueXiuLianOBJ:get_CaChe(actor) function JueXueXiuLianOBJ:hasJueXue(actor, juexueId)
local juexueCfg = Player.getkeytbl(actor, VarCfg.Player.str["绝学修炼"]) or {} if not juexueId then
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) return false
self.CaChe[self_id] = {}
for i, v in pairs(juexueCfg or {}) do
self.CaChe[self_id][v] = true
end end
local juexueCfg = self:getBookJueXueTbl(actor)
for i, v in pairs(juexueCfg or {}) do
if v == juexueId then
return true
end
end
return false
end end
GameEvent.add(EventCfg.onLoginEnd, function(actor)
JueXueXiuLianOBJ:get_CaChe(actor)
end, JueXueXiuLianOBJ)
GameEvent.add(EventCfg.onqfloadend, function(actor)
JueXueXiuLianOBJ:get_CaChe(actor)
end, JueXueXiuLianOBJ)
JueXueXiuLianOBJ.AttackdamageCfg = { JueXueXiuLianOBJ.AttackdamageCfg = {
--* 基本剑术伤害提升5% --* 基本剑术伤害提升5%
@ -345,10 +403,9 @@ JueXueXiuLianOBJ.onAttackPlayCfg = {
--------------* 注册攻击事件 --------------* 注册攻击事件
---* 攻击前触发 对人对怪 ---* 攻击前触发 对人对怪
local function _onAttackdamage(actor, target, hitter, magicId, damage, model, Info) local function _onAttackdamage(actor, target, hitter, magicId, damage, model, Info)
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) for i, v in pairs(JueXueXiuLianOBJ:getBookJueXueTbl(actor)) do
for i, v in pairs(JueXueXiuLianOBJ.CaChe[self_id]) do if v > 0 and JueXueXiuLianOBJ.AttackdamageCfg[v] then
if JueXueXiuLianOBJ.AttackdamageCfg[i] then local func = JueXueXiuLianOBJ.AttackdamageCfg[v]
local func = JueXueXiuLianOBJ.AttackdamageCfg[i]
func(actor, target, hitter, magicId, damage, model, Info) func(actor, target, hitter, magicId, damage, model, Info)
end end
end end
@ -357,10 +414,9 @@ GameEvent.add(EventCfg.onAttackdamage, _onAttackdamage, JueXueXiuLianOBJ)
---* 攻击前触发 对人 ---* 攻击前触发 对人
local function _onAttackHumandamage(actor, target, hitter, magicId, damage, model, Info) local function _onAttackHumandamage(actor, target, hitter, magicId, damage, model, Info)
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) for i, v in pairs(JueXueXiuLianOBJ:getBookJueXueTbl(actor)) do
for i, v in pairs(JueXueXiuLianOBJ.CaChe[self_id]) do if v > 0 and JueXueXiuLianOBJ.AttackHumandamageCfg[v] then
if JueXueXiuLianOBJ.AttackHumandamageCfg[i] then local func = JueXueXiuLianOBJ.AttackHumandamageCfg[v]
local func = JueXueXiuLianOBJ.AttackHumandamageCfg[i]
func(actor, target, hitter, magicId, damage, model, Info) func(actor, target, hitter, magicId, damage, model, Info)
end end
end end
@ -370,10 +426,9 @@ GameEvent.add(EventCfg.onAttackHumandamage, _onAttackHumandamage, JueXueXiuLianO
---* 攻击后触发 对人对怪 ---* 攻击后触发 对人对怪
local function _onAttack(actor, target, hitter, magicId, Info) local function _onAttack(actor, target, hitter, magicId, Info)
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) for i, v in pairs(JueXueXiuLianOBJ:getBookJueXueTbl(actor)) do
for i, v in pairs(JueXueXiuLianOBJ.CaChe[self_id]) do if v > 0 and JueXueXiuLianOBJ.onAttackCfg[v] then
if JueXueXiuLianOBJ.onAttackCfg[i] then local func = JueXueXiuLianOBJ.onAttackCfg[v]
local func = JueXueXiuLianOBJ.onAttackCfg[i]
func(actor, target, hitter, magicId, Info) func(actor, target, hitter, magicId, Info)
end end
end end
@ -382,10 +437,9 @@ GameEvent.add(EventCfg.onAttack, _onAttack, JueXueXiuLianOBJ)
---* 攻击后触发 对怪 ---* 攻击后触发 对怪
local function _onAttackMon(actor, target, hitter, magicId, Info) local function _onAttackMon(actor, target, hitter, magicId, Info)
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) for i, v in pairs(JueXueXiuLianOBJ:getBookJueXueTbl(actor)) do
for i, v in pairs(JueXueXiuLianOBJ.CaChe[self_id]) do if v > 0 and JueXueXiuLianOBJ.onAttackMonCfg[v] then
if JueXueXiuLianOBJ.onAttackMonCfg[i] then local func = JueXueXiuLianOBJ.onAttackMonCfg[v]
local func = JueXueXiuLianOBJ.onAttackMonCfg[i]
func(actor, target, hitter, magicId, Info) func(actor, target, hitter, magicId, Info)
end end
end end
@ -395,10 +449,9 @@ GameEvent.add(EventCfg.onAttackMon, _onAttackMon, JueXueXiuLianOBJ)
---* 攻击后触发 对人 ---* 攻击后触发 对人
local function _onAttackPlay(actor, target, hitter, magicId, Info) local function _onAttackPlay(actor, target, hitter, magicId, Info)
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) for i, v in pairs(JueXueXiuLianOBJ:getBookJueXueTbl(actor)) do
for i, v in pairs(JueXueXiuLianOBJ.CaChe[self_id]) do if v > 0 and JueXueXiuLianOBJ.onAttackPlayCfg[v] then
if JueXueXiuLianOBJ.onAttackPlayCfg[i] then local func = JueXueXiuLianOBJ.onAttackPlayCfg[v]
local func = JueXueXiuLianOBJ.onAttackPlayCfg[i]
func(actor, target, hitter, magicId, Info) func(actor, target, hitter, magicId, Info)
end end
end end

View file

@ -59,8 +59,8 @@ ZhuangBeiLianHuaOBJ.onwhere = {
-- »ùÀà_Ö÷´°Ìå -- »ùÀà_Ö÷´°Ìå
function ZhuangBeiLianHuaOBJ:main(actor, ...) function ZhuangBeiLianHuaOBJ:main(actor, ...)
if getbaseinfo(actor, ConstCfg.gbase.renew_level) < 4 then if getbaseinfo(actor, ConstCfg.gbase.renew_level) < 6 then
Func.sendmsg9(actor, "[装备炼化]:#70|人物4转后开放!") Func.sendmsg9(actor, "[装备炼化]:#70|人物6转后开放!")
return return
end end

View file

@ -2,8 +2,7 @@ MagicOBJ = {}
function beginmagic(actor, magicId, magicName, target, x, y) function beginmagic(actor, magicId, magicName, target, x, y)
if magicId == 25 and isplayer(actor) then if magicId == 25 and isplayer(actor) then
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) if JueXueXiuLianOBJ:hasJueXue(actor, 7) then
if JueXueXiuLianOBJ.CaChe[self_id][7] then
---* 圆月刀法 ---* 圆月刀法
releasemagic(actor, 2012, 1, 3, target, 1) releasemagic(actor, 2012, 1, 3, target, 1)
return false return false
@ -11,8 +10,7 @@ function beginmagic(actor, magicId, magicName, target, x, y)
end end
if magicId == 56 and isplayer(actor) then if magicId == 56 and isplayer(actor) then
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) if JueXueXiuLianOBJ:hasJueXue(actor, 20) then
if JueXueXiuLianOBJ.CaChe[self_id][20] then
if Func.random(20) then if Func.random(20) then
makeposion(target, 12, 2, 1) makeposion(target, 12, 2, 1)
Func.sendmsg(actor, string.format("[技能绝学]:#70|%s#215|触发,冰冻目标持续2s.#7", "追云逐日")) Func.sendmsg(actor, string.format("[技能绝学]:#70|%s#215|触发,冰冻目标持续2s.#7", "追云逐日"))
@ -47,8 +45,7 @@ end
-- 对目标人物使用野蛮冲撞时自身触发 -- 对目标人物使用野蛮冲撞时自身触发
function magtagfunc27(actor, roleObject) function magtagfunc27(actor, roleObject)
if isplayer(actor) then if isplayer(actor) then
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) if JueXueXiuLianOBJ:hasJueXue(actor, 10) then
if JueXueXiuLianOBJ.CaChe[self_id][10] then
if not hasbuff(roleObject, 10002) then if not hasbuff(roleObject, 10002) then
addbuff(roleObject, 10002, 1) addbuff(roleObject, 10002, 1)
playeffect(roleObject, 33, 0, 0, 1, 0, 0) playeffect(roleObject, 33, 0, 0, 1, 0, 0)
@ -56,7 +53,7 @@ function magtagfunc27(actor, roleObject)
end end
end end
if JueXueXiuLianOBJ.CaChe[self_id][11] then if JueXueXiuLianOBJ:hasJueXue(actor, 11) then
if not hasbuff(roleObject, 10003) then if not hasbuff(roleObject, 10003) then
addbuff(roleObject, 10003, 3) addbuff(roleObject, 10003, 3)
Func.sendmsg(actor, string.format("[技能绝学]:#70|%s#215|触发,使目标禁止使用回城、随机、传送.#7", "恶魔降临")) Func.sendmsg(actor, string.format("[技能绝学]:#70|%s#215|触发,使目标禁止使用回城、随机、传送.#7", "恶魔降临"))
@ -67,8 +64,7 @@ end
function magselffunc27(actor) function magselffunc27(actor)
if isplayer(actor) then if isplayer(actor) then
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) if JueXueXiuLianOBJ:hasJueXue(actor, 12) then
if JueXueXiuLianOBJ.CaChe[self_id][12] then
if Player.gettempint(actor, VarCfg.Player.temp.int["迅捷如风"]) == 0 then if Player.gettempint(actor, VarCfg.Player.temp.int["迅捷如风"]) == 0 then
if Func.random(20) then if Func.random(20) then
SetSkillCD(actor, 27, 0) SetSkillCD(actor, 27, 0)
@ -86,8 +82,7 @@ end
function magselffunc26(actor) function magselffunc26(actor)
if isplayer(actor) then if isplayer(actor) then
local self_id = getbaseinfo(actor, ConstCfg.gbase.id) if JueXueXiuLianOBJ:hasJueXue(actor, 15) then
if JueXueXiuLianOBJ.CaChe[self_id][15] then
if Player.gettempint(actor, VarCfg.Player.temp.int["熔灵再生"]) == 0 then if Player.gettempint(actor, VarCfg.Player.temp.int["熔灵再生"]) == 0 then
if Func.random(30) then if Func.random(30) then
releasemagic(actor, 26, 1, 3, 1, 1) releasemagic(actor, 26, 1, 3, 1, 1)

View file

@ -10,6 +10,14 @@ JueXueXiuLianOBJ.UIfile = "game/A/JueXueXiuLianUI"
-- 配置文件 -- 配置文件
JueXueXiuLianOBJ.cfg = {} JueXueXiuLianOBJ.cfg = {}
JueXueXiuLianOBJ.bookPos = 9
JueXueXiuLianOBJ.bookName = "武林秘籍"
JueXueXiuLianOBJ.bookVarKeys = {
"INT_绝学修炼_1",
"INT_绝学修炼_2",
"INT_绝学修炼_3",
"INT_绝学修炼_4",
}
--* 初始化绝学界面 --* 初始化绝学界面
@ -66,7 +74,7 @@ end
function JueXueXiuLianOBJ:get(id) function JueXueXiuLianOBJ:get(id)
local jiesuoCfg = hk.getkeytbl("HUMAN(STR_绝学修炼)") local jiesuoCfg = self:getBookJueXueTbl()
for i, v in pairs(jiesuoCfg or {}) do for i, v in pairs(jiesuoCfg or {}) do
if v == id then if v == id then
return false return false
@ -78,16 +86,18 @@ end
----* 人物解锁格子初始化 ----* 人物解锁格子初始化
function JueXueXiuLianOBJ:jiesuo() function JueXueXiuLianOBJ:jiesuo()
self.id = self.id or 1 self.id = self.id or 1
local jiesuoCfg = hk.getkeytbl("HUMAN(STR_绝学修炼)") GUI:setVisible(self.ui.up_btn, false)
local hasBook = self:getBookItem() and true or false
local jiesuoCfg = self:getBookJueXueTbl()
GUI:ListView_removeAllItems(self.ui.xl_ListView) GUI:ListView_removeAllItems(self.ui.xl_ListView)
for i = 1, 4, 1 do for i = 1, 4, 1 do
local open = jiesuoCfg[i] and true or false local open = jiesuoCfg[i] and jiesuoCfg[i] > 0
local jiesuolist = string.format("jiesuolist_%d", i) local jiesuolist = string.format("jiesuolist_%d", i)
self.ui[jiesuolist] = GUI:Image_Create(self.ui.xl_ListView, jiesuolist, 0, 0, string.format("res/custom/11/box/%d.png", not open and i or 6)) self.ui[jiesuolist] = GUI:Image_Create(self.ui.xl_ListView, jiesuolist, 0, 0, string.format("res/custom/11/box/%d.png", not open and i or 6))
GUI:setTouchEnabled(self.ui[jiesuolist], true) GUI:setTouchEnabled(self.ui[jiesuolist], true)
if open and jiesuoCfg[i] > 0 then if open then
local jiesuo_icon = string.format("jiesuo_icon_%d", i) local jiesuo_icon = string.format("jiesuo_icon_%d", i)
self.ui[jiesuo_icon] = GUI:Image_Create(self.ui[jiesuolist], jiesuo_icon, 34, 54, string.format("res/custom/11/magicIcon/%d.png", self.cfg.juexue[jiesuoCfg[i]].icon)) self.ui[jiesuo_icon] = GUI:Image_Create(self.ui[jiesuolist], jiesuo_icon, 34, 54, string.format("res/custom/11/magicIcon/%d.png", self.cfg.juexue[jiesuoCfg[i]].icon))
GUI:setContentSize(self.ui[jiesuo_icon], 60, 60) GUI:setContentSize(self.ui[jiesuo_icon], 60, 60)
@ -97,7 +107,7 @@ function JueXueXiuLianOBJ:jiesuo()
self.ui[juexue_name] = GUI:Text_Create(self.ui[jiesuolist], juexue_name, 34, 12, 13, "#ffffff", self.cfg.juexue[jiesuoCfg[i]].name) self.ui[juexue_name] = GUI:Text_Create(self.ui[jiesuolist], juexue_name, 34, 12, 13, "#ffffff", self.cfg.juexue[jiesuoCfg[i]].name)
if self.id == i then if hasBook and self.id == i then
if GUI:Win_IsNotNull(self.ui.select_bg) then if GUI:Win_IsNotNull(self.ui.select_bg) then
GUI:removeFromParent(self.ui.select_bg) GUI:removeFromParent(self.ui.select_bg)
end end
@ -130,11 +140,24 @@ function JueXueXiuLianOBJ:jiesuo()
end) end)
end) end)
else else
GUI:addOnClickEvent(self.ui[jiesuolist], function() if hasBook and self.id == i then
GUI:Button_loadTextureNormal(self.ui.up_btn, "res/custom/11/10.png") GUI:Button_loadTextureNormal(self.ui.up_btn, "res/custom/11/10.png")
GUI:Button_loadTexturePressed(self.ui.up_btn, "res/custom/11/11.png") GUI:Button_loadTexturePressed(self.ui.up_btn, "res/custom/11/11.png")
self.xh = self.cfg.jiesuo[i].xh self.xh = self.cfg.jiesuo[i].xh
self:setxh() self:setxh()
GUI:setVisible(self.ui.up_btn, true)
GUI:addOnClickEvent(self.ui.up_btn, function()
ssrMessage:SubLink(self.__cname .. "_jiesuo", { id = i })
end)
end
GUI:addOnClickEvent(self.ui[jiesuolist], function()
self.id = i
GUI:Button_loadTextureNormal(self.ui.up_btn, "res/custom/11/10.png")
GUI:Button_loadTexturePressed(self.ui.up_btn, "res/custom/11/11.png")
self.xh = self.cfg.jiesuo[i].xh
self:setxh()
GUI:setVisible(self.ui.up_btn, hasBook)
GUI:addOnClickEvent(self.ui.up_btn, function() GUI:addOnClickEvent(self.ui.up_btn, function()
ssrMessage:SubLink(self.__cname .. "_jiesuo", { id = i }) ssrMessage:SubLink(self.__cname .. "_jiesuo", { id = i })
@ -144,6 +167,25 @@ function JueXueXiuLianOBJ:jiesuo()
end end
end end
function JueXueXiuLianOBJ:getBookItem()
local equipData = GUIFunction:GetEquipDataByPos(self.bookPos)
if equipData and equipData.Name == self.bookName and equipData.MakeIndex then
return equipData
end
end
function JueXueXiuLianOBJ:getBookJueXueTbl()
local equipData = self:getBookItem()
local tbl = {}
if not equipData then
return tbl
end
for i, key in ipairs(self.bookVarKeys or {}) do
tbl[i] = tonumber(SL:GetValue("ITEM_CUSTOM_VAR_BY_VNAME", equipData.MakeIndex, key)) or 0
end
return tbl
end
function JueXueXiuLianOBJ:setxh() function JueXueXiuLianOBJ:setxh()
GUI:removeAllChildren(self.ui.xh_Layout) GUI:removeAllChildren(self.ui.xh_Layout)
local index = 1 local index = 1
@ -170,14 +212,25 @@ end
---* 注册事件 ---* 注册事件
function JueXueXiuLianOBJ:EventBind() function JueXueXiuLianOBJ:EventBind()
local function JueXueXiuLianOBJ_Var_Change(data) local function reloadBook()
if GUI:Win_IsNotNull(self._parent) then if GUI:Win_IsNotNull(self._parent) then
if data.key == "HUMAN(STR_绝学修炼)" then self:updata()
self:updata()
end
end end
end end
SL:RegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname, JueXueXiuLianOBJ_Var_Change, self._parent)
local function JueXueXiuLianOBJ_Item_Var_Change(data)
if not GUI:Win_IsNotNull(self._parent) then
return
end
local equipData = self:getBookItem()
if equipData and data and tostring(data.MakeIndex) == tostring(equipData.MakeIndex) then
self:updata()
end
end
SL:RegisterLUAEvent(LUA_EVENT_ITEM_CUSTOM_ATTR, self.__cname, JueXueXiuLianOBJ_Item_Var_Change, self._parent)
SL:RegisterLUAEvent(LUA_EVENT_TAKE_ON_EQUIP, self.__cname, reloadBook, self._parent)
SL:RegisterLUAEvent(LUA_EVENT_TAKE_OFF_EQUIP, self.__cname, reloadBook, self._parent)
--关闭窗口 --关闭窗口
SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname, function(widgetName) SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname, function(widgetName)
@ -193,7 +246,9 @@ function JueXueXiuLianOBJ:OnClose(widgetName)
end end
function JueXueXiuLianOBJ:UnRegisterEvent() function JueXueXiuLianOBJ:UnRegisterEvent()
SL:UnRegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname) SL:UnRegisterLUAEvent(LUA_EVENT_ITEM_CUSTOM_ATTR, self.__cname)
SL:UnRegisterLUAEvent(LUA_EVENT_TAKE_ON_EQUIP, self.__cname)
SL:UnRegisterLUAEvent(LUA_EVENT_TAKE_OFF_EQUIP, self.__cname)
SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname) SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname)
end end

View file

@ -2463,6 +2463,42 @@ function ItemTips.PushItemList(cellView, widgetList)
end end
end end
function ItemTips.GetJueXueBookStr(itemData)
if not itemData or itemData.Name ~= "武林秘籍" or not itemData.MakeIndex then
return nil
end
local keys = {
"INT_绝学修炼_1",
"INT_绝学修炼_2",
"INT_绝学修炼_3",
"INT_绝学修炼_4",
}
local lines = {"<[武林绝学]/FCOLOR=70>"}
for i, key in ipairs(keys) do
local juexueId = tonumber(SL:GetValue("ITEM_CUSTOM_VAR_BY_VNAME", itemData.MakeIndex, key)) or 0
local line = string.format("%d.未解锁", i)
local color = 249
if juexueId > 0 then
color = 250
local cfg = JueXueXiuLianOBJ and JueXueXiuLianOBJ.cfg and JueXueXiuLianOBJ.cfg.juexue and JueXueXiuLianOBJ.cfg.juexue[juexueId]
if cfg then
line = string.format("%d.%s%s", i, cfg.name or ("绝学ID:" .. juexueId), cfg.effec or "")
else
line = string.format("%d.绝学ID:%d", i, juexueId)
end
end
table.insert(lines, string.format("<%s/FCOLOR=%s>", line, color))
end
return table.concat(lines, "\\")
end
function ItemTips.CreateJueXueBookWidget(param)
local itemData = param and param.tip_itemData
local richStr = ItemTips.GetJueXueBookStr(itemData)
if richStr and string.len(richStr) > 0 then
return GUI:RichTextFCOLOR_Create(-1, "rich_juexue_book", 0, 0, richStr, ItemTips._richWid, fontSize, "#FFFFFF", vspace, nil, fontPath)
end
end
function ItemTips.FillTipsContent(tipsLayout, cellView, tipsParam) function ItemTips.FillTipsContent(tipsLayout, cellView, tipsParam)
local groupList = ItemTips._config.group local groupList = ItemTips._config.group
local maxWidth = ItemTips._maxWidth local maxWidth = ItemTips._maxWidth
@ -2588,7 +2624,12 @@ function ItemTips.FillTipsContent(tipsLayout, cellView, tipsParam)
-- else -- else
end end
-- 武林秘籍绝学
local juexueBookWidget = ItemTips.CreateJueXueBookWidget(tipsParam)
ItemTips.PushItem(cellView, juexueBookWidget)
if juexueBookWidget then
ItemTips.PushItem(cellView, ItemTips.CreateSplitLine())
end
-- 自定义属性 -- 自定义属性
local diyAttWidget = ItemTips.CreateDiyAttrWidget(tipsParam) local diyAttWidget = ItemTips.CreateDiyAttrWidget(tipsParam)
ItemTips.PushItem(cellView, diyAttWidget) ItemTips.PushItem(cellView, diyAttWidget)

View file

@ -1 +1 @@
{"gm":0,"signkey":"634eff98723b31da43ed35f0dd4edf36","oper_mode":1,"modlist":"http://list.dhsf.xqhuyu.com/testmodlist/modlist_tool_11557.txt","resolution":"1024x768","channel":1} {"oper_mode":2,"modlist":"http:\/\/list.dhsf.xqhuyu.com\/testmodlist\/modlist_tool_11557.txt","channel":1,"gm":0,"signkey":"634eff98723b31da43ed35f0dd4edf36","resolution":"1136x640"}