• 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.1 Offline training is really slow, shouldnt skill/magic rate change this ?

danne3131

Active Member
Joined
Jun 26, 2008
Messages
390
Solutions
1
Reaction score
48
On my server the offline training id really slow. I changed skill rate in config so skills when ur playing advances fast but not while training offline..

Anyone knows how to Edit offline trainers? :)

Thank you
 
I modified the lines WibbenZ has pointed out to apply the rate modifier to offline training, it should now increase accordingly. I haven't had the time to test, but it should work.

Apply this patch to your source root (the directory that contains data/ and src/). If you don't know how to apply patches, on Linux you have to run:
Code:
patch -p1 -i <path to patch file>
On Windows, I don't know. You might just look at the patch and copy the relevant lines though.

Patch code, in case you can not open the link:
Code:
From 675f71e3ebc963d278ca55d299061138a556d5ba Mon Sep 17 00:00:00 2001
From: Ranieri Althoff <[email protected]>
Date: Mon, 1 Jun 2015 02:52:35 -0300
Subject: [PATCH] Fix offline traning ignoring skill/magic rate

---
src/player.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/player.cpp b/src/player.cpp
index 82425d7..8013428 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -1236,20 +1236,20 @@ void Player::onCreatureAppear(Creature* creature, bool isLogin)
                     bool sendUpdateSkills = false;
                     if (offlineTrainingSkill == SKILL_CLUB || offlineTrainingSkill == SKILL_SWORD || offlineTrainingSkill == SKILL_AXE) {
                         float modifier = topVocation->getAttackSpeed() / 1000.f;
-                        sendUpdateSkills = addOfflineTrainingTries(static_cast<skills_t>(offlineTrainingSkill), (trainingTime / modifier) / 2);
+                        sendUpdateSkills = addOfflineTrainingTries(static_cast<skills_t>(offlineTrainingSkill), g_config.getNumber(ConfigManager::RATE_SKILL) * (trainingTime / modifier) / 2);
                     } else if (offlineTrainingSkill == SKILL_DISTANCE) {
                         float modifier = topVocation->getAttackSpeed() / 1000.f;
-                        sendUpdateSkills = addOfflineTrainingTries(static_cast<skills_t>(offlineTrainingSkill), (trainingTime / modifier) / 4);
+                        sendUpdateSkills = addOfflineTrainingTries(static_cast<skills_t>(offlineTrainingSkill), g_config.getNumber(ConfigManager::RATE_SKILL * (trainingTime / modifier) / 4);
                     } else if (offlineTrainingSkill == SKILL_MAGLEVEL) {
                         int32_t gainTicks = topVocation->getManaGainTicks() * 2;
                         if (gainTicks == 0) {
                             gainTicks = 1;
                         }
-                        addOfflineTrainingTries(SKILL_MAGLEVEL, trainingTime * (static_cast<double>(vocation->getManaGainAmount()) / gainTicks));
+                        addOfflineTrainingTries(SKILL_MAGLEVEL, g_config.getNumber(ConfigManager::RATE_MAGIC) * trainingTime * (static_cast<double>(vocation->getManaGainAmount()) / gainTicks));
                     }
-                    if (addOfflineTrainingTries(SKILL_SHIELD, trainingTime / 4) || sendUpdateSkills) {
+                    if (addOfflineTrainingTries(SKILL_SHIELD, g_config.getNumber(ConfigManager::RATE_SKILL) * trainingTime / 4) || sendUpdateSkills) {
                         sendSkills();
                     }
                 }
--
2.4.2
 
Back
Top