diff options
author | Haru <haru@dotalux.com> | 2017-10-21 17:48:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 17:48:13 +0200 |
commit | d1691ef81112667c2cfb3ae74a074a6debd4af53 (patch) | |
tree | c8c1126b5407fcfe8fe43b1db14e3970c656eda8 /src/map | |
parent | e5d9b3768241a7e91bf8dd9bf8b776d4cee310d7 (diff) | |
parent | ec9f4b20aca50905d635db6d1e5398918a6dba5d (diff) | |
download | hercules-d1691ef81112667c2cfb3ae74a074a6debd4af53.tar.gz hercules-d1691ef81112667c2cfb3ae74a074a6debd4af53.tar.bz2 hercules-d1691ef81112667c2cfb3ae74a074a6debd4af53.tar.xz hercules-d1691ef81112667c2cfb3ae74a074a6debd4af53.zip |
Merge pull request #1859 from 4144/newpackets
Add shuffle packets for latest clients, fix rodex in 2017 clients, fix exp packets.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 168 | ||||
-rw-r--r-- | src/map/clif.h | 3 | ||||
-rw-r--r-- | src/map/guild.c | 3 | ||||
-rw-r--r-- | src/map/guild.h | 2 | ||||
-rw-r--r-- | src/map/intif.c | 6 | ||||
-rw-r--r-- | src/map/packets.h | 146 | ||||
-rw-r--r-- | src/map/packets_keys.h | 21 | ||||
-rw-r--r-- | src/map/packets_struct.h | 23 | ||||
-rw-r--r-- | src/map/pc.c | 86 | ||||
-rw-r--r-- | src/map/pc.h | 14 | ||||
-rw-r--r-- | src/map/rodex.c | 11 | ||||
-rw-r--r-- | src/map/rodex.h | 2 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/status.h | 6 |
14 files changed, 424 insertions, 71 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index de0f0573f..088c92ea8 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3033,27 +3033,50 @@ void clif_updatestatus(struct map_session_data *sd,int type) WFIFOL(fd,4)=sd->status.zeny; len = packet_len(0xb1); break; +// [4144] unconfirment exact version can be from 20170405 to 20170913 +#if PACKETVER >= 20170830 case SP_BASEEXP: - WFIFOW(fd,0)=0xb1; - WFIFOL(fd,4)=(uint32)(sd->status.base_exp); + WFIFOW(fd, 0) = 0xacb; + WFIFOQ(fd, 4) = sd->status.base_exp; + len = packet_len(0xacb); + break; + case SP_JOBEXP: + WFIFOW(fd, 0) = 0xacb; + WFIFOQ(fd, 4) = sd->status.job_exp; + len = packet_len(0xacb); + break; + case SP_NEXTBASEEXP: + WFIFOW(fd, 0) = 0xacb; + WFIFOQ(fd, 4) = pc->nextbaseexp(sd); + len = packet_len(0xacb); + break; + case SP_NEXTJOBEXP: + WFIFOW(fd, 0) = 0xacb; + WFIFOQ(fd, 4) = pc->nextjobexp(sd); + len = packet_len(0xacb); + break; +#else + case SP_BASEEXP: + WFIFOW(fd, 0) = 0xb1; + WFIFOL(fd, 4) = (uint32)(sd->status.base_exp); len = packet_len(0xb1); break; case SP_JOBEXP: - WFIFOW(fd,0)=0xb1; - WFIFOL(fd,4)=(uint32)(sd->status.job_exp); + WFIFOW(fd, 0) = 0xb1; + WFIFOL(fd, 4) = (uint32)(sd->status.job_exp); len = packet_len(0xb1); break; case SP_NEXTBASEEXP: - WFIFOW(fd,0)=0xb1; - WFIFOL(fd,4)=pc->nextbaseexp(sd); + WFIFOW(fd, 0) = 0xb1; + WFIFOL(fd, 4) = (uint32)pc->nextbaseexp(sd); len = packet_len(0xb1); break; case SP_NEXTJOBEXP: - WFIFOW(fd,0)=0xb1; - WFIFOL(fd,4)=pc->nextjobexp(sd); + WFIFOW(fd, 0) = 0xb1; + WFIFOL(fd, 4) = (uint32)pc->nextjobexp(sd); len = packet_len(0xb1); break; - +#endif /** * SP_U<STAT> are used to update the amount of points necessary to increase that stat **/ @@ -14027,7 +14050,7 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd) /* it sends the request when the criteria doesn't match (and of course we let it fail) */ /* so restoring the old parse_globalmes method. */ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) { - unsigned int next = pc->nextbaseexp(sd); + uint64 next = pc->nextbaseexp(sd); if( next == 0 ) next = pc->thisbaseexp(sd); if( next ) { int percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. ); @@ -16697,20 +16720,34 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat /// exp type: /// 0 = normal exp gain/loss /// 1 = quest exp gain/loss -void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool is_quest) { +void clif_displayexp(struct map_session_data *sd, uint64 exp, char type, bool is_quest) +{ int fd; +// [4144] unconfirment exact version can be from 20170405 to 20170913 +#if PACKETVER >= 20170830 + const int cmd = 0xacc; +#else + const int cmd = 0x7f6; +#endif nullpo_retv(sd); fd = sd->fd; - WFIFOHEAD(fd, packet_len(0x7f6)); - WFIFOW(fd,0) = 0x7f6; - WFIFOL(fd,2) = sd->bl.id; - WFIFOL(fd,6) = exp; - WFIFOW(fd,10) = type; - WFIFOW(fd,12) = is_quest?1:0;// Normal exp is shown in yellow, quest exp is shown in purple. - WFIFOSET(fd,packet_len(0x7f6)); + WFIFOHEAD(fd, packet_len(cmd)); + WFIFOW(fd, 0) = cmd; + WFIFOL(fd, 2) = sd->bl.id; +// [4144] unconfirment exact version can be from 20170405 to 20170913 +#if PACKETVER >= 20170830 + WFIFOQ(fd, 6) = exp; + WFIFOW(fd, 14) = type; + WFIFOW(fd, 16) = is_quest ? 1 : 0; // Normal exp is shown in yellow, quest exp is shown in purple. +#else + WFIFOL(fd, 6) = (uint32)exp; + WFIFOW(fd, 10) = type; + WFIFOW(fd, 12) = is_quest ? 1 : 0; // Normal exp is shown in yellow, quest exp is shown in purple. +#endif + WFIFOSET(fd, packet_len(cmd)); } /// Displays digital clock digits on top of the screen (ZC_SHOWDIGIT). @@ -19433,8 +19470,9 @@ void clif_rodex_send_maillist(int fd, struct map_session_data *sd, int8 open_typ WFIFOHEAD(fd, sizeof(*packet) + (sizeof(*inner) + RODEX_TITLE_LENGTH) * RODEX_MAIL_PER_PAGE); packet = WFIFOP(fd, 0); packet->PacketType = ((page_start == (VECTOR_LENGTH(sd->rodex.messages) - 1)) ? rodexmailList : rodexnextpage); +#if PACKETVER < 20170419 packet->opentype = open_type; - +#endif inner = WFIFOP(fd, size); while (page_start >= 0 && count < RODEX_MAIL_PER_PAGE) { @@ -19447,7 +19485,11 @@ void clif_rodex_send_maillist(int fd, struct map_session_data *sd, int8 open_typ inner->MailID = msg->id; inner->Isread = msg->is_read == true ? 1 : 0; inner->type = msg->type; +#if PACKETVER >= 20170419 + inner->openType = msg->opentype; +#else inner->regDateTime = (int)time(NULL) - msg->send_date; +#endif inner->expireDateTime = msg->expire_date - (int)time(NULL); if (open_type == RODEX_OPENTYPE_RETURN) { inner->expireDateTime += RODEX_EXPIRE; @@ -19465,12 +19507,80 @@ void clif_rodex_send_maillist(int fd, struct map_session_data *sd, int8 open_typ } packet->PacketLength = size; +#if PACKETVER < 20170419 packet->cnt = count; +#endif packet->IsEnd = page_start > 0 ? 0 : 1; WFIFOSET(fd, size); #endif } +void clif_rodex_send_mails_all(int fd, struct map_session_data *sd) +{ +#if PACKETVER >= 20170419 + struct PACKET_ZC_MAIL_LIST *packet; + struct maillistinfo *inner; + int16 size = sizeof(*packet); + int packetMailCount = 0; + int mailListCount = 0; + int mailsSize = VECTOR_LENGTH(sd->rodex.messages); + int i; + + nullpo_retv(sd); + + WFIFOHEAD(fd, sizeof(*packet) + (sizeof(*inner) + RODEX_TITLE_LENGTH) * RODEX_MAIL_PER_PAGE); + packet = WFIFOP(fd, 0); + packet->PacketType = rodexmailList; + inner = WFIFOP(fd, size); + + i = mailsSize - 1; + while (i >= 0) { + struct rodex_message *msg = &VECTOR_INDEX(sd->rodex.messages, i); + --i; + + if (msg->is_deleted) + continue; + + inner->MailID = msg->id; + inner->Isread = msg->is_read == true ? 1 : 0; + inner->type = msg->type; + inner->openType = msg->opentype; + inner->expireDateTime = msg->expire_date - (int)time(NULL); + if (msg->opentype == RODEX_OPENTYPE_RETURN) { + inner->expireDateTime += RODEX_EXPIRE; + } + inner->Titlelength = (int16)strlen(msg->title) + 1; + if (msg->opentype != RODEX_OPENTYPE_RETURN) { + strncpy(inner->SenderName, msg->sender_name, sizeof(msg->sender_name)); + } else { + strncpy(inner->SenderName, msg->receiver_name, sizeof(msg->receiver_name)); + } + strncpy(inner->title, msg->title, inner->Titlelength); + size += sizeof(*inner) + inner->Titlelength; + inner = WFIFOP(fd, size); + packetMailCount ++; + mailListCount ++; + if (packetMailCount == RODEX_MAIL_PER_PAGE) { + packet->PacketLength = size; + packet->IsEnd = mailListCount > mailsSize ? 1 : 0; + WFIFOSET(fd, size); + WFIFOHEAD(fd, sizeof(*packet) + (sizeof(*inner) + RODEX_TITLE_LENGTH) * RODEX_MAIL_PER_PAGE); + packet = WFIFOP(fd, 0); + packet->PacketType = rodexmailList; + size = sizeof(*packet); + inner = WFIFOP(fd, size); + packetMailCount = 0; + } + } + + if (packetMailCount > 0 || mailListCount == 0) { + packet->PacketLength = size; + packet->IsEnd = 1; + WFIFOSET(fd, size); + } +#endif +} + void clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 open_type, int count) { #if PACKETVER >= 20131218 @@ -19484,8 +19594,9 @@ void clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 open_type WFIFOHEAD(fd, sizeof(*packet) + (sizeof(*inner) + RODEX_TITLE_LENGTH) * RODEX_MAIL_PER_PAGE); packet = WFIFOP(fd, 0); packet->PacketType = rodexmailList; +#if PACKETVER < 20170419 packet->opentype = open_type; - +#endif inner = WFIFOP(fd, size); i = VECTOR_LENGTH(sd->rodex.messages) - 1; @@ -19500,7 +19611,11 @@ void clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 open_type inner->MailID = msg->id; inner->Isread = msg->is_read == true ? 1 : 0; inner->type = msg->type; +#if PACKETVER >= 20170419 + inner->openType = msg->opentype; +#else inner->regDateTime = (int)time(NULL) - msg->send_date; +#endif inner->expireDateTime = msg->expire_date - (int)time(NULL); if (open_type == RODEX_OPENTYPE_RETURN) { inner->expireDateTime += RODEX_EXPIRE; @@ -19518,7 +19633,9 @@ void clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 open_type } packet->PacketLength = size; +#if PACKETVER < 20170419 packet->cnt = count; +#endif packet->IsEnd = 1; WFIFOSET(fd, size); #endif @@ -19693,14 +19810,22 @@ void clif_parse_rodex_refresh_maillist(int fd, struct map_session_data *sd) __at void clif_parse_rodex_refresh_maillist(int fd, struct map_session_data *sd) { const struct PACKET_CZ_REQ_REFRESH_MAIL_LIST *packet = RFIFOP(fd, 0); +#if PACKETVER >= 20170419 + rodex->refresh(sd, RODEX_OPENTYPE_UNSET, packet->Upper_MailID); +#else rodex->refresh(sd, packet->opentype, packet->Upper_MailID); +#endif } void clif_parse_rodex_open_mailbox(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); void clif_parse_rodex_open_mailbox(int fd, struct map_session_data *sd) { const struct PACKET_CZ_REQ_OPEN_MAIL *packet = RFIFOP(fd, 0); - rodex->open(sd, packet->opentype); +#if PACKETVER >= 20170419 + rodex->open(sd, RODEX_OPENTYPE_UNSET, packet->Upper_MailID); +#else + rodex->open(sd, packet->opentype, packet->Upper_MailID); +#endif rodex->clean(sd, 1); } @@ -20785,4 +20910,5 @@ void clif_defaults(void) { clif->pRodexRequestItems = clif_parse_rodex_request_items; clif->rodex_request_items = clif_rodex_request_items; clif->rodex_icon = clif_rodex_icon; + clif->rodex_send_mails_all = clif_rodex_send_mails_all; } diff --git a/src/map/clif.h b/src/map/clif.h index 73cb72128..851c823ea 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -784,7 +784,7 @@ struct clif_interface { void (*equiptickack) (struct map_session_data* sd, int flag); void (*viewequip_ack) (struct map_session_data* sd, struct map_session_data* tsd); void (*equpcheckbox) (struct map_session_data* sd); - void (*displayexp) (struct map_session_data *sd, unsigned int exp, char type, bool is_quest); + void (*displayexp) (struct map_session_data *sd, uint64 exp, char type, bool is_quest); void (*font) (struct map_session_data *sd); void (*progressbar) (struct map_session_data * sd, unsigned int color, unsigned int second); void (*progressbar_abort) (struct map_session_data * sd); @@ -1378,6 +1378,7 @@ struct clif_interface { void (*rodex_send_mail_result) (int fd, struct map_session_data *sd, int8 result); void (*rodex_send_maillist) (int fd, struct map_session_data *sd, int8 open_type, int64 page_start); void (*rodex_send_refresh) (int fd, struct map_session_data *sd, int8 open_type, int count); + void (*rodex_send_mails_all) (int fd, struct map_session_data *sd); void (*pRodexReadMail) (int fd, struct map_session_data *sd); void (*rodex_read_mail) (struct map_session_data *sd, int8 opentype, struct rodex_message *msg); void (*pRodexNextMaillist) (int fd, struct map_session_data *sd); diff --git a/src/map/guild.c b/src/map/guild.c index 092e066c3..bb0484477 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1282,7 +1282,8 @@ struct DBData create_expcache(union DBKey key, va_list args) /*==================================================== * Return taxed experience from player sd to guild *---------------------------------------------------*/ -unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp) { +uint64 guild_payexp(struct map_session_data *sd, uint64 exp) +{ struct guild *g; struct guild_expcache *c; int per; diff --git a/src/map/guild.h b/src/map/guild.h index 71e989870..9296f9ec0 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -100,7 +100,7 @@ struct guild_interface { struct map_session_data *(*getavailablesd) (struct guild *g); int (*getindex) (const struct guild *g, int account_id, int char_id); int (*getposition) (struct guild *g, struct map_session_data *sd); - unsigned int (*payexp) (struct map_session_data *sd,unsigned int exp); + uint64 (*payexp) (struct map_session_data *sd, uint64 exp); int (*getexp) (struct map_session_data *sd,int exp); // [Celest] /* */ int (*create) (struct map_session_data *sd, const char *name); diff --git a/src/map/intif.c b/src/map/intif.c index 1458fc710..60edc8d8b 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -2433,7 +2433,9 @@ int intif_rodex_requestinbox(int char_id, int account_id, int8 flag, int8 openty void intif_parse_RequestRodexOpenInbox(int fd) { struct map_session_data *sd; +#if PACKETVER < 20170419 int8 opentype = RFIFOB(fd, 8); +#endif int8 flag = RFIFOB(fd, 9); int8 is_end = RFIFOB(fd, 10); int count = RFIFOL(fd, 11); @@ -2461,10 +2463,14 @@ void intif_parse_RequestRodexOpenInbox(int fd) } if (is_end == true) { +#if PACKETVER >= 20170419 + clif->rodex_send_mails_all(sd->fd, sd); +#else if (flag == 0) clif->rodex_send_maillist(sd->fd, sd, opentype, VECTOR_LENGTH(sd->rodex.messages) - 1); else clif->rodex_send_refresh(sd->fd, sd, opentype, count); +#endif } } diff --git a/src/map/packets.h b/src/map/packets.h index afa986346..e9d895440 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -9476,8 +9476,8 @@ packet(0x96e,-1,clif->ackmergeitems); // 2017-02-28aRagexeRE #if PACKETVER >= 20170228 // new packets - packet(0x0ac0,26); - packet(0x0ac1,26); + packet(0x0ac0,26,clif->pRodexOpenMailbox); // CZ_OPEN_RODEXBOX + packet(0x0ac1,26,clif->pRodexRefreshMaillist); // CZ_REQ_REFRESH_RODEX packet(0x0ac2,-1); packet(0x0ac3,2); packet(0x0ac4,-1); @@ -10527,4 +10527,146 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0adf,58); #endif +// 2017-09-27bRagexeRE +#if PACKETVER == 20170927 +// shuffle packets + packet(0x02c4,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x035f,6,clif->pGetCharNameRequest,2); // CZ_REQNAME + packet(0x0361,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0362,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0366,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x085c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0873,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0875,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x087d,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x087e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x088b,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0899,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x089a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x089b,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x08a3,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x08a5,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x08a6,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x08ad,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x091e,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0922,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0923,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0927,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x093b,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0942,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0945,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x094b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x094d,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0959,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x095a,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND +#endif + +#if PACKETVER >= 20170927 +// new packets + packet(0x0ae0,30); +// changed packet sizes +#endif + +// 2017-10-02cRagexeRE +#if PACKETVER == 20171002 +// shuffle packets + packet(0x022d,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0363,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x0885,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0897,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0899,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x089d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0928,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x092d,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0934,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x093b,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x093d,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x093e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0943,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x095f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2017-10-11bRagexeRE +#if PACKETVER == 20171011 +// shuffle packets + packet(0x023b,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x0437,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x087b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x0882,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0950,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0954,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + +// 2017-10-18aRagexeRE +#if PACKETVER == 20171018 +// shuffle packets + packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME + packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE + packet(0x0363,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER + packet(0x0364,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX + packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID + packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT + packet(0x0436,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP + packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND + packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE + packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE + packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE + packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO + packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE + packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK + packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL + packet(0x086a,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK + packet(0x087a,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD + packet(0x087e,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER + packet(0x0889,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY + packet(0x089a,6,clif->pDropItem,2,4); // CZ_ITEM_THROW + packet(0x089f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ + packet(0x08a6,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION + packet(0x0938,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES + packet(0x0944,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD + packet(0x094a,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS + packet(0x094f,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER + packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME +#endif + #endif /* MAP_PACKETS_H */ diff --git a/src/map/packets_keys.h b/src/map/packets_keys.h index 424956bc9..85796813a 100644 --- a/src/map/packets_keys.h +++ b/src/map/packets_keys.h @@ -2132,6 +2132,27 @@ packetKeys(0x53024DA5,0x04EC212D,0x0BF87CD4); #endif +// 2017-09-27bRagexeRE, 2017-09-27dRagexeRE +#if PACKETVER == 20170927 + packetKeys(0x15624100,0x0CE1463E,0x0E5D6534); +#endif + +// 2017-10-02cRagexeRE +#if PACKETVER == 20171002 + packetKeys(0x15E1716C,0x4E765B63,0x357D2370); +#endif + +// 2017-10-11aRagexeRE, 2017-10-11bRagexeRE +#if PACKETVER == 20171011 + packetKeys(0x4F121B3E,0x12670E17,0x19896C11); +#endif + +// 2017-10-18aRagexeRE +#if PACKETVER == 20171018 + packetKeys(0x2CAA109C,0x158C1EC2,0x7A5E58F3); +#endif + + #if defined(OBFUSCATIONKEY1) && defined(OBFUSCATIONKEY2) && defined(OBFUSCATIONKEY3) packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3); #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 207c345da..03b555e2b 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -318,10 +318,12 @@ enum packet_headers { rodexadditem = 0x0A05, rodexremoveitem = 0x0A07, rodexopenwrite = 0x0A12, -#if PACKETVER < 20160600 +#if PACKETVER < 20160601 rodexmailList = 0x09F0, -#else // PACKETVER >= 20160600 +#elif PACKETVER < 20170419 rodexmailList = 0x0A7D, +#else // PACKETVER >= 20170419 + rodexmailList = 0x0Ac2, #endif #if PACKETVER < 20160316 rodexcheckplayer = 0x0A14, @@ -1369,11 +1371,16 @@ struct PACKET_ZC_NOTIFY_UNREADMAIL { } __attribute__((packed)); struct maillistinfo { +#if PACKETVER >= 20170419 + uint8 openType; +#endif int64 MailID; int8 Isread; uint8 type; char SenderName[24]; +#if PACKETVER < 20170419 int32 regDateTime; +#endif int32 expireDateTime; int16 Titlelength; char title[]; @@ -1382,8 +1389,10 @@ struct maillistinfo { struct PACKET_ZC_MAIL_LIST { int16 PacketType; int16 PacketLength; +#if PACKETVER < 20170419 int8 opentype; int8 cnt; +#endif int8 IsEnd; } __attribute__((packed)); @@ -1395,8 +1404,13 @@ struct PACKET_CZ_REQ_NEXT_MAIL_LIST { struct PACKET_CZ_REQ_OPEN_MAIL { int16 PacketType; +#if PACKETVER >= 20170419 + int64 Upper_MailID; + int8 unknown[16]; +#else int8 opentype; int64 Upper_MailID; +#endif } __attribute__((packed)); struct PACKET_CZ_REQ_READ_MAIL { @@ -1429,8 +1443,13 @@ struct PACKET_ZC_ACK_DELETE_MAIL { struct PACKET_CZ_REQ_REFRESH_MAIL_LIST { int16 PacketType; +#if PACKETVER >= 20170419 + int64 Upper_MailID; + int8 unknown[16]; +#else int8 opentype; int64 Upper_MailID; +#endif } __attribute__((packed)); struct PACKET_CZ_REQ_ZENY_FROM_MAIL { diff --git a/src/map/pc.c b/src/map/pc.c index a4a32545b..760519298 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6698,8 +6698,9 @@ int pc_follow(struct map_session_data *sd,int target_id) { return 0; } -int pc_checkbaselevelup(struct map_session_data *sd) { - unsigned int next = pc->nextbaseexp(sd); +int pc_checkbaselevelup(struct map_session_data *sd) +{ + uint64 next = pc->nextbaseexp(sd); nullpo_ret(sd); if (!next || sd->status.base_exp < next) @@ -6763,7 +6764,7 @@ void pc_baselevelchanged(struct map_session_data *sd) { int pc_checkjoblevelup(struct map_session_data *sd) { - unsigned int next = pc->nextjobexp(sd); + uint64 next = pc->nextjobexp(sd); nullpo_ret(sd); if(!next || sd->status.job_exp < next) @@ -6796,7 +6797,7 @@ int pc_checkjoblevelup(struct map_session_data *sd) /** * Alters EXP based on self bonuses that do not get shared with the party **/ -void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src) { +void pc_calcexp(struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src) { int buff_ratio = 0, buff_job_ratio = 0, race_ratio = 0, pk_ratio = 0; int64 jexp, bexp; @@ -6861,8 +6862,8 @@ void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned in bexp += apply_percentrate64(bexp, buff_ratio, 100); jexp += apply_percentrate64(jexp, buff_ratio + buff_job_ratio, 100); - *job_exp = (unsigned int)cap_value(jexp, 1, UINT_MAX); - *base_exp = (unsigned int)cap_value(bexp, 1, UINT_MAX); + *job_exp = cap_value(jexp, 1, UINT64_MAX); + *base_exp = cap_value(bexp, 1, UINT64_MAX); } /** @@ -6871,9 +6872,10 @@ void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned in * @param is_quest Used to let client know that the EXP was from a quest (clif->displayexp) PACKETVER >= 20091027 * @retval true success **/ -bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool is_quest) { - float nextbp=0, nextjp=0; - unsigned int nextb=0, nextj=0; +bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest) +{ + float nextbp = 0, nextjp = 0; + uint64 nextb = 0, nextj = 0; nullpo_ret(sd); if (sd->bl.prev == NULL || pc_isdead(sd)) @@ -6889,7 +6891,7 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in pc->calcexp(sd, &base_exp, &job_exp, src); if (sd->status.guild_id > 0) - base_exp -= guild->payexp(sd,base_exp); + base_exp -= guild->payexp(sd, base_exp); nextb = pc->nextbaseexp(sd); nextj = pc->nextjobexp(sd); @@ -6900,16 +6902,16 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in if (nextj > 0) nextjp = (float) job_exp / (float) nextj; - if(battle_config.max_exp_gain_rate) { + if (battle_config.max_exp_gain_rate) { if (nextbp > battle_config.max_exp_gain_rate/1000.) { //Note that this value should never be greater than the original //base_exp, therefore no overflow checks are needed. [Skotlex] - base_exp = (unsigned int)(battle_config.max_exp_gain_rate/1000.*nextb); + base_exp = (uint64)(battle_config.max_exp_gain_rate / 1000. * nextb); if (sd->state.showexp) nextbp = (float) base_exp / (float) nextb; } if (nextjp > battle_config.max_exp_gain_rate/1000.) { - job_exp = (unsigned int)(battle_config.max_exp_gain_rate/1000.*nextj); + job_exp = (uint64)(battle_config.max_exp_gain_rate / 1000. * nextj); if (sd->state.showexp) nextjp = (float) job_exp / (float) nextj; } @@ -6919,23 +6921,23 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in // Cap exp to the level up requirement of the previous level when you are at max level, // otherwise cap at UINT_MAX (this is required for some S. Novice bonuses). [Skotlex] if (base_exp) { - nextb = nextb?UINT_MAX:pc->thisbaseexp(sd); - if(sd->status.base_exp > nextb - base_exp) + nextb = nextb ? UINT64_MAX : pc->thisbaseexp(sd); + if (sd->status.base_exp > nextb - base_exp) sd->status.base_exp = nextb; else sd->status.base_exp += base_exp; pc->checkbaselevelup(sd); - clif->updatestatus(sd,SP_BASEEXP); + clif->updatestatus(sd, SP_BASEEXP); } if (job_exp) { - nextj = nextj?UINT_MAX:pc->thisjobexp(sd); - if(sd->status.job_exp > nextj - job_exp) + nextj = nextj ? UINT64_MAX : pc->thisjobexp(sd); + if (sd->status.job_exp > nextj - job_exp) sd->status.job_exp = nextj; else sd->status.job_exp += job_exp; pc->checkjoblevelup(sd); - clif->updatestatus(sd,SP_JOBEXP); + clif->updatestatus(sd, SP_JOBEXP); } #if PACKETVER >= 20091027 @@ -6948,7 +6950,8 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in if(sd->state.showexp) { char output[256]; sprintf(output, - "Experience Gained Base:%u (%.2f%%) Job:%u (%.2f%%)",base_exp,nextbp*(float)100,job_exp,nextjp*(float)100); + "Experience Gained Base:%"PRIu64" (%.2f%%) Job:%"PRIu64" (%.2f%%)", + base_exp, nextbp * (float)100, job_exp, nextjp * (float)100); clif_disp_onlyself(sd, output); } @@ -6973,7 +6976,7 @@ int pc_maxjoblv(const struct map_session_data *sd) *------------------------------------------*/ //Base exp needed for next level. -unsigned int pc_nextbaseexp(const struct map_session_data *sd) +uint64 pc_nextbaseexp(const struct map_session_data *sd) { nullpo_ret(sd); @@ -6984,7 +6987,7 @@ unsigned int pc_nextbaseexp(const struct map_session_data *sd) } //Base exp needed for this level. -unsigned int pc_thisbaseexp(const struct map_session_data *sd) +uint64 pc_thisbaseexp(const struct map_session_data *sd) { if (sd->status.base_level > pc->maxbaselv(sd) || sd->status.base_level <= 1) return 0; @@ -7000,7 +7003,7 @@ unsigned int pc_thisbaseexp(const struct map_session_data *sd) *------------------------------------------*/ //Job exp needed for next level. -unsigned int pc_nextjobexp(const struct map_session_data *sd) +uint64 pc_nextjobexp(const struct map_session_data *sd) { nullpo_ret(sd); @@ -7010,7 +7013,7 @@ unsigned int pc_nextjobexp(const struct map_session_data *sd) } //Job exp needed for this level. -unsigned int pc_thisjobexp(const struct map_session_data *sd) +uint64 pc_thisjobexp(const struct map_session_data *sd) { if (sd->status.job_level > pc->maxjoblv(sd) || sd->status.job_level <= 1) return 0; @@ -7958,7 +7961,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { // activate Steel body if a super novice dies at 99+% exp [celest] if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && !sd->state.snovice_dead_flag) { - unsigned int next = pc->nextbaseexp(sd); + uint64 next = pc->nextbaseexp(sd); if( next == 0 ) next = pc->thisbaseexp(sd); if (get_percentage64(sd->status.base_exp, next) >= 99) { sd->state.snovice_dead_flag = 1; @@ -10988,6 +10991,35 @@ int pc_split_atoui(char* str, unsigned int* val, char sep, int max) return i; } +int pc_split_atoui64(char* str, uint64* val, char sep, int max) +{ + static int warning=0; + int i,j; + nullpo_ret(val); + for (i=0; i<max; i++) { + double f; + if (!str) break; + f = atof(str); + if (f < 0) + val[i] = 0; + else if (f > UINT64_MAX) { + val[i] = UINT64_MAX; + if (!warning) { + warning = 1; + ShowWarning("pc_readdb (exp.txt): Required exp per level is capped to %"PRIu64"\n", UINT64_MAX); + } + } else + val[i] = (uint64)f; + str = strchr(str,sep); + if (str) + *str++=0; + } + //Zero up the remaining. + for(j=i; j < max; j++) + val[j] = 0; + return i; +} + /** * Parses the skill tree config file. * @@ -11295,7 +11327,7 @@ int pc_readdb(void) { count++; job = jobs[0] = pc->class2idx(job_id); //We send one less and then one more because the last entry in the exp array should hold 0. - pc->max_level[job][type] = pc_split_atoui(split[3], pc->exp_table[job][type],',',maxlv-1)+1; + pc->max_level[job][type] = pc_split_atoui64(split[3], pc->exp_table[job][type], ',', maxlv - 1) + 1; //Reverse check in case the array has a bunch of trailing zeros... [Skotlex] //The reasoning behind the -2 is this... if the max level is 5, then the array //should look like this: @@ -11932,7 +11964,7 @@ bool pc_process_chat_message(struct map_session_data *sd, const char *message) */ void pc_check_supernovice_call(struct map_session_data *sd, const char *message) { - unsigned int next = pc->nextbaseexp(sd); + uint64 next = pc->nextbaseexp(sd); int percent = 0; nullpo_retv(sd); diff --git a/src/map/pc.h b/src/map/pc.h index 46aafa5e5..50cb1b68e 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -829,7 +829,7 @@ struct pc_interface { /* */ BEGIN_ZEROED_BLOCK; /* Everything within this block will be memset to 0 when status_defaults() is executed */ - unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL]; + uint64 exp_table[CLASS_COUNT][2][MAX_LEVEL]; int max_level[CLASS_COUNT][2]; unsigned int statp[MAX_LEVEL+1]; unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1]; @@ -949,11 +949,11 @@ END_ZEROED_BLOCK; /* End */ int (*maxjoblv) (const struct map_session_data *sd); int (*checkbaselevelup) (struct map_session_data *sd); int (*checkjoblevelup) (struct map_session_data *sd); - bool (*gainexp) (struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest); - unsigned int (*nextbaseexp) (const struct map_session_data *sd); - unsigned int (*thisbaseexp) (const struct map_session_data *sd); - unsigned int (*nextjobexp) (const struct map_session_data *sd); - unsigned int (*thisjobexp) (const struct map_session_data *sd); + bool (*gainexp) (struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest); + uint64 (*nextbaseexp) (const struct map_session_data *sd); + uint64 (*thisbaseexp) (const struct map_session_data *sd); + uint64 (*nextjobexp) (const struct map_session_data *sd); + uint64 (*thisjobexp) (const struct map_session_data *sd); int (*gets_status_point) (int level); int (*need_status_point) (struct map_session_data *sd,int type,int val); int (*maxparameterincrease) (struct map_session_data* sd, int type); @@ -1079,7 +1079,7 @@ END_ZEROED_BLOCK; /* End */ int (*bonus_addeff) (struct s_addeffect* effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration); int (*bonus_addeff_onskill) (struct s_addeffectonskill* effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target); int (*bonus_item_drop) (struct s_add_drop *drop, const short max, short id, short group, int race, int rate); - void (*calcexp) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src); + void (*calcexp) (struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src); int (*respawn_timer) (int tid, int64 tick, int id, intptr_t data); int (*jobchange_killclone) (struct block_list *bl, va_list ap); int (*getstat) (struct map_session_data* sd, int type); diff --git a/src/map/rodex.c b/src/map/rodex.c index 63d7242db..dcecb6b8f 100644 --- a/src/map/rodex.c +++ b/src/map/rodex.c @@ -547,13 +547,18 @@ void rodex_clean(struct map_session_data *sd, int8 flag) /// User request to open rodex, load mails from char-server /// @param sd : Who's requesting /// @param open_type : Box Type (see RODEX_OPENTYPE) -void rodex_open(struct map_session_data *sd, int8 open_type) +void rodex_open(struct map_session_data *sd, int8 open_type, int64 first_mail_id) { +#if PACKETVER >= 20170419 + const int type = 1; +#else + const int type = 0; +#endif nullpo_retv(sd); if (open_type == RODEX_OPENTYPE_ACCOUNT && battle_config.feature_rodex_use_accountmail == false) open_type = RODEX_OPENTYPE_MAIL; - intif->rodex_requestinbox(sd->status.char_id, sd->status.account_id, 0, open_type, 0); + intif->rodex_requestinbox(sd->status.char_id, sd->status.account_id, type, open_type, first_mail_id); } /// User request to read next page of mails @@ -568,7 +573,7 @@ void rodex_next_page(struct map_session_data *sd, int8 open_type, int64 last_mai if (open_type == RODEX_OPENTYPE_ACCOUNT && battle_config.feature_rodex_use_accountmail == false) { // Should not happen open_type = RODEX_OPENTYPE_MAIL; - rodex->open(sd, open_type); + rodex->open(sd, open_type, 0); return; } diff --git a/src/map/rodex.h b/src/map/rodex.h index 18ecd91d6..ddf7cb32b 100644 --- a/src/map/rodex.h +++ b/src/map/rodex.h @@ -60,7 +60,7 @@ struct rodex_interface { void (*final) (void); bool (*isenabled) (void); - void (*open) (struct map_session_data *sd, int8 open_type); + void (*open) (struct map_session_data *sd, int8 open_type, int64 first_mail_id); void (*next_page) (struct map_session_data *sd, int8 open_type, int64 last_mail_id); void (*refresh) (struct map_session_data *sd, int8 open_type, int64 first_mail_id); void (*add_item) (struct map_session_data *sd, int16 idx, int16 amount); diff --git a/src/map/skill.c b/src/map/skill.c index a84955377..a8ced2ccf 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -13832,8 +13832,8 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id break; case PR_REDEMPTIO: { - int exp; - if( ((exp = pc->nextbaseexp(sd)) > 0 && get_percentage64(sd->status.base_exp, exp) < 1) || + int64 exp; + if (((exp = pc->nextbaseexp(sd)) > 0 && get_percentage64(sd->status.base_exp, exp) < 1) || ((exp = pc->nextjobexp(sd)) > 0 && get_percentage64(sd->status.job_exp, exp) < 1)) { clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); //Not enough exp. return 0; diff --git a/src/map/status.h b/src/map/status.h index eb3cf491b..a104c66ab 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1927,7 +1927,7 @@ enum e_mode //who were not on your field of sight when it happened) //opt1: Non stackable status changes. -enum { +enum e_opt1 { OPT1_STONE = 1, //Petrified OPT1_FREEZE, OPT1_STUN, @@ -1940,7 +1940,7 @@ enum { }; //opt2: Stackable status changes. -enum { +enum e_opt2 { OPT2_POISON = 0x0001, OPT2_CURSE = 0x0002, OPT2_SILENCE = 0x0004, @@ -1953,7 +1953,7 @@ enum { }; //opt3: (SHOW_EFST_*) -enum { +enum e_opt3 { OPT3_NORMAL = 0x00000000, OPT3_QUICKEN = 0x00000001, OPT3_OVERTHRUST = 0x00000002, |