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

Solved TFS 1.0 Offline Training -> SKILL_MAGLEVEL dont WORK

putamerda

New Member
Joined
Jan 2, 2012
Messages
73
Reaction score
0
Is there something I can change or do with the offline training system to make Magic training work? the statues are all correct, Shielding skills still advance on the skill trainer. (You see a skill trainer.
Use this statue to train your magic level and shielding skill offline.) However when you use (During your absence you trained for 5 hours and 49 minutes.) nothing happens at all for ML.

Code:
local statue = {
[18488] = SKILL_SWORD,
[18489] = SKILL_AXE,
[18490] = SKILL_CLUB,
[18491] = SKILL_DISTANCE,
[18492] = SKILL_MAGLEVEL
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local premiumDays = getPlayerPremiumDays(cid)

if premiumDays > 0 then
doPlayerSetOfflineTrainingSkill(cid, statue[item.itemid])
doRemoveCreature(cid)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
end
return true
end

Code:
<action fromid="18488" toid="18492" script="offlinetraining.lua"/>

Global
Code:
SKILL_FIST = 0
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6
SKILL_MAGLEVEL = 7
SKILL_LEVEL = 8
 
I can't reproduce this, running the latest version of forgottenserver?
 
I use this one: http://www30.speedy*****malware.localhost/MBWEA/download/tfs-10.31.rar
I could not compile to mysself because i cant install the lastest Visual Studio on my pc
 
This is kind of an old post so sorry if I bring it back to life, but did you find how to solve this? I guess it was a commit bug back then? the thing is I'm using commit 1647 TFS1.0 (basically from yesterdays source) and everything checking up to this point seems ok, offline training works fine for every other skill, but for magic level, nothing happens, it just trains shielding, but not even 1% after 10hrs offline training starting ML levels, so it should go up pretty fast. Any ideas on what could it be or how to fix it?

At this point the .lua file looks like this:
Code:
local statues = {
    [18488] = SKILL_SWORD,
    [18489] = SKILL_AXE,
    [18490] = SKILL_CLUB,
    [18491] = SKILL_DISTANCE,
    [18492] = SKILL_MAGLEVEL
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local skill = statues[item.itemid]
    if not skill then
        return false
    end

    local player = Player(cid)

    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUNEEDPREMIUMACCOUNT))
        return true
    end

    if player:isPzLocked() then
        return false
    end

    doPlayerSetOfflineTrainingSkill(cid, skill)
    player:remove()
    return true
end

NOTE: It looks like in bed/offline training it its ML training, at a low rate, but is doing it. So this means it's something to do with the offline training with statues section.
 
Last edited:
This is kind of an old post so sorry if I bring it back to life, but did you find how to solve this? I guess it was a commit bug back then? the thing is I'm using commit 1647 TFS1.0 (basically from yesterdays source) and everything checking up to this point seems ok, offline training works fine for every other skill, but for magic level, nothing happens, it just trains shielding, but not even 1% after 10hrs offline training starting ML levels, so it should go up pretty fast. Any ideas on what could it be or how to fix it?

At this point the .lua file looks like this:
Code:
local statues = {
    [18488] = SKILL_SWORD,
    [18489] = SKILL_AXE,
    [18490] = SKILL_CLUB,
    [18491] = SKILL_DISTANCE,
    [18492] = SKILL_MAGLEVEL
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local skill = statues[item.itemid]
    if not skill then
        return false
    end

    local player = Player(cid)

    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUNEEDPREMIUMACCOUNT))
        return true
    end

    if player:isPzLocked() then
        return false
    end

    doPlayerSetOfflineTrainingSkill(cid, skill)
    player:remove()
    return true
end

NOTE: It looks like in bed/offline training it its ML training, at a low rate, but is doing it. So this means it's something to do with the offline training with statues section.

Can you try applying this change and let me know if it has been fixed: https://github.com/otland/forgottenserver/commit/426d5c70a9c6f0642358ea95411d7b959eb8531b? In the future, please report issues at our GitHub page (https://github.com/otland/forgottenserver/issues/new).
 
Can you try applying this change and let me know if it has been fixed: https://github.com/otland/forgottenserver/commit/426d5c70a9c6f0642358ea95411d7b959eb8531b? In the future, please report issues at our GitHub page (https://github.com/otland/forgottenserver/issues/new).
Thank you Mark your the best =) , I just rebuild with your fix and it works. I really appreciate your help and work. I''ll make sure to report further issues if they arise to the github issues section.
 
Back
Top Bottom