• 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 Skills stages 0.5 = 0?

zabuzo

Well-Known Member
Joined
Jun 10, 2016
Messages
238
Reaction score
54
I'm trying to use this skills stages script:
It sets skills stages, amazing, works so well IF the skills stages rates is higher then 1
Idk why, but when players get skills 60 and rates sets to 0.5, the skills don't get up (i've test 10 hours training, don't recive even 1%)
Looks like it is setting the skill to 0

Is anybody knows why?
I really need to set 0.5:
first because i want to do a server really hard exp/skills
second because i want to make a custom vocation that have 2x more atk speed, so it have to be 0.5 skill rates
 
Solution
Vocation is one of the 4 reasons that i need 0.5 rates
So i gonna go to the second way
Let me understand...
This line return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11)) * 10;
Make skill try hits 10x higher then before, so 0.5 of this is 5...
Amazing!

Its just now change config.lua to:
Code:
    rateSkill = 10.0 -- 10.0 = 1.0 because of gesior_skills_stages
    rateMagic = 10.0 -- 10.0 = 1.0 because of gesior_skills_stages

magic level is working or do i need to change somewhere else?
For magic level:
Code:
return 1600 * std::pow(manaMultiplier, static_cast<int32_t>(magLevel - 1));
replace with:
Code:
return...
with this config:

login:
Code:
dofile(getDataDir() .. "creaturescripts/scripts/stagesconfig.lua")

function onLogin(cid)
    updatePlayerRates(cid)
    if(config.infoOnLogin) then
        doPlayerSendTextMessage(cid, config.msgColor, getPlayerSkillRatesText(cid))
    end
    return true
end

creaturescripts/scripts/stagesconfig.lua
Code:
config = {
    infoOnAdvance = true, -- send player message about skill rate change
    infoOnLogin   = true, -- send player message about skill rates when he login
    msgColor    = MESSAGE_STATUS_CONSOLE_ORANGE
}

SERVER_RATE_SR = getConfigValue('rateSkill')
SERVER_RATE_ML = getConfigValue('rateMagic')

CUSTOM_RATE_STAGES = {
    -- Skill Stages Mage --
    MAGE = {
        [SKILL_FIST]      = {{ 0, 1.0 }},
        [SKILL_CLUB]      = {{ 0, 1.0 }},
        [SKILL_SWORD]     = {{ 0, 1.0 }},
        [SKILL_AXE]       = {{ 0, 1.0 }},
        [SKILL_DISTANCE]  = {{ 0, 1.0 }},
        [SKILL_SHIELD]    = {{ 0, 3.0 },{ 15, 2.0 },{ 30, 1.0 }},
        [SKILL__MAGLEVEL] = {{ 0, 3.0 },{ 15, 2.0 },{ 30, 1.0 }},
    },
    -- Skill Stages Paladin --
    ARCHER = {
        [SKILL_FIST]      = {{ 0, 1.0 }},
        [SKILL_CLUB]      = {{ 0, 1.0 }},
        [SKILL_SWORD]     = {{ 0, 1.0 }},
        [SKILL_AXE]       = {{ 0, 1.0 }},
        [SKILL_DISTANCE]  = {{ 0, 3.0 },{ 40, 2.0 },{ 60, 1.0 }},
        [SKILL_SHIELD]    = {{ 0, 3.0 },{ 40, 2.0 },{ 60, 1.0 }},
        [SKILL__MAGLEVEL] = {{ 0, 3.0 },{  4, 2.0 },{  9, 1.0 }},
    },
    -- Skill Stages Knight --
    KNIGHT = {
        [SKILL_FIST]      = {{ 0, 1.0 }},
        [SKILL_CLUB]      = {{ 0, 3.0 },{ 40, 2.0 },{ 60, 1.0 }},
        [SKILL_SWORD]     = {{ 0, 0.9 },{ 40, 2.0 },{ 60, 1.0 }},
        [SKILL_AXE]       = {{ 0, 3.0 },{ 40, 2.0 },{ 60, 1.0 }},
        [SKILL_DISTANCE]  = {{ 0, 1.0 }},
        [SKILL_SHIELD]    = {{ 0, 3.0 },{ 40, 2.0 },{ 60, 1.0 }},
        [SKILL__MAGLEVEL] = {{ 0, 3.0 },{  4, 2.0 },{  6, 1.0 }},
    },
    --SKILL_FISHING = {{0,5},{60,4},{80,3},{100,2},{110,1}}
}

