If boters on your server make mlvl/skill 100 at night and you cant catch them it should be useful. You can 'limit' mlvl/skill to dont let cheaters get 100-120 mlvl/skill, but normal players can easy get 60-80 skill.
In game it show rate from config.lua * rate from stages
Skill (sword) stages:
In data\creaturescripts\scripts\ create file skillstagesadvance.lua and paste:
In data\creaturescripts\scripts\ create file skillstageslogin.lua and paste:
In data/creaturescripts/creaturescripts.xml add:
Config example:
From skill 0 (to 59) rate is: skill rate from config.lua * 8
From skill 60 (to 79) rate is: skill rate from config.lua * 5
From skill 80 (to 99) rate is: skill rate from config.lua * 3
From skill 100 (to max. TFS mlvl) rate is: skill rate from config.lua * 2
First stage must be 0
If you dont want stages for X skill/mlvl comment line in config file or remove.
In game it show rate from config.lua * rate from stages
Skill (sword) stages:
Magic level stages:(sword rate change on lvl 12, 14 [config])
11:42 Welcome to the Forgotten Server!
11:42 Your last visit was on Mon Sep 07 10:57:08 2009.
11:42 YOUR RATES: [ Magic Level: 30x || Fist: 15x | Club: 15x | Sword: 15x | Axe: 15x | Distance: 15 | Shielding: 27x | Fishing: 3x ]
11:42 You advanced in sword fighting.
11:42 You advanced in sword fighting.
11:42 sword fighting rate changed from 15x to 12x. YOUR RATES: [ Magic Level: 30x || Fist: 15x | Club: 15x | Sword: 12x | Axe: 15x | Distance: 15 | Shielding: 27x | Fishing: 3x ]
11:43 You advanced in sword fighting.
11:43 You advanced in sword fighting.
11:43 sword fighting rate changed from 12x to 9x. YOUR RATES: [ Magic Level: 30x || Fist: 15x | Club: 15x | Sword: 9x | Axe: 15x | Distance: 15 | Shielding: 27x | Fishing: 3x ]
In data\creaturescripts\scripts\ create file stagesconfig.lua and paste:11:45 YOUR RATES: [ Magic Level: 30x || Fist: 24x | Club: 24x | Sword: 24x | Axe: 24x | Distance: 24 | Shielding: 27x | Fishing: 3x ]
11:45 You advanced to magic level 1.
...
11:45 You advanced to magic level 6.
11:45 magic level rate changed from 30x to 15x. YOUR RATES: [ Magic Level: 15x || Fist: 24x | Club: 24x | Sword: 24x | Axe: 24x | Distance: 24 | Shielding: 27x | Fishing: 3x ]
11:45 You advanced to magic level 7.
...
11:45 You advanced to magic level 15.
11:45 magic level rate changed from 15x to 12x. YOUR RATES: [ Magic Level: 12x || Fist: 24x | Club: 24x | Sword: 24x | Axe: 24x | Distance: 24 | Shielding: 27x | Fishing: 3x ]
11:45 You advanced to magic level 16.
PHP:
skillConfig = {skill = getConfigValue('rateSkill'), magiclevel = getConfigValue('rateMagic')}
skillStages = {}
skillStages[SKILL_FIST] = {{0,8},{60,5},{80,3},{100,2}}
skillStages[SKILL_CLUB] = {{0,8},{60,5},{80,2},{100,1}}
skillStages[SKILL_SWORD] = {{0,8},{60,5},{80,2},{100,1}}
skillStages[SKILL_AXE] = {{0,8},{60,5},{80,2},{100,1}}
skillStages[SKILL_DISTANCE] = {{0,8},{60,5},{80,2},{100,1}}
skillStages[SKILL_SHIELD] = {{0,9},{60,8},{80,7},{100,6},{110,3}}
--skillStages[SKILL_FISHING] = {{0,5},{60,4},{80,3},{100,2},{110,1}} -- uncomment it to make it work, you can remove other skill config if you dont need it
skillStages[SKILL__MAGLEVEL] = {{0,10},{6,5},{15,7},{80,5},{90,2},{99,1}}
showInfoOnAdvance = true -- send player message about skill rate change
showInfoOnLogin = true -- send player message about skill rates when he login
function getPlayerSkillRatesText(cid)
local skillInfo = getPlayerRates(cid)
return "YOUR RATES: [ Magic Level: " .. skillInfo[SKILL__MAGLEVEL] * skillConfig.magiclevel .. "x || Fist: " .. skillInfo[SKILL_FIST] * skillConfig.skill .. "x | Club: " .. skillInfo[SKILL_CLUB] * skillConfig.skill .. "x | Sword: " .. skillInfo[SKILL_SWORD] * skillConfig.skill .. "x | Axe: " .. skillInfo[SKILL_AXE] * skillConfig.skill .. "x | Distance: " .. skillInfo[SKILL_DISTANCE] * skillConfig.skill .. " | Shielding: " .. skillInfo[SKILL_SHIELD] * skillConfig.skill .. "x | Fishing: " .. skillInfo[SKILL_FISHING] * skillConfig.skill .. "x ]"
end
PHP:
dofile(getDataDir() .. "creaturescripts/scripts/stagesconfig.lua")
function onAdvance(cid, skill, oldLevel, newLevel)
if(skillStages[skill] ~= nil) then
local skillRate = 1
local oldRates = getPlayerRates(cid)
for i, skillRateInfo in pairs(skillStages[skill]) do
if(newLevel >= skillRateInfo[1]) then
skillRate = skillRateInfo[2]
else
break
end
end
doPlayerSetRate(cid, skill, skillRate)
if(showInfoOnAdvance and skillRate ~= oldRates[skill]) then
if(skill >= 0 and skill <= 6) then
configRate = skillConfig.skill
else
configRate = skillConfig.magiclevel
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, SKILL_NAMES[skill] .. " rate changed from " .. oldRates[skill] * configRate .. "x to " .. skillRate * configRate .. "x. " .. getPlayerSkillRatesText(cid))
end
end
return true
end
PHP:
dofile(getDataDir() .. "creaturescripts/scripts/stagesconfig.lua")
function onLogin(cid)
for skill, skillStage in pairs(skillStages) do
if(skill >= 0 and skill <= 6) then
nowSkill = getPlayerSkillLevel(cid, skill)
else
nowSkill = getPlayerMagLevel(cid, true)
end
for i, skillRateInfo in pairs(skillStage) do
if(nowSkill >= skillRateInfo[1]) then
skillRate = skillRateInfo[2]
else
break
end
end
doPlayerSetRate(cid, skill, skillRate)
end
if(showInfoOnLogin) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerSkillRatesText(cid))
end
registerCreatureEvent(cid, "SkillStagesAdvance")
return TRUE
end
PHP:
<event type="login" name="SkillStagesLogin" event="script" value="skillstageslogin.lua"/>
<event type="advance" name="SkillStagesAdvance" event="script" value="skillstagesadvance.lua"/>
PHP:
skillStages[SKILL_FIST] = {{0,8},{60,5},{80,3},{100,2}}
From skill 60 (to 79) rate is: skill rate from config.lua * 5
From skill 80 (to 99) rate is: skill rate from config.lua * 3
From skill 100 (to max. TFS mlvl) rate is: skill rate from config.lua * 2
First stage must be 0
If you dont want stages for X skill/mlvl comment line in config file or remove.