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

[Znote AAC] How do i set different looktype on each proffesion

Baneczek

うさちゃん
Joined
Nov 13, 2013
Messages
70
Reaction score
4
Location
Pila, Poland
Hello guys. I need some help with Znote's AAC. Could anyone tell me how do i set looktype for every profession that i want to make? Let's say i want to do a knight, His looktype will be 999 (yeye ofc it will be 999...) but if i want to do a sorcerer, his looktype will be 1000. Could anyone help me please?
 
Hello guys. I need some help with Znote's AAC. Could anyone tell me how do i set looktype for every profession that i want to make? Let's say i want to do a knight, His looktype will be 999 (yeye ofc it will be 999...) but if i want to do a sorcerer, his looktype will be 1000. Could anyone help me please?

Default ZnoteAAC won't support it, you would need to make custom edits.

At your config.php add this after line "$config['femaleOutfitId'] = 136;"
Code:
    $config['knightMaleOutfitId'] = 128;
    $config['sorcMaleOutfitId'] = 136;
    $config['druidMaleOutfitId'] = 136;
    $config['paladinMaleOutfitId'] = 136;
    $config['knightFemaleOutfitId'] = 128;
    $config['sorcFemaleOutfitId'] = 136;
    $config['druidFemaleOutfitId'] = 136;
    $config['paladinFemaleOutfitId'] = 136;

And in engine/users.php search for "function user_create_character($character_data)", change it for this one:

Code:
// CREATE CHARACTER
function user_create_character($character_data) {
    array_walk($character_data, 'array_sanitize');
    $cnf = fullConfig();
  
    if ($character_data['sex'] == 1) {
        if ($character_data['vocation'] == 1) {
            $outfit_type = $cnf['sorcMaleOutfitId'];
        } elseif ($character_data['vocation'] == 2) {
            $outfit_type = $cnf['druidMaleOutfitId'];
        } elseif ($character_data['vocation'] == 3) {
            $outfit_type = $cnf['paladinMaleOutfitId'];
        } elseif ($character_data['vocation'] == 4) {
            $outfit_type = $cnf['knightMaleOutfitId'];
        } else {
            $outfit_type = $cnf['maleOutfitId'];
        }
    } else {
        if ($character_data['vocation'] == 1) {
            $outfit_type = $cnf['sorcFemaleOutfitId'];
        } elseif ($character_data['vocation'] == 2) {
            $outfit_type = $cnf['druidFemaleOutfitId'];
        } elseif ($character_data['vocation'] == 3) {
            $outfit_type = $cnf['paladinFemaleOutfitId'];
        } elseif ($character_data['vocation'] == 4) {
            $outfit_type = $cnf['knightFemaleOutfitId'];
        } else {
            $outfit_type = $cnf['femaleOutfitId'];
        }
    }
      
    // This is TFS 0.2 compatible import data with Znote AAC mysql schema
    $import_data = array(
        'name'    =>    $character_data['name'],
        'group_id' => 1,
        'account_id' => $character_data['account_id'],
        'level' => $cnf['level'],
        'vocation'    =>    $character_data['vocation'],
        'health' => $cnf['health'],
        'healthmax' => $cnf['health'],
        'experience' => 0, /* Will automatically be configured according to level after creating this array*/
        'lookbody' => $cnf['lookBody'], /* STARTER OUTFITS */
        'lookfeet' => $cnf['lookFeet'],
        'lookhead' => $cnf['lookHead'],
        'looklegs' => $cnf['lookLegs'],
        'looktype' => $outfit_type,
        'lookaddons' => 0,
        'maglevel' => 0,
        'mana' => $cnf['mana'],
        'manamax' => $cnf['mana'],
        'manaspent' => 0,
        'soul' => $cnf['soul'],
        'town_id'    =>    $character_data['town_id'],
        'posx' => $cnf['default_pos']['x'],
        'posy' => $cnf['default_pos']['y'],
        'posz' => $cnf['default_pos']['z'],
        'conditions' => '',
        'cap' => $cnf['cap'],
        'sex' => $character_data['sex'],
        'lastlogin' => 0,
        'lastip'    =>    $character_data['lastip'],
        'save' => 1,
        'skull' => 0,
        'skulltime' => 0,
        'rank_id' => 0,
        'guildnick' => '',
        'lastlogout' => 0,
        'blessings' => 0,
        'direction' => 0,
        'loss_experience' => 10,
        'loss_mana' => 10,
        'loss_skills' => 10,
        'premend' => 0,
        'online' => 0,
        'balance' => 0
    );
  
    // TFS 1.0 rules
    if (Config('TFSVersion') === 'TFS_10') {
        unset($import_data['rank_id']);
        unset($import_data['guildnick']);
        unset($import_data['direction']);
        unset($import_data['loss_experience']);
        unset($import_data['loss_mana']);
        unset($import_data['loss_skills']);
        unset($import_data['loss_mana']);
        unset($import_data['premend']);
        unset($import_data['online']);
    }

    // Set correct experience for level
    $import_data['experience'] = level_to_experience($import_data['level']);
  
    // If you are no vocation (id 0), use these details instead:
    if ($character_data['vocation'] === '0') {
        $import_data['level'] = $cnf['nvlevel'];
        $import_data['experience'] = level_to_experience($cnf['nvlevel']);
        $import_data['health'] = $cnf['nvHealth'];
        $import_data['healthmax'] = $cnf['nvHealth'];
        $import_data['cap'] = $cnf['nvCap'];
        $import_data['mana'] = $cnf['nvMana'];
        $import_data['manamax'] = $cnf['nvMana'];
        $import_data['soul'] = $cnf['nvSoul'];
      
        if ($cnf['nvForceTown'] == 1) {
            $import_data['town_id'] = $cnf['nvTown'];
        }
    }
  
    $fields = array_keys($import_data); // Fetch select fields
    $data = array_values($import_data); // Fetch insert data
  
    $fields_sql = implode("`, `", $fields); // Convert array into SQL compatible string
    $data_sql = implode("', '", $data); // Convert array into SQL compatible string
    echo 1;
    mysql_insert("INSERT INTO `players`(`$fields_sql`) VALUES ('$data_sql');");
  
    $created = time();
    $charid = user_character_id($import_data['name']);
    echo 2;
    mysql_insert("INSERT INTO `znote_players`(`player_id`, `created`, `hide_char`, `comment`) VALUES ('$charid', '$created', '0', '');");
}

You will be able to set what you want at config.php.
 
Default ZnoteAAC won't support it, you would need to make custom edits.

At your config.php add this after line "$config['femaleOutfitId'] = 136;"
Code:
    $config['knightMaleOutfitId'] = 128;
    $config['sorcMaleOutfitId'] = 136;
    $config['druidMaleOutfitId'] = 136;
    $config['paladinMaleOutfitId'] = 136;
    $config['knightFemaleOutfitId'] = 128;
    $config['sorcFemaleOutfitId'] = 136;
    $config['druidFemaleOutfitId'] = 136;
    $config['paladinFemaleOutfitId'] = 136;

And in engine/users.php search for "function user_create_character($character_data)", change it for this one:

Code:
// CREATE CHARACTER
function user_create_character($character_data) {
    array_walk($character_data, 'array_sanitize');
    $cnf = fullConfig();

    if ($character_data['sex'] == 1) {
        if ($character_data['vocation'] == 1) {
            $outfit_type = $cnf['sorcMaleOutfitId'];
        } elseif ($character_data['vocation'] == 2) {
            $outfit_type = $cnf['druidMaleOutfitId'];
        } elseif ($character_data['vocation'] == 3) {
            $outfit_type = $cnf['paladinMaleOutfitId'];
        } elseif ($character_data['vocation'] == 4) {
            $outfit_type = $cnf['knightMaleOutfitId'];
        } else {
            $outfit_type = $cnf['maleOutfitId'];
        }
    } else {
        if ($character_data['vocation'] == 1) {
            $outfit_type = $cnf['sorcFemaleOutfitId'];
        } elseif ($character_data['vocation'] == 2) {
            $outfit_type = $cnf['druidFemaleOutfitId'];
        } elseif ($character_data['vocation'] == 3) {
            $outfit_type = $cnf['paladinFemaleOutfitId'];
        } elseif ($character_data['vocation'] == 4) {
            $outfit_type = $cnf['knightFemaleOutfitId'];
        } else {
            $outfit_type = $cnf['femaleOutfitId'];
        }
    }
    
    // This is TFS 0.2 compatible import data with Znote AAC mysql schema
    $import_data = array(
        'name'    =>    $character_data['name'],
        'group_id' => 1,
        'account_id' => $character_data['account_id'],
        'level' => $cnf['level'],
        'vocation'    =>    $character_data['vocation'],
        'health' => $cnf['health'],
        'healthmax' => $cnf['health'],
        'experience' => 0, /* Will automatically be configured according to level after creating this array*/
        'lookbody' => $cnf['lookBody'], /* STARTER OUTFITS */
        'lookfeet' => $cnf['lookFeet'],
        'lookhead' => $cnf['lookHead'],
        'looklegs' => $cnf['lookLegs'],
        'looktype' => $outfit_type,
        'lookaddons' => 0,
        'maglevel' => 0,
        'mana' => $cnf['mana'],
        'manamax' => $cnf['mana'],
        'manaspent' => 0,
        'soul' => $cnf['soul'],
        'town_id'    =>    $character_data['town_id'],
        'posx' => $cnf['default_pos']['x'],
        'posy' => $cnf['default_pos']['y'],
        'posz' => $cnf['default_pos']['z'],
        'conditions' => '',
        'cap' => $cnf['cap'],
        'sex' => $character_data['sex'],
        'lastlogin' => 0,
        'lastip'    =>    $character_data['lastip'],
        'save' => 1,
        'skull' => 0,
        'skulltime' => 0,
        'rank_id' => 0,
        'guildnick' => '',
        'lastlogout' => 0,
        'blessings' => 0,
        'direction' => 0,
        'loss_experience' => 10,
        'loss_mana' => 10,
        'loss_skills' => 10,
        'premend' => 0,
        'online' => 0,
        'balance' => 0
    );

    // TFS 1.0 rules
    if (Config('TFSVersion') === 'TFS_10') {
        unset($import_data['rank_id']);
        unset($import_data['guildnick']);
        unset($import_data['direction']);
        unset($import_data['loss_experience']);
        unset($import_data['loss_mana']);
        unset($import_data['loss_skills']);
        unset($import_data['loss_mana']);
        unset($import_data['premend']);
        unset($import_data['online']);
    }

    // Set correct experience for level
    $import_data['experience'] = level_to_experience($import_data['level']);

    // If you are no vocation (id 0), use these details instead:
    if ($character_data['vocation'] === '0') {
        $import_data['level'] = $cnf['nvlevel'];
        $import_data['experience'] = level_to_experience($cnf['nvlevel']);
        $import_data['health'] = $cnf['nvHealth'];
        $import_data['healthmax'] = $cnf['nvHealth'];
        $import_data['cap'] = $cnf['nvCap'];
        $import_data['mana'] = $cnf['nvMana'];
        $import_data['manamax'] = $cnf['nvMana'];
        $import_data['soul'] = $cnf['nvSoul'];
    
        if ($cnf['nvForceTown'] == 1) {
            $import_data['town_id'] = $cnf['nvTown'];
        }
    }

    $fields = array_keys($import_data); // Fetch select fields
    $data = array_values($import_data); // Fetch insert data

    $fields_sql = implode("`, `", $fields); // Convert array into SQL compatible string
    $data_sql = implode("', '", $data); // Convert array into SQL compatible string
    echo 1;
    mysql_insert("INSERT INTO `players`(`$fields_sql`) VALUES ('$data_sql');");

    $created = time();
    $charid = user_character_id($import_data['name']);
    echo 2;
    mysql_insert("INSERT INTO `znote_players`(`player_id`, `created`, `hide_char`, `comment`) VALUES ('$charid', '$created', '0', '');");
}

