• 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!

Create new race? Querry

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
581
Reaction score
78
Good start to the year for everyone I wanted to ask, how can I create two new races on my server? the ideas to implement the elf and dwarf race when one can create the account one can create the char el male,female,dwarf What I want to do is in the dwarf and elf races put some specific outfits that I have... 4 or 5 outfits per race... but that have the same characteristics as all the vocations I just want to print it, as content... nothing more I am using otx2
 
Good start to the year for everyone I wanted to ask, how can I create two new races on my server? the ideas to implement the elf and dwarf race when one can create the account one can create the char el male,female,dwarf What I want to do is in the dwarf and elf races put some specific outfits that I have... 4 or 5 outfits per race... but that have the same characteristics as all the vocations I just want to print it, as content... nothing more I am using otx2
Orcs / Elvs /Pandas /Minotaurs /Evokers still can be called He or She so I think it depends more on their vocations not gender for example in dragon ball ots you can find goku,vegeta,etcc every character is a vocation not a gender
 
Orcs / Elvs /Pandas /Minotaurs /Evokers still can be called He or She so I think it depends more on their vocations not gender for example in dragon ball ots you can find goku,vegeta,etcc every character is a vocation not a gender
The idea is that the dwarf genre can become a knight, paladin, sorcerer, or druid... that it is the same as humans... the same with the elf race... what I would like to be able to choose... humans, dwarf or elf... and it depends on each species to have specific outfits
 
The idea is that the dwarf genre can become a knight, paladin, sorcerer, or druid... that it is the same as humans... the same with the elf race... what I would like to be able to choose... humans, dwarf or elf... and it depends on each species to have specific outfits
Maybe making it as a simple vocation at the beggning and promoting them like for example dwarf-->
(dwarf druid
,dwarf sorcerer,
dwarf knight,
dwarf paladin)

Like make it as a rookslayer vocation at the beggning called orc make the orc has its own beggning island when he reach level 8 he goes to a npcs to specfiy the only vocation orcs can claim (orc druid,orc sorcerer....)

Also remmember in Wow every race has its unique stats like Goblin movment speed is high, Orcs has higher attack speed etc... you can't specify each gendre in tibia to has unique stats or maybe you can but the way I told you to make it as vocation is more way better
 
There is a way to achieve this through a lib. For example, you could create a file in data/lib/ to implement what you want, such as races, genders, and vocations. If you have sufficient knowledge, you can do this. I found an example that could serve as a reference for you to reflect on and develop. Alternatively, as mentioned above, editing the source code itself may be necessary.

 
Last edited:
What I did was changing my vocations into races, very easy to add new races, I now have 8.
Just make new Character Samples to accompany the new races.

In my firstitems.lua I am giving storages and outfits to all races upon login, this enables quests and outfits, also this sets their hometown.
----------

I just use the promotion function to promote certain races to certain classes.

No need to add anything in src or making a new script.
 
What I did was changing my vocations into races, very easy to add new races, I now have 8.
Just make new Character Samples to accompany the new races.

In my firstitems.lua I am giving storages and outfits to all races upon login, this enables quests and outfits, also this sets their hometown.
----------

I just use the promotion function to promote certain races to certain classes.

No need to add anything in src or making a new script.
Indeed
 
What I did was changing my vocations into races, very easy to add new races, I now have 8.
Just make new Character Samples to accompany the new races.

In my firstitems.lua I am giving storages and outfits to all races upon login, this enables quests and outfits, also this sets their hometown.
----------

I just use the promotion function to promote certain races to certain classes.

No need to add anything in src or making a new script.
may you explain a bit further please. I'm currently trying to implement a undead race.
 
What I did was changing my vocations into races, very easy to add new races, I now have 8.
Just make new Character Samples to accompany the new races.

In my firstitems.lua I am giving storages and outfits to all races upon login, this enables quests and outfits, also this sets their hometown.
----------

I just use the promotion function to promote certain races to certain classes.

No need to add anything in src or making a new script.
What I would like is... that when you create the character on the page you can choose, male, female, elf or dwarf and that each race has its own separate outfit... as does the male and the female, after the other races such as elf and dwarf function the same as the male and female, one when you reach level 8 being an elf or dwarf one can be made the vocation normally, knight or druid or sorcerer or paladin, let me explain?
 
@tnecniiv and @Jpstafe
I just make use of the already existing vocation system, but by making the initial vocation your race, after which you can get "promoted" to a first vocation/class.

Super easy-peasy lemon squeezy
Do the following to add new vocation or change existing ones:
- Server Folder > Data > XML > Vocations.xml: Add your new vocation here. Lets use Orc for an example below:
LUA:
<vocation id="5" clientid="5" name="Orc" description="an uruk-ongmair" gaincap="20" gainhp="12" gainmana="4" gainhpticks="4" gainhpamount="8" gainmanaticks="6" gainmanaamount="3" manamultiplier="1.0" attackspeed="1900" basespeed="245" soulmax="100" gainsoulticks="120" noPongKickTime="50">
        <formula meleeDamage="1.2" distDamage="0.9" defense="1.0" armor="1.1" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="1.5" />
        <skill id="2" multiplier="1.5" />
        <skill id="3" multiplier="1.5" />
        <skill id="4" multiplier="1.5" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.5" />
    </vocation>

Now go to Server Folder > Data > Creature Scripts > firstitems.lua
I will give you an example of my script, it is very easy to read, it does the following:
  • Upon first login gives the player items depending on vocation/race.
  • Upon first login gives the player some starting storages for (tutorial) quest.
  • Upon first login will set the players hometown to their vocation/race town.
  • Upon first login will teleport the player to a specific location.
  • Upon first login gives the player specific outfits depending on gender and vocation/race.
LUA:
local firstItems = {
    hobbit = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},   -- Additional item for hobbit
    human = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},  -- Additional item for human
    dwarf = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},   -- Additional item for dwarf
    elf = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},  -- Additional item for elf
}

local townIds = {
    elf = 3,
    human = 1,
    hobbit = 2,
    dwarf = 12,
}

local townNames = {
    [3] = "Rivendell",
    [1] = "Bree",
    [2] = "Hobbiton",
    [12] = "Nogrod",
}

local outfits = {
    elf = {1137, 1136},   -- Elf female/male
    hobbit = {368, 368},  -- Hobbit female/male
    human = {1246, 1245},   -- Human female/male
    dwarf = {160, 370},   -- Dwarf female/male
}

function onLogin(player)
    if player:getLastLoginSaved() == 0 then
        local vocation = player:getVocation():getName():lower()
        
        if vocation == "no vocation" then
            player:addItem(2148, 50)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 50 gold coins.") -- Admin First Login
            return true
        end
        
        local items = firstItems[vocation].items
        local storage = firstItems[vocation].storage

        for i = 1, #items do
            player:addItem(items[i], 1)
        end
        
        -- Set race-specific storages and teleport to specific location
        if vocation == "hobbit" then
            player:teleportTo(Position(2032, 1892, 7)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(900, 0) -- Race Quest Start
        elseif vocation == "human" then
            player:teleportTo(Position(3004, 1824, 7)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(920, 0) -- Race Quest Start
        elseif vocation == "dwarf" then
            player:teleportTo(Position(1708, 2238, 7)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(940, 0) -- Race Quest Start
        elseif vocation == "elf" then
            player:teleportTo(Position(4214, 1746, 6)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(960, 0) -- Race Quest Start
        end
        
 -- Set the town based on vocation
        local townId = townIds[vocation]
        local town = Town(townId)
        if not town then
            return false
        end
        player:setTown(town)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your tales start in " .. townNames[townId] .. ". \nYour quest log has been updated.")
        player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)

        local outfit = outfits[vocation]
        player:addOutfit(outfit[1])  -- Assuming outfit[1] is the female outfit
        player:addOutfit(outfit[2])  -- Assuming outfit[2] is the male outfit
        
        local currentOutfit = player:getOutfit()
        currentOutfit.lookType = player:getSex() == 0 and outfit[1] or outfit[2]
        player:setOutfit(currentOutfit)
        
        
    end
    return true
end

Now what you can do next is use the promotion.lua script to give players vocations/classes, so you make another entry in vocations.xml adding "fromvoc = 5"

You can fully play around with this, you are able to create forks of classes and vocations for example a player may choose out of a few vocations when being an Orc, after which you can advance again to a more specialized class for what vocation they initially chosen. Some races may not get certain vocations etc, very easy for you to setup.

----------------
Side Note if you add more starting races than 4, don't forget to add them in your website/htdocs/config.php
( I changed my sample names, original are Knight Sample, Druid Sample etc)

So if you add a 5th, you need to adjust these accordingly, also add a new Character Sample in database.
SQL:
INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `lastlogout`, `balance`, `deletion`, `created`, `hidden`, `comment`) VALUES (null, 'Orc Sample', 1, 1, 8, 5, 185, 185, 4200, 118, 114, 38, 57, 131, 0, 90, 90, 0, 100, 1, 1000, 1000, 7, '', 470, 1, 1706124632, 2130706433, 1, 1706124632, 0, 0, 1706124632, 1, '');

1736681463731.webp
1736681449890.webp
1736681498766.webp
 
@tnecniiv and @Jpstafe
I just make use of the already existing vocation system, but by making the initial vocation your race, after which you can get "promoted" to a first vocation/class.

Super easy-peasy lemon squeezy
Do the following to add new vocation or change existing ones:
- Server Folder > Data > XML > Vocations.xml: Add your new vocation here. Lets use Orc for an example below:
LUA:
<vocation id="5" clientid="5" name="Orc" description="an uruk-ongmair" gaincap="20" gainhp="12" gainmana="4" gainhpticks="4" gainhpamount="8" gainmanaticks="6" gainmanaamount="3" manamultiplier="1.0" attackspeed="1900" basespeed="245" soulmax="100" gainsoulticks="120" noPongKickTime="50">
        <formula meleeDamage="1.2" distDamage="0.9" defense="1.0" armor="1.1" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="1.5" />
        <skill id="2" multiplier="1.5" />
        <skill id="3" multiplier="1.5" />
        <skill id="4" multiplier="1.5" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.5" />
    </vocation>

Now go to Server Folder > Data > Creature Scripts > firstitems.lua
I will give you an example of my script, it is very easy to read, it does the following:
  • Upon first login gives the player items depending on vocation/race.
  • Upon first login gives the player some starting storages for (tutorial) quest.
  • Upon first login will set the players hometown to their vocation/race town.
  • Upon first login will teleport the player to a specific location.
  • Upon first login gives the player specific outfits depending on gender and vocation/race.
LUA:
local firstItems = {
    hobbit = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},   -- Additional item for hobbit
    human = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},  -- Additional item for human
    dwarf = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},   -- Additional item for dwarf
    elf = {items = {1987, 2195, 49275, 2650, 2050, 18559, 2600, 2160, 31447}},  -- Additional item for elf
}

