If you add @Evil Hero's player events, then you can manipulate the exp gained or lost by a player.
Here I show you how to add experience bonus rate for players.
/events/scripts/player.lua
Normally you just have these lines when you end adding the new events:
For the first one, you can modify the experience gained with some conditions like this
>self:getStorageValue(storage) >= 1
>EXTRA_EXP_RATE
With some little effort, you can also make it reduce the lost experience.
Here I show you how to add experience bonus rate for players.
/events/scripts/player.lua
Normally you just have these lines when you end adding the new events:
Code:
function Player:onGainExperience(target, exp, rawExp)
return exp
end
function Player:onLoseExperience(exp)
return exp
end
For the first one, you can modify the experience gained with some conditions like this
Code:
function Player:onGainExperience(target, exp, rawExp)
if self:getStorageValue(STORAGE) >= 1 then
local EXTRA_EXP_RATE = 0.5 --+50% exp rate
local stamina = 1
if getConfigInfo('staminaSystem') == 'yes' then
stamina = (self:getPremiumDays() > 0 and self:getStamina() > 2400) and 1.5 or 0.5
end
return rawExp*getConfigInfo('rateExp')*stamina*(1+EXTRA_EXP_RATE)
end
return exp
end
>EXTRA_EXP_RATE
With some little effort, you can also make it reduce the lost experience.