cristianso
Member
- Joined
- Jan 27, 2019
- Messages
- 47
- Reaction score
- 16
I made a EXP script that forces the player to get a certain amount of exp in rookgaard and when he moves to main island he get the normal exp. The script is working until level 20, after that it is like I am playing 1x server... Whats going on?
PS: I am sure I disabled Stages in XML.
This code is inside events\scripts\player.lua,
PS: I am sure I disabled Stages in XML.
This code is inside events\scripts\player.lua,
Lua:
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
local town = self:getTown():getId()
local level = self:getLevel()
if town <= 2 then
exp = exp * 2.5
end
if town > 2 then
if level <20 then
exp = exp*12
end
if level >=21 and level <60 then
exp = exp*10
end
if level >=61 and level <100 then
exp = exp*8
end
if level >=101 and level <130 then
exp = exp*6
end
if level >=131 and level <160 then
exp = exp * 4
end
if level >= 161 then
exp = exp*2
end
end
-- 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
return exp
end