Advertisement
Guest User

skills_stages_advance.lua

a guest
Aug 14th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. function onAdvance(cid, skill, oldLevel, newLevel)
  2.    
  3.     local stagesVocation = getPlayerVocation(cid)
  4.     if stagesVocation > 4 then
  5.         stagesVocation = stagesVocation - 4
  6.     end
  7.    
  8.     local targetVocation = skillStagesConfig[stagesVocation]
  9.     if targetVocation then
  10.         local targetSkillStage = targetVocation[skill]
  11.         if targetSkillStage then
  12.             local skillRate = 1
  13.             for level, rate in pairs(targetSkillStage) do
  14.                 if newLevel >= level[1] and newLevel <= level[2] then
  15.                     skillRate = rate
  16.                 end
  17.             end
  18.             doPlayerSetRate(cid, skill, skillRate)
  19.         end
  20.     end
  21.    
  22.     return true
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement