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

Solved ZNOTE Acc starting skills TFS 1.2

Verrine

Member
Joined
Mar 2, 2016
Messages
117
Reaction score
7
Hello! I wonder where can I change starting skills in znote? Every new char is starting with 10 skills and mlvl 0
How can I change it?
 
how can I make different skills for paladin, knight and sorc?
modified to this and still 10:

Code:
'name'        =>    format_character_name($_POST['name']),
            'account_id'=>    $session_user_id,
            'vocation'    =>    $_POST['selected_vocation'],
            'town_id'    =>    $_POST['selected_town'],
            'sex'        =>    $_POST['selected_gender'],
            'lastip'    =>    ip2long(getIP()),
            'created'    =>    time(),
            'skill_shielding'    => 25
 
how can I make different skills for paladin, knight and sorc?
modified to this and still 10:

Code:
'name'        =>    format_character_name($_POST['name']),
            'account_id'=>    $session_user_id,
            'vocation'    =>    $_POST['selected_vocation'],
            'town_id'    =>    $_POST['selected_town'],
            'sex'        =>    $_POST['selected_gender'],
            'lastip'    =>    ip2long(getIP()),
            'created'    =>    time(),
            'skill_shielding'    => 25
well you need to edit the function user_create_character
take a look at this modified function
PHP:
// CREATE CHARACTER
function user_create_character($character_data) {
    array_walk($character_data, 'array_sanitize');
    $cnf = fullConfig();
   
    if ($character_data['sex'] == 1) {
        $outfit_type = $cnf['maleOutfitId'];
    } 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,
        'skill_sword' => 10,
        'skill_club' => 10
    );
   
    // 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'];
        }
    } elseif ($character_data['vocation'] === '1') {
        $import_data['maglevel'] = $cnf['nvmaglevel'];
    } elseif ($character_data['vocation'] === '4') {
        $import_data['skill_sword'] = $cnf['knightsword'];
    }

   
    $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', '');");
}
and add those values to config.php file
$config['nvmagiclevel'] = 20; --- idk
$config['knightsword'] = 50;
 
did it and sword fighting is still 10 ;/ added configs in config.php and edited punction in engine/function/users.php
 
Change your file with this. Edit values for new character in this file.

createcharacter.php
Code:
<?php require_once 'engine/init.php';
protect_page();
include 'layout/overall/header.php';
if (empty($_POST) === false) {
    // $_POST['']
    $required_fields = array('name', 'selected_town');
    foreach($_POST as $key=>$value) {
        if (empty($value) && in_array($key, $required_fields) === true) {
            $errors[] = 'You need to fill in all fields.';
            break 1;
        }
    }
  
    // check errors (= user exist, pass long enough
    if (empty($errors) === true) {
        if (!Token::isValid($_POST['token'])) {
            $errors[] = 'Token is invalid.';
        }
        $_POST['name'] = validate_name($_POST['name']);
        if ($_POST['name'] === false) {
            $errors[] = 'Your name can not contain more than 2 words.';
        } else {
            if (user_character_exist($_POST['name']) !== false) {
                $errors[] = 'Sorry, that character name already exist.';
            }
            if (!preg_match("/^[a-zA-Z_ ]+$/", $_POST['name'])) {
                $errors[] = 'Your name may only contain a-z, A-Z and spaces.';
            }
            if (strlen($_POST['name']) < $config['minL'] || strlen($_POST['name']) > $config['maxL']) {
                $errors[] = 'Your character name must be between ' . $config['minL'] . ' - ' . $config['maxL'] . ' characters long.';
            }
            // name restriction
            $resname = explode(" ", $_POST['name']);
            foreach($resname as $res) {
                if(in_array(strtolower($res), $config['invalidNameTags'])) {
                    $errors[] = 'Your username contains a restricted word.';
                }
                else if(strlen($res) == 1) {
                    $errors[] = 'Too short words in your name.';
                }
            }
            // Validate vocation id
            if (!in_array((int)$_POST['selected_vocation'], $config['available_vocations'])) {
                $errors[] = 'Permission Denied. Wrong vocation.';
            }
            // Validate town id
            if (!in_array((int)$_POST['selected_town'], $config['available_towns'])) {
                $errors[] = 'Permission Denied. Wrong town.';
            }
            // Validate gender id
            if (!in_array((int)$_POST['selected_gender'], array(0, 1))) {
                $errors[] = 'Permission Denied. Wrong gender.';
            }
            if (vocation_id_to_name($_POST['selected_vocation']) === false) {
                $errors[] = 'Failed to recognize that vocation, does it exist?';
            }
            if (town_id_to_name($_POST['selected_town']) === false) {
                $errors[] = 'Failed to recognize that town, does it exist?';
            }
            if (gender_exist($_POST['selected_gender']) === false) {
                $errors[] = 'Failed to recognize that gender, does it exist?';
            }
            // Char count
            $char_count = user_character_list_count($session_user_id);
            if ($char_count >= $config['max_characters']) {
                $errors[] = 'Your account is not allowed to have more than '. $config['max_characters'] .' characters.';
            }
            if (validate_ip(getIP()) === false && $config['validate_IP'] === true) {
                $errors[] = 'Failed to recognize your IP address. (Not a valid IPv4 address).';
            }
        }
    }
}
?>

