julianfern94
New Member
- Joined
- Dec 26, 2012
- Messages
- 168
- Reaction score
- 4
Threads says all, im using thais war 8.6 with pvp bots
In config.php on line 98-102.
Code:$config['level'] = 8; $config['health'] = 185; $config['mana'] = 35; $config['cap'] = 435; $config['soul'] = 0;
Use tibia health/mana calculator on tibia.wikia. Then just fill it in.It works well for starting at level 8, but in case it starts at level higher than 8 the player remains with the same life and mana.
How to configure life and mana of different vocations and level greater than 8?
// If new character vocation ID is 1:
if ($character_data['vocation'] === '1') {
$import_data['level'] = 50;
$import_data['experience'] = level_to_experience(50);
$import_data['health'] = 1000; // Start with 1000 HP.
$import_data['healthmax'] = 1000;
}
https://github.com/Znote/ZnoteAAC/blob/master/config.php#L279-#L327It works well for starting at level 8, but in case it starts at level higher than 8 the player remains with the same life and mana.
How to configure life and mana of different vocations and level greater than 8?
// Start Level Needed
$config['startCustom'] = true;
$config['startLevel'] = 150;
// Base Level Stats
$config['baseLevel'] = 8;
$config['baseHealth'] = 185;
$config['baseMana'] = 40;
$config['baseCap'] = 470;
$config['baseSoul'] = 100;
// Parameter: level, vocationId returns health for that level.
function health_for_Level($level, $vocation) {
$voc = $import_data['vocations_gain'][$vocation];
return ( $import_data['baseHealth'] + ($voc['hp'] * ($import_data['level'] - $import_data['baseLevel'])) );
}
// Parameter: level, vocationId returns mana for that level.
function mana_for_Level($level, $vocation) {
$voc = $import_data['vocations_gain'][$vocation];
return ( $import_data['baseMana'] + ($voc['mp'] * ($import_data['level'] - $import_data['baseLevel'])) );
}
// Parameter: level, vocationId returns mana for that level.
function cap_for_Level($level, $vocation) {
$voc = $import_data['vocations_gain'][$vocation];
return ( $import_data['baseCap'] + ($voc['cap'] * ($import_data['level'] - $import_data['baseLevel'])) );
}
// If need custom stats vocation
if ($import_data['startCustom'] == true) {
$sLevel = $cnf['startLevel'];
$vocationId = $character_data['vocation'];
$import_data['level'] = $sLevel;
$import_data['experience'] = level_to_experience($sLevel, $vocationId);
$import_data['health'] = health_for_Level($sLevel, $vocationId);
$import_data['healthmax'] = health_for_Level($sLevel, $vocationId);
$import_data['mana'] = mana_for_Level($sLevel, $vocationId);
$import_data['manamax'] = mana_for_Level($sLevel, $vocationId);
$import_data['cap'] = cap_for_Level($sLevel, $vocationId);
$import_data['soul'] = $cnf['baseSoul'];
}
// Start Level Needed
$config['newCharacterData'] = array(
'custom' => true,
'level' => 150
);
// Base Level Stats
$config['baseCharacterData'] array(
'level' => 8,
'health' => 185,
'mana' => 40,
'cap' => 470,
'soul' => 100
);
// When you are inside a function, (like user_create_character), you can load config variables through the Config('keyvalue') function.
$vocation_gains = Config('vocations_gain');
$start = Config('newCharacterData');
// $startcustom = $start['custom'];
// $startlevel = $start['level'];
$base = Config('baseCharacterData');
if ($start['custom'] === true) {
$voc = $vocation_gains[(int)$character_data['vocation']];
$import_data['health'] = ( $base['health'] + ($voc['hp'] * ($start['level'] - $base['level'])) );
// ...
}
// Custom Start
$vocation_gains = Config('vocations_gain');
$start = Config('newCharacterData');
$base = Config('baseCharacterData');
if ($start['custom'] === true) {
$voc = $vocation_gains[(int)$character_data['vocation']];
$health_ = ( $base['health'] + ($voc['hp'] * ($start['level'] - $base['level'])) );
$mana_ = ( $base['mana'] + ($voc['mp'] * ($start['level'] - $base['level'])) );
$cap_ = ( $base['cap'] + ($voc['cap'] * ($start['level'] - $base['level'])) );
$import_data['level'] = $start['level'];
$import_data['experience'] = level_to_experience($start['level']);
$import_data['health'] = $health_;
$import_data['healthmax'] = $health_;
$import_data['mana'] = $mana_;
$import_data['manamax'] = $mana_;
$import_data['cap'] = $cap_;
$import_data['soul'] = $base['soul'];
}
$voc = $vocation_gains[(int)$character_data['vocation']]; $health_ = ( $base
Hello, do you have this full code working?users.php
Code:// Custom Start $vocation_gains = Config('vocations_gain'); $start = Config('newCharacterData'); $base = Config('baseCharacterData'); if ($start['custom'] === true) { $voc = $vocation_gains[(int)$character_data['vocation']]; $health_ = ( $base['health'] + ($voc['hp'] * ($start['level'] - $base['level'])) ); $mana_ = ( $base['mana'] + ($voc['mp'] * ($start['level'] - $base['level'])) ); $cap_ = ( $base['cap'] + ($voc['cap'] * ($start['level'] - $base['level'])) ); $import_data['level'] = $start['level']; $import_data['experience'] = level_to_experience($start['level']); $import_data['health'] = $health_; $import_data['healthmax'] = $health_; $import_data['mana'] = $mana_; $import_data['manamax'] = $mana_; $import_data['cap'] = $cap_; $import_data['soul'] = $base['soul']; }