From e14c290ea85a382aa10a5e5a102f627fa5eeadf4 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 19 Dec 2024 15:49:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(NpcTeleport):=20=E4=BF=AE=E5=A4=8D=E8=BD=AC?= =?UTF-8?q?=E7=94=9F=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改了 Actor.checkActorLevel 的调用参数,将转生检查的逻辑修正 - 优化了转生检查通过后的处理流程,提高了代码的可读性和效率 - 保留了原有的套装检查和场景传送检测逻辑 --- .../data/functions/NpcEvent/NpcTeleport.txt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/LogicServer/data/functions/NpcEvent/NpcTeleport.txt b/LogicServer/data/functions/NpcEvent/NpcTeleport.txt index d31e0c6..9df9c74 100755 --- a/LogicServer/data/functions/NpcEvent/NpcTeleport.txt +++ b/LogicServer/data/functions/NpcEvent/NpcTeleport.txt @@ -122,25 +122,27 @@ if NetmsgDispatcher then return end - -- 检查转生 - local zs = config.zsLevel and Actor.checkActorLevel(actor,config.zsLevel, 0) + -- 检查转生 + local zs = config.zsLevel and Actor.checkActorLevel(actor, 0, config.zsLevel) --local tips = string.format(Lang.TisMsg.xxx, config.nLevel) --Actor.sendTipmsg(actor, "等级不足!", ttFlyTip) - if editionConf.suit == System.getServerId() and config.suit then + if zs == true then + --转生符合检查则不用进行下面的检查 + elseif editionConf.suit == System.getServerId() and config.suit then -- 检查套装 local suit = SuitConfig[config.suit] if suit and suit.equip then - local myJob = Actor.getIntProperty(actor, PROP_ACTOR_VOCATION) - for _, v in pairs(suit.equip or {}) do -- 遍历套装配置 - if (not v.job or v.job and v.job == myJob) and false == Actor.hasEquiment(actor, v.id) then - --Actor.sendTipmsg(actor, "未穿戴套装["..v.name.."]", tstUI) - return - end - end - end - else - if zs ~= true then return end - end + local myJob = Actor.getIntProperty(actor, PROP_ACTOR_VOCATION) + for _, v in pairs(suit.equip or {}) do -- 遍历套装配置 + if (not v.job or v.job and v.job == myJob) and false == Actor.hasEquiment(actor, v.id) then + --Actor.sendTipmsg(actor, "未穿戴套装["..v.name.."]", tstUI) + return + end + end + end + else + if zs ~= true then return end + end -- 场景传送检测 if not Actor.canTelport(actor, config.nSceneId) then