<h1>Create Character</h1>
<?php
if (isset($_GET['success']) && empty($_GET['success'])) {
    echo 'Congratulations! Your character has been created. See you in-game!';
} else {
    if (empty($_POST) === false && empty($errors) === true) {
        if ($config['log_ip']) {
            znote_visitor_insert_detailed_data(2);
        }
      
        if (($_POST['selected_vocation']) == 1) {
      
        //Register
        $character_data = array(
            'name'        =>    format_character_name($_POST['name']),
            'account_id'=>    $session_user_id,
            'vocation'    =>    $_POST['selected_vocation'],
            'town_id'    =>    $_POST['selected_town'],
            'sex'        =>    $_POST['selected_gender'],
            'lastip'    =>    ip2long(getIP()),
            'created'    =>    time(),
            'maglevel'    =>    0,
            'skill_fist'    =>    10,
            'skill_sword'    =>    10,
            'skill_club'    =>    10,
            'skill_axe'    =>    10,
            'skill_dist'    =>    10,
            'skill_shielding'    =>    10,
            'skill_fishing'    =>    10
        );
        } elseif (($_POST['selected_vocation']) == 2) {
        //Register
        $character_data = array(
            'name'        =>    format_character_name($_POST['name']),
            'account_id'=>    $session_user_id,
            'vocation'    =>    $_POST['selected_vocation'],
            'town_id'    =>    $_POST['selected_town'],
            'sex'        =>    $_POST['selected_gender'],
            'lastip'    =>    ip2long(getIP()),
            'created'    =>    time(),
            'maglevel'    =>    0,
            'skill_fist'    =>    11,
            'skill_sword'    =>    11,
            'skill_club'    =>    11,
            'skill_axe'    =>    11,
            'skill_dist'    =>    11,
            'skill_shielding'    =>    11,
            'skill_fishing'    =>    11
        );
        } elseif (($_POST['selected_vocation']) == 3) {
        //Register
        $character_data = array(
            'name'        =>    format_character_name($_POST['name']),
            'account_id'=>    $session_user_id,
            'vocation'    =>    $_POST['selected_vocation'],
            'town_id'    =>    $_POST['selected_town'],
            'sex'        =>    $_POST['selected_gender'],
            'lastip'    =>    ip2long(getIP()),
            'created'    =>    time(),
            'maglevel'    =>    0,
            'skill_fist'    =>    12,
            'skill_sword'    =>    12,
            'skill_club'    =>    12,
            'skill_axe'    =>    12,
            'skill_dist'    =>    12,
            'skill_shielding'    =>    12,
            'skill_fishing'    =>    12
        );
        } elseif (($_POST['selected_vocation']) == 4) {
        //Register
        $character_data = array(
            'name'        =>    format_character_name($_POST['name']),
            'account_id'=>    $session_user_id,
            'vocation'    =>    $_POST['selected_vocation'],
            'town_id'    =>    $_POST['selected_town'],
            'sex'        =>    $_POST['selected_gender'],
            'lastip'    =>    ip2long(getIP()),
            'created'    =>    time(),
            'maglevel'    =>    0,
            'skill_fist'    =>    13,
            'skill_sword'    =>    13,
            'skill_club'    =>    13,
            'skill_axe'    =>    13,
            'skill_dist'    =>    13,
            'skill_shielding'    =>    13,
            'skill_fishing'    =>    13
        );
        }
  
      
        user_create_character($character_data);
        header('Location: createcharacter.php?success');
        exit();
        //End register
      
    } else if (empty($errors) === false){
        echo '<font color="red"><b>';
        echo output_errors($errors);
        echo '</b></font>';
    }
    ?>
    <form action="" method="post">
        <ul>
            <li>
                Name:<br>
                <input type="text" name="name">
            </li>
            <li>
                <!-- Available vocations to select from when creating character -->
                Vocation:<br>
                <select name="selected_vocation">
                <?php foreach ($config['available_vocations'] as $id) { ?>
                <option value="<?php echo $id; ?>"><?php echo vocation_id_to_name($id); ?></option>
                <?php } ?>
                </select>
            </li>
            <li>
                <!-- Available genders to select from when creating character -->
                Gender:<br>
                <select name="selected_gender">
                <option value="1">Male(boy)</option>
                <option value="0">Female(girl)</option>
                </select>
            </li>
            <?php
            $available_towns = $config['available_towns'];
            if (count($available_towns) > 1):
                ?>
                <li>
                    <!-- Available towns to select from when creating character -->
                    Town:<br>
                    <select name="selected_town">
                        <?php
                        foreach ($available_towns as $tid):
                            ?>
                            <option value="<?php echo $tid; ?>"><?php echo town_id_to_name($tid); ?></option>
                            <?php
                        endforeach;
                        ?>
                    </select>
                </li>
                <?php
            else:
                ?>
                <input type="hidden" name="selected_town" value="<?php echo end($available_towns); ?>">
                <?php
            endif;
            /* Form file */
            Token::create();
            ?>
            <li>
                <input type="submit" value="Create Character">
            </li>
        </ul>
    </form>
    <?php
}
include 'layout/overall/footer.php'; ?>
 
Last edited:
website/engine/function/users.php

change function to this:

Code:
// CREATE CHARACTER
function user_create_character($character_data) {
    array_walk($character_data, 'array_sanitize');
    $cnf = fullConfig();
   
    if ($character_data['sex'] == 1) {
        $outfit_type = $cnf['maleOutfitId'];
    } 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' => $character_data['maglevel'],
        '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,
        'skill_fist' => $character_data['skill_fist'],
        'skill_sword' => $character_data['skill_sword'],
        'skill_club' => $character_data['skill_club'],
        'skill_axe' => $character_data['skill_axe'],
        'skill_dist' => $character_data['skill_dist'],
        'skill_shielding' => $character_data['skill_shielding'],
        'skill_fishing' => $character_data['skill_fishing']
    );
 
d7b4a0406c161dd3278dfbb2202d7587.png

Not working
I use OTHire and ACC ZnoteOTHire 1.5
Anyone know what to do?
 
Back
Top