Commit 235d8a37b937c07bb7a2700c7238aaa643dd6d0c

Authored by liuzujun
1 parent 6a9c06e5

#fxcn_11862 角色精进点了学习技能的不会消耗材料

Showing 1 changed file with 9 additions and 5 deletions   Show diff stats
src/actions/HeroAction.lua
@@ -202,11 +202,8 @@ function _M.talentRpc(agent, data) @@ -202,11 +202,8 @@ function _M.talentRpc(agent, data)
202 202
203 203
204 local cost = {} 204 local cost = {}
205 - if curLevel == #curData then  
206 - talent = talent:setv(0, curStage + 1)  
207 - talent = talent:setv(1, 1)  
208 - else  
209 - if curLevel > #curData then return 2 end 205 + if curLevel < #curData then
  206 + --if curLevel > #curData then return 2 end
210 207
211 local talentData = curData[curLevel] 208 local talentData = curData[curLevel]
212 if not talentData then return 3 end 209 if not talentData then return 3 end
@@ -217,6 +214,13 @@ function _M.talentRpc(agent, data) @@ -217,6 +214,13 @@ function _M.talentRpc(agent, data)
217 if not role:checkItemEnough(cost) then return 5 end 214 if not role:checkItemEnough(cost) then return 5 end
218 if not role:costItems(cost, {log = {desc = "heroTalent", int1 = msg.id, int2 = hero:getProperty("type")}}) then return 6 end 215 if not role:costItems(cost, {log = {desc = "heroTalent", int1 = msg.id, int2 = hero:getProperty("type")}}) then return 6 end
219 talent = talent:setv(1, curLevel + 1) 216 talent = talent:setv(1, curLevel + 1)
  217 +
  218 + if curLevel + 1 == #curData then
  219 + talent = talent:setv(0, curStage + 1)
  220 + talent = talent:setv(1, 1)
  221 + end
  222 + else
  223 + return 2
220 end 224 end
221 curStage = talent:getv(0, 1) 225 curStage = talent:getv(0, 1)
222 role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = curStage, count = 1}) 226 role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = curStage, count = 1})