summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDastgir Pojee <dastgirp@gmail.com>2016-10-02 18:07:19 +0530
committerhemagx <ibrahem.h.basyone@gmail.com>2016-10-22 02:21:44 +0200
commitb21e4ad15f1a81154553662ecf330d6a6694dd15 (patch)
tree472da2f6be542092e1bdc7151a7aa02d30730564 /src
parentd8441a3522797a25b5bcc46d6e5b38adebd0a70b (diff)
downloadhercules-b21e4ad15f1a81154553662ecf330d6a6694dd15.tar.gz
hercules-b21e4ad15f1a81154553662ecf330d6a6694dd15.tar.bz2
hercules-b21e4ad15f1a81154553662ecf330d6a6694dd15.tar.xz
hercules-b21e4ad15f1a81154553662ecf330d6a6694dd15.zip
Added Packets for Several Clients: 2015-10-01, 2015-10-29, 2015-11-04 and
2015-12-16 Added New Char Creation Packet(0xa39). Added Placeholder of JOB_SUMMONER
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c55
-rw-r--r--src/char/char.h2
-rw-r--r--src/common/mmo.h2
-rw-r--r--src/map/packets.h150
4 files changed, 189 insertions, 20 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 945111640..4beeff00a 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1544,7 +1544,7 @@ int char_check_char_name(char * name, char * esc_name)
* -5: 'Symbols in Character Names are forbidden'
* char_id: Success
**/
-int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style)
+int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job)
{
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
@@ -1560,6 +1560,14 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int
if( flag < 0 )
return flag;
+ switch(starting_job) {
+ case JOB_SUMMONER:
+ case JOB_NOVICE:
+ break;
+ default:
+ return -2; // Char Creation Denied
+ }
+
//check other inputs
#if PACKETVER >= 20120307
if(slot < 0 || slot >= sd->char_slots)
@@ -1580,11 +1588,11 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int
return -2; /* character account limit exceeded */
#if PACKETVER >= 20120307
- //Insert the new char entry to the database
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `status_point`,`str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
+ // Insert the new char entry to the database
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `status_point`,`str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
"`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES ("
"'%d', '%d', '%s', '%d', '%d','%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
- char_db, sd->account_id , slot, esc_name, start_zeny, 48, str, agi, vit, int_, dex, luk,
+ char_db, sd->account_id , slot, esc_name, starting_job, start_zeny, 48, str, agi, vit, int_, dex, luk,
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) )
{
@@ -1593,10 +1601,10 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int
}
#else
//Insert the new char entry to the database
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
"`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES ("
"'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
- char_db, sd->account_id , slot, esc_name, start_zeny, str, agi, vit, int_, dex, luk,
+ char_db, sd->account_id , slot, esc_name, starting_job, start_zeny, str, agi, vit, int_, dex, luk,
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) )
{
@@ -1613,9 +1621,9 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int
// Validation success, log result
if (chr->enable_logs) {
if (SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
+ "INSERT INTO `%s` (`time`, `char_msg`, `account_id`, `char_id`, `char_num`, `class`, `name`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hair`, `hair_color`)"
"VALUES (NOW(), '%s', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- charlog_db, "make new char", sd->account_id, char_id, slot, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color))
+ charlog_db, "make new char", sd->account_id, char_id, slot, starting_job, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color))
Sql_ShowDebug(inter->sql_handle);
}
@@ -4625,10 +4633,12 @@ void char_parse_char_create_new_char(int fd, struct char_session_data* sd)
//turn character creation on/off [Kevin]
result = -2;
} else {
- #if PACKETVER >= 20120307
- result = chr->make_new_char_sql(sd, RFIFOP(fd,2), 1, 1, 1, 1, 1, 1, RFIFOB(fd,26),RFIFOW(fd,27),RFIFOW(fd,29));
+ #if PACKETVER >= 20151001
+ result = chr->make_new_char_sql(sd, RFIFOP(fd,2), 1, 1, 1, 1, 1, 1, RFIFOB(fd,26), RFIFOW(fd,27), RFIFOW(fd,29), RFIFOW(fd, 31));
+ #elif PACKETVER >= 20120307
+ result = chr->make_new_char_sql(sd, RFIFOP(fd,2), 1, 1, 1, 1, 1, 1, RFIFOB(fd,26), RFIFOW(fd,27), RFIFOW(fd,29), JOB_NOVICE);
#else
- result = chr->make_new_char_sql(sd, 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));
+ result = chr->make_new_char_sql(sd, 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), JOB_NOVICE);
#endif
}
@@ -4644,11 +4654,13 @@ void char_parse_char_create_new_char(int fd, struct char_session_data* sd)
// add new entry to the chars list
sd->found_char[char_dat.slot] = result; // the char_id of the new char
}
- #if PACKETVER >= 20120307
- RFIFOSKIP(fd,31);
- #else
- RFIFOSKIP(fd,37);
- #endif
+#if PACKETVER >= 20151001
+ RFIFOSKIP(fd, 36);
+#if PACKETVER >= 20120307
+ RFIFOSKIP(fd, 31);
+#else
+ RFIFOSKIP(fd, 37);
+#endif
}
// flag:
@@ -5026,17 +5038,22 @@ int char_parse_char(int fd)
break;
// create new char
- #if PACKETVER >= 20120307
+#if PACKETVER >= 20151001
+ // S 0a39 <name>.24B <slot>.B <hair color>.W <hair style>.W <starting job ID>.W <Unknown>.(W or 2 B's)??? <sex>.B
+ case 0xa39:
+ {
+ FIFOSD_CHECK(36);
+#elif PACKETVER >= 20120307
// S 0970 <name>.24B <slot>.B <hair color>.W <hair style>.W
case 0x970:
{
FIFOSD_CHECK(31);
- #else
+#else
// 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);
- #endif
+#endif
chr->parse_char_create_new_char(fd, sd);
}
diff --git a/src/char/char.h b/src/char/char.h
index 4dbdfd9db..d7bc96e13 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -147,7 +147,7 @@ struct char_interface {
bool (*char_slotchange) (struct char_session_data *sd, int fd, unsigned short from, unsigned short to);
int (*rename_char_sql) (struct char_session_data *sd, int char_id);
int (*check_char_name) (char * name, char * esc_name);
- int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style);
+ int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job);
int (*divorce_char_sql) (int partner_id1, int partner_id2);
int (*count_users) (void);
int (*mmo_char_tobuf) (uint8* buffer, struct mmo_charstatus* p);
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 77f706f0d..4dd19d422 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -993,6 +993,8 @@ enum {
JOB_OBORO,
JOB_REBELLION = 4215,
+ JOB_SUMMONER = 4218,
+
#ifndef JOB_MAX
JOB_MAX,
#endif
diff --git a/src/map/packets.h b/src/map/packets.h
index 8b0a733c7..3dc23cb24 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -2930,6 +2930,140 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0980,7,clif->pSelectCart); // CZ_SELECTCART
#endif
+// 2015-10-01bRagexeRE
+#if PACKETVER >= 20151001
+ packet(0x0369,7,clif->pActionRequest,2,6);
+ packet(0x083C,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0437,5,clif->pWalkToXY,2);
+ packet(0x035F,6,clif->pTickSend,2);
+ packet(0x0202,5,clif->pChangeDir,2,4);
+ packet(0x07E4,6,clif->pTakeItem,2);
+ packet(0x0362,6,clif->pDropItem,2,4);
+ packet(0x07EC,8,clif->pMoveToKafra,2,4);
+ packet(0x0364,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x096A,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0360,6,clif->pReqClickBuyingStore,2);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
+// packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0802,26,clif->pPartyInvite2,2);
+// packet(0x0436,4); // CZ_GANGSI_RANK
+ packet(0x023B,26,clif->pFriendsListAdd,2);
+ packet(0x0361,5,clif->pHomMenu,2,4);
+ packet(0x0860,36,clif->pStoragePassword,0);
+#endif
+
+// 2015-10-29aRagexe
+#if PACKETVER >= 20151029
+ packet(0x0369,7,clif->pActionRequest,2,6);
+ packet(0x083C,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0437,5,clif->pWalkToXY,2);
+ packet(0x035F,6,clif->pTickSend,2);
+ packet(0x0202,5,clif->pChangeDir,2,4);
+ packet(0x07E4,6,clif->pTakeItem,2);
+ packet(0x0362,6,clif->pDropItem,2,4);
+ packet(0x07EC,8,clif->pMoveToKafra,2,4);
+ packet(0x0364,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x096A,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0360,6,clif->pReqClickBuyingStore,2);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
+ packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0802,26,clif->pPartyInvite2,2);
+ packet(0x0436,4); // CZ_GANGSI_RANK
+ packet(0x023B,26,clif->pFriendsListAdd,2);
+ packet(0x0361,5,clif->pHomMenu,2,4);
+ packet(0x0860,36,clif->pStoragePassword,0);
+ packet(0x0a39,36);
+#endif
+
+// 2015-11-04aRagexe
+#if PACKETVER >= 20151104
+ packet(0x0369,7,clif->pActionRequest,2,6);
+ packet(0x083C,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0363,5,clif->pWalkToXY,2);
+ packet(0x0886,6,clif->pTickSend,2);
+ packet(0x0928,5,clif->pChangeDir,2,4);
+ packet(0x0964,6,clif->pTakeItem,2);
+ packet(0x0437,6,clif->pDropItem,2,4);
+ packet(0x088B,8,clif->pMoveToKafra,2,4);
+ packet(0x0364,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x0887,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0815,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0436,6,clif->pReqClickBuyingStore,2);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x023B,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0811,18,clif->pPartyBookingRegisterReq,2,4,6);
+ packet(0x0939,8); // CZ_JOIN_BATTLE_FIELD
+ packet(0x093A,-1,clif->pItemListWindowSelected,2,4,8,12);
+ packet(0x0360,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x08A5,26,clif->pPartyInvite2,2);
+ packet(0x08A3,4); // CZ_GANGSI_RANK CZ_GANGSI_RANK
+ packet(0x07EC,26,clif->pFriendsListAdd,2);
+ packet(0x088D,5,clif->pHomMenu,2,4);
+ packet(0x0940,36,clif->pStoragePassword,2,4,20);
+ packet(0x0a39,36);
+#endif
+
+// 2015-12-16aRagexe
+#if PACKETVER >= 20151216
+ packet(0x089D,7,clif->pActionRequest,2,6);
+ packet(0x0968,10,clif->pUseSkillToId,2,4,6);
+ packet(0x08A2,5,clif->pWalkToXY,2);
+ packet(0x085B,6,clif->pTickSend,2);
+ packet(0x022D,5,clif->pChangeDir,2,4);
+ packet(0x08A9,6,clif->pTakeItem,2);
+ packet(0x0966,6,clif->pDropItem,2,4);
+ packet(0x08AC,8,clif->pMoveToKafra,2,4);
+ packet(0x0864,8,clif->pMoveFromKafra,2,4);
+ packet(0x0865,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0874,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x088B,6,clif->pGetCharNameRequest,2);
+ packet(0x089E,6,clif->pSolveCharName,2);
+ packet(0x0436,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0960,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0944,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0954,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0361,6,clif->pReqClickBuyingStore,2);
+ packet(0x083C,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0870,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
+ packet(0x086A,8); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0949,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x0947,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x086E,26,clif->pPartyInvite2,2);
+ packet(0x0364,4); // CZ_GANGSI_RANK
+ packet(0x091D,26,clif->pFriendsListAdd,2);
+ packet(0x0362,5,clif->pHomMenu,2,4);
+ packet(0x0885,36,clif->pStoragePassword,0);
+#endif
+
/* PacketKeys: http://herc.ws/board/topic/1105-hercules-wpe-free-june-14th-patch/ */
#if PACKETVER >= 20110817
packetKeys(0x053D5CED,0x3DED6DED,0x6DED6DED); /* Thanks to Shakto */
@@ -3175,6 +3309,22 @@ packet(0x96e,-1,clif->ackmergeitems);
packetKeys(0x62C86D09,0x75944F17,0x112C133D); /* Dastgir */
#endif
+#if PACKETVER >= 20151001
+ packetKeys(0x5CFF4561,0x32514AD1,0x06D126D1); /* Dastgir */
+#endif
+
+#if PACKETVER >= 20151029
+ packetKeys(0x45B945B9,0x45B945B9,0x45B945B9); /* Dastgir */
+#endif
+
+#if PACKETVER >= 20151104
+ packetKeys(0x4C17382A,0x7ED174C9,0x29961E4F); /* ossi0110 */
+#endif
+
+#if PACKETVER >= 20151216
+ packetKeys(0x25DD643D,0x61AC39DE,0x77A8206D); /* Dastgir */
+#endif
+
#if defined(OBFUSCATIONKEY1) && defined(OBFUSCATIONKEY2) && defined(OBFUSCATIONKEY3)
packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3);
#endif