• 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!

TFS 1.X+ [tfs 1.3] Player with storage 1500 gain 10% more skills?

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
I'm Using tfs 1.3 to 8.6...
Is it possible for a player with storage value 1500 to train skills 10% faster than others?
 
Solution
In your data/events/scripts/ folder open file named player.lua and search for this code
Lua:
function Player:onGainSkillTries(skill, tries)
    if APPLY_SKILL_MULTIPLIER == false then
        return tries
    end

    if skill == SKILL_MAGLEVEL then
        return tries * configManager.getNumber(configKeys.RATE_MAGIC)
    end
    return tries * configManager.getNumber(configKeys.RATE_SKILL)
end

As You can see there is some returns, surround these returns with if-else blocks with "self:getStorageValue(your-key-here) == value-you-want" and proper code inside these ifs, it should be something like this

Lua:
function Player:onGainSkillTries(skill, tries)
    local multiplier = 1.1
    if APPLY_SKILL_MULTIPLIER == false then
        if...
In your data/events/scripts/ folder open file named player.lua and search for this code
Lua:
function Player:onGainSkillTries(skill, tries)
    if APPLY_SKILL_MULTIPLIER == false then
        return tries
    end

    if skill == SKILL_MAGLEVEL then
        return tries * configManager.getNumber(configKeys.RATE_MAGIC)
    end
    return tries * configManager.getNumber(configKeys.RATE_SKILL)
end

As You can see there is some returns, surround these returns with if-else blocks with "self:getStorageValue(your-key-here) == value-you-want" and proper code inside these ifs, it should be something like this

Lua:
function Player:onGainSkillTries(skill, tries)
    local multiplier = 1.1
    if APPLY_SKILL_MULTIPLIER == false then
        if self:getStorageValue(storageID) == valueYouWant then
            return tries * multiplier
        else
            return tries
        end
    end

    if skill == SKILL_MAGLEVEL then
        if self:getStorageValue(storageID) == valueYouWant then
            return tries * configManager.getNumber(configKeys.RATE_MAGIC) * multiplier
        else
            return tries * configManager.getNumber(configKeys.RATE_MAGIC)
        end
    end

    if self:getStorageValue(storageID) == valueYouWant then
        return tries * configManager.getNumber(configKeys.RATE_SKILL) * multiplier
    else
        return tries * configManager.getNumber(configKeys.RATE_SKILL)
    end
end
 
Solution
Players don't have individual skill rates, the rates are global (which is why you get the value from configManager).
Unless you're talking about vocation skill rate?
just to check if the script was correct.
But I tested hitting monsters to test, and all ok!
 
Back
Top