I will check this out, and see if it will work, I will have really much to do because it's Naruto server, and there are really much vocations to set their looktypes.


if you have problems with the lua script, just ask

I think i can handle it :D
Lua is way easier for me than PHP functions...
 
Last edited:
config.php
Code:
    $config['vocation_looktypes'] = array(
        1 => array(
            'female' => '136',
            'male' => '128'
        ),
        2 => array(
            'female' => '137',
            'male' => '129'
        ),
        3 => array(
            'female' => '138',
            'male' => '130'
        ),
        4 => array(
            'female' => '139',
            'male' => '131'
        ),
    );
users.php, function user_create_character
Code:
    $looktype = $cnf['vocation_looktypes'][$character_data['vocation']];
    $outfit_type = $character_data['sex'] == 0 ? $looktype['female'] : $looktype['male'];

Easy to configure.
 
config.php
Code:
    $config['vocation_looktypes'] = array(
        1 => array(
            'female' => '136',
            'male' => '128'
        ),
        2 => array(
            'female' => '137',
            'male' => '129'
        ),
        3 => array(
            'female' => '138',
            'male' => '130'
        ),
        4 => array(
            'female' => '139',
            'male' => '131'
        ),
    );
users.php, function user_create_character
Code:
    $looktype = $cnf['vocation_looktypes'][$character_data['vocation']];
    $outfit_type = $character_data['sex'] == 0 ? $looktype['female'] : $looktype['male'];

Easy to configure.
Wow. This is really easy to configure. Thank you really much. I think i will use this one.
 
Back
Top