• 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 0.X [REQUEST] Training Monk tiles give faster skill gain rates.

warriorfrog

Active Member
Joined
Jul 29, 2015
Messages
334
Reaction score
35
@FenX made this topic to training room increase the player's skill gain rate, i wanna make something like that

but the solution there was to 1.0, i'm using 0.4
is anyone know how to convert that?

data/events/scripts/player.lua
Code:
function Player:onGainSkillTries(skill, tries)
    if APPLY_SKILL_MULTIPLIER == false then
        return tries
    end

    -- Training Room Tile
    local tile = self:getTile()
    local ground = tile and tile:getGround()
    if ground and ground.actionid == 9000 then -- change 9000 to whatever action id you set the tiles to
        tries = math.floor(tries * 2) -- example: 2x skill rate
    end

    if skill == SKILL_MAGLEVEL then
        return tries * configManager.getNumber(configKeys.RATE_MAGIC)
    end
    return tries * configManager.getNumber(configKeys.RATE_SKILL)
end
on 0.4 the foldder /data/events even doesnt exist... Fir3element/3777 (https://github.com/Fir3element/3777/tree/master/data)

topic link:
 
Solution
Why not just doing something simple like onStepIn and onStepOut with UniqueID on trainers tiles?
Try this and change rates to the ones you need, onStepIn = ontrainers and onStepOut = outside the main skills so put the number you want.
data\movements\scripts skill.lua
Lua:
function onStepIn(cid, item, position, fromPosition)
    if(not isPlayer(cid)) then
        return true
    end
    doPlayerSetRate(cid, SKILL_FIST, 10)
    doPlayerSetRate(cid, SKILL_CLUB, 10)
    doPlayerSetRate(cid, SKILL_SWORD, 10)
    doPlayerSetRate(cid, SKILL_AXE, 10)
    doPlayerSetRate(cid, SKILL_DISTANCE, 10)
    doPlayerSetRate(cid, SKILL_SHIELD, 10)
    doPlayerSetRate(cid, SKILL_FISHING, 10)
    doPlayerSetRate(cid, SKILL__MAGLEVEL, 10)...
Why not just doing something simple like onStepIn and onStepOut with UniqueID on trainers tiles?
Try this and change rates to the ones you need, onStepIn = ontrainers and onStepOut = outside the main skills so put the number you want.
data\movements\scripts skill.lua
Lua:
function onStepIn(cid, item, position, fromPosition)
    if(not isPlayer(cid)) then
        return true
    end
    doPlayerSetRate(cid, SKILL_FIST, 10)
    doPlayerSetRate(cid, SKILL_CLUB, 10)
    doPlayerSetRate(cid, SKILL_SWORD, 10)
    doPlayerSetRate(cid, SKILL_AXE, 10)
    doPlayerSetRate(cid, SKILL_DISTANCE, 10)
    doPlayerSetRate(cid, SKILL_SHIELD, 10)
    doPlayerSetRate(cid, SKILL_FISHING, 10)
    doPlayerSetRate(cid, SKILL__MAGLEVEL, 10)
    return true
end
function onStepOut(cid, item, position, fromPosition)
    if(not isPlayer(cid)) then
        return true
    end
    doPlayerSetRate(cid, SKILL_FIST, 5)
    doPlayerSetRate(cid, SKILL_CLUB, 5)
    doPlayerSetRate(cid, SKILL_SWORD, 5)
    doPlayerSetRate(cid, SKILL_AXE, 5)
    doPlayerSetRate(cid, SKILL_DISTANCE, 5)
    doPlayerSetRate(cid, SKILL_SHIELD, 5)
    doPlayerSetRate(cid, SKILL_FISHING, 5)
    doPlayerSetRate(cid, SKILL__MAGLEVEL, 5)
    return true
end
and then in movements.xml add this
XML:
    <movevent type="StepIn" uniqueid="15111-15222" event="script" value="skill.lua" />
    <movevent type="StepOut" uniqueid="15111-15222" event="script" value="skill.lua" />
then put unique ids on your training monk tiles and test.
 
Solution
Why not just doing something simple like onStepIn and onStepOut with UniqueID on trainers tiles?
Try this and change rates to the ones you need, onStepIn = ontrainers and onStepOut = outside the main skills so put the number you want.
data\movements\scripts skill.lua
Lua:
function onStepIn(cid, item, position, fromPosition)
    if(not isPlayer(cid)) then
        return true
    end
    doPlayerSetRate(cid, SKILL_FIST, 10)
    doPlayerSetRate(cid, SKILL_CLUB, 10)
    doPlayerSetRate(cid, SKILL_SWORD, 10)
    doPlayerSetRate(cid, SKILL_AXE, 10)
    doPlayerSetRate(cid, SKILL_DISTANCE, 10)
    doPlayerSetRate(cid, SKILL_SHIELD, 10)
    doPlayerSetRate(cid, SKILL_FISHING, 10)
    doPlayerSetRate(cid, SKILL__MAGLEVEL, 10)
    return true
end
function onStepOut(cid, item, position, fromPosition)
    if(not isPlayer(cid)) then
        return true
    end
    doPlayerSetRate(cid, SKILL_FIST, 5)
    doPlayerSetRate(cid, SKILL_CLUB, 5)
    doPlayerSetRate(cid, SKILL_SWORD, 5)
    doPlayerSetRate(cid, SKILL_AXE, 5)
    doPlayerSetRate(cid, SKILL_DISTANCE, 5)
    doPlayerSetRate(cid, SKILL_SHIELD, 5)
    doPlayerSetRate(cid, SKILL_FISHING, 5)
    doPlayerSetRate(cid, SKILL__MAGLEVEL, 5)
    return true
end
and then in movements.xml add this
XML:
    <movevent type="StepIn" uniqueid="15111-15222" event="script" value="skill.lua" />
    <movevent type="StepOut" uniqueid="15111-15222" event="script" value="skill.lua" />
then put unique ids on your training monk tiles and test.

Thank you, i didn't know this :D
 
sorry for time, but is there a version for nostalrius by ezzz ?

Hello. Im trying to do a Training Monk, that gives You a lower training rate. That i got config.lua set up to SKILL RATE like 10x, and player vs player or player vs monster use that 10x rate but on training monk i want to do rate like 5x ( /2 )

i want to use it on tile uniqueid 9999 on movements (onstepin/onstepout)

Lua:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() then
    Player.addSkillTries(SKILL_FIST * 500)
    Player.addSkillTries(SKILL_CLUB * 500)
    Player.addSkillTries(SKILL_SWORD * 500)
    Player.addSkillTries(SKILL_AXE * 500)
    Player.addSkillTries(SKILL_DISTANCE * 500)
    Player.addSkillTries(SKILL_SHIELD * 500)
    Player.addSkillTries(SKILL_FISHING * 500)
    end
end
function onStepOut(creature, item, position, fromPosition)
    if creature:isPlayer() then
    Player.addSkillTries(SKILL_FIST * 1)
    Player.addSkillTries(SKILL_CLUB * 1)
    Player.addSkillTries(SKILL_SWORD * 1)
    Player.addSkillTries(SKILL_AXE * 1)
    Player.addSkillTries(SKILL_DISTANCE * 1)
    Player.addSkillTries(SKILL_SHIELD * 1)
    Player.addSkillTries(SKILL_FISHING * 1)
    end

end

and for lower by half
something like that

Lua:
local skillRate = configManager.getNumber(configKeys.RATE_SKILL)

function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() then
    Player.addSkillTries(skills, skillRate / 2)

    end
end

function onStepOut(creature, item, position, fromPosition)
    if creature:isPlayer() then
    Player.addSkillTries(skills, skillRate * 1)

    end
end

but it dosnt work...
 
Last edited:
Back
Top