• 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.X+ TFS 1.2 Weird "You advanced in" numbers

Stanos

Veteran OT User
Joined
Jun 12, 2018
Messages
587
Solutions
4
Reaction score
315
Location
Europe
Hiho
So got an weird issue and have no idea where is the problem. I will try to explain everything.

So we got this:
23:57 You advanced in speed [1123854
23:57 You advanced in speed [1223854
23:57 You advanced in speed [1323854
23:57 You advanced in speed [1423854
23:57 You advanced in speed [1523854


As you can see it has weird 23854 numbers and im not sure how to remove them and even what is that.

This is my player.cpp addSkillAdvance with prints

Console which is on skill advance and everything looks just fine
fa621ab121293764a508bca88fe671d6-png.jpg

Then we have player.lua
Lua:
function Player:addSkillLevel(skillId)
    local curSkill = self:getSkillLevel(skillId)
    local curTries = self:getSkillTries(skillId)
    local voc = self:getVocation()
    local nextTries = voc:getRequiredSkillTries(skillId, curSkill + 1)
    self:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2))
end
Lua:
function Player:addSkillLevels(skill, count)
    count = math.max(1, count or 1)
    
    if isInArray({SKILL_FIST, SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE, SKILL_SHIELD, SKILL_FISHING}, skill) then
        for i = 1, count do
            self:addSkillTries(skill, self:getVocation():getRequiredSkillTries(skill, self:getSkillLevel(skill) + 1) - self:getSkillTries(skill))
        end
        return true
    end
    
    if skill == SKILL_MAGLEVEL then
        for i = 1, count do
            local xp = math.ceil(self:getVocation():getRequiredManaSpent(self:getBaseMagicLevel() + 1) / configManager.getNumber(configKeys.RATE_MAGIC))
            self:addManaSpent(xp)
        end
        return true
    end

    return false
end
 
Solution
Change
C++:
ss << "You advanced in " << getSkillName(skill) << " [" << skills[skill].level << '].';
To
C++:
ss << "You advanced in " << getSkillName(skill) << " [" << skills[skill].level << "].";
Change
C++:
ss << "You advanced in " << getSkillName(skill) << " [" << skills[skill].level << '].';
To
C++:
ss << "You advanced in " << getSkillName(skill) << " [" << skills[skill].level << "].";
 
Solution
Back
Top