Breed
Intermediate OT User
- Joined
- Jan 7, 2015
- Messages
- 517
- Reaction score
- 122
This will allow you to automatically get all the vocations for your server and exclude any you don't want to list
In the config.php file starting on line 257
You will find this code below
You are going to replace all of that with this code
What does this do?
It parses the vocations.xml file on your server and gets both name & id for each vocation and stores it in an array so that the AAC can use it when you go to create a new character.
If you make a change in your vocations.xml file it will reflect here, so if you rename your vocations you don't need to touch this ever again it will automatically update.
You can also exclude any vocation
If you were to use print_r on $config['vocations'] you would see this output
In the config.php file starting on line 257
You will find this code below
PHP:
// Vocation ids and names.
$config['vocations'] = array(
0 => 'No vocation',
1 => 'Sorcerer',
2 => 'Druid',
3 => 'Paladin',
4 => 'Knight',
5 => 'Master Sorcerer',
6 => 'Elder Druid',
7 => 'Royal Paladin',
8 => 'Elite Knight',
);
You are going to replace all of that with this code
PHP:
// change this to your vocations.xml path
$vpath = 'C:\docs\1041 server\data\XML\vocations.xml';
$voc = array();
$doNotListTheseVocations = array(0,5,6,7,8);
if(file_exists($vpath) && $xml = simplexml_load_file($vpath)){
foreach($xml as $xmlx){
if(!in_array(intval($xmlx['id']), $doNotListTheseVocations, true)){
if(isset($xmlx['id']) && isset($xmlx['name']) ){
$voc[intval($xmlx['id'])] = (string)$xmlx['name'];
}
}
}
}$config['vocations'] = $voc;
What does this do?
It parses the vocations.xml file on your server and gets both name & id for each vocation and stores it in an array so that the AAC can use it when you go to create a new character.
If you make a change in your vocations.xml file it will reflect here, so if you rename your vocations you don't need to touch this ever again it will automatically update.
You can also exclude any vocation
PHP:
$doNotListTheseVocations = array(0,5,6,7,8);
If you were to use print_r on $config['vocations'] you would see this output
PHP:
Array
(
[1] => Sorcerer
[2] => Druid
[3] => Paladin
[4] => Knight
)
Last edited: