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

help Disable exp stages/stamina for PvP exp [TFS 1.5 by Nekiro]

sevengym

Member
Joined
Aug 27, 2014
Messages
100
Reaction score
9
Location
Poland
How to make so Experience Stages and Stamina work only for Exp from monsters? Not for PvP exp. I set up a stable 3 level loss for death. But I cannot set up stable 1 level gain for kill because Stages and Stamina affect it in this line
LUA:
    -- Experience stage multiplier
    exp = exp * Game.getExperienceStage(self:getLevel())

    -- Stamina modifier
    if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
        useStamina(self)

        local staminaMinutes = self:getStamina()
        if staminaMinutes > 2400 and self:isPremium() then
            exp = exp * 1.5
        elseif staminaMinutes <= 840 then
            exp = exp * 0.5
        end
    end

    return hasEventCallback(EVENT_CALLBACK_ONGAINEXPERIENCE) and EventCallback(EVENT_CALLBACK_ONGAINEXPERIENCE, self, source, exp, rawExp) or exp
end
I also tried to manipulate this code without any success:
C++:
uint64_t Player::getGainedExperience(Creature* attacker) const
{
    if (g_config.getBoolean(ConfigManager::EXPERIENCE_FROM_PLAYERS)) {
        Player* attackerPlayer = attacker->getPlayer();
        if (attackerPlayer && attackerPlayer != this && skillLoss && std::abs(static_cast<int32_t>(attackerPlayer->getLevel() - level)) <= g_config.getNumber(ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE)) {
            return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));
        }
    }
    return 0;
}
Post automatically merged:

bump
 
Last edited:
I think it is in config when you set in the first minlevel to "1" stage maxlevel to "" instead of "100x" for example
Post automatically merged:

I think it is in config when you set in the first minlevel to "1" stage maxlevel to "" instead of "100x" for example
LUA:
{ minlevel = 1, maxlevel = , multiplier = 7 }
 
you have to remove experience form players(false in config lua) and instead move it onto onKill function you will then have full control over what the player gains for killing others.
 
you have to remove experience form players(false in config lua) and instead move it onto onKill function you will then have full control over what the player gains for killing others.
I tried onKill, with doPlayerAddLevel or doPlayerAddExp. Same result. Doesn't matter if I add exp to player in C++ or Lua exp stages will still multiply it at the end.
Post automatically merged:

I think it is in config when you set in the first minlevel to "1" stage maxlevel to "" instead of "100x" for example
Post automatically merged:


LUA:
{ minlevel = 1, maxlevel = , multiplier = 7 }
The thing is it doesnt matter how i edit stages in config.lua, at the end
LUA:
-- Experience stage multiplier
    exp = exp * Game.getExperienceStage(self:getLevel())
this will modify any exp gained. I honestly see no way to separate Stages from impacting PvP exp.
Post automatically merged:

bump
 
Last edited:
Back
Top