forgottenserver/data/lib/core/vocation.lua
Rey Alemán 1972bc8940
feature: in-game highscores (#4421)
Co-authored-by: Rey Alemán <rey.aleman@oulook.com>
2023-05-11 21:19:47 -04:00

25 lines
468 B
Lua

function Vocation.getBase(self)
local base = self
while base:getDemotion() do
base = base:getDemotion()
end
return base
end
function Vocation.getFromVocation(self)
local demotion = self:getDemotion()
if demotion then
return demotion
end
return self
end
function Vocation.getRelated(self)
local vocations = {}
local related = self
repeat
vocations[#vocations + 1] = related
related = related:getPromotion()
until not related
return vocations
end