Untitled diff

Created Diff never expires
1 removal
29 lines
7 additions
35 lines
function Player:onGainExperience(source, exp, rawExp)
function Player:onGainExperience(source, exp, rawExp)
if not source or source:isPlayer() then
if not source or source:isPlayer() then
return exp
return exp
end
end


-- Soul regeneration
-- Soul regeneration
local vocation = self:getVocation()
local vocation = self:getVocation()
if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
self:addCondition(soulCondition)
self:addCondition(soulCondition)
end
end


-- Apply experience stage multiplier
-- Apply experience stage multiplier
exp = exp * Game.getExperienceStage(self:getLevel())
-- custom edit: half exp after some passive damage bonus
if(self:getLevel() < configManager.getNumber(configKeys.MAX_LEVEL)) then
exp = exp * (Game.getExperienceStage(self:getLevel()))
else
exp = exp * (Game.getExperienceStage(self:getLevel()) / (self:getPassiveDamageBonus()+1))
end


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


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


return exp
return exp
end
end