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

EXP/Skill/ML Ring

Matthmg

New Member
Joined
Feb 29, 2016
Messages
5
Reaction score
0
Hello people! i need some help. I want a ring that provides extra exp/skill/ml rate when equipped for a determined period of time. For example: the server rate is 5x with the ring 10x

I'm using TFS 1.1.

I really appreciate any help you can provide.
 
You can edit player.lua in events, in this example I used a power ring as the exp ring, you have to edit items if you want a custom ring.

in /data/events/scripts/player.lua:

under:
Code:
function Player:onGainExperience(source, exp, rawExp)


add:
Code:
    -- Apply bonus experience multiplier if wearing ring
    local ring = self:getSlotItem(CONST_SLOT_RING)
    if ring and ring.itemid == 2203 then -- 2203 = the ring
        exp = exp * 5 -- 5x
    end


For skills, find and change:
Code:
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


to
Code:
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
    tries = tries * configManager.getNumber(configKeys.RATE_SKILL)

    -- Apply bonus skill multiplier if wearing ring
    local ring = self:getSlotItem(CONST_SLOT_RING)
    if ring and ring.itemid == 2203 then -- 2203 = the ring
        tries = tries * 5 -- 5x skill rate
    end
    return tries
end
 
You can edit player.lua in events, in this example I used a power ring as the exp ring, you have to edit items if you want a custom ring.

in /data/events/scripts/player.lua:

under:
Code:
function Player:onGainExperience(source, exp, rawExp)


add:
Code:
    -- Apply bonus experience multiplier if wearing ring
    local ring = self:getSlotItem(CONST_SLOT_RING)
    if ring and ring.itemid == 2203 then -- 2203 = the ring
        exp = exp * 5 -- 5x
    end


For skills, find and change:
Code:
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


to
Code:
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
    tries = tries * configManager.getNumber(configKeys.RATE_SKILL)

    -- Apply bonus skill multiplier if wearing ring
    local ring = self:getSlotItem(CONST_SLOT_RING)
    if ring and ring.itemid == 2203 then -- 2203 = the ring
        tries = tries * 5 -- 5x skill rate
    end
    return tries
end
Hey bro, when i use this all the rates changes to 1x and the exp ring don't work.
 
Back
Top