leandroluck
New Member
- Joined
- Dec 24, 2010
- Messages
- 104
- Reaction score
- 1
Code:
local config = {
-- base vocationId
[1] = {
-- skillId
[SKILL_FIST] = {
-- [{skillLevel}] = skillRate
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_CLUB] = {
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_SWORD] = {
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_AXE] = {
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_DISTANCE] = {
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_SHIELD] = {
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_FISHING] = {
[{10, 60}] = 70,
[{61, 80}] = 30,
[{81, 100}] = 10,
[{101, 300}] = 5
},
[SKILL_MAGLEVEL] = {
[{0, 6}] = 20,
[{7, 15}] = 10,
[{16, 80}] = 5,
[{81, 90}] = 3,
[{91, 95}] = 2,
[{96, 300}] = 1
}
},
local function getSkillRate(player, skillId)
local targetVocation = config[player:getVocation():getBase():getId()]
if targetVocation then
local targetSkillStage = targetVocation[skillId]
if targetSkillStage then
local skillLevel = skillId ~= SKILL_MAGLEVEL and player:getSkillLevel(skillId) or player:getBaseMagicLevel()
for level, rate in pairs(targetSkillStage) do
if skillLevel >= level[1] and skillLevel <= level[2] then
return rate
end
end
end
end
return skillId == SKILL_MAGLEVEL and configManager.getNumber(configKeys.RATE_MAGIC) or configManager.getNumber(configKeys.RATE_SKILL)
end
function Player:onGainSkillTries(skill, tries)
if not APPLY_SKILL_MULTIPLIER then
return tries
end
return tries * getSkillRate(self, skill)
end
Hello the problem is that when I activate this script the players are gaining the exp x1 not by stages