How to add a new vocation

Tutorial explaining how to add a new vocation in Canary Server. After add the new vocation, the server need to be compiled to apply the changes.

1 - src/creatures/creatures_definitions.hpp and search for:

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
};
  • Add your new vocation, in the example was used Warrior And Elite Warrior vocations;

  • Being the last vocation you add it to the VOCATION_LAST.

  • It will look like this:

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_WARRIOR = 9,
    VOCATION_ELITE_WARRIOR = 10,
    VOCATION_LAST = VOCATION_ELITE_WARRIOR
};

2 - data/libs/vocation.lua:

  • Add your new vocation following the example below:

  • In ClientID is 0, it will show in the client Vocation: None (but it will be a Warrior or a Elite Warrior). This will appear only at the time of log in and showing the characters, once in the game it will show that the vocation is a Warrior or a Elite Warrior.

3 - data/libs/functions/player.lua and search for:

  • Below the vocations functions add the function for the new vocation:

4 - data/XML/vocations.xml:

  • Add the new vocation like the example below:

5 - Credits:

  • Majesty

Last updated