• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Reduce Exp Per Rebirth

Wusse

Member
Joined
Oct 3, 2023
Messages
33
Reaction score
6
Hey its me once again with stupid questions!

I found this post (Reduce Exp per rebirth (https://otland.net/threads/reduce-exp-per-rebirth.242972/)) hoping i would get some answers, but yeah... haha as you can se its tibia playes being tibia players... ^^
something i learned from the post was (which is brilliant if you ask me) the fact that you can use a onLogin Function since the character has to login after each rebirth. Not having this implementet simply means a player can sit in the first spawn meant for 0 rebirths without swapping spawn ever...

Im currently using TFS 1.4.2 10,98 with the reborn system (Feature - Reborn System | Reset level, increase power, set exclusive items, spells, houses, web and more! (https://otland.net/threads/reborn-system-reset-level-increase-power-set-exclusive-items-spells-houses-web-and-more.245808/)).

Question 1: How would i go about to add such a function and where exactly do i do it?

Help is highly appreciated ^^!
 
Solution
on top of player.lua add

Lua:
local rates = {
    {range = {0, 9}, rate = 10}, -- 0 to 9 rebirth
    {range = {10, 14}, rate = 9}, -- 10 to 14 rebirth
    {range = {15, 20}, rate = 8}, -- 15 to 20 rebirth
}

above:
Lua:
-- Apply experience stage multiplier
add
Lua:
local rebirthLevel = self:getRebirth()
for _, rebirth in pairs(rates) do
    if rebirthLevel >= rebirth.range[1] and rebirthLevel <= rebirth.range[2] then
        exp = exp * rebirth.rate
        break
    end
end
onGainExperience event

Lua:
exp = exp - (exp * rebithMultiplier)
smth like that

Im having a hard time finding where exactly onGainExperience Event actually is, do you mind pinpointing me to the right direction?

Edit:


this is the only thing i could make sense of... (not working)
 
Last edited:
Im having a hard time finding where exactly onGainExperience Event actually is, do you mind pinpointing me to the right direction?

Edit:


this is the only thing i could make sense of... (not working)
in data/events/player.lua, all what u must do its just to create a multiplier, lets say each reborn give 1% more experience, then u should create smth like

local rebirth = player:getRebirth()
local rebirthMultiplier = rebirth * 0.01

then increase returned exp in that func that i said
 
on top of player.lua add

Lua:
local rates = {
    {range = {0, 9}, rate = 10}, -- 0 to 9 rebirth
    {range = {10, 14}, rate = 9}, -- 10 to 14 rebirth
    {range = {15, 20}, rate = 8}, -- 15 to 20 rebirth
}

above:
Lua:
-- Apply experience stage multiplier
add
Lua:
local rebirthLevel = self:getRebirth()
for _, rebirth in pairs(rates) do
    if rebirthLevel >= rebirth.range[1] and rebirthLevel <= rebirth.range[2] then
        exp = exp * rebirth.rate
        break
    end
end
 
Solution
on top of player.lua add

Lua:
local rates = {
    {range = {0, 9}, rate = 10}, -- 0 to 9 rebirth
    {range = {10, 14}, rate = 9}, -- 10 to 14 rebirth
    {range = {15, 20}, rate = 8}, -- 15 to 20 rebirth
}

above:
Lua:
-- Apply experience stage multiplier
add
Lua:
local rebirthLevel = self:getRebirth()
for _, rebirth in pairs(rates) do
    if rebirthLevel >= rebirth.range[1] and rebirthLevel <= rebirth.range[2] then
        exp = exp * rebirth.rate
        break
    end
end
Thank you so much, it works like a charm!

Appreciate it!


in data/events/player.lua, all what u must do its just to create a multiplier, lets say each reborn give 1% more experience, then u should create smth like

local rebirth = player:getRebirth()
local rebirthMultiplier = rebirth * 0.01

then increase returned exp in that func that i said

Thank you for leading me into the right Direction!
 
Last edited:
Hey its me once again with stupid questions!

I found this post (Reduce Exp per rebirth (https://otland.net/threads/reduce-exp-per-rebirth.242972/)) hoping i would get some answers, but yeah... haha as you can se its tibia playes being tibia players... ^^
something i learned from the post was (which is brilliant if you ask me) the fact that you can use a onLogin Function since the character has to login after each rebirth. Not having this implementet simply means a player can sit in the first spawn meant for 0 rebirths without swapping spawn ever...

Im currently using TFS 1.4.2 10,98 with the reborn system (Feature - Reborn System | Reset level, increase power, set exclusive items, spells, houses, web and more! (https://otland.net/threads/reborn-system-reset-level-increase-power-set-exclusive-items-spells-houses-web-and-more.245808/)).

Question 1: How would i go about to add such a function and where exactly do i do it?

Help is highly appreciated ^^!
how to add this to tfs 1.5?
 
Back
Top