• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Limitation Skill.[8.0]

Nyro17

New Member
Joined
Feb 6, 2020
Messages
10
Reaction score
1
Hello guys, I had an idea for my server but dunnow if its possible to do it.

Im using a server version 8.0 and i would like to set max skills to 10.

Most of time i see skill stages xml in data/XML. But this time i dont see it.

So here is my question.

Is there any way to set max player skill to 10?
Im using forgotten server 1.2

dunnow my tfs xddd
hope u guys could help me :/

Thanks
 
Solution
is there any way to do it?

Try this, made some changes in evil puncker's script

Code:
function Player.getRequiredSkillTries(self, skillId, level)
    return self:getVocation():getRequiredSkillTries(skillId, level)
end

local skillCap = 10

function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_SWORD then
        if newLevel > skillCap then
            local formula = getRequiredSkillTries(player, SKILL_SWORD, skillCap) - player:getSkillTries(SKILL_SWORD)
            player:addSkillTries(SKILL_SWORD, formula)
            return false
        end
    end
    return true
end
in events folder -> in the ongainskilltries(if i recall correctly) function

-> create a condition to check if player has reached it's maximum skill
if that's the case -> return 0 or false

Not sure if 1.2 has it, but it probaly has.


Animera
 
I have something like u comment, but it doesnt works and also it doesnt say anything in console... so i dont know what to do :c
 
something like this maybe:
LUA:
function Player.getRequiredSkillTries(self, skillId, level)
    return self:getVocation():getRequiredSkillTries(skillId, level)
end

function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL__SWORD then
        if newLevel > 10 then
            player:addSkillTries(getRequiredSkillTries(player,SKILL__SWORD,10))
            return false
        end
    end
    return true
end

btw have you tried setting skill multipliers in vocations.xml to zero? (or one)

<skill id="0" multiplier="1.5" />
<skill id="1" multiplier="2.0" />
<skill id="2" multiplier="2.0" />
<skill id="3" multiplier="2.0" />
<skill id="4" multiplier="2.0" />
<skill id="5" multiplier="1.5" />
<skill id="6" multiplier="1.1" />
 
something like this maybe:
LUA:
function Player.getRequiredSkillTries(self, skillId, level)
    return self:getVocation():getRequiredSkillTries(skillId, level)
end

function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL__SWORD then
        if newLevel > 10 then
            player:addSkillTries(getRequiredSkillTries(player,SKILL__SWORD,10))
            return false
        end
    end
    return true
end

btw have you tried setting skill multipliers in vocations.xml to zero? (or one)

<skill id="0" multiplier="1.5" />
<skill id="1" multiplier="2.0" />
<skill id="2" multiplier="2.0" />
<skill id="3" multiplier="2.0" />
<skill id="4" multiplier="2.0" />
<skill id="5" multiplier="1.5" />
<skill id="6" multiplier="1.1" />

No works
Post automatically merged:

set skillrate to 0 maybe?

or find a reliable distro.
If i set rates to 0 it wont advance... another idea is to set it too low
 
No works
Post automatically merged:


If i set rates to 0 it wont advance... another idea is to set it too low

Oh i thought you didn't wanted to advance at all..

@Evil Puncker doesn't addskilltries actually add skilltries instead of setting it?
Maybe try the one that checks how much skilltries a certain skill has and then calculating to correct to the difference?
 
Oh i thought you didn't wanted to advance at all..

@Evil Puncker doesn't addskilltries actually add skilltries instead of setting it?
Maybe try the one that checks how much skilltries a certain skill has and then calculating to correct to the difference?
My purpose is to make something "real". I explain:
Why skills starts from 10 to ....?
I would like to set it from 1 to 10, meaning 10 max skill.
My problem is that I cant set a max skill in my 8.0 server, thats the code that im using:

Code:
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL_SWORD then
        if getPlayerSkillLevel(cid, SKILL_SWORD) >= 10 then
                doPlayerSetRate(cid, SKILL_SWORD, 0.0)
        end
    
    elseif skill == SKILL_SWORD then
        if getPlayerSkillLevel(cid, SKILL_FIST) >= 10 then
                doPlayerSetRate(cid, SKILL_FIST, 0.0)
        end   
    return false
    
    elseif skill == SKILL_AXE then
        if getPlayerSkillLevel(cid, SKILL_AXE) >= 10 then
                doPlayerSetRate(cid, SKILL_AXE, 0.0)
        end   
    return false
    
    elseif skill == SKILL_CLUB then
        if getPlayerSkillLevel(cid, SKILL_CLUB) >= 10 then
                doPlayerSetRate(cid, SKILL_CLUB, 0.0)
        end   
    return false
    
    elseif skill == SKILL_DISTANCE then
        if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 10 then
                doPlayerSetRate(cid, SKILL_DISTANCE, 0.0)
        end   
    return false
    
    elseif skill == SKILL_SHIELD then
        if getPlayerSkillLevel(cid, SKILL_FIST) >= 10 then
                doPlayerSetRate(cid, SKILL_FIST, 0.0)
        end   
    return false
    
    elseif skill == SKILL_FISH then
        if getPlayerSkillLevel(cid, SKILL_FISH) >= 10 then
                doPlayerSetRate(cid, SKILL_FISH, 0.0)
        end   
    return false
    
end
end

In my console I dont see any error, and characters can go far from 10
 
My purpose is to make something "real". I explain:
Why skills starts from 10 to ....?
I would like to set it from 1 to 10, meaning 10 max skill.
My problem is that I cant set a max skill in my 8.0 server, thats the code that im using:

Code:
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL_SWORD then
        if getPlayerSkillLevel(cid, SKILL_SWORD) >= 10 then
                doPlayerSetRate(cid, SKILL_SWORD, 0.0)
        end
   
    elseif skill == SKILL_SWORD then
        if getPlayerSkillLevel(cid, SKILL_FIST) >= 10 then
                doPlayerSetRate(cid, SKILL_FIST, 0.0)
        end  
    return false
   
    elseif skill == SKILL_AXE then
        if getPlayerSkillLevel(cid, SKILL_AXE) >= 10 then
                doPlayerSetRate(cid, SKILL_AXE, 0.0)
        end  
    return false
   
    elseif skill == SKILL_CLUB then
        if getPlayerSkillLevel(cid, SKILL_CLUB) >= 10 then
                doPlayerSetRate(cid, SKILL_CLUB, 0.0)
        end  
    return false
   
    elseif skill == SKILL_DISTANCE then
        if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 10 then
                doPlayerSetRate(cid, SKILL_DISTANCE, 0.0)
        end  
    return false
   
    elseif skill == SKILL_SHIELD then
        if getPlayerSkillLevel(cid, SKILL_FIST) >= 10 then
                doPlayerSetRate(cid, SKILL_FIST, 0.0)
        end  
    return false
   
    elseif skill == SKILL_FISH then
        if getPlayerSkillLevel(cid, SKILL_FISH) >= 10 then
                doPlayerSetRate(cid, SKILL_FISH, 0.0)
        end  
    return false
   
end
end

In my console I dont see any error, and characters can go far from 10

Your using old functions, in a TFS 1.2?

I know the newer tfs has partially a backward compability. But it's hard to say what your sources/datapack actual has as it seem to be modified(8.0)?
AFAIK those functions do not exist and is most likely deprecated/not working...
 
is there any way to do it?
Your using old functions, in a TFS 1.2?

I know the newer tfs has partially a backward compability. But it's hard to say what your sources/datapack actual has as it seem to be modified(8.0)?
AFAIK those functions do not exist and is most likely deprecated/not working...
 
is there any way to do it?

Try this, made some changes in evil puncker's script

Code:
function Player.getRequiredSkillTries(self, skillId, level)
    return self:getVocation():getRequiredSkillTries(skillId, level)
end

local skillCap = 10

function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_SWORD then
        if newLevel > skillCap then
            local formula = getRequiredSkillTries(player, SKILL_SWORD, skillCap) - player:getSkillTries(SKILL_SWORD)
            player:addSkillTries(SKILL_SWORD, formula)
            return false
        end
    end
    return true
end
 
Solution
Try this, made some changes in evil puncker's script

Code:
function Player.getRequiredSkillTries(self, skillId, level)
    return self:getVocation():getRequiredSkillTries(skillId, level)
end

local skillCap = 10

function onAdvance(player, skill, oldLevel, newLevel)
    if skill == SKILL_SWORD then
        if newLevel > skillCap then
            local formula = getRequiredSkillTries(player, SKILL_SWORD, skillCap) - player:getSkillTries(SKILL_SWORD)
            player:addSkillTries(SKILL_SWORD, formula)
            return false
        end
    end
    return true
end
Maybe it can work, im not sure... but i lost my patience with that xD.
So thanks and sorry...
I give you rep. Thanks for your time and one more time: thansk
 
Back
Top