• 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 How to change MAX stamina?

gmstrikker

Well-Known Member
Joined
Jul 30, 2014
Messages
458
Solutions
1
Reaction score
50
I would like to limit stamina for 33 hours instead of 42
Also change green stamina from 42-40 to 33-30

How to do it?
I've search on sources and found all of this:

The only thing i change was here:

from:
Code:
#define STAMINA_MAX (42 * 60 * 60 * 1000)

to:
Code:
#define STAMINA_MAX (33 * 60 * 60 * 1000)

And on config.lua
Code:
    rateStaminaLoss = 1 -- lose 1 stamina in 1 stamina hunting
    rateStaminaGain = 3 -- add 1 stamina in 3 minutes off
    rateStaminaThresholdGain = 12
    staminaRatingLimitTop = 30 * 60
    staminaRatingLimitBottom = 14 * 60
    staminaLootLimit = 14 * 60
    rateStaminaAboveNormal = 1.5
    rateStaminaUnderNormal = 0.5
    staminaThresholdOnlyPremium = false

But i got 3 problems

1- stamina not fill full, it looks like this:


2- xp don't change after 30- (without green bonus)

with this stamina i still got the same XP from rats (18)

3- stamina still green forever




What else should i change?
 
Solution
3-
my otc don't have this stuff, it is too old, i gonna update to a new one
what should i use and why?

2-
i've add this 'staminaSystem = true' in my config.lua but rats still giving 15 xp instead of 150
1. Mehah
2.
This:
C++:
bool Player::rateExperience(double& gainExp, bool fromMonster)
{
    if(hasFlag(PlayerFlag_NotGainExperience) || gainExp <= 0)
        return false;

    if(!fromMonster)
        return true;

    gainExp *= rates[SKILL__LEVEL] * g_game.getExperienceStage(level,
        vocation->getExperienceMultiplier());
    if(!hasFlag(PlayerFlag_HasInfiniteStamina))
    {
        int32_t minutes =...
1. Mehah
2.
This:
C++:
bool Player::rateExperience(double& gainExp, bool fromMonster)
{
    if(hasFlag(PlayerFlag_NotGainExperience) || gainExp <= 0)
        return false;

    if(!fromMonster)
        return true;

    gainExp *= rates[SKILL__LEVEL] * g_game.getExperienceStage(level,
        vocation->getExperienceMultiplier());
    if(!hasFlag(PlayerFlag_HasInfiniteStamina))
    {
        int32_t minutes = getStaminaMinutes();
        if(minutes >= g_config.getNumber(ConfigManager::STAMINA_LIMIT_TOP))
        {
            if(isPremium() || !g_config.getNumber(ConfigManager::STAMINA_BONUS_PREMIUM))
                gainExp *= g_config.getDouble(ConfigManager::RATE_STAMINA_ABOVE);
        }
        else if(minutes < (g_config.getNumber(ConfigManager::STAMINA_LIMIT_BOTTOM)) && minutes > 0)
            gainExp *= g_config.getDouble(ConfigManager::RATE_STAMINA_UNDER);
        else if(minutes <= 0)
            gainExp = 0;
    }
    else if(isPremium() || !g_config.getNumber(ConfigManager::STAMINA_BONUS_PREMIUM))
        gainExp *= g_config.getDouble(ConfigManager::RATE_STAMINA_ABOVE);

    return true;
}
To this:
C++:
bool Player::rateExperience(double& gainExp, bool fromMonster)
{
    if(hasFlag(PlayerFlag_NotGainExperience) || gainExp <= 0)
        return false;

    if(!fromMonster)
        return true;

    gainExp *= rates[SKILL__LEVEL] * g_game.getExperienceStage(level,
        vocation->getExperienceMultiplier());
    if(!hasFlag(PlayerFlag_HasInfiniteStamina))
    {
        int32_t minutes = getStaminaMinutes();
        if(minutes >= g_config.getNumber(ConfigManager::STAMINA_LIMIT_TOP))
        {
            if(g_config.getNumber(ConfigManager::STAMINA_BONUS_PREMIUM))
                gainExp *= g_config.getDouble(ConfigManager::RATE_STAMINA_ABOVE);
        }
        else if(minutes < (g_config.getNumber(ConfigManager::STAMINA_LIMIT_BOTTOM)) && minutes > 0)
            gainExp *= g_config.getDouble(ConfigManager::RATE_STAMINA_UNDER);
        else if(minutes <= 0)
            gainExp = 0;
    }
    else(g_config.getNumber(ConfigManager::STAMINA_BONUS_PREMIUM))
        gainExp *= g_config.getDouble(ConfigManager::RATE_STAMINA_ABOVE);

    return true;
}

oh thank you so much man, looks like the bonus and max stamina is working on server side, thank you so much...

i just have to update my otclient to test that stamina colors stuff

when i get support here: OTClient - Error compile new OTC debian (https://otland.net/threads/error-compile-new-otc-debian.274829/)
i gonna finish this topic here if everything is fine

again, thank you so much
 
Back
Top