local townIds = {
    elf = 3,
    human = 1,
    hobbit = 2,
    dwarf = 12,
}

local townNames = {
    [3] = "Rivendell",
    [1] = "Bree",
    [2] = "Hobbiton",
    [12] = "Nogrod",
}

local outfits = {
    elf = {1137, 1136},   -- Elf female/male
    hobbit = {368, 368},  -- Hobbit female/male
    human = {1246, 1245},   -- Human female/male
    dwarf = {160, 370},   -- Dwarf female/male
}

function onLogin(player)
    if player:getLastLoginSaved() == 0 then
        local vocation = player:getVocation():getName():lower()
       
        if vocation == "no vocation" then
            player:addItem(2148, 50)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 50 gold coins.") -- Admin First Login
            return true
        end
       
        local items = firstItems[vocation].items
        local storage = firstItems[vocation].storage

        for i = 1, #items do
            player:addItem(items[i], 1)
        end
       
        -- Set race-specific storages and teleport to specific location
        if vocation == "hobbit" then
            player:teleportTo(Position(2032, 1892, 7)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(900, 0) -- Race Quest Start
        elseif vocation == "human" then
            player:teleportTo(Position(3004, 1824, 7)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(920, 0) -- Race Quest Start
        elseif vocation == "dwarf" then
            player:teleportTo(Position(1708, 2238, 7)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(940, 0) -- Race Quest Start
        elseif vocation == "elf" then
            player:teleportTo(Position(4214, 1746, 6)) -- Tutorial Location
            player:setStorageValue(1500, 0) -- LORD OF THE RINGS START (devremovebeta)
            player:setStorageValue(960, 0) -- Race Quest Start
        end
       
 -- Set the town based on vocation
        local townId = townIds[vocation]
        local town = Town(townId)
        if not town then
            return false
        end
        player:setTown(town)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your tales start in " .. townNames[townId] .. ". \nYour quest log has been updated.")
        player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)

        local outfit = outfits[vocation]
        player:addOutfit(outfit[1])  -- Assuming outfit[1] is the female outfit
        player:addOutfit(outfit[2])  -- Assuming outfit[2] is the male outfit
       
        local currentOutfit = player:getOutfit()
        currentOutfit.lookType = player:getSex() == 0 and outfit[1] or outfit[2]
        player:setOutfit(currentOutfit)
       
       
    end
    return true
end

Now what you can do next is use the promotion.lua script to give players vocations/classes, so you make another entry in vocations.xml adding "fromvoc = 5"

You can fully play around with this, you are able to create forks of classes and vocations for example a player may choose out of a few vocations when being an Orc, after which you can advance again to a more specialized class for what vocation they initially chosen. Some races may not get certain vocations etc, very easy for you to setup.

----------------
Side Note if you add more starting races than 4, don't forget to add them in your website/htdocs/config.php
( I changed my sample names, original are Knight Sample, Druid Sample etc)

So if you add a 5th, you need to adjust these accordingly, also add a new Character Sample in database.
SQL:
INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `lastlogout`, `balance`, `deletion`, `created`, `hidden`, `comment`) VALUES (null, 'Orc Sample', 1, 1, 8, 5, 185, 185, 4200, 118, 114, 38, 57, 131, 0, 90, 90, 0, 100, 1, 1000, 1000, 7, '', 470, 1, 1706124632, 2130706433, 1, 1706124632, 0, 0, 1706124632, 1, '');

View attachment 89462
View attachment 89461
View attachment 89463
Now I will try it, thanks for taking the time to explain and put the codes (L
 
Back
Top