msg.add<uint16_t>(100); // base xp gain rate
msg.add<uint16_t>(0); // xp voucher
msg.add<uint16_t>(0); // low level bonus
msg.add<uint16_t>(0); // xp boost
msg.add<uint16_t>(100); // stamina multiplier (100 = x1.0)
Code:msg.add<uint16_t>(100); // base xp gain rate msg.add<uint16_t>(0); // xp voucher msg.add<uint16_t>(0); // low level bonus msg.add<uint16_t>(0); // xp boost msg.add<uint16_t>(100); // stamina multiplier (100 = x1.0)
Change 0 to you value.
https://github.com/otland/forgottenserver/blob/master/src/protocolgame.cpp#L2835
https://github.com/malucooo/Otxserver-Testing/blob/master/src/protocolgamebase.cpp#L201
This is only show player that exp i increase. To double exp you need change https://github.com/malucooo/Otxserver-Testing/blob/master/data/events/scripts/player.lua#L183
Change
toCode:msg.add<uint16_t>(100); // base xp gain rate
Code:msg.add<uint16_t>(g_config.getNumber(ConfigManager::RATE_EXPERIENCE)*100); // base xp gain rate
-- exp card
local BONUS_EXP_STORAGE = 61398
local BONUS_EXP_MULT = 1.3
-- exp card
local configexp = {
["Monday"] = 1.0,
["Tuesday"] = 1.0,
["Wednesday"] = 1.0,
["Thursday"] = 1.0,
["Friday"] = 1.0,
["Saturday"] = 2.0,
["Sunday"] = 2.0
}
function Player:onGainExperience(source, exp, rawExp)
if not source or source:isPlayer() then
return exp
end
exp = exp * configexp[os.date("%A")]
-- 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
-- exp card
if self:getStorageValue(BONUS_EXP_STORAGE) - os.time() > 0 then
exp = exp * BONUS_EXP_MULT
end
-- exp card
return exp
end
function Player:onLoseExperience(exp)
return exp
end
i go to try compiling.
i compiling for working i need add: PlayerSetStaminaXpBoost() in .lua? etc?
Yep, you need to utilize the 'set' methods you just added to your source code in order to update the value for 'XP Gain Rate'.i compiling for working i need add: PlayerSetStaminaXpBoost() in .lua? etc?
Yep, you need to utilize the 'set' methods you just added to your source code in order to update the value for 'XP Gain Rate'.