function getPlayerSkillRatesText(cid)
    local skillInfo = getPlayerRates(cid)
    local packed = {
        (skillInfo[SKILL__MAGLEVEL] * SERVER_RATE_ML),
        (skillInfo[SKILL_FIST]      * SERVER_RATE_SR),
        (skillInfo[SKILL_CLUB]      * SERVER_RATE_SR),
        (skillInfo[SKILL_SWORD]     * SERVER_RATE_SR),
        (skillInfo[SKILL_AXE]       * SERVER_RATE_SR),
        (skillInfo[SKILL_DISTANCE]  * SERVER_RATE_SR),
        (skillInfo[SKILL_SHIELD]    * SERVER_RATE_SR),
        (skillInfo[SKILL_FISHING]   * SERVER_RATE_SR)
    }
    local message = string.format("YOUR RATES: [ Magic Level: %sx || Fist: %sx | Club: %sx |  Sword: %sx | Axe: %sx |  Distance: %s | Shielding: %sx | Fishing: %sx ]", unpack(packed))
    return message
end

function updatePlayerRates(cid, evented)
    local oldRates = getPlayerRates(cid)

    local function doRatings(class)
        local classStages = CUSTOM_RATE_STAGES[class]
        for skill, stages in pairs(classStages) do
            local skillLevel = 0
            if(skill >= 0 and skill <= 6) then
                skillLevel = getPlayerSkillLevel(cid, skill)
            else
                -- if out of range, presume magic
                skillLevel = getPlayerMagLevel(cid, true)
            end
            local skillRate = 1 
            -- gotta check cuz some are empty in the defaults like fishing
            if(classStages[skill] ~= nil) then
                for i, skillStage in pairs(stages) do
                    if(skillLevel >= skillStage[1]) then
                        skillRate = skillStage[2]
                    else
                        break
                    end
                end
                -- print("doPlayerSetRate -> [".. skill .."] [".. skillRate .."]")
                print(skillRate)
                doPlayerSetRate(cid, skill, skillRate)
            end
        end
        return getPlayerRates(cid)
    end
    if (type(evented) == "string") then
        doPlayerSendTextMessage(cid, config.msgColor, evented)
    end
    doRatings( getClass(cid) )
    -- return oldRates, doRatings( getClass(cid), training)
    return true
end

when i login with a knight, it shows on Default
Code:
03:26 YOUR RATES: [ Magic Level: 3x || Fist: 1x | Club: 3x |  Sword: 0.89999997615814x | Axe: 3x |  Distance: 1 | Shielding: 3x | Fishing: 1x ]

So i did think that is the problem...

But looking in the print i put before the magic happen (print(skillRate))

It prints right
Code:
1
0.9
3
3
1
3
3

the function doPlayerSetRate is waiting for a double value

so after all this i have no idea
what is happen? halp, i wanna use this amazing @Gesior.pl idea :(
 
You can set rate to 0.9 or 1.5, but it won't work as it should with server skill rate 1. Skill 'tries' (hits) are stored as INT value:

Player rate 0.9 is fine, when server skill rate is 10, so it gives 9.
If you set player rate to 0.9 and server rate is 1, it will give 0.9 - which converted to INT gives 0.
If you set player rate to 1.5 and server rate is 1, it will give 1.5 - which converted to INT gives 1.

Formula and conversion to INT are there:
 
You can set rate to 0.9 or 1.5, but it won't work as it should with server skill rate 1. Skill 'tries' (hits) are stored as INT value:

Player rate 0.9 is fine, when server skill rate is 10, so it gives 9.
If you set player rate to 0.9 and server rate is 1, it will give 0.9 - which converted to INT gives 0.
If you set player rate to 1.5 and server rate is 1, it will give 1.5 - which converted to INT gives 1.

Formula and conversion to INT are there:

Oh no :(

I want to make a hard low exp/skills server...

1 skill rates should be the base
i want to set skill/2 on traning monks
skill/2 on afk players
also make a vocation that hits 2x faster and sets his skills/2 too

do u know a way to transform that count to a double that could be 0.5, 0.25, 0.125 and just add the tries when become 1?

btw, thank you so much to show me where was the error and to make that script...
it make a better game for noob players
 
i had a idea, do this with storage

looking other codes i made this:

Code:
void Player::addSkillAdvance(skills_t skill, uint32_t count, bool useMultiplier/* = true*/)
{
    if(!count)
        return;
    uint32_t previousSkill = skills[skill][SKILL_LEVEL];
    //player has reached max skill
    uint32_t currReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL]),
        nextReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1);
    if(currReqTries > nextReqTries)
        return;
    // <skill_rates_stages_lower_then_1>
    std::string value;
    player->getStorage(skill, value);
    int32_t value_int = (int32_t)(atoi(value.c_str()));
    if(player->getStorage(skill, value_int) < 1) {
        return;
    } else {
        player->setStorage(skill, 0);
    }
    // </skill_rates_stages_lower_then_1>
    if(useMultiplier)
        count = uint32_t((double)count * rates[skill] * g_config.getDouble(ConfigManager::RATE_SKILL));
    std::stringstream s;
    while(skills[skill][SKILL_TRIES] + count >= nextReqTries)
    {
        count -= nextReqTries - skills[skill][SKILL_TRIES];
        skills[skill][SKILL_TRIES] = skills[skill][SKILL_PERCENT] = 0;
        skills[skill][SKILL_LEVEL]++;
        s.str("");
        s << "You advanced in " << getSkillName(skill);
        if(g_config.getBool(ConfigManager::ADVANCING_SKILL_LEVEL))
            s << " [" << skills[skill][SKILL_LEVEL] << "]";
        s << ".";
        sendTextMessage(MSG_EVENT_ADVANCE, s.str().c_str());
        currReqTries = nextReqTries;
        nextReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1);
        if(currReqTries > nextReqTries)
        {
            count = 0;
            break;
        }
    }
    if(skills[skill][SKILL_LEVEL] > previousSkill) {
        CreatureEventList advanceEvents = getCreatureEvents(CREATURE_EVENT_ADVANCE);
        for(CreatureEventList::iterator it = advanceEvents.begin(); it != advanceEvents.end(); ++it)
            (*it)->executeAdvance(this, skill, previousSkill, skills[skill][SKILL_LEVEL]);
    }
    if(count)
        skills[skill][SKILL_TRIES] += count;
    //update percent
    uint32_t newPercent = Player::getPercentLevel(skills[skill][SKILL_TRIES], nextReqTries);
    if(skills[skill][SKILL_PERCENT] != newPercent)
    {
        skills[skill][SKILL_PERCENT] = newPercent;
        sendSkills();
    }
    else if(!s.str().empty())
        sendSkills();
}

but recive this errors:
Code:
player.cpp: In member function ‘void Player::addSkillAdvance(skills_t, uint32_t, bool)’:
player.cpp:636:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if(currReqTries > nextReqTries)
     ^~
player.cpp:640:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  const Player* player = creature->getPlayer()
  ^~~~~
player.cpp:640:25: error: ‘creature’ was not declared in this scope
  const Player* player = creature->getPlayer()
                         ^~~~~~~~
player.cpp:642:28: error: ‘value’ was not declared in this scope
  player->getStorage(skill, value);
                            ^~~~~
player.cpp:642:28: note: suggested alternative:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from otpch.h:35,
                 from player.cpp:17:
/usr/include/boost/bind/bind.hpp:118:25: note:   ‘boost::_bi::value’
 template<class T> class value
                         ^~~~~
player.cpp:644:40: error: no matching function for call to ‘Player::getStorage(skills_t&, int32_t&) const’
  if(player->getStorage(skill, value_int) < 1) {
                                        ^
In file included from player.h:23:0,
                 from player.cpp:20:
creature.h:336:16: note: candidate: virtual bool Creature::getStorage(uint32_t, std::__cxx11::string&) const
   virtual bool getStorage(const uint32_t key, std::string& value) const;
                ^~~~~~~~~~
creature.h:336:16: note:   no known conversion for argument 2 from ‘int32_t {aka int}’ to ‘std::__cxx11::string& {aka std::__cxx11::basic_string<char>&}’
player.cpp:647:30: error: passing ‘const Player’ as ‘this’ argument discards qualifiers [-fpermissive]
   player->setStorage(skill, 0);
                              ^
In file included from player.cpp:20:0:
player.h:406:16: note:   in call to ‘virtual bool Player::setStorage(uint32_t, const string&)’
   virtual bool setStorage(const uint32_t key, const std::string& value);
                ^~~~~~~~~~
Makefile:33: recipe for target 'player.o' failed
make: *** [player.o] Error 1

anybody can give me a hand pls?
 
I can give you a tip:

You are already in Player class:
Code:
void Player::addSkillAdvance(skills_t skill, uint32_t count, bool useMultiplier/* = true*/)

So you don't need to use:
Code:
player->getStorage(skill, value);

But just:
Code:
getStorage(skill, value);
 
I can give you a tip:

You are already in Player class:
Code:
void Player::addSkillAdvance(skills_t skill, uint32_t count, bool useMultiplier/* = true*/)

So you don't need to use:
Code:
player->getStorage(skill, value);

But just:
Code:
getStorage(skill, value);

I'm sorry, i was editing my last post, i did fix that, but i was trying to go as long i could alone before ask another question


I'm trapped and i need some help:

I did this:
Code:
void Player::addSkillAdvance(skills_t skill, uint32_t count, bool useMultiplier/* = true*/)
{
    if(!count)
        return;
    uint32_t previousSkill = skills[skill][SKILL_LEVEL];
    //player has reached max skill
    uint32_t currReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL]),
        nextReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1);
    if(currReqTries > nextReqTries)
        return;
    // <skill_rates_stages_lower_then_1> 2
    // get skill rates stages storages
    std::string skillrate_value;
    getCreature()->getStorage(skill, skillrate_value);
    int32_t skillrate_int = (int32_t)(atoi(skillrate_value.c_str()));
    // is less then 1, 0.9-
    if(skillrate_int < 1) {
        // get double trys storages
        std::string skilltry_value;
        getCreature()->getStorage(skill+10, skilltry_value);
        int32_t skilltry_int = (int32_t)(atoi(skilltry_value.c_str()));
        if(skilltry_int < 1) {
            skilltry_int += skillrate_int;
            std::string str = boost::lexical_cast<std::string>(skilltry_int);
            setStorage(skill+10, str);
            return;
        }
        else {
            setStorage(skill+10, "0");
        }
    }
    // </skill_rates_stages_lower_then_1>
    if(useMultiplier)
        count = uint32_t((double)count * rates[skill] * g_config.getDouble(ConfigManager::RATE_SKILL));
    std::stringstream s;
    while(skills[skill][SKILL_TRIES] + count >= nextReqTries)
    {
        count -= nextReqTries - skills[skill][SKILL_TRIES];
        skills[skill][SKILL_TRIES] = skills[skill][SKILL_PERCENT] = 0;
        skills[skill][SKILL_LEVEL]++;
        s.str("");
        s << "You advanced in " << getSkillName(skill);
        if(g_config.getBool(ConfigManager::ADVANCING_SKILL_LEVEL))
            s << " [" << skills[skill][SKILL_LEVEL] << "]";
        s << ".";
        sendTextMessage(MSG_EVENT_ADVANCE, s.str().c_str());
        currReqTries = nextReqTries;
        nextReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1);
        if(currReqTries > nextReqTries)
        {
            count = 0;
            break;
        }
    }
    if(skills[skill][SKILL_LEVEL] > previousSkill) {
        CreatureEventList advanceEvents = getCreatureEvents(CREATURE_EVENT_ADVANCE);
        for(CreatureEventList::iterator it = advanceEvents.begin(); it != advanceEvents.end(); ++it)
            (*it)->executeAdvance(this, skill, previousSkill, skills[skill][SKILL_LEVEL]);
    }
    if(count)
        skills[skill][SKILL_TRIES] += count;
    //update percent
    uint32_t newPercent = Player::getPercentLevel(skills[skill][SKILL_TRIES], nextReqTries);
    if(skills[skill][SKILL_PERCENT] != newPercent)
    {
        skills[skill][SKILL_PERCENT] = newPercent;
        sendSkills();
    }
    else if(!s.str().empty())
        sendSkills();
}

everything compiles, but when i run the game the skills still not growing...
printing some stuff on console:
Code:
    print("rates: ".. getPlayerStorageValue(cid, 2))
    print("trys: ".. getPlayerStorageValue(cid, 12))

shows:
Code:
rates: 0.5
trys: -1

why trys is not changing?
did i do something wrong on that edits on source?
 
I'm sorry, i was editing my last post, i did fix that, but i was trying to go as long i could alone before ask another question


I'm trapped and i need some help:

I did this:
Code:
void Player::addSkillAdvance(skills_t skill, uint32_t count, bool useMultiplier/* = true*/)
{
    if(!count)
        return;
    uint32_t previousSkill = skills[skill][SKILL_LEVEL];
    //player has reached max skill
    uint32_t currReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL]),
        nextReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1);
    if(currReqTries > nextReqTries)
        return;
    // <skill_rates_stages_lower_then_1> 2
    // get skill rates stages storages
    std::string skillrate_value;
    getCreature()->getStorage(skill, skillrate_value);
    int32_t skillrate_int = (int32_t)(atoi(skillrate_value.c_str()));
    // is less then 1, 0.9-
    if(skillrate_int < 1) {
        // get double trys storages
        std::string skilltry_value;
        getCreature()->getStorage(skill+10, skilltry_value);
        int32_t skilltry_int = (int32_t)(atoi(skilltry_value.c_str()));
        if(skilltry_int < 1) {
            skilltry_int += skillrate_int;
            std::string str = boost::lexical_cast<std::string>(skilltry_int);
            setStorage(skill+10, str);
            return;
        }
        else {
            setStorage(skill+10, "0");
        }
    }
    // </skill_rates_stages_lower_then_1>
    if(useMultiplier)
        count = uint32_t((double)count * rates[skill] * g_config.getDouble(ConfigManager::RATE_SKILL));
    std::stringstream s;
    while(skills[skill][SKILL_TRIES] + count >= nextReqTries)
    {
        count -= nextReqTries - skills[skill][SKILL_TRIES];
        skills[skill][SKILL_TRIES] = skills[skill][SKILL_PERCENT] = 0;
        skills[skill][SKILL_LEVEL]++;
        s.str("");
        s << "You advanced in " << getSkillName(skill);
        if(g_config.getBool(ConfigManager::ADVANCING_SKILL_LEVEL))
            s << " [" << skills[skill][SKILL_LEVEL] << "]";
        s << ".";
        sendTextMessage(MSG_EVENT_ADVANCE, s.str().c_str());
        currReqTries = nextReqTries;
        nextReqTries = vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1);
        if(currReqTries > nextReqTries)
        {
            count = 0;
            break;
        }
    }
    if(skills[skill][SKILL_LEVEL] > previousSkill) {
        CreatureEventList advanceEvents = getCreatureEvents(CREATURE_EVENT_ADVANCE);
        for(CreatureEventList::iterator it = advanceEvents.begin(); it != advanceEvents.end(); ++it)
            (*it)->executeAdvance(this, skill, previousSkill, skills[skill][SKILL_LEVEL]);
    }
    if(count)
        skills[skill][SKILL_TRIES] += count;
    //update percent
    uint32_t newPercent = Player::getPercentLevel(skills[skill][SKILL_TRIES], nextReqTries);
    if(skills[skill][SKILL_PERCENT] != newPercent)
    {
        skills[skill][SKILL_PERCENT] = newPercent;
        sendSkills();
    }
    else if(!s.str().empty())
        sendSkills();
}

everything compiles, but when i run the game the skills still not growing...
printing some stuff on console:
Code:
    print("rates: ".. getPlayerStorageValue(cid, 2))
    print("trys: ".. getPlayerStorageValue(cid, 12))

shows:
Code:
rates: 0.5
trys: -1

why trys is not changing?
did i do something wrong on that edits on source?

Code:
    // <skill_rates_stages_lower_then_1> 2
    // get skill rates stages storages
    std::string skillrate_value;
    getCreature()->getStorage(skill, skillrate_value);
    int32_t skillrate_int = (int32_t)(atoi(skillrate_value.c_str()));
    // is less then 1, 0.9-
    if(skillrate_int < 1) {
        // get double trys storages
        std::string skilltry_value;
        getCreature()->getStorage(skill+10, skilltry_value);
        int32_t skilltry_int = (int32_t)(atoi(skilltry_value.c_str()));
        if(skilltry_int < 1) {
            skilltry_int += skillrate_int;
            std::string str = boost::lexical_cast<std::string>(skilltry_int);
            setStorage(skill+10, str);
            return;
        }
        else {
            setStorage(skill+10, "0");
        }
    }
    // </skill_rates_stages_lower_then_1>

