Ir para conteúdo

Skills stages


narutomaniacos

Posts Recomendados

Vi umas pessoas querendo esse script então como não achei no forum resolvi postar..

serve para regular os rates do seu server, exemplo: do level 30 até o 49 o Rate ml(dificuldade para UPAR) é 1

 

primeiro vá em config.lua procure por Rates em rateSkill deixe 1

Em creaturescript/scripts/skills (caso não tenha pasta skills crie)

 

copie e cole qualquer script, então o renomeie para "stagesconfig" e cole isso dentro:

 

skillConfig = {skill = getConfigValue('rateSkill'), magiclevel = getConfigValue('rateMagic')}

skillStages = {}
skillStages[sKILL_FIST] = {{0,3},{30,2},{50,2},{80,1},{100,0.90},{130,0.50}}
skillStages[sKILL_CLUB] = {{0,10},{30,8},{50,6},{80,4},{100,2},{130,0.50}}
skillStages[sKILL_SWORD] = {{0,10},{30,6},{50,4},{80,2},{100,1},{130,0.25}}
skillStages[sKILL_AXE] = {{0,10},{30,8},{50,6},{80,4},{100,2},{130,0.50}}
skillStages[sKILL_DISTANCE] = {{0,10},{30,8},{50,6},{80,4},{100,2},{130,0.50}}
skillStages[sKILL_SHIELD] = {{0,10},{30,8},{50,6},{80,4},{100,2},{130,0.50}}
skillStages[sKILL_FISHING] = {{0,10},{30,8},{50,6},{80,4},{100,2},{130,0.50}} -- uncomment it to make it work, you can remove other skill config if you dont need it
skillStages[sKILL__MAGLEVEL] = {{0,2},{30,1},{50,0.90},{80,0.80},{100,0.60},{130,0.50}}
showInfoOnAdvance = false -- send player message about skill rate change
showInfoOnLogin = false -- send player message about skill rates when he login
function getPlayerSkillRatesText(cid)
local skillInfo = getPlayerRates(cid)
return "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

 

 

Depois, copie e cole qualquer script, então o renomeie para "skillstageslogin" e cole isso dentro:

 

dofile(getDataDir() .. "creaturescripts/scripts/skills/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

 

 

Depois, copie e cole qualquer script, então o renomeie para "skillstagesadvance" e cole isso dentro:

 

 

dofile(getDataDir() .. "creaturescripts/scripts/skills/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

 

 

Depois vá em login.lua e registre as tags:

registerCreatureEvent(cid, "SkillStagesLogin")
registerCreatureEvent(cid, "SkillStagesAdvance")
e então em creaturescripts.xml:
<event type="login" name="SkillStagesLogin" event="script" value="skills/skillstageslogin.lua" />
<event type="advance" name="SkillStagesAdvance" event="script" value="skills/skillstagesadvance.lua" />

 

Para configurar é simples, basta ir em stagesconfig: por exemplo no fist fight

{0,3},{30,2} = no level 0 o rate skill sera 3, isso só ira mudar no level 30 que o rate sera 2, configure todas as skills ao seu gosto!

OBS: Testado em tfs 0.3.6(8.60)

Creditos: Autor desconhecido(caso você seja o criador do escript informe e colocarei os creditos), eu pelo tópico.

Espero ter ajudado.

Editado por narutomaniacos
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...