diff options
32 files changed, 742 insertions, 148 deletions
diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..0d3aea1ac --- /dev/null +++ b/.mailmap @@ -0,0 +1,9 @@ +# SVN -> git mailmap + +<kisuka@kisuka.com> <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec> +<euphy@rathena.org> <euphyy@54d463be-8e91-2dee-dedb-b68131a5f0ec> +<lemongrass@kstp.at> <lemongrass3110@54d463be-8e91-2dee-dedb-b68131a5f0ec> +<trojal@gmail.com> <trojal@54d463be-8e91-2dee-dedb-b68131a5f0ec> +<joseph.tk.ea@gmail.com> <j-tkay@54d463be-8e91-2dee-dedb-b68131a5f0ec> +<ind@henn.et> <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> +<Kenpachi.Developer@gmx.de> <kenpachi2k11@54d463be-8e91-2dee-dedb-b68131a5f0ec> diff --git a/conf/map/battle/party.conf b/conf/map/battle/party.conf index 07a0bdaea..a38321806 100644 --- a/conf/map/battle/party.conf +++ b/conf/map/battle/party.conf @@ -41,6 +41,12 @@ party_update_interval: 1000 // 1: Athena - bar is updated with the party map dots (up to 1 second delay) party_hp_mode: 0 +// When changing party leader, should the new leader be in the same map +// as the current leader. (Note 1) +// true: Aegis - They must be in the same map +// false: Athena - They can be in different maps +party_change_leader_same_map: true + // When 'Party Share' item sharing is enabled in a party, // announce in the party which party-member received the item and what's he received? (Note 1) show_party_share_picker: true diff --git a/doc/constants.md b/doc/constants.md index 60ba6908d..8523c980b 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -4004,6 +4004,11 @@ - `DATATYPE_VAR`: 4096 - `DATATYPE_LABEL`: 8192 +### Logmes types + +- `LOGMES_NPC`: 0 +- `LOGMES_ATCOMMAND`: 1 + ### Item Subtypes (Weapon types) - `W_FIST`: 0 @@ -4059,6 +4064,14 @@ - `DRESSROOM_OPEN`: 1 - `DRESSROOM_CLOSE`: 0 +### getmapinfo options + +- `MAPINFO_NAME`: 0 +- `MAPINFO_ID`: 1 +- `MAPINFO_SIZE_X`: 2 +- `MAPINFO_SIZE_Y`: 3 +- `MAPINFO_ZONE`: 4 + ### Renewal - `RENEWAL`: 1 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 331bed1c7..5c730106b 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -3305,6 +3305,27 @@ Notice that NPC objects disabled with disablenpc() will still be located. --------------------------------------- +*getmapinfo(<info>{, "<map name>"}) +*getmapinfo(<info>{, <map id>}) + +This command returns various information about a specific map. If the second +argument is omitted, it will try to use the map of the attached NPC, or the +map of the attached player if the NPC can't be found. + +Valid <info> are: + MAPINFO_NAME name of the map + MAPINFO_ID numeric ID of the map + MAPINFO_ZONE name of the zone used by the map + MAPINFO_SIZE_X width of the map (cells on the x axis) + MAPINFO_SIZE_Y height of the map (cells on the y axis) + +Examples: + getmapinfo(MAPINFO_ID, "map name"); // ID from name + getmapinfo(MAPINFO_NAME, 3); // name from ID + getmapinfo(MAPINFO_ZONE); // zone, ie Normal, PvP, Jail, ... + +--------------------------------------- + *getunits(<type>, <variable>, <limit>, "<map>"{, <x1>, <y1>, <x2>, <y2>}) This function searches a whole map or area for units and adds their GID to @@ -7506,13 +7527,21 @@ window). It will not be displayed anywhere else. debugmes("\033[38D\033[K ==Message== \n"); // enable colour code. --------------------------------------- -*logmes("<message>") +*logmes("<message>"{, <log type>}) + +This command will write the message given to the map server log files, as +specified in 'conf/map/logs.conf'. If SQL logging is enabled, the message will +go to the specified log table. If logs are not enabled, nothing will happen. + +Log types are: -This command will write the message given to the map server NPC log file, -as specified in 'conf/map/logs.conf'. If SQL logging is enabled, the message -will go to the 'npclog' table. +LOGMES_NPC - log to the 'npclog' table (Default) +LOGMES_ATCOMMAND - log to the 'atcommandlog' table + +Example: -If logs are not enabled for NPCs, nothing will happen. + logmes("foobar"); + logmes("foobar", LOGMES_ATCOMMAND); --------------------------------------- diff --git a/npc/kafras/functions_kafras.txt b/npc/kafras/functions_kafras.txt index e1e547174..90334cc6e 100644 --- a/npc/kafras/functions_kafras.txt +++ b/npc/kafras/functions_kafras.txt @@ -216,14 +216,23 @@ function script F_KafStor { // Niflheim Specific Message if (getarg(2) == 1) { mes "^666666S-s-ssoooorry,"; - mes "y-you're a-a-aaaa"; - mes "Nooviiice... N-neeeds"; - mes "B-basic sssskill l-level 6...^000000"; + if (Class == Job_Summoner) { + mes "y-you n-neeed"; + mes "N-new b-basic sssskill...^000000"; + } else { + mes "y-you're a-a-aaaa"; + mes "Nooviiice... N-neeeds"; + mes "B-basic sssskill l-level 6...^000000"; + } return; } mes "I'm sorry, but you"; - mes "need the Novice's"; - mes "Basic Skill Level 6 to"; + if (Class == Job_Summoner) { + mes "need the New Basic Skill to"; + } else { + mes "need the Novice's"; + mes "Basic Skill Level 6 to"; + } mes "use the Storage Service."; return; } diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c index c45c88eb0..994e8110e 100644 --- a/src/char/int_rodex.c +++ b/src/char/int_rodex.c @@ -92,6 +92,19 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 return -1; } break; + + case RODEX_OPENTYPE_UNSET: + if (SQL_ERROR == SQL->StmtPrepare(stmt, + "SELECT `mail_id`, `sender_name`, `sender_id`, `receiver_name`, `receiver_id`, `receiver_accountid`," + "`title`, `body`, `zeny`, `type`, `is_read`, `send_date`, `expire_date`, `weight`" + "FROM `%s` WHERE `expire_date` > '%d' AND (`receiver_id` = '%d' or `receiver_accountid` = '%d') AND `mail_id` > '%"PRId64"'" + "ORDER BY `mail_id` ASC", rodex_db, (int)time(NULL), char_id, account_id, mail_id) + ) { + SqlStmt_ShowDebug(stmt); + SQL->StmtFree(stmt); + return -1; + } + break; } if (SQL_ERROR == SQL->StmtExecute(stmt) @@ -173,7 +186,18 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 msg.type &= ~MAIL_TYPE_ZENY; } +#if PACKETVER >= 20170419 + if (opentype == RODEX_OPENTYPE_UNSET) { + if (msg.receiver_id != 0) + msg.opentype = RODEX_OPENTYPE_MAIL; + else + msg.opentype = RODEX_OPENTYPE_ACCOUNT; + } else { + msg.opentype = opentype; + } +#else msg.opentype = opentype; +#endif #if PACKETVER < 20160601 // NPC Message Type isn't supported in old clients msg.type &= ~MAIL_TYPE_NPC; diff --git a/src/common/mmo.h b/src/common/mmo.h index fe67d6efb..52f68b719 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -276,7 +276,11 @@ STATIC_ASSERT(MAX_ITEM_OPTIONS <= 5, "This value is limited by the client and da #define RODEX_BODY_LENGTH (500 + 1) #define RODEX_MAX_ITEM (5) #define RODEX_EXPIRE (1 * 15 * 24 * 60 * 60) +#if PACKETVER >= 20170419 +#define RODEX_MAIL_PER_PAGE 32 +#else #define RODEX_MAIL_PER_PAGE 7 +#endif // The following system marks a different job ID system used by the map server, // which makes a lot more sense than the normal one. [Skotlex] @@ -418,7 +422,7 @@ enum e_item_bound_type { #endif }; -enum { +enum e_option { OPTION_NOTHING = 0x00000000, OPTION_SIGHT = 0x00000001, OPTION_HIDE = 0x00000002, @@ -851,6 +855,7 @@ enum rodex_opentype { RODEX_OPENTYPE_MAIL = 0, RODEX_OPENTYPE_ACCOUNT = 1, RODEX_OPENTYPE_RETURN = 2, + RODEX_OPENTYPE_UNSET = 3, }; enum MAIL_TYPE { @@ -917,7 +922,7 @@ enum { }; //These mark the ID of the jobs, as expected by the client. [Skotlex] -enum { +enum e_class { JOB_NOVICE, JOB_SWORDMAN, JOB_MAGE, diff --git a/src/map/battle.c b/src/map/battle.c index 2861599b8..9c6e67694 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7096,6 +7096,7 @@ static const struct battle_data { { "vending_over_max", &battle_config.vending_over_max, 1, 0, 1, }, { "show_steal_in_same_party", &battle_config.show_steal_in_same_party, 0, 0, 1, }, { "party_hp_mode", &battle_config.party_hp_mode, 0, 0, 1, }, + { "party_change_leader_same_map", &battle_config.party_change_leader_same_map, 0, 0, 1, }, { "show_party_share_picker", &battle_config.party_show_share_picker, 1, 0, 1, }, { "show_picker_item_type", &battle_config.show_picker_item_type, 112, 0, INT_MAX, }, { "party_update_interval", &battle_config.party_update_interval, 1000, 100, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index e6129ca7c..4a63887c4 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -298,6 +298,7 @@ struct Battle_Config { int show_steal_in_same_party; int party_share_type; int party_hp_mode; + int party_change_leader_same_map; int party_show_share_picker; int show_picker_item_type; int attack_attr_none; @@ -545,7 +546,7 @@ struct Battle_Config { int player_warp_keep_direction; int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs - + int bow_unequip_arrow; int max_summoner_parameter; // Summoner Max Stats 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 ac8cc8d35..851c823ea 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -385,6 +385,7 @@ enum clif_messages { MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found. MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found. + MSG_PARTY_LEADER_SAMEMAP = 0x82e, //< It is only possible to change the party leader while on the same map. }; /** @@ -783,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); @@ -1377,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/map.c b/src/map/map.c index f8aebcfa6..ff5c2aafd 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -447,6 +447,11 @@ int map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) { struct status_change *sc = status->get_sc(bl); if (sc && (sc->option&OPTION_INVISIBLE)) continue; + if (bl->type == BL_NPC) { + const struct npc_data *nd = BL_UCCAST(BL_NPC, bl); + if (nd->class_ == FAKE_NPC || nd->class_ == HIDDEN_WARP_CLASS) + continue; + } } if (flag&0x1) { struct unit_data *ud = unit->bl2ud(bl); diff --git a/src/map/mob.c b/src/map/mob.c index 98f8865a9..1fb46283d 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1354,7 +1354,7 @@ int mob_unlocktarget(struct mob_data *md, int64 tick) { md->ud.target_to = 0; unit->set_target(&md->ud, 0); } - if(battle_config.official_cell_stack_limit && map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) { + if(battle_config.official_cell_stack_limit && map->count_oncell(md->bl.m, md->bl.x, md->bl.y, BL_CHAR|BL_NPC, 0x1 | 0x2) > battle_config.official_cell_stack_limit) { unit->walktoxy(&md->bl, md->bl.x, md->bl.y, 8); } 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/party.c b/src/map/party.c index 26b4bae8b..a4a7e6dca 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -731,6 +731,11 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts return false; } + if (battle_config.party_change_leader_same_map && sd->bl.m != tsd->bl.m) { + clif->msgtable(sd, MSG_PARTY_LEADER_SAMEMAP); // It is only possible to change the party leader while on the same map. + return false; + } + if( map->list[sd->bl.m].flag.partylock ) { clif->message(sd->fd, msg_sd(sd,287)); // You cannot change party leaders in this map. return false; 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/script.c b/src/map/script.c index 367c9927d..e2f53088c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12779,6 +12779,76 @@ BUILDIN(setmapflagnosave) { return true; } +enum mapinfo_info { + MAPINFO_NAME, + MAPINFO_ID, + MAPINFO_SIZE_X, + MAPINFO_SIZE_Y, + MAPINFO_ZONE +}; + +BUILDIN(getmapinfo) +{ + enum mapinfo_info mode = script_getnum(st, 2); + int16 m; + + if (script_hasdata(st, 3)) { + if (script_isstringtype(st, 3)) { + const char *str = script_getstr(st, 3); + m = map->mapname2mapid(str); + } else { + m = script_getnum(st, 3); + } + } else { + struct block_list *bl = NULL; + + if (st->oid) { + bl = map->id2bl(st->oid); + } else if (st->rid) { + bl = map->id2bl(st->rid); + } + + if (bl == NULL) { + ShowError("script:getmapinfo: map not supplied and NPC/PC not attached!\n"); + script_pushint(st, -3); + return false; + } + + m = bl->m; + } + + if (m < 0) { + // here we don't throw an error, so the command can be used + // to detect whether or not a map exists + script_pushint(st, -1); + return true; + } + + switch (mode) { + case MAPINFO_NAME: + script_pushconststr(st, map->list[m].name); + break; + case MAPINFO_ID: + script_pushint(st, m); + break; + case MAPINFO_SIZE_X: + script_pushint(st, map->list[m].xs); + break; + case MAPINFO_SIZE_Y: + script_pushint(st, map->list[m].ys); + break; + case MAPINFO_ZONE: + script_pushstrcopy(st, map->list[m].zone->name); + break; + default: + ShowError("script:getmapinfo: unknown option in second argument (%u).\n", mode); + script_pushint(st, -2); + return false; + } + + return true; +} + BUILDIN(getmapflag) { int16 m,i; @@ -15785,19 +15855,37 @@ BUILDIN(getmapxy) return true; } +enum logmes_type { + LOGMES_NPC, + LOGMES_ATCOMMAND +}; + /*========================================== - * Allows player to write NPC logs (i.e. Bank NPC, etc) [Lupus] + * Allows player to write logs (i.e. Bank NPC, etc) [Lupus] *------------------------------------------*/ -BUILDIN(logmes) -{ - const char *str; +BUILDIN(logmes) { + const char *str = script_getstr(st, 2); struct map_session_data *sd = script->rid2sd(st); + enum logmes_type type = LOGMES_NPC; + nullpo_retr(sd, false); - if (sd == NULL) - return true; + if (script_hasdata(st, 3)) { + type = script_getnum(st, 3); + } + + switch (type) { + case LOGMES_ATCOMMAND: + logs->atcommand(sd, str); + break; + case LOGMES_NPC: + logs->npc(sd, str); + break; + default: + ShowError("script:logmes: Unknown log type!\n"); + st->state = END; + return false; + } - str = script_getstr(st,2); - logs->npc(sd,str); return true; } @@ -23994,6 +24082,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(isloggedin,"i?"), BUILDIN_DEF(setmapflagnosave,"ssii"), BUILDIN_DEF(getmapflag,"si"), + BUILDIN_DEF(getmapinfo,"i?"), BUILDIN_DEF(setmapflag,"si?"), BUILDIN_DEF(removemapflag,"si"), BUILDIN_DEF(pvpon,"s"), @@ -24070,7 +24159,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(checkoption2,"i?"), BUILDIN_DEF(guildgetexp,"i"), BUILDIN_DEF(guildchangegm,"is"), - BUILDIN_DEF(logmes,"s"), //this command actls as MES but rints info into LOG file either SQL/TXT [Lupus] + BUILDIN_DEF(logmes,"s?"), //this command actls as MES but rints info into LOG file either SQL/TXT [Lupus] BUILDIN_DEF(summon,"si??"), // summons a slave monster [Celest] BUILDIN_DEF(isnight,""), // check whether it is night time [Celest] BUILDIN_DEF(isequipped,"i*"), // check whether another item/card has been equipped [Celest] @@ -24597,6 +24686,10 @@ void script_hardcoded_constants(void) script->set_constant("DATATYPE_VAR", DATATYPE_VAR, false, false); script->set_constant("DATATYPE_LABEL", DATATYPE_LABEL, false, false); + script->constdb_comment("Logmes types"); + script->set_constant("LOGMES_NPC", LOGMES_NPC, false, false); + script->set_constant("LOGMES_ATCOMMAND", LOGMES_ATCOMMAND, false, false); + script->constdb_comment("Item Subtypes (Weapon types)"); script->set_constant("W_FIST", W_FIST, false, false); script->set_constant("W_DAGGER", W_DAGGER, false, false); @@ -24648,6 +24741,13 @@ void script_hardcoded_constants(void) script->set_constant("DRESSROOM_OPEN", DRESSROOM_OPEN, false, false); script->set_constant("DRESSROOM_CLOSE", DRESSROOM_CLOSE, false, false); + script->constdb_comment("getmapinfo options"); + script->set_constant("MAPINFO_NAME", MAPINFO_NAME, false, false); + script->set_constant("MAPINFO_ID", MAPINFO_ID, false, false); + script->set_constant("MAPINFO_SIZE_X", MAPINFO_SIZE_X, false, false); + script->set_constant("MAPINFO_SIZE_Y", MAPINFO_SIZE_Y, false, false); + script->set_constant("MAPINFO_ZONE", MAPINFO_ZONE, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); diff --git a/src/map/skill.c b/src/map/skill.c index 967832766..726deaa9a 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, diff --git a/src/map/unit.c b/src/map/unit.c index 00c78054b..0b5b21caf 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -474,7 +474,7 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) ud->to_x = bl->x; ud->to_y = bl->y; - if(battle_config.official_cell_stack_limit && map->count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) { + if (battle_config.official_cell_stack_limit && map->count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 0x1 | 0x2) > battle_config.official_cell_stack_limit) { //Walked on occupied cell, call unit_walktoxy again if(ud->steptimer != INVALID_TIMER) { //Execute step timer on next step instead diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index cbd11e1b8..d6ce83912 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1180,8 +1180,8 @@ typedef void (*HPMHOOK_pre_clif_viewequip_ack) (struct map_session_data **sd, st typedef void (*HPMHOOK_post_clif_viewequip_ack) (struct map_session_data *sd, struct map_session_data *tsd); typedef void (*HPMHOOK_pre_clif_equpcheckbox) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_equpcheckbox) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_displayexp) (struct map_session_data **sd, unsigned int *exp, char *type, bool *is_quest); -typedef void (*HPMHOOK_post_clif_displayexp) (struct map_session_data *sd, unsigned int exp, char type, bool is_quest); +typedef void (*HPMHOOK_pre_clif_displayexp) (struct map_session_data **sd, uint64 *exp, char *type, bool *is_quest); +typedef void (*HPMHOOK_post_clif_displayexp) (struct map_session_data *sd, uint64 exp, char type, bool is_quest); typedef void (*HPMHOOK_pre_clif_font) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_font) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_progressbar) (struct map_session_data **sd, unsigned int *color, unsigned int *second); @@ -2260,6 +2260,8 @@ typedef void (*HPMHOOK_pre_clif_rodex_send_maillist) (int *fd, struct map_sessio typedef void (*HPMHOOK_post_clif_rodex_send_maillist) (int fd, struct map_session_data *sd, int8 open_type, int64 page_start); typedef void (*HPMHOOK_pre_clif_rodex_send_refresh) (int *fd, struct map_session_data **sd, int8 *open_type, int *count); typedef void (*HPMHOOK_post_clif_rodex_send_refresh) (int fd, struct map_session_data *sd, int8 open_type, int count); +typedef void (*HPMHOOK_pre_clif_rodex_send_mails_all) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_rodex_send_mails_all) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pRodexReadMail) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pRodexReadMail) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_rodex_read_mail) (struct map_session_data **sd, int8 *opentype, struct rodex_message **msg); @@ -2508,8 +2510,8 @@ typedef int (*HPMHOOK_pre_guild_getindex) (const struct guild **g, int *account_ typedef int (*HPMHOOK_post_guild_getindex) (int retVal___, const struct guild *g, int account_id, int char_id); typedef int (*HPMHOOK_pre_guild_getposition) (struct guild **g, struct map_session_data **sd); typedef int (*HPMHOOK_post_guild_getposition) (int retVal___, struct guild *g, struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_guild_payexp) (struct map_session_data **sd, unsigned int *exp); -typedef unsigned int (*HPMHOOK_post_guild_payexp) (unsigned int retVal___, struct map_session_data *sd, unsigned int exp); +typedef uint64 (*HPMHOOK_pre_guild_payexp) (struct map_session_data **sd, uint64 *exp); +typedef uint64 (*HPMHOOK_post_guild_payexp) (uint64 retVal___, struct map_session_data *sd, uint64 exp); typedef int (*HPMHOOK_pre_guild_getexp) (struct map_session_data **sd, int *exp); typedef int (*HPMHOOK_post_guild_getexp) (int retVal___, struct map_session_data *sd, int exp); typedef int (*HPMHOOK_pre_guild_create) (struct map_session_data **sd, const char **name); @@ -5418,16 +5420,16 @@ typedef int (*HPMHOOK_pre_pc_checkbaselevelup) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_checkbaselevelup) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_checkjoblevelup) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_checkjoblevelup) (int retVal___, struct map_session_data *sd); -typedef bool (*HPMHOOK_pre_pc_gainexp) (struct map_session_data **sd, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest); -typedef bool (*HPMHOOK_post_pc_gainexp) (bool retVal___, struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest); -typedef unsigned int (*HPMHOOK_pre_pc_nextbaseexp) (const struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_nextbaseexp) (unsigned int retVal___, const struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_thisbaseexp) (const struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_thisbaseexp) (unsigned int retVal___, const struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_nextjobexp) (const struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_nextjobexp) (unsigned int retVal___, const struct map_session_data *sd); -typedef unsigned int (*HPMHOOK_pre_pc_thisjobexp) (const struct map_session_data **sd); -typedef unsigned int (*HPMHOOK_post_pc_thisjobexp) (unsigned int retVal___, const struct map_session_data *sd); +typedef bool (*HPMHOOK_pre_pc_gainexp) (struct map_session_data **sd, struct block_list **src, uint64 *base_exp, uint64 *job_exp, bool *is_quest); +typedef bool (*HPMHOOK_post_pc_gainexp) (bool retVal___, struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest); +typedef uint64 (*HPMHOOK_pre_pc_nextbaseexp) (const struct map_session_data **sd); +typedef uint64 (*HPMHOOK_post_pc_nextbaseexp) (uint64 retVal___, const struct map_session_data *sd); +typedef uint64 (*HPMHOOK_pre_pc_thisbaseexp) (const struct map_session_data **sd); +typedef uint64 (*HPMHOOK_post_pc_thisbaseexp) (uint64 retVal___, const struct map_session_data *sd); +typedef uint64 (*HPMHOOK_pre_pc_nextjobexp) (const struct map_session_data **sd); +typedef uint64 (*HPMHOOK_post_pc_nextjobexp) (uint64 retVal___, const struct map_session_data *sd); +typedef uint64 (*HPMHOOK_pre_pc_thisjobexp) (const struct map_session_data **sd); +typedef uint64 (*HPMHOOK_post_pc_thisjobexp) (uint64 retVal___, const struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_gets_status_point) (int *level); typedef int (*HPMHOOK_post_pc_gets_status_point) (int retVal___, int level); typedef int (*HPMHOOK_pre_pc_need_status_point) (struct map_session_data **sd, int *type, int *val); @@ -5634,8 +5636,8 @@ typedef int (*HPMHOOK_pre_pc_bonus_addeff_onskill) (struct s_addeffectonskill ** typedef int (*HPMHOOK_post_pc_bonus_addeff_onskill) (int retVal___, struct s_addeffectonskill *effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target); typedef int (*HPMHOOK_pre_pc_bonus_item_drop) (struct s_add_drop **drop, const short *max, short *id, short *group, int *race, int *rate); typedef int (*HPMHOOK_post_pc_bonus_item_drop) (int retVal___, struct s_add_drop *drop, const short max, short id, short group, int race, int rate); -typedef void (*HPMHOOK_pre_pc_calcexp) (struct map_session_data **sd, unsigned int **base_exp, unsigned int **job_exp, struct block_list **src); -typedef void (*HPMHOOK_post_pc_calcexp) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src); +typedef void (*HPMHOOK_pre_pc_calcexp) (struct map_session_data **sd, uint64 **base_exp, uint64 **job_exp, struct block_list **src); +typedef void (*HPMHOOK_post_pc_calcexp) (struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src); typedef int (*HPMHOOK_pre_pc_respawn_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_pc_respawn_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef int (*HPMHOOK_pre_pc_jobchange_killclone) (struct block_list **bl, va_list ap); @@ -5892,8 +5894,8 @@ typedef void (*HPMHOOK_pre_rodex_final) (void); typedef void (*HPMHOOK_post_rodex_final) (void); typedef bool (*HPMHOOK_pre_rodex_isenabled) (void); typedef bool (*HPMHOOK_post_rodex_isenabled) (bool retVal___); -typedef void (*HPMHOOK_pre_rodex_open) (struct map_session_data **sd, int8 *open_type); -typedef void (*HPMHOOK_post_rodex_open) (struct map_session_data *sd, int8 open_type); +typedef void (*HPMHOOK_pre_rodex_open) (struct map_session_data **sd, int8 *open_type, int64 *first_mail_id); +typedef void (*HPMHOOK_post_rodex_open) (struct map_session_data *sd, int8 open_type, int64 first_mail_id); typedef void (*HPMHOOK_pre_rodex_next_page) (struct map_session_data **sd, int8 *open_type, int64 *last_mail_id); typedef void (*HPMHOOK_post_rodex_next_page) (struct map_session_data *sd, int8 open_type, int64 last_mail_id); typedef void (*HPMHOOK_pre_rodex_refresh) (struct map_session_data **sd, int8 *open_type, int64 *first_mail_id); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index e2494067c..4bdc167f2 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1896,6 +1896,8 @@ struct { struct HPMHookPoint *HP_clif_rodex_send_maillist_post; struct HPMHookPoint *HP_clif_rodex_send_refresh_pre; struct HPMHookPoint *HP_clif_rodex_send_refresh_post; + struct HPMHookPoint *HP_clif_rodex_send_mails_all_pre; + struct HPMHookPoint *HP_clif_rodex_send_mails_all_post; struct HPMHookPoint *HP_clif_pRodexReadMail_pre; struct HPMHookPoint *HP_clif_pRodexReadMail_post; struct HPMHookPoint *HP_clif_rodex_read_mail_pre; @@ -8093,6 +8095,8 @@ struct { int HP_clif_rodex_send_maillist_post; int HP_clif_rodex_send_refresh_pre; int HP_clif_rodex_send_refresh_post; + int HP_clif_rodex_send_mails_all_pre; + int HP_clif_rodex_send_mails_all_post; int HP_clif_pRodexReadMail_pre; int HP_clif_pRodexReadMail_post; int HP_clif_rodex_read_mail_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index b094fa841..34b79bff8 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -970,6 +970,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->rodex_send_mail_result, HP_clif_rodex_send_mail_result) }, { HP_POP(clif->rodex_send_maillist, HP_clif_rodex_send_maillist) }, { HP_POP(clif->rodex_send_refresh, HP_clif_rodex_send_refresh) }, + { HP_POP(clif->rodex_send_mails_all, HP_clif_rodex_send_mails_all) }, { HP_POP(clif->pRodexReadMail, HP_clif_pRodexReadMail) }, { HP_POP(clif->rodex_read_mail, HP_clif_rodex_read_mail) }, { HP_POP(clif->pRodexNextMaillist, HP_clif_pRodexNextMaillist) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 786536aea..d0d062f4e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -10602,10 +10602,10 @@ void HP_clif_equpcheckbox(struct map_session_data *sd) { } return; } -void HP_clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool is_quest) { +void HP_clif_displayexp(struct map_session_data *sd, uint64 exp, char type, bool is_quest) { int hIndex = 0; if (HPMHooks.count.HP_clif_displayexp_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, unsigned int *exp, char *type, bool *is_quest); + void (*preHookFunc) (struct map_session_data **sd, uint64 *exp, char *type, bool *is_quest); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_displayexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_displayexp_pre[hIndex].func; @@ -10620,7 +10620,7 @@ void HP_clif_displayexp(struct map_session_data *sd, unsigned int exp, char type HPMHooks.source.clif.displayexp(sd, exp, type, is_quest); } if (HPMHooks.count.HP_clif_displayexp_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, unsigned int exp, char type, bool is_quest); + void (*postHookFunc) (struct map_session_data *sd, uint64 exp, char type, bool is_quest); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_displayexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_displayexp_post[hIndex].func; postHookFunc(sd, exp, type, is_quest); @@ -24671,6 +24671,32 @@ void HP_clif_rodex_send_refresh(int fd, struct map_session_data *sd, int8 open_t } return; } +void HP_clif_rodex_send_mails_all(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_rodex_send_mails_all_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rodex_send_mails_all_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_rodex_send_mails_all_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.rodex_send_mails_all(fd, sd); + } + if (HPMHooks.count.HP_clif_rodex_send_mails_all_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rodex_send_mails_all_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_rodex_send_mails_all_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} void HP_clif_pRodexReadMail(int fd, struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_pRodexReadMail_pre > 0) { @@ -27645,11 +27671,11 @@ int HP_guild_getposition(struct guild *g, struct map_session_data *sd) { } return retVal___; } -unsigned int HP_guild_payexp(struct map_session_data *sd, unsigned int exp) { +uint64 HP_guild_payexp(struct map_session_data *sd, uint64 exp) { int hIndex = 0; - unsigned int retVal___ = 0; + uint64 retVal___ = 0; if (HPMHooks.count.HP_guild_payexp_pre > 0) { - unsigned int (*preHookFunc) (struct map_session_data **sd, unsigned int *exp); + uint64 (*preHookFunc) (struct map_session_data **sd, uint64 *exp); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_payexp_pre[hIndex].func; @@ -27664,7 +27690,7 @@ unsigned int HP_guild_payexp(struct map_session_data *sd, unsigned int exp) { retVal___ = HPMHooks.source.guild.payexp(sd, exp); } if (HPMHooks.count.HP_guild_payexp_post > 0) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, unsigned int exp); + uint64 (*postHookFunc) (uint64 retVal___, struct map_session_data *sd, uint64 exp); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_payexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, exp); @@ -55930,11 +55956,11 @@ int HP_pc_checkjoblevelup(struct map_session_data *sd) { } return retVal___; } -bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest) { +bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest) { int hIndex = 0; bool retVal___ = false; if (HPMHooks.count.HP_pc_gainexp_pre > 0) { - bool (*preHookFunc) (struct map_session_data **sd, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest); + bool (*preHookFunc) (struct map_session_data **sd, struct block_list **src, uint64 *base_exp, uint64 *job_exp, bool *is_quest); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_gainexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_gainexp_pre[hIndex].func; @@ -55949,7 +55975,7 @@ bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned retVal___ = HPMHooks.source.pc.gainexp(sd, src, base_exp, job_exp, is_quest); } if (HPMHooks.count.HP_pc_gainexp_post > 0) { - bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest); + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_gainexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_gainexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, src, base_exp, job_exp, is_quest); @@ -55957,11 +55983,11 @@ bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned } return retVal___; } -unsigned int HP_pc_nextbaseexp(const struct map_session_data *sd) { +uint64 HP_pc_nextbaseexp(const struct map_session_data *sd) { int hIndex = 0; - unsigned int retVal___ = 0; + uint64 retVal___ = 0; if (HPMHooks.count.HP_pc_nextbaseexp_pre > 0) { - unsigned int (*preHookFunc) (const struct map_session_data **sd); + uint64 (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_nextbaseexp_pre[hIndex].func; @@ -55976,7 +56002,7 @@ unsigned int HP_pc_nextbaseexp(const struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.nextbaseexp(sd); } if (HPMHooks.count.HP_pc_nextbaseexp_post > 0) { - unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); + uint64 (*postHookFunc) (uint64 retVal___, const struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_nextbaseexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -55984,11 +56010,11 @@ unsigned int HP_pc_nextbaseexp(const struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_thisbaseexp(const struct map_session_data *sd) { +uint64 HP_pc_thisbaseexp(const struct map_session_data *sd) { int hIndex = 0; - unsigned int retVal___ = 0; + uint64 retVal___ = 0; if (HPMHooks.count.HP_pc_thisbaseexp_pre > 0) { - unsigned int (*preHookFunc) (const struct map_session_data **sd); + uint64 (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_thisbaseexp_pre[hIndex].func; @@ -56003,7 +56029,7 @@ unsigned int HP_pc_thisbaseexp(const struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.thisbaseexp(sd); } if (HPMHooks.count.HP_pc_thisbaseexp_post > 0) { - unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); + uint64 (*postHookFunc) (uint64 retVal___, const struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_thisbaseexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -56011,11 +56037,11 @@ unsigned int HP_pc_thisbaseexp(const struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_nextjobexp(const struct map_session_data *sd) { +uint64 HP_pc_nextjobexp(const struct map_session_data *sd) { int hIndex = 0; - unsigned int retVal___ = 0; + uint64 retVal___ = 0; if (HPMHooks.count.HP_pc_nextjobexp_pre > 0) { - unsigned int (*preHookFunc) (const struct map_session_data **sd); + uint64 (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_nextjobexp_pre[hIndex].func; @@ -56030,7 +56056,7 @@ unsigned int HP_pc_nextjobexp(const struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.nextjobexp(sd); } if (HPMHooks.count.HP_pc_nextjobexp_post > 0) { - unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); + uint64 (*postHookFunc) (uint64 retVal___, const struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_nextjobexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -56038,11 +56064,11 @@ unsigned int HP_pc_nextjobexp(const struct map_session_data *sd) { } return retVal___; } -unsigned int HP_pc_thisjobexp(const struct map_session_data *sd) { +uint64 HP_pc_thisjobexp(const struct map_session_data *sd) { int hIndex = 0; - unsigned int retVal___ = 0; + uint64 retVal___ = 0; if (HPMHooks.count.HP_pc_thisjobexp_pre > 0) { - unsigned int (*preHookFunc) (const struct map_session_data **sd); + uint64 (*preHookFunc) (const struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_thisjobexp_pre[hIndex].func; @@ -56057,7 +56083,7 @@ unsigned int HP_pc_thisjobexp(const struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.thisjobexp(sd); } if (HPMHooks.count.HP_pc_thisjobexp_post > 0) { - unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd); + uint64 (*postHookFunc) (uint64 retVal___, const struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_thisjobexp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -58826,10 +58852,10 @@ int HP_pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, sh } return retVal___; } -void HP_pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src) { +void HP_pc_calcexp(struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src) { int hIndex = 0; if (HPMHooks.count.HP_pc_calcexp_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, unsigned int **base_exp, unsigned int **job_exp, struct block_list **src); + void (*preHookFunc) (struct map_session_data **sd, uint64 **base_exp, uint64 **job_exp, struct block_list **src); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcexp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_calcexp_pre[hIndex].func; @@ -58844,7 +58870,7 @@ void HP_pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned HPMHooks.source.pc.calcexp(sd, base_exp, job_exp, src); } if (HPMHooks.count.HP_pc_calcexp_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src); + void (*postHookFunc) (struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcexp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_calcexp_post[hIndex].func; postHookFunc(sd, base_exp, job_exp, src); @@ -61893,14 +61919,14 @@ bool HP_rodex_isenabled(void) { } return retVal___; } -void HP_rodex_open(struct map_session_data *sd, int8 open_type) { +void HP_rodex_open(struct map_session_data *sd, int8 open_type, int64 first_mail_id) { int hIndex = 0; if (HPMHooks.count.HP_rodex_open_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int8 *open_type); + void (*preHookFunc) (struct map_session_data **sd, int8 *open_type, int64 *first_mail_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_open_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_rodex_open_pre[hIndex].func; - preHookFunc(&sd, &open_type); + preHookFunc(&sd, &open_type, &first_mail_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -61908,13 +61934,13 @@ void HP_rodex_open(struct map_session_data *sd, int8 open_type) { } } { - HPMHooks.source.rodex.open(sd, open_type); + HPMHooks.source.rodex.open(sd, open_type, first_mail_id); } if (HPMHooks.count.HP_rodex_open_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int8 open_type); + void (*postHookFunc) (struct map_session_data *sd, int8 open_type, int64 first_mail_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_open_post; hIndex++) { postHookFunc = HPMHooks.list.HP_rodex_open_post[hIndex].func; - postHookFunc(sd, open_type); + postHookFunc(sd, open_type, first_mail_id); } } return; |