From 235d8a37b937c07bb7a2700c7238aaa643dd6d0c Mon Sep 17 00:00:00 2001 From: liuzujun Date: Thu, 30 Dec 2021 11:46:02 +0800 Subject: [PATCH] #fxcn_11862 角色精进点了学习技能的不会消耗材料 --- src/actions/HeroAction.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 358465b..0e2d0ce 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -202,11 +202,8 @@ function _M.talentRpc(agent, data) local cost = {} - if curLevel == #curData then - talent = talent:setv(0, curStage + 1) - talent = talent:setv(1, 1) - else - if curLevel > #curData then return 2 end + if curLevel < #curData then + --if curLevel > #curData then return 2 end local talentData = curData[curLevel] if not talentData then return 3 end @@ -217,6 +214,13 @@ function _M.talentRpc(agent, data) if not role:checkItemEnough(cost) then return 5 end if not role:costItems(cost, {log = {desc = "heroTalent", int1 = msg.id, int2 = hero:getProperty("type")}}) then return 6 end talent = talent:setv(1, curLevel + 1) + + if curLevel + 1 == #curData then + talent = talent:setv(0, curStage + 1) + talent = talent:setv(1, 1) + end + else + return 2 end curStage = talent:getv(0, 1) role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = curStage, count = 1}) -- libgit2 0.21.2