mirror of
https://github.com/otland/forgottenserver
synced 2026-08-15 16:32:07 -04:00
25 lines
468 B
Lua
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
|