Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
function Vocation.getClass(self)
-- vocationId: className
local classes = {
1: 'Mage',
2: 'Healer'
}
if classes[self:getId()] ~= nil then
return classes[self:getId()]
end
return 'Unknown'
end
And extend the classes metatable with the class name for each vocation id.
Then you can do stuff like:
LUA:
player:getVocation():getClass() -- Mage
local myVocation = player:getVocation()
myVocation:getClass()
Alternatively?:
LUA:
function Vocation.getClass(vocationId)
-- vocationId: className
local classes = {
1: 'Mage',
2: 'Healer'
}
if classes[vocationId] ~= nil then
return classes[vocationId]
end
return 'Unknown'
end
function Vocation.getClass(self)
-- vocationId: className
local classes = {
1: 'Mage',
2: 'Healer'
}
if classes[self:getId()] ~= nil then
return classes[self:getId()]
end
return 'Unknown'
end
And extend the classes metatable with the class name for each vocation id.
Then you can do stuff like:
LUA:
player:getVocation():getClass() -- Mage
local myVocation = player:getVocation()
myVocation:getClass()
Alternatively?:
LUA:
function Vocation.getClass(vocationId)
-- vocationId: className
local classes = {
1: 'Mage',
2: 'Healer'
}
if classes[vocationId] ~= nil then
return classes[vocationId]
end
return 'Unknown'
end
LUA:
local thisVocation = Vocation():getClass( player:getVocation():getId() ) -- Mage
local healer = Vocation():getClass(2) -- Healer
myVocation:getClass()