I did something wrong here?
How can i debug it?
 
Lol! You are right, maybe that is it...
Do u know how to convert to double instead of int?
Quite much work, requires database schema changes. I would edit vocations.xml and set higher skill multipliers for vocations:
Normal skill multiply for sword skill of knight is 1.1. To make it skill slower, set it higher.
You can easily calculate how much harded it will be to get skill with Google as calculator.
1.1 - rate for sword skill of knight
40 - skill to check
Formula: 1.1^40 - paste it in Google search, it will show result: 45

Results for 1.1:
Code:
1.1^40 = 45
1.1^60 = 304
1.1^80 =2048
1.1^100 = 13780
1.1^120 = 92709

Results for 1.11:
Code:
1.1^40 = 65
1.1^60 = 524
1.1^80 =4225
1.1^100 = 34064
1.1^120 = 274635
That small change 1.1 -> 1.11 makes skilling 2-3 slower.

------------------------------------------------------------

If you prefer linear change, you can edit one line in sources:

Replace:
Code:
return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11));
With:
Code:
return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11)) * 10;
Now, you must use 'skillRate = 10' in config.lua, to make skilling like 'x1' on real tibia. So you can set skillRate in config.lua to 10 and use my 'skill stages' with value 0.5. Skill will go like it's 0.5 - after changes it will be 5 for C++ - and there is no need for 'int to double' change.
 
Quite much work, requires database schema changes. I would edit vocations.xml and set higher skill multipliers for vocations:
Normal skill multiply for sword skill of knight is 1.1. To make it skill slower, set it higher.
You can easily calculate how much harded it will be to get skill with Google as calculator.
1.1 - rate for sword skill of knight
40 - skill to check
Formula: 1.1^40 - paste it in Google search, it will show result: 45

Results for 1.1:
Code:
1.1^40 = 45
1.1^60 = 304
1.1^80 =2048
1.1^100 = 13780
1.1^120 = 92709

Results for 1.11:
Code:
1.1^40 = 65
1.1^60 = 524
1.1^80 =4225
1.1^100 = 34064
1.1^120 = 274635
That small change 1.1 -> 1.11 makes skilling 2-3 slower.

------------------------------------------------------------

If you prefer linear change, you can edit one line in sources:
Replace:
Code:
return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11));
With:
Code:
return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11)) * 10;
Now, you must use 'skillRate = 10' in config.lua, to make skilling like 'x1' on real tibia. So you can set skillRate in config.lua to 10 and use my 'skill stages' with value 0.5. Skill will go like it's 0.5 - after changes it will be 5 for C++ - and there is no need for 'int to double' change.

Vocation is one of the 4 reasons that i need 0.5 rates
So i gonna go to the second way
Let me understand...
This line return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11)) * 10;
Make skill try hits 10x higher then before, so 0.5 of this is 5...
Amazing!

Its just now change config.lua to:
Code:
    rateSkill = 10.0 -- 10.0 = 1.0 because of gesior_skills_stages
    rateMagic = 10.0 -- 10.0 = 1.0 because of gesior_skills_stages

magic level is working or do i need to change somewhere else?
 
Vocation is one of the 4 reasons that i need 0.5 rates
So i gonna go to the second way
Let me understand...
This line return skillBase[skill] * std::pow(skillMultipliers[skill], static_cast<int32_t>(level - 11)) * 10;
Make skill try hits 10x higher then before, so 0.5 of this is 5...
Amazing!

Its just now change config.lua to:
Code:
    rateSkill = 10.0 -- 10.0 = 1.0 because of gesior_skills_stages
    rateMagic = 10.0 -- 10.0 = 1.0 because of gesior_skills_stages

magic level is working or do i need to change somewhere else?
For magic level:
Code:
return 1600 * std::pow(manaMultiplier, static_cast<int32_t>(magLevel - 1));
replace with:
Code:
return 1600 * std::pow(manaMultiplier, static_cast<int32_t>(magLevel - 1)) * 10;
 
Solution
Back
Top