I'm trying to put the xp rate gain on the client equal to rl, it only stays at "100%" as in the image below:
I am using this double xp scroll script
dara\actions\scripts\exp.lua:
And player.lua
I wanted it to be "150%" with stamina bonus,, "300% with stamina bonus + xp srcoll and" 200xp "with xp scroll. Can anyone help me?
OBS: I'm was looking in sources and find this but idk how use it:
I am using this double xp scroll script
dara\actions\scripts\exp.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(1234) >= os.time() then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have double exp!")
return true
end
player:setStorageValue(1234, os.time() + 3600)
Item(item.uid):remove(1)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You've activated Experience Card.")
player:getPosition():sendMagicEffect(15)
return true
end
And player.lua
Code:
-- exp card
local BONUS_EXP_STORAGE = 1234
local BONUS_EXP_MULT = 2
-- exp card
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
-- 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
OBS: I'm was looking in sources and find this but idk how use it:
Code:
msg.add<uint16_t>(player->getBaseXpGain()); // 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)