Tutorial Agregar nueva vocation protocolo 12x-12.72

Alex

Administrator
Dev
Messages
2,374
Points
707
Hola a todos,

Hoy veremos como agregar una nueva vocation a nuestro servidor, este último necesitara ser compilado para poder funcionar.

Parte Servidor:

En primer lugar, buscaremos el archivo enums.h ( que sera el único archivo source que tocar y podremos compilar ) =
Code:
enum Vocation_t : uint16_t {
    VOCATION_NONE = 0,
    VOCATION_SORCERER = 1,
    VOCATION_DRUID = 2,
    VOCATION_PALADIN = 3,
    VOCATION_KNIGHT = 4,
    VOCATION_MASTER_SORCERER = 5,
    VOCATION_ELDER_DRUID = 6,
    VOCATION_ROYAL_PALADIN = 7,
    VOCATION_ELITE_KNIGHT = 8,
    VOCATION_LAST = VOCATION_ELITE_KNIGHT
};
Aquí, encontraremos esta parte, debajo de VOCATION_ELITE_KNIGHT, escribiremos nuestra vocación ejemplo: VOCATION_CRUSADER
Y al ser la última entonces la agregaremos a la VOCATION_LAST.
Quedará de esta forma:

Code:
enum Vocation_t : uint16_t {
    VOCATION_NONE = 0,
    VOCATION_SORCERER = 1,
    VOCATION_DRUID = 2,
    VOCATION_PALADIN = 3,
    VOCATION_KNIGHT = 4,
    VOCATION_MASTER_SORCERER = 5,
    VOCATION_ELDER_DRUID = 6,
    VOCATION_ROYAL_PALADIN = 7,
    VOCATION_ELITE_KNIGHT = 8,
    VOCATION_CRUSADER = 9,
    VOCATION_LAST = VOCATION_CRUSADER
};

En siguiente nos iremos al archivo data/lib/tables, vocation.lua:
Code:
VOCATION = {
    ID = {
        NONE = 0,
        SORCERER = 1,
        DRUID = 2,
        PALADIN = 3,
        KNIGHT = 4,
        MASTER_SORCERER = 5,
        ELDER_DRUID = 6,
        ROYAL_PALADIN = 7,
        ELITE_KNIGHT = 8,
    },
    CLIENT_ID = {
        NONE = 0,
        KNIGHT = 1,
        PALADIN = 2,
        SORCERER = 3,
        DRUID = 4,
        ELITE_KNIGHT = 11,
        ROYAL_PALADIN = 12,
        MASTER_SORCERER = 13,
        ELDER_DRUID = 14,
    },
    BASE_ID = {
        NONE = 0,
        SORCERER = 1,
        DRUID = 2,
        PALADIN = 3,
        KNIGHT = 4,
    }
}

En el cual agregaremos el crusader, por mi parte en ClientID, le puse 0, por el cual mostrara al cliente Tibia Vocation: None ( pero sera bien un crusader ) esto aparecera únicamente al momento de logearse y mostrar los characters, una vez en el juego muestra bien que somos un crusader.

Code:
VOCATION = {
    ID = {
        NONE = 0,
        SORCERER = 1,
        DRUID = 2,
        PALADIN = 3,
        KNIGHT = 4,
        MASTER_SORCERER = 5,
        ELDER_DRUID = 6,
        ROYAL_PALADIN = 7,
        ELITE_KNIGHT = 8,
        CRUSADER = 9
    },
    CLIENT_ID = {
        NONE = 0,
        KNIGHT = 1,
        PALADIN = 2,
        SORCERER = 3,
        DRUID = 4,
        ELITE_KNIGHT = 11,
        ROYAL_PALADIN = 12,
        MASTER_SORCERER = 13,
        ELDER_DRUID = 14,
        CRUSADER = 0
    },
    BASE_ID = {
        NONE = 0,
        SORCERER = 1,
        DRUID = 2,
        PALADIN = 3,
        KNIGHT = 4,
        CRUSADER = 5
    }
}

Y finalmente nos iremos al archivo data/lib/core y buscaremos:
Code:
function Player.isKnight(self)
    return table.contains({VOCATION.ID.KNIGHT, VOCATION.ID.ELITE_KNIGHT}, self:getVocation():getId())
end

Justo debajo agregaremos nuestra vocation nueva:
Code:
function Player.isCrusader(self)
    return table.contains({VOCATION.ID.CRUSADER, VOCATION.ID.CRUSADER}, self:getVocation():getId())
end

Nos iremos al archivo data/XML/Vocations, y abriremos el vocations.xml
Vamos a copiar el último apartado que corresponde al Elite Knight, y cambiaremos el vocation id="8" para 9, y el clientid="11" para 0.
No podréis crear uno nuevo en clientID debido a que el cliente TIBIA no disponemos de sources, por el cual su vocation no existe y si agregan otro número no podrán entrar.
Editaremos a gusto la capacidad, la vida, y los skills.
Code:
<vocation id="8" clientid="11" baseid="4" name="Elite Knight" description="an elite knight" magicshield="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4000" gainhpamount="1" gainmanaticks="6000" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15000" fromvoc="4">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.1" />
        <skill id="1" multiplier="1.1" />
        <skill id="2" multiplier="1.1" />
        <skill id="3" multiplier="1.1" />
        <skill id="4" multiplier="1.4" />
        <skill id="5" multiplier="1.1" />
        <skill id="6" multiplier="1.1" />
    </vocation>


