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

Change rates for offline training

Blixmo

Member
Joined
Dec 8, 2011
Messages
135
Reaction score
16
Location
Sweden
Hello,

is it possible to change the rates for the bed offline training system? I've not managed to remove it without making changes to the /src folder so I wanna try to lower the rate instead, if it's possible?

TFS 0.3.7

Thanks
 
This is Blixmo´s offlinetraining.lua

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)
    if getPlayerPremiumDays(cid) > 0 then
        doPlayerSetOfflineTrainingSkill(cid, statue[item.itemid])
        doRemoveCreature(cid)
    else
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
    end
 
    return true
end
 
You can find this in player.cpp
Code:
tries *= g_config.getDouble(ConfigManager::RATE_MAGIC);
tries *= g_config.getDouble(ConfigManager::RATE_SKILL);

Add new configurable rates just for offline training

config.lua
Code:
rateOfflineSkill = 1
rateOfflineMagic = 1
configmanager.cpp
m_confDouble[RATE_SKILL] = getGlobalDouble("rateSkill", 1);
m_confDouble[RATE_MAGIC] = getGlobalDouble("rateMagic", 1);
m_confDouble[RATE_OFFLINESKILL] = getGlobalDouble("rateOfflineSkill", 1);
m_confDouble[RATE_OFFLINEMAGIC] = getGlobalDouble("rateOfflineMagic", 1);
configmanager.h
RATE_SKILL,
RATE_MAGIC,
RATE_OFFLINESKILL,
RATE_OFFLINEMAGIC,
player.cpp
tries *= g_config.getDouble(ConfigManager::RATE_OFFLINEMAGIC);
tries *= g_config.getDouble(ConfigManager::RATE_OFFLINESKILL);
 
You can find this in player.cpp
Code:
tries *= g_config.getDouble(ConfigManager::RATE_MAGIC);
tries *= g_config.getDouble(ConfigManager::RATE_SKILL);

Add new configurable rates just for offline training

config.lua
Code:
rateOfflineSkill = 1
rateOfflineMagic = 1
configmanager.cpp

configmanager.h

player.cpp

And this can be done without recompiling?

Thanks!
 
Nope, it always require recompilation after changes in the source code.
 
Yes, obviously since it's coded in the source code. :p

You can change the current rates in config.lua but affects both normal/offline training.
 
Yeah, tought so too. Was just hoping it could be removed from beds without modifing the source code.

Well, thanks for the help. I guess this one is solved now then.
 
Back
Top