Jump to content

Nana

Members
  • Posts

    118
  • Joined

  • Last visited

Posts posted by Nana

  1. Another way to do that MAYBE .. is that you chose wich weapons do you like that have effect and wich effect (like Sword2)

    so, if you have a weapon +11 and you refine it the NPC instead give you your original weapon(example ID 1234) giveyou a custom one (ID 4321) wich have an effect or animation .

    I think this way could be easier to implement if you have an spriter or have time to learn it, that move the src and client (cause i suppouse include come HEX mods in the exe)

  2. Just set a new var, #define CREATE_NAME_LENGTH

    In Src/char/char.c search this

    int make_new_char(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style)

    {

    char name[NAME_LENGTH];

    int i;

    safestrncpy(name, name_, NAME_LENGTH);

    normalize_name(name,TRIM_CHARS);

    // check length of character name

    if( name[0] == '\0' )

    return -2; // empty character name

    // check content of character name

    if( remove_control_chars(name) )

    return -2; // control chars in name

    // check for reserved names

    if( strcmpi(name, main_chat_nick) == 0 || strcmpi(name, wisp_server_name) == 0 || strcmpi(name, ally_chat_nick) == 0 )

    return -1; // nick reserved for internal server messages

    // Check Authorised letters/symbols in the name of the character

    if( char_name_option == 1 ) { // only letters/symbols in char_name_letters are authorised

    for( i = 0; i < NAME_LENGTH && name; i++ )

    if( strchr(char_name_letters, name) == NULL )

    return -2;

    } else

    if( char_name_option == 2 ) { // letters/symbols in char_name_letters are forbidden

    for( i = 0; i < NAME_LENGTH && name; i++ )

    if( strchr(char_name_letters, name) != NULL )

    return -2;

    } // else, all letters/symbols are authorised (except control char removed before)

    // check name (already in use?)

    ARR_FIND( 0, char_num, i,

    (name_ignoring_case && strncmp(char_dat.status.name, name, NAME_LENGTH) == 0) ||

    (!name_ignoring_case && strncmpi(char_dat.status.name, name, NAME_LENGTH) == 0) );

    if( i < char_num )

    return -1; // name already exists

    //check other inputs

    if((slot >= MAX_CHARS) // slots

    || (hair_style >= 24) // hair style

    || (hair_color >= 9) // hair color

    || (str + agi + vit + int_ + dex + luk != 6*5 ) // stats

    || (str < 1 || str > 9 || agi < 1 || agi > 9 || vit < 1 || vit > 9 || int_ < 1 || int_ > 9 || dex < 1 || dex > 9 || luk < 1 || luk > 9) // individual stat values

    || (str + int_ != 10 || agi + luk != 10 || vit + dex != 10) ) // pairs

    return -2; // invalid input

    // check char slot

    ARR_FIND( 0, char_num, i, char_dat.status.account_id == sd->account_id && char_dat.status.slot == slot );

    if( i < char_num )

    return -2; // slot already in use

    if (char_num >= char_max) {

    char_max += 256;

    RECREATE(char_dat, struct character_data, char_max);

    if (!char_dat) {

    ShowFatalError("Out of memory: make_new_char (realloc of char_dat).\n");

    char_log("Out of memory: make_new_char (realloc of char_dat).\n");

    exit(EXIT_FAILURE);

    }

    }

    // validation success, log result

    char_log("make new char: account: %d, slot %d, name: %s, stats: %d/%d/%d/%d/%d/%d, hair: %d, hair color: %d.\n",

    sd->account_id, slot, name, str, agi, vit, int_, dex, luk, hair_style, hair_color);

    i = char_num;

    memset(&char_dat, 0, sizeof(struct character_data));

    char_dat.status.char_id = char_id_count++;

    char_dat.status.account_id = sd->account_id;

    char_dat.status.slot = slot;

    safestrncpy(char_dat.status.name,name,NAME_LENGTH);

    char_dat.status.class_ = 0;

    char_dat.status.base_level = 1;

    char_dat.status.job_level = 1;

    char_dat.status.base_exp = 0;

    char_dat.status.job_exp = 0;

    char_dat.status.zeny = start_zeny;

    char_dat.status.str = str;

    char_dat.status.agi = agi;

    char_dat.status.vit = vit;

    char_dat.status.int_ = int_;

    char_dat.status.dex = dex;

    char_dat.status.luk = luk;

    char_dat.status.max_hp = 40 * (100 + char_dat.status.vit) / 100;

    char_dat.status.max_sp = 11 * (100 + char_dat.status.int_) / 100;

    char_dat.status.hp = char_dat.status.max_hp;

    char_dat.status.sp = char_dat.status.max_sp;

    char_dat.status.status_point = 0;

    char_dat.status.skill_point = 0;

    char_dat.status.option = 0;

    char_dat.status.karma = 0;

    char_dat.status.manner = 0;

    char_dat.status.party_id = 0;

    char_dat.status.guild_id = 0;

    char_dat.status.hair = hair_style;

    char_dat.status.hair_color = hair_color;

    char_dat.status.clothes_color = 0;

    char_dat.status.inventory[0].nameid = start_weapon; // Knife

    char_dat.status.inventory[0].amount = 1;

    char_dat.status.inventory[0].identify = 1;

    char_dat.status.inventory[1].nameid = start_armor; // Cotton Shirt

    char_dat.status.inventory[1].amount = 1;

    char_dat.status.inventory[1].identify = 1;

    char_dat.status.weapon = 0; // W_FIST

    char_dat.status.shield = 0;

    char_dat.status.head_top = 0;

    char_dat.status.head_mid = 0;

    char_dat.status.head_bottom = 0;

    memcpy(&char_dat.status.last_point, &start_point, sizeof(start_point));

    memcpy(&char_dat.status.save_point, &start_point, sizeof(start_point));

    char_num++;

    ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s\n", sd->account_id, i, slot, name);

    mmo_char_sync();

    return i;

    }

    Then change the variable, example

    int make_new_char(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style)

    {

    char name[CREATE_NAME_LENGTH];

    int i;

    safestrncpy(name, name_, CREATE_NAME_LENGTH);

    in all the function (cause it is only the create char function)

    recomplire and.. i think this should work :S

    If you have any error plz post and i helpyou n_n ~

  3. Hi, is just a question

    For example if I want that any job need to do one ques for skill (example if you have Owl's Eye lvl 3 it suppose that you get Vulture's Eye), i want that you need owl's Eyes lvl 3 plus make a little quest, for example have the questvultule == 1

    How can I do that? is this possible? or just can with items in require db?

  4. You have to use something like this

    query_sql "SELECT `str` FROM global_reg_value WHERE account_id = " +.@idcuenta[0], .@array$[0]; // check cash points

    if (.@array$[0] != "#CASHPOINTS") { // if not then null

    query_sql "INSERT INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account_id`) VALUES ('0','#CASHPOINTS','" +.@cantidad +"','2','" +.@idcuenta[0] +"')"; // Create cash points SQL

    } else { // Cash exist

    // update

    } // End if

    this is just an example of Rokimoki's guide n_n ~

×
×
  • Create New...