Lais Prad
Disgusting Scammer
- Joined
- Apr 12, 2017
- Messages
- 153
- Solutions
- 6
- Reaction score
- 15
How to add in this config to show in skill stats?
player.lua
I tried this way:
protocolgame.base
player.lua
Lua:
local BONUS_EXP_STORAGE = 61398
local BONUS_EXP_MULT = 1.2
function Player:onGainExperience(source, exp, rawExp)
if not source or source:isPlayer() then
return exp
end
-- Soul regeneration
local vocation = self:getVocation()
if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
self:addCondition(soulCondition)
end
-- Apply 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
-- I WANT TO ADD THIS BONUS FOR SHOW IN STATS
if self:getStorageValue(BONUS_EXP_STORAGE) - os.time() > 0 then
exp = exp * BONUS_EXP_MULT -- 20%
end
return exp
end
I tried this way:
C++:
if self:getStorageValue(BONUS_EXP_STORAGE) - os.time() > 0
{
msg.add<uint16_t>(g_config.getNumber(ConfigManager::RATE_EXPERIENCE)*120); // base xp gain rate
}
else
{
msg.add<uint16_t>(g_config.getNumber(ConfigManager::RATE_EXPERIENCE)*100); // base xp gain rate
}
protocolgame.base
C++:
msg.add<uint16_t>(g_config.getNumber(ConfigManager::RATE_EXPERIENCE)*100); // base xp gain rate
msg.add<uint16_t>(player->getVoucherXpBoost()); // xp voucher
msg.add<uint16_t>(player->getGrindingXpBoost()); // low level bonus
msg.add<uint16_t>(player->getStoreXpBoost()); // xp boost
msg.add<uint16_t>(player->getStaminaXpBoost()); // stamina multiplier (100 = 1.0x)