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