• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Gesior, possibility to choose rook or main

nanduzenho

Member
Joined
Mar 21, 2021
Messages
191
Solutions
1
Reaction score
16
GitHub
nanduzenho
Good afternoon!!! I would like to put a start in rook option just for those who want to start there. However, when I put the "no vocation" option in createaccount, I still have the option to choose the city, such as Thais, Carlin, Venore... Does anyone know how to make the player who chooses to start in rook not have this possibility to go to main without a vocation?

config.php :

PHP:
$config['site']['newchar_vocations'] = array(1 => 'Sorcerer Sample', 2 => 'Druid Sample', 3 => 'Paladin Sample', 4 => 'Knight Sample');
$config['site']['newchar_towns'] = array(1, 2, 3, 4, 5);
$config['site']['max_players_per_account'] = 7;
 
Last edited:
Solution
X
I don't know how to solve your current issue, but I do have an easy work-around for you.

If the vocation is 0, and the the town does not equal rookgaard, then set town, and teleport player to rook temple, during login.

This way it doesn't matter what city they choose, they will spawn in rookgaard, as you intend.

LUA:
local vocationId = 0
local townId = 7 -- I think this is rook on most maps? You'll have to check.

local loginEvent = CreatureEvent("onLogin_rookgaardianCheck")
loginEvent:type("login")

function loginEvent.onLogin(player)
    if player:getVocation():getId() == vocationId then
        if player:getTown():getId() ~= townId then
            local town = Town(townId)
            player:setTown(town)...
I don't know how to solve your current issue, but I do have an easy work-around for you.

If the vocation is 0, and the the town does not equal rookgaard, then set town, and teleport player to rook temple, during login.

This way it doesn't matter what city they choose, they will spawn in rookgaard, as you intend.

LUA:
local vocationId = 0
local townId = 7 -- I think this is rook on most maps? You'll have to check.

local loginEvent = CreatureEvent("onLogin_rookgaardianCheck")
loginEvent:type("login")

function loginEvent.onLogin(player)
    if player:getVocation():getId() == vocationId then
        if player:getTown():getId() ~= townId then
            local town = Town(townId)
            player:setTown(town)
            player:teleportTo(town:getTemplePosition())
        end
    end
    return true
end

loginEvent:register()
 
Solution
I don't know how to solve your current issue, but I do have an easy work-around for you.

If the vocation is 0, and the the town does not equal rookgaard, then set town, and teleport player to rook temple, during login.

This way it doesn't matter what city they choose, they will spawn in rookgaard, as you intend.

LUA:
local vocationId = 0
local townId = 7 -- I think this is rook on most maps? You'll have to check.

local loginEvent = CreatureEvent("onLogin_rookgaardianCheck")
loginEvent:type("login")

function loginEvent.onLogin(player)
    if player:getVocation():getId() == vocationId then
        if player:getTown():getId() ~= townId then
            local town = Town(townId)
            player:setTown(town)
            player:teleportTo(town:getTemplePosition())
        end
    end
    return true
end

loginEvent:register()
where do i put?
 
Back
Top