Para quiénes gusten de agregar items para sus vocations, entonces nos iremos para data/scripts/movements/unscripted_equipements.lua
Y en data/scripts/weapons/unscripted_weapons.lua.
Por el cual bastara agregar la nueva classe "crusader" en el caso del ejemplo para que solo ellos puedan equipar un item.

¿Como es el código para llamar a la vocation nueva Crusader ?
De esa forma:
VOCATION.ID.CRUSADER

Podréis basaros en un script como el The Oracle, para crear un script y agregar su nueva vocation por el cual podrán elegir la vocation antes de ir para una Town.


Parte Web Con ZnoteAAC:

Por la parte web, nos iremos en www o htdocs / config.php encontraremos:
Code:
// Vocations IDS
    $config['vocations'] = array(
        0 => array(
            'name' => 'No vocation',
            'fromVoc' => false
        ),
        1 => array(
            'name' => 'Sorcerer',
            'fromVoc' => false
        ),
        2 => array(
            'name' => 'Druid',
            'fromVoc' => false
        ),
        3 => array(
            'name' => 'Paladin',
            'fromVoc' => false
        ),
        4 => array(
            'name' => 'Knight',
            'fromVoc' => false
        ),
        5 => array(
            'name' => 'Master Sorcerer',
            'fromVoc' => 1
        ),
        6 => array(
            'name' => 'Elder Druid',
            'fromVoc' => 2
        ),
        7 => array(
            'name' => 'Royal Paladin',
            'fromVoc' => 3
        ),
        8 => array(
            'name' => 'Elite Knight',
            'fromVoc' => 4
        ),

Agregaremos al final:
Code:
 9 => array(

            'name' => 'Crusader',

            'fromVoc' => false

        ),
El false, significa que es una vocation de Base, por el cual, si van a crear un "Master_Crusader" entonces el master_crusader tendra "fromVoc => "9" que será la ID del crusader.

Despues justo debajo veremos:
Code:
$config['vocations_gain'] = array(
        0 => array(
            'hp' => 5,
            'mp' => 5,
            'cap' => 10
        ),
        1 => array(
            'hp' => 5,
            'mp' => 30,
            'cap' => 10
        ),
        2 => array(
            'hp' => 5,
            'mp' => 30,
            'cap' => 10
        ),
        3 => array(
            'hp' => 10,
            'mp' => 15,
            'cap' => 20
        ),
        4 => array(
            'hp' => 15,
            'mp' => 5,
            'cap' => 25
        ),
        5 => array(
            'hp' => 5,
            'mp' => 30,
            'cap' => 10
        ),
        6 => array(
            'hp' => 5,
            'mp' => 30,
            'cap' => 10
        ),
        7 => array(
            'hp' => 10,
            'mp' => 15,
            'cap' => 20
        ),
        8 => array(
            'hp' => 15,
            'mp' => 5,
            'cap' => 25
        ),

En el cual al final agregaremos:
Capacity, mp y Hp de su gusto.
Code:
 9 => array(

            'hp' => 15,

            'mp' => 5,

            'cap' => 25

        ),


Si deseamos agregar nuestra nueva vocation en la pagina web, entonces reemplazaremos en la línea 306 del notepad del config.php:
Code:
$config['available_vocations'] = array(0);
por:
Code:
$config['available_vocations'] = array(9);
9 = Crusader, pueden agregar más, (1,2,3,4,9), que serian entonces, Sorc, Druid, Pally, Knight y Crusader.

Espero que les sirva, quizás el sistema es el mismo para versiones más avanzadas, pero de momento no estoy dentro los 12.85+.
Pero seguro es bastante similar.
 
Buenas tardes, ¿acaso sabes decirme dónde registro los movimientos? Ya logré agregar las nuevas clases, pero quería vincular algunos ítems a las nuevas vocaciones. Por ejemplo: al bárbaro me gustaría que solo usara armas de dos manos, pero cuando entro en el movements.xml e intento registrar un equipo, el servidor acusa que el movimiento está duplicado. Desde ya te agradezco
 
Buenas tardes, ¿acaso sabes decirme dónde registro los movimientos? Ya logré agregar las nuevas clases, pero quería vincular algunos ítems a las nuevas vocaciones. Por ejemplo: al bárbaro me gustaría que solo usara armas de dos manos, pero cuando entro en el movements.xml e intento registrar un equipo, el servidor acusa que el movimiento está duplicado. Desde ya te agradezco

Muy tarde, no vi este mensaje.
El item que agregas en movements.xml, no puede ser duplicado es decir, que solamente puedes tener 1 identica id en movements.xml en el caso que varias vocations lo usen entonces agrega las vocations a ese mismo item.
 
buenas, cuando agrego la nueva vocación y entro a custom oufit para cambiar el addon me saca del juego solo con esa vocación nueva y ya seguí todos los pasos ayuda
 
buenas, cuando agrego la nueva vocación y entro a custom oufit para cambiar el addon me saca del juego solo con esa vocación nueva y ya seguí todos los pasos ayuda
Hola,
No sera algo que ver con la vocation pienso mas un problema con el outfit en si mismo, mira en el editor si tiene todos las imagenes, sea en addon, en movimiento, en mount, etc.
Si usas un tibia oficial ( cliente ) puede dar este problema, unicamente en otclient no te saca.
 

Tibia Server Lists

#1 FEATURED US Ultron OT 1,360 / 5,000 EXPStages PROTO8.6 ENGINEUltron OT RANK PTS6.7 -11% VOTES1 #2 FEATURED US Nefera 0 / 0 EXPx1 PROTO15.20 ENGINECrystal Server RANK PTS5.1 -56% VOTES0 #3 FEATURED BR RebornOT 4 / 1,000 EXPx999 PROTO15.20 ENGINECrystal RANK PTS4.4 +100% VOTES1 #4 FEATURED ES Deixis 0 / 0 EXPStages PROTO1098 ENGINETFS RANK PTS4.1 -84% VOTES1 #5 DE DBU Online 99 / 400 EXP11 PROTO8.6 ENGINETFS 1.0 RANK PTS6.0 -30% VOTES0 #6 BR Tibinha YurOts 30 / 150 EXPStages PROTO7.4 ENGINEYurOTS 1.5 RANK PTS5.7 +35% VOTES0 #7 US Wiki Ots 50 / 1,000 EXPx9999 PROTOcustom client ENGINETFS 1.4.2 RANK PTS5.6 -5% VOTES0 #8 MX Marlboro War 11 / 300 EXP999 PROTO8.6 ENGINETFS 0.3.7 RANK PTS5.4 -43% VOTES0 #9 CL ZHYRAVEX 13 / 500 EXPx5 PROTO10.98 ENGINETFS 1.4.2 RANK PTS5.2 +181% VOTES1 #10 US Halera 5 / 1,000 EXPStages PROTO10.98 ENGINETFS 1.4.2 RANK PTS5.2 +160% VOTES0 #11 ES JustRL FreeTC 1530 13 / 250 EXPx2 PROTO15.30 ENGINECrystal Server RANK PTS5.0 -28% VOTES0 #12 PL Lubelski 0 / 1,000 EXP200 PROTO7.6 ENGINELubelskiOTS 2.56.0 RANK PTS4.7 -12% VOTES0 #13 PL ReWar 0 / 2,000 EXPcustom PROTO8.6 ENGINEOther RANK PTS4.5 -98% VOTES0 #14 BR Exordion Legacy 0 / 2,000 EXPx2 PROTO7.72 ENGINEExordion RANK PTS4.4 -51% VOTES0 #15 BR Rethoria OpenToday 7.4 Custom 0 / 0 EXPx10 PROTO10.98 ENGINEOther RANK PTS4.4 -6% VOTES0 #16 US BerethaOnline 0 / 2,000 EXPStages PROTO15.0 ENGINETFS RANK PTS4.4 -99% VOTES0 #17 BR T2OT Celular e Navegador 107 / 2,000 EXP5x (stages, 0.8x at level 2000) PROTO15.32 ENGINECanary RANK PTS4.4 +100% VOTES1 #18 PL CUSTOM FUNPVP 24 / 5,000 EXP6 PROTO7.6 ENGINECustom 7.6 RANK PTS4.1 +100% VOTES0 #19 ES Farlia Global 2026 0 / 333 EXPx5 PROTO15.25 ENGINEFarliaServ 1.525 RANK PTS4.1 0% VOTES0 #20 SE MortalisOT Custom 0 / 500 EXP100x -1.2x PROTO10.98 ENGINEMortalisOT V1 RANK PTS4.1 0% VOTES0 #21 BR Turion Server 0 / 2,000 EXPx1 PROTO7.4 ENGINETurion 7.7 Project RANK PTS4.0 -100% VOTES0 #22 US MasterRunes 0 / 1,000 EXPx10 PROTO15.20 ENGINECanary 3.x RANK PTS4.0 +100% VOTES0 #23 RU Oldavia | 8.60 0 / 0 EXPx9999 PROTO8.6 ENGINETFS 1.3 RANK PTS4.0 -100% VOTES0 #24 ES tibiarl2.ddns.net 5 / 900 EXPx3 PROTO15.20 ENGINECanary 3.x RANK PTS3.9 +100% VOTES0 #25 US Rommania 0 / 3,000 EXPstages, x10 PROTO7.4 ENGINETFS 0.4 RANK PTS3.7 -56% VOTES0 #26 MX Maeli 1 / 150 EXPx10 PROTO10.98 ENGINETFS 1.4.2 RANK PTS3.7 -59% VOTES0 #27 ES DarkDragon EXPx10 PROTO8.6 ENGINECanary RANK PTS0.0 0% VOTES0
Top