• 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+ setOfflineTraining Skill 8.6

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,470
Solutions
27
Reaction score
844
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi, I use nekiro 1.4 for 8.6 and I have a trouble with the default training offline script. I wonder if this function is implemented on this version since 8.6 is a downgrade and not a native feature of the version.

offtrainer.png

The code

Code:
local statues = {
    [12663] = SKILL_SWORD,
    [12664] = SKILL_AXE,
    [12665] = SKILL_CLUB,
    [12666] = SKILL_DISTANCE,
    [12667] = SKILL_MAGLEVEL
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local skill = statues[item:getId()]
    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUNEEDPREMIUMACCOUNT))
        return true
    end

    if player:isPzLocked() then
        return false
    end

    player:setOfflineTrainingSkill(skill)
    player:remove()
    return true
end

Regards!!
 
Solution
Afaik I removed these methods in 8.6 downgrade and all newer stuff. You have to add it back.
I went with safer approach for the other downgrades (commenting out, not deleting), but this one was made like this and I don't have time to redo it.
hello, apparently the function is not there, check in src in luascript and player the function "setOfflineTraining"

compat.lua

Lua:
function doPlayerSetOfflineTrainingSkill(cid, skillId) local p = Player(cid) return p ~= nil and p:setOfflineTrainingSkill(skillId) or false end
 
hello, apparently the function is not there, check in src in luascript and player the function "setOfflineTraining"

compat.lua

Lua:
function doPlayerSetOfflineTrainingSkill(cid, skillId) local p = Player(cid) return p ~= nil and p:setOfflineTrainingSkill(skillId) or false end

Thanks for responding ^^ The function is already added to compat.lua, using same files

Tried by changing the p ~= but still didn't work

Regards!
 
Afaik I removed these methods in 8.6 downgrade and all newer stuff. You have to add it back.
I went with safer approach for the other downgrades (commenting out, not deleting), but this one was made like this and I don't have time to redo it.
 
Solution
Afaik I removed these methods in 8.6 downgrade and all newer stuff. You have to add it back.
I went with safer approach for the other downgrades (commenting out, not deleting), but this one was made like this and I don't have time to redo it.
I thought that happened, it is still good that the downgrade its loyal to the protocol :) by any chance could you post the source lines that are related to the system? Thanks a lot for the answer, regards!
 
I thought that happened, it is still good that the downgrade its loyal to the protocol :) by any chance could you post the source lines that are related to the system? Thanks a lot for the answer, regards!
That's a lot of changes, you have to search by keywords like offline training, training or something or you can check out my downgrade commit and search for offline keywords (it's huge though)
 
Back
Top