Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: char/char.c
- ===================================================================
- --- char/char.c (revision 15668)
- +++ char/char.c (working copy)
- @@ -1320,8 +1320,14 @@
- //-----------------------------------
- // Function to create a new character
- //-----------------------------------
- +#if PACKETVER >= 20120307
- +int make_new_char_sql(struct char_session_data* sd, char* name_, int slot, int hair_color, int hair_style)
- +{
- + int str = 5, agi = 5, vit = 5, int_ = 5, dex = 5,luk = 5;
- +#else
- int make_new_char_sql(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)
- {
- +#endif
- char name[NAME_LENGTH];
- char esc_name[NAME_LENGTH*2+1];
- int char_id, flag;
- @@ -1335,10 +1341,14 @@
- return flag;
- //check other inputs
- +#if PACKETVER >= 20120307
- + if(slot >= MAX_CHARS)
- +#else
- if((slot >= MAX_CHARS) // slots
- || (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
- +#endif
- return -2; // invalid input
- // check the number of already existing chars in this account
- @@ -3672,14 +3682,24 @@
- break;
- // create new char
- +#if PACKETVER < 20120307
- // S 0067 <name>.24B <str>.B <agi>.B <vit>.B <int>.B <dex>.B <luk>.B <slot>.B <hair color>.W <hair style>.W
- case 0x67:
- FIFOSD_CHECK(37);
- +#else
- + // S 0970 <name>.24B <slot>.B <hair color>.W <hair style>.W
- + case 0x970:
- + FIFOSD_CHECK(31);
- +#endif
- if( !char_new ) //turn character creation on/off [Kevin]
- i = -2;
- else
- +#if PACKETVER >= 20120307
- + i = make_new_char_sql(sd, (char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOW(fd,27),RFIFOW(fd,29));
- +#else
- i = make_new_char_sql(sd, (char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOB(fd,27),RFIFOB(fd,28),RFIFOB(fd,29),RFIFOB(fd,30),RFIFOB(fd,31),RFIFOB(fd,32),RFIFOW(fd,33),RFIFOW(fd,35));
- +#endif
- //'Charname already exists' (-1), 'Char creation denied' (-2) and 'You are underaged' (-3)
- if (i < 0)
- @@ -3711,8 +3731,11 @@
- if( ch < MAX_CHARS )
- sd->found_char[ch] = i; // the char_id of the new char
- }
- -
- +#if PACKETVER >= 20120307
- + RFIFOSKIP(fd,31);
- +#else
- RFIFOSKIP(fd,37);
- +#endif
- break;
- // delete char
- Index: common/mmo.h
- ===================================================================
- --- common/mmo.h (revision 15668)
- +++ common/mmo.h (working copy)
- @@ -43,9 +43,10 @@
- // 20110111 - 2011-01-11aRagexeRE+ - 0x6b, 0x6d
- // 20110928 - 2011-09-28aRagexeRE+ - 0x6b, 0x6d
- // 20111025 - 2011-10-25aRagexeRE+ - 0x6b, 0x6d
- +// 20120307 - 2012-03-07aRagexeRE+ - 0x970 Character creation packet
- #ifndef PACKETVER
- - #define PACKETVER 20111116
- + #define PACKETVER 20120307
- //#define PACKETVER 20100730
- #endif
Add Comment
Please, Sign In to add comment