summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-04-17 05:56:31 +0200
committerGitHub <noreply@github.com>2019-04-17 05:56:31 +0200
commit0013040c4ed763eb4359a56ee106449fea5f2a83 (patch)
tree318eb5428ce91b1ee31662aaf3c6ef3e9084a603
parentab81d4012eac5c2c00c485971fc9b89bf69761be (diff)
parent9ae815c3a8768f1eddd89b365d64526a6a8ecd48 (diff)
downloadhercules-0013040c4ed763eb4359a56ee106449fea5f2a83.tar.gz
hercules-0013040c4ed763eb4359a56ee106449fea5f2a83.tar.bz2
hercules-0013040c4ed763eb4359a56ee106449fea5f2a83.tar.xz
hercules-0013040c4ed763eb4359a56ee106449fea5f2a83.zip
Merge pull request #2437 from 4144/rodexfixes
Different rodex fixes
-rw-r--r--src/char/int_rodex.c136
-rw-r--r--src/char/int_rodex.h4
-rw-r--r--src/char/inter.c2
-rw-r--r--src/char/mapif.c34
-rw-r--r--src/char/mapif.h3
-rw-r--r--src/common/HPMDataCheck.h1
-rw-r--r--src/common/mmo.h10
-rw-r--r--src/map/intif.c50
-rw-r--r--src/map/intif.h4
-rw-r--r--src/map/rodex.c94
-rw-r--r--src/map/rodex.h2
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc24
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc16
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc118
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc16
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc116
18 files changed, 561 insertions, 77 deletions
diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c
index 5725c3777..ffa5f5452 100644
--- a/src/char/int_rodex.c
+++ b/src/char/int_rodex.c
@@ -346,11 +346,128 @@ static int64 inter_rodex_savemessage(struct rodex_message *msg)
return msg->id;
}
+static int64 inter_rodex_getzeny(int64 mail_id)
+{
+ Assert_retr(-1, mail_id > 0);
+
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `zeny`, `type` FROM `%s` WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id)) {
+ Sql_ShowDebug(inter->sql_handle);
+ } else {
+ if (SQL_SUCCESS == SQL->NextRow(inter->sql_handle)) {
+ char *data;
+ SQL->GetData(inter->sql_handle, 0, &data, NULL);
+ int64 zeny = atoi(data);
+ SQL->GetData(inter->sql_handle, 1, &data, NULL);
+ uint8 type = atoi(data);
+ SQL->FreeResult(inter->sql_handle);
+ if ((type & MAIL_TYPE_ZENY) == 0)
+ return -1;
+ return zeny;
+ }
+ }
+ SQL->FreeResult(inter->sql_handle);
+
+ return -1;
+}
+
+static int inter_rodex_getitems(int64 mail_id, struct rodex_item *items)
+{
+ Assert_retr(-1, mail_id > 0);
+ nullpo_retr(-1, items);
+
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `type` FROM `%s` WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id)) {
+ Sql_ShowDebug(inter->sql_handle);
+ return -1;
+ } else {
+ if (SQL_SUCCESS == SQL->NextRow(inter->sql_handle)) {
+ char *data;
+ SQL->GetData(inter->sql_handle, 0, &data, NULL);
+ uint8 type = atoi(data);
+ SQL->FreeResult(inter->sql_handle);
+ if ((type & MAIL_TYPE_ITEM) == 0)
+ return -1;
+ } else {
+ SQL->FreeResult(inter->sql_handle);
+ return -1;
+ }
+ }
+
+
+ int itemsCount = 0;
+
+ struct SqlStmt *stmt_items = SQL->StmtMalloc(inter->sql_handle);
+
+ if (stmt_items == NULL) {
+ return -1;
+ }
+
+ StringBuf buf;
+ StrBuf->Init(&buf);
+
+ StrBuf->AppendStr(&buf, "SELECT `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`");
+ for (int i = 0; i < MAX_SLOTS; i++) {
+ StrBuf->Printf(&buf, ", `card%d`", i);
+ }
+ for (int i = 0; i < MAX_ITEM_OPTIONS; i++) {
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", i, i);
+ }
+ StrBuf->Printf(&buf, "FROM `%s` WHERE mail_id = ? ORDER BY `mail_id` ASC", rodex_item_db);
+
+ struct item it = { 0 };
+
+ if (SQL_ERROR == SQL->StmtPrepareStr(stmt_items, StrBuf->Value(&buf))
+ || SQL_ERROR == SQL->StmtBindParam(stmt_items, 0, SQLDT_INT64, &mail_id, sizeof mail_id)
+ ) {
+ SqlStmt_ShowDebug(stmt_items);
+ }
+
+ if (SQL_ERROR == SQL->StmtExecute(stmt_items)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 0, SQLDT_INT, &it.nameid, sizeof it.nameid, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 1, SQLDT_SHORT, &it.amount, sizeof it.amount, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 2, SQLDT_UINT, &it.equip, sizeof it.equip, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 3, SQLDT_CHAR, &it.identify, sizeof it.identify, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 4, SQLDT_CHAR, &it.refine, sizeof it.refine, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 5, SQLDT_CHAR, &it.attribute, sizeof it.attribute, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 6, SQLDT_UINT, &it.expire_time, sizeof it.expire_time, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 7, SQLDT_UCHAR, &it.bound, sizeof it.bound, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 8, SQLDT_UINT64, &it.unique_id, sizeof it.unique_id, NULL, NULL)
+ ) {
+ SqlStmt_ShowDebug(stmt_items);
+ }
+ for (int i = 0; i < MAX_SLOTS; i++) {
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + i, SQLDT_INT, &it.card[i], sizeof it.card[i], NULL, NULL))
+ SqlStmt_ShowDebug(stmt_items);
+ }
+ for (int i = 0; i < MAX_ITEM_OPTIONS; i++) {
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + MAX_SLOTS + i * 2, SQLDT_INT16, &it.option[i].index, sizeof it.option[i].index, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 10 + MAX_SLOTS + i * 2, SQLDT_INT16, &it.option[i].value, sizeof it.option[i].value, NULL, NULL)
+ ) {
+ SqlStmt_ShowDebug(stmt_items);
+ }
+ }
+
+ for (int i = 0; i < RODEX_MAX_ITEM && SQL_SUCCESS == SQL->StmtNextRow(stmt_items); ++i) {
+ items[i].item = it;
+ items[i].idx = itemsCount;
+ itemsCount++;
+ }
+
+ SQL->StmtFreeResult(stmt_items);
+
+ StrBuf->Destroy(&buf);
+ SQL->StmtFree(stmt_items);
+
+ return itemsCount;
+}
+
/*==========================================
* Update/Delete mail
*------------------------------------------*/
-static bool inter_rodex_updatemail(int64 mail_id, int8 flag)
+static bool inter_rodex_updatemail(int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag)
{
+ Assert_retr(false, fd >= 0);
+ Assert_retr(false, account_id > 0);
+ Assert_retr(false, char_id > 0);
Assert_retr(false, mail_id > 0);
Assert_retr(false, flag >= 0 && flag <= 4);
@@ -361,17 +478,26 @@ static bool inter_rodex_updatemail(int64 mail_id, int8 flag)
break;
case 1: // Get Zeny
- if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `zeny` = 0, `type` = `type` & (~2) WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id))
+ {
+ const int64 zeny = inter_rodex->getzeny(mail_id);
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `zeny` = 0, `type` = `type` & (~2) WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id)) {
Sql_ShowDebug(inter->sql_handle);
+ break;
+ }
+ mapif->rodex_getzenyack(fd, char_id, mail_id, opentype, zeny);
break;
-
+ }
case 2: // Get Items
+ {
+ struct rodex_item items[RODEX_MAX_ITEM];
+ const int count = inter_rodex->getitems(mail_id, &items[0]);
if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `mail_id` = '%"PRId64"'", rodex_item_db, mail_id))
Sql_ShowDebug(inter->sql_handle);
if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `zeny` = 0, `type` = `type` & (~4) WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id))
Sql_ShowDebug(inter->sql_handle);
+ mapif->rodex_getitemsack(fd, char_id, mail_id, opentype, count, &items[0]);
break;
-
+ }
case 3: // Delete Mail
if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `mail_id` = '%"PRId64"'", rodex_db, mail_id))
Sql_ShowDebug(inter->sql_handle);
@@ -429,4 +555,6 @@ void inter_rodex_defaults(void)
inter_rodex->hasnew = inter_rodex_hasnew;
inter_rodex->checkname = inter_rodex_checkname;
inter_rodex->updatemail = inter_rodex_updatemail;
+ inter_rodex->getzeny = inter_rodex_getzeny;
+ inter_rodex->getitems = inter_rodex_getitems;
}
diff --git a/src/char/int_rodex.h b/src/char/int_rodex.h
index 7fae77d8d..a6a172ceb 100644
--- a/src/char/int_rodex.h
+++ b/src/char/int_rodex.h
@@ -36,7 +36,9 @@ struct inter_rodex_interface {
bool (*hasnew) (int char_id, int account_id);
bool (*checkname) (const char *name, int *target_char_id, int *target_class, int *target_level);
int64 (*savemessage) (struct rodex_message* msg);
- bool (*updatemail) (int64 mail_id, int8 flag);
+ bool (*updatemail) (int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag);
+ int64 (*getzeny) (int64 mail_id);
+ int (*getitems) (int64 mail_id, struct rodex_item *items);
};
#ifdef HERCULES_CORE
diff --git a/src/char/inter.c b/src/char/inter.c
index 1f1750e32..64c840c16 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -79,7 +79,7 @@ static int inter_recv_packet_length[] = {
6,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3060- Quest system [Kevin] [Inkfish]
-1,10, 6,-1, 0, 0, 0, 0, 0, 0, 0, 0, -1,10, 6,-1, // 3070- Mercenary packets [Zephyrus], Elemental packets [pakpil]
56,14,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3080-
- -1,10,-1, 6, 0, 20,10,11, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets
+ -1,10,-1, 6, 0, 20,10,20, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets
};
static struct DBMap *wis_db = NULL; // int wis_id -> struct WisData*
diff --git a/src/char/mapif.c b/src/char/mapif.c
index fb904a46d..8f213ecb5 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -1744,10 +1744,13 @@ static void mapif_rodex_sendhasnew(int fd, int char_id, bool has_new)
*------------------------------------------*/
static void mapif_parse_rodex_updatemail(int fd)
{
- int64 mail_id = RFIFOL(fd, 2);
- int8 flag = RFIFOB(fd, 10);
+ int account_id = RFIFOL(fd, 2);
+ int char_id = RFIFOL(fd, 6);
+ int64 mail_id = RFIFOQ(fd, 10);
+ uint8 opentype = RFIFOB(fd, 18);
+ int8 flag = RFIFOB(fd, 19);
- inter_rodex->updatemail(mail_id, flag);
+ inter_rodex->updatemail(fd, account_id, char_id, mail_id, opentype, flag);
}
/*==========================================
@@ -2461,6 +2464,29 @@ static void mapif_achievement_save(int char_id, struct char_achievements *p)
inter_achievement->tosql(char_id, cp, p);
}
+static void mapif_rodex_getzenyack(int fd, int char_id, int64 mail_id, uint8 opentype, int64 zeny)
+{
+ WFIFOHEAD(fd, 23);
+ WFIFOW(fd, 0) = 0x3899;
+ WFIFOL(fd, 2) = char_id;
+ WFIFOQ(fd, 6) = zeny;
+ WFIFOQ(fd, 14) = mail_id;
+ WFIFOB(fd, 22) = opentype;
+ WFIFOSET(fd, 23);
+}
+
+static void mapif_rodex_getitemsack(int fd, int char_id, int64 mail_id, uint8 opentype, int count, const struct rodex_item *items)
+{
+ WFIFOHEAD(fd, 15 + sizeof(struct rodex_item) * RODEX_MAX_ITEM);
+ WFIFOW(fd, 0) = 0x389a;
+ WFIFOL(fd, 2) = char_id;
+ WFIFOQ(fd, 6) = mail_id;
+ WFIFOB(fd, 14) = opentype;
+ WFIFOB(fd, 15) = count;
+ memcpy(WFIFOP(fd, 16), items, sizeof(struct rodex_item) * RODEX_MAX_ITEM);
+ WFIFOSET(fd, 16 + sizeof(struct rodex_item) * RODEX_MAX_ITEM);
+}
+
void mapif_defaults(void)
{
mapif = &mapif_s;
@@ -2605,6 +2631,8 @@ void mapif_defaults(void)
mapif->rodex_send = mapif_rodex_send;
mapif->parse_rodex_checkname = mapif_parse_rodex_checkname;
mapif->rodex_checkname = mapif_rodex_checkname;
+ mapif->rodex_getzenyack = mapif_rodex_getzenyack;
+ mapif->rodex_getitemsack = mapif_rodex_getitemsack;
mapif->load_guild_storage = mapif_load_guild_storage;
mapif->save_guild_storage_ack = mapif_save_guild_storage_ack;
mapif->parse_LoadGuildStorage = mapif_parse_LoadGuildStorage;
diff --git a/src/char/mapif.h b/src/char/mapif.h
index f57748ac6..71a41f94c 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -24,6 +24,7 @@
#include "common/mmo.h"
struct WisData;
+struct rodex_item;
/**
* mapif interface
@@ -168,6 +169,8 @@ struct mapif_interface {
void (*rodex_send) (int fd, int sender_id, int receiver_id, int receiver_accountid, bool result);
void (*parse_rodex_checkname) (int fd);
void (*rodex_checkname) (int fd, int reqchar_id, int target_char_id, int target_class, int target_level, char *name);
+ void (*rodex_getzenyack) (int fd, int char_id, int64 mail_id, uint8 opentype, int64 zeny);
+ void (*rodex_getitemsack) (int fd, int char_id, int64 mail_id, uint8 opentype, int count, const struct rodex_item *items);
int (*load_guild_storage) (int fd, int account_id, int guild_id, char flag);
int (*save_guild_storage_ack) (int fd, int account_id, int guild_id, int fail);
int (*parse_LoadGuildStorage) (int fd);
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 57b57c345..2e961bff6 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -230,6 +230,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "party_member", sizeof(struct party_member), SERVER_TYPE_ALL },
{ "point", sizeof(struct point), SERVER_TYPE_ALL },
{ "quest", sizeof(struct quest), SERVER_TYPE_ALL },
+ { "rodex_item", sizeof(struct rodex_item), SERVER_TYPE_ALL },
{ "rodex_maillist", sizeof(struct rodex_maillist), SERVER_TYPE_ALL },
{ "rodex_message", sizeof(struct rodex_message), SERVER_TYPE_ALL },
{ "s_elemental", sizeof(struct s_elemental), SERVER_TYPE_ALL },
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 2fc464243..a29b0f2db 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -978,6 +978,11 @@ enum fame_list_type {
RANKTYPE_PK = 3, //Not supported yet
};
+struct rodex_item {
+ struct item item;
+ int idx;
+};
+
struct rodex_message {
int64 id;
int sender_id;
@@ -987,10 +992,7 @@ struct rodex_message {
char receiver_name[NAME_LENGTH];
char title[RODEX_TITLE_LENGTH];
char body[RODEX_BODY_LENGTH];
- struct {
- struct item item;
- int idx;
- } items[RODEX_MAX_ITEM];
+ struct rodex_item items[RODEX_MAX_ITEM];
int64 zeny;
uint8 type;
int8 opentype;
diff --git a/src/map/intif.c b/src/map/intif.c
index 86bf07bce..e25f56b63 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -2754,16 +2754,21 @@ static void intif_parse_RodexNotifications(int fd)
/// 2 - user got Items
/// 3 - delete
/// 4 - sender Read (returned mail)
-static int intif_rodex_updatemail(int64 mail_id, int8 flag)
+static int intif_rodex_updatemail(struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag)
{
+ nullpo_ret(sd);
+
if (intif->CheckForCharServer())
return 0;
- WFIFOHEAD(inter_fd, 11);
+ WFIFOHEAD(inter_fd, 20);
WFIFOW(inter_fd, 0) = 0x3097;
- WFIFOQ(inter_fd, 2) = mail_id;
- WFIFOB(inter_fd, 10) = flag;
- WFIFOSET(inter_fd, 11);
+ WFIFOL(inter_fd, 2) = sd->status.account_id;
+ WFIFOL(inter_fd, 6) = sd->status.char_id;
+ WFIFOQ(inter_fd, 10) = mail_id;
+ WFIFOB(inter_fd, 18) = opentype;
+ WFIFOB(inter_fd, 19) = flag;
+ WFIFOSET(inter_fd, 20);
return 0;
}
@@ -2855,6 +2860,35 @@ static void intif_parse_RodexCheckName(int fd)
clif->rodex_checkname_result(sd, target_char_id, target_class, target_level, name);
}
+static void intif_parse_GetZenyAck(int fd)
+{
+ int char_id = RFIFOL(fd, 2);
+ int64 zeny = RFIFOL(fd, 6);
+ int64 mail_id = RFIFOQ(fd, 14);
+ uint8 opentype = RFIFOB(fd, 22);
+ struct map_session_data *sd = map->charid2sd(char_id);
+
+ if (sd == NULL) // User is not online anymore
+ return;
+ rodex->getZenyAck(sd, mail_id, opentype, zeny);
+}
+
+static void intif_parse_GetItemsAck(int fd)
+{
+ int char_id = RFIFOL(fd, 2);
+
+ struct map_session_data *sd = map->charid2sd(char_id);
+ if (sd == NULL) // User is not online anymore
+ return;
+
+ int64 mail_id = RFIFOQ(fd, 6);
+ uint8 opentype = RFIFOB(fd, 14);
+ int count = RFIFOB(fd, 15);
+ struct rodex_item items[RODEX_MAX_ITEM];
+ memcpy(&items[0], RFIFOP(fd, 16), sizeof(struct rodex_item) * RODEX_MAX_ITEM);
+ rodex->getItemsAck(sd, mail_id, opentype, count, &items[0]);
+}
+
//-----------------------------------------------------------------
// Communication from the inter server
// Return a 0 (false) if there were any errors.
@@ -2972,6 +3006,8 @@ static int intif_parse(int fd)
case 0x3896: intif->pRodexHasNew(fd); break;
case 0x3897: intif->pRodexSendMail(fd); break;
case 0x3898: intif->pRodexCheckName(fd); break;
+ case 0x3899: intif->pGetZenyAck(fd); break;
+ case 0x389a: intif->pGetItemsAck(fd); break;
// Clan System
case 0x3858: intif->pRecvClanMemberAction(fd); break;
@@ -3001,7 +3037,7 @@ void intif_defaults(void)
-1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin] [Inkfish]
-1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 3, 3, 0, //0x3870 Mercenaries [Zephyrus] / Elemental [pakpil]
14,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880
- -1,-1, 7, 3, 0,-1, 7, 15,18 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator] / RoDEX [KirieZ]
+ -1,-1, 7, 3, 0,-1, 7, 15,18 + NAME_LENGTH, 23, 16 + sizeof(struct rodex_item) * RODEX_MAX_ITEM, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator] / RoDEX [KirieZ]
};
intif = &intif_s;
@@ -3171,6 +3207,8 @@ void intif_defaults(void)
intif->pRodexHasNew = intif_parse_RodexNotifications;
intif->pRodexSendMail = intif_parse_RodexSendMail;
intif->pRodexCheckName = intif_parse_RodexCheckName;
+ intif->pGetZenyAck = intif_parse_GetZenyAck;
+ intif->pGetItemsAck = intif_parse_GetItemsAck;
/* Clan System */
intif->pRecvClanMemberAction = intif_parse_RecvClanMemberAction;
/* Achievement System */
diff --git a/src/map/intif.h b/src/map/intif.h
index 425ab1d18..8df669217 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -135,9 +135,11 @@ struct intif_interface {
// RoDEX
int(*rodex_requestinbox) (int char_id, int account_id, int8 flag, int8 opentype, int64 mail_id);
int(*rodex_checkhasnew) (struct map_session_data *sd);
- int(*rodex_updatemail) (int64 mail_id, int8 flag);
+ int(*rodex_updatemail) (struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag);
int(*rodex_sendmail) (struct rodex_message *msg);
int(*rodex_checkname) (struct map_session_data *sd, const char *name);
+ void (*pGetZenyAck) (int fd);
+ void (*pGetItemsAck) (int fd);
/* Clan System */
int (*clan_kickoffline) (int clan_id, int kick_interval);
int (*clan_membercount) (int clan_id, int kick_interval);
diff --git a/src/map/rodex.c b/src/map/rodex.c
index 33070c5f8..766fdc5ea 100644
--- a/src/map/rodex.c
+++ b/src/map/rodex.c
@@ -404,12 +404,12 @@ static void rodex_read_mail(struct map_session_data *sd, int64 mail_id)
if (msg->opentype == RODEX_OPENTYPE_RETURN) {
if (msg->sender_read == false) {
- intif->rodex_updatemail(msg->id, 4);
+ intif->rodex_updatemail(sd, msg->id, 0, 4);
msg->sender_read = true;
}
} else {
if (msg->is_read == false) {
- intif->rodex_updatemail(msg->id, 0);
+ intif->rodex_updatemail(sd, msg->id, 0, 0);
msg->is_read = true;
}
}
@@ -430,21 +430,36 @@ static void rodex_delete_mail(struct map_session_data *sd, int64 mail_id)
nullpo_retv(msg);
msg->is_deleted = true;
- intif->rodex_updatemail(msg->id, 3);
+ intif->rodex_updatemail(sd, msg->id, 0, 3);
clif->rodex_delete_mail(sd, msg->opentype, msg->id);
}
+/// give requested zeny from message to player
+static void rodex_getZenyAck(struct map_session_data *sd, int64 mail_id, int8 opentype, int64 zeny)
+{
+ nullpo_retv(sd);
+ if (zeny <= 0) {
+ clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_FATAL_ERROR);
+ return;
+ }
+
+ if (pc->getzeny(sd, (int)zeny, LOG_TYPE_MAIL, NULL) != 0) {
+ clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_FATAL_ERROR);
+ return;
+ }
+
+ clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_SUCCESS);
+}
+
/// Gets attached zeny
/// @param sd : Who's getting
/// @param mail_id : Mail ID that we're getting zeny from
static void rodex_get_zeny(struct map_session_data *sd, int8 opentype, int64 mail_id)
{
- struct rodex_message *msg;
-
nullpo_retv(sd);
- msg = rodex->get_mail(sd, mail_id);
+ struct rodex_message *msg = rodex->get_mail(sd, mail_id);
if (msg == NULL) {
clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_FATAL_ERROR);
@@ -456,16 +471,31 @@ static void rodex_get_zeny(struct map_session_data *sd, int8 opentype, int64 mai
return;
}
- if (pc->getzeny(sd, (int)msg->zeny, LOG_TYPE_MAIL, NULL) != 0) {
- clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_FATAL_ERROR);
- return;
- }
-
msg->type &= ~MAIL_TYPE_ZENY;
msg->zeny = 0;
- intif->rodex_updatemail(mail_id, 1);
+ intif->rodex_updatemail(sd, mail_id, opentype, 1);
+}
- clif->rodex_request_zeny(sd, opentype, mail_id, RODEX_GET_ZENY_SUCCESS);
+// give requested items from message to player
+static void rodex_getItemsAck(struct map_session_data *sd, int64 mail_id, int8 opentype, int count, const struct rodex_item *items)
+{
+ nullpo_retv(sd);
+ nullpo_retv(items);
+
+ for (int i = 0; i < count; ++i) {
+ const struct item *it = &items[i].item;
+
+ if (it->nameid == 0) {
+ continue;
+ }
+
+ if (pc->additem(sd, it, it->amount, LOG_TYPE_MAIL) != 0) {
+ clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEM_FULL_ERROR);
+ return;
+ }
+ }
+
+ clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEMS_SUCCESS);
}
/// Gets attached item
@@ -473,14 +503,12 @@ static void rodex_get_zeny(struct map_session_data *sd, int8 opentype, int64 mai
/// @param mail_id : Mail ID that we're getting items from
static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 mail_id)
{
- struct rodex_message *msg;
- int weight = 0;
- int empty_slots = 0, required_slots;
- int i;
-
nullpo_retv(sd);
- msg = rodex->get_mail(sd, mail_id);
+ int weight = 0;
+ int empty_slots = 0;
+
+ struct rodex_message *msg = rodex->get_mail(sd, mail_id);
if (msg == NULL) {
clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEM_FATAL_ERROR);
@@ -492,7 +520,7 @@ static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 ma
return;
}
- for (i = 0; i < RODEX_MAX_ITEM; ++i) {
+ for (int i = 0; i < RODEX_MAX_ITEM; ++i) {
if (msg->items[i].item.nameid != 0) {
weight += itemdb->search(msg->items[i].item.nameid)->weight * msg->items[i].item.amount;
}
@@ -503,8 +531,8 @@ static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 ma
return;
}
- required_slots = msg->items_count;
- for (i = 0; i < sd->status.inventorySize; ++i) {
+ int required_slots = msg->items_count;
+ for (int i = 0; i < sd->status.inventorySize; ++i) {
if (sd->status.inventory[i].nameid == 0) {
empty_slots++;
} else if (itemdb->isstackable(sd->status.inventory[i].nameid) == 1) {
@@ -529,27 +557,9 @@ static void rodex_get_items(struct map_session_data *sd, int8 opentype, int64 ma
return;
}
- for (i = 0; i < RODEX_MAX_ITEM; ++i) {
- struct item *it = &msg->items[i].item;
-
- if (it->nameid == 0) {
- continue;
- }
-
- if (pc->additem(sd, it, it->amount, LOG_TYPE_MAIL) != 0) {
- clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEM_FULL_ERROR);
- intif->rodex_updatemail(mail_id, 2);
- return;
- } else {
- memset(it, 0x0, sizeof(*it));
- }
- }
-
msg->type &= ~MAIL_TYPE_ITEM;
msg->items_count = 0;
- intif->rodex_updatemail(mail_id, 2);
-
- clif->rodex_request_items(sd, opentype, mail_id, RODEX_GET_ITEMS_SUCCESS);
+ intif->rodex_updatemail(sd, mail_id, opentype, 2);
}
/// Cleans user's RoDEX related data
@@ -668,4 +678,6 @@ void rodex_defaults(void)
rodex->get_zeny = rodex_get_zeny;
rodex->get_items = rodex_get_items;
rodex->clean = rodex_clean;
+ rodex->getZenyAck = rodex_getZenyAck;
+ rodex->getItemsAck = rodex_getItemsAck;
}
diff --git a/src/map/rodex.h b/src/map/rodex.h
index 56cc3a9d1..b6e7ca5b7 100644
--- a/src/map/rodex.h
+++ b/src/map/rodex.h
@@ -74,6 +74,8 @@ struct rodex_interface {
void (*get_items) (struct map_session_data *sd, int8 opentype, int64 mail_id);
void (*delete_mail) (struct map_session_data *sd, int64 mail_id);
void (*clean) (struct map_session_data *sd, int8 flag);
+ void (*getZenyAck) (struct map_session_data *sd, int64 mail_id, int8 opentype, int64 zeny);
+ void (*getItemsAck) (struct map_session_data *sd, int64 mail_id, int8 opentype, int count, const struct rodex_item *items);
};
#ifdef HERCULES_CORE
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index c1016d19b..e82bca1fd 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -3532,8 +3532,12 @@ typedef bool (*HPMHOOK_pre_inter_rodex_checkname) (const char **name, int **targ
typedef bool (*HPMHOOK_post_inter_rodex_checkname) (bool retVal___, const char *name, int *target_char_id, int *target_class, int *target_level);
typedef int64 (*HPMHOOK_pre_inter_rodex_savemessage) (struct rodex_message **msg);
typedef int64 (*HPMHOOK_post_inter_rodex_savemessage) (int64 retVal___, struct rodex_message *msg);
-typedef bool (*HPMHOOK_pre_inter_rodex_updatemail) (int64 *mail_id, int8 *flag);
-typedef bool (*HPMHOOK_post_inter_rodex_updatemail) (bool retVal___, int64 mail_id, int8 flag);
+typedef bool (*HPMHOOK_pre_inter_rodex_updatemail) (int *fd, int *account_id, int *char_id, int64 *mail_id, uint8 *opentype, int8 *flag);
+typedef bool (*HPMHOOK_post_inter_rodex_updatemail) (bool retVal___, int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag);
+typedef int64 (*HPMHOOK_pre_inter_rodex_getzeny) (int64 *mail_id);
+typedef int64 (*HPMHOOK_post_inter_rodex_getzeny) (int64 retVal___, int64 mail_id);
+typedef int (*HPMHOOK_pre_inter_rodex_getitems) (int64 *mail_id, struct rodex_item **items);
+typedef int (*HPMHOOK_post_inter_rodex_getitems) (int retVal___, int64 mail_id, struct rodex_item *items);
#endif // CHAR_INT_RODEX_H
#ifdef CHAR_INT_STORAGE_H /* inter_storage */
typedef int (*HPMHOOK_pre_inter_storage_tosql) (int *account_id, const struct storage_data **p);
@@ -3700,12 +3704,16 @@ typedef int (*HPMHOOK_pre_intif_rodex_requestinbox) (int *char_id, int *account_
typedef int (*HPMHOOK_post_intif_rodex_requestinbox) (int retVal___, int char_id, int account_id, int8 flag, int8 opentype, int64 mail_id);
typedef int (*HPMHOOK_pre_intif_rodex_checkhasnew) (struct map_session_data **sd);
typedef int (*HPMHOOK_post_intif_rodex_checkhasnew) (int retVal___, struct map_session_data *sd);
-typedef int (*HPMHOOK_pre_intif_rodex_updatemail) (int64 *mail_id, int8 *flag);
-typedef int (*HPMHOOK_post_intif_rodex_updatemail) (int retVal___, int64 mail_id, int8 flag);
+typedef int (*HPMHOOK_pre_intif_rodex_updatemail) (struct map_session_data **sd, int64 *mail_id, uint8 *opentype, int8 *flag);
+typedef int (*HPMHOOK_post_intif_rodex_updatemail) (int retVal___, struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag);
typedef int (*HPMHOOK_pre_intif_rodex_sendmail) (struct rodex_message **msg);
typedef int (*HPMHOOK_post_intif_rodex_sendmail) (int retVal___, struct rodex_message *msg);
typedef int (*HPMHOOK_pre_intif_rodex_checkname) (struct map_session_data **sd, const char **name);
typedef int (*HPMHOOK_post_intif_rodex_checkname) (int retVal___, struct map_session_data *sd, const char *name);
+typedef void (*HPMHOOK_pre_intif_pGetZenyAck) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGetZenyAck) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGetItemsAck) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGetItemsAck) (int fd);
typedef int (*HPMHOOK_pre_intif_clan_kickoffline) (int *clan_id, int *kick_interval);
typedef int (*HPMHOOK_post_intif_clan_kickoffline) (int retVal___, int clan_id, int kick_interval);
typedef int (*HPMHOOK_pre_intif_clan_membercount) (int *clan_id, int *kick_interval);
@@ -5048,6 +5056,10 @@ typedef void (*HPMHOOK_pre_mapif_parse_rodex_checkname) (int *fd);
typedef void (*HPMHOOK_post_mapif_parse_rodex_checkname) (int fd);
typedef void (*HPMHOOK_pre_mapif_rodex_checkname) (int *fd, int *reqchar_id, int *target_char_id, int *target_class, int *target_level, char **name);
typedef void (*HPMHOOK_post_mapif_rodex_checkname) (int fd, int reqchar_id, int target_char_id, int target_class, int target_level, char *name);
+typedef void (*HPMHOOK_pre_mapif_rodex_getzenyack) (int *fd, int *char_id, int64 *mail_id, uint8 *opentype, int64 *zeny);
+typedef void (*HPMHOOK_post_mapif_rodex_getzenyack) (int fd, int char_id, int64 mail_id, uint8 opentype, int64 zeny);
+typedef void (*HPMHOOK_pre_mapif_rodex_getitemsack) (int *fd, int *char_id, int64 *mail_id, uint8 *opentype, int *count, const struct rodex_item **items);
+typedef void (*HPMHOOK_post_mapif_rodex_getitemsack) (int fd, int char_id, int64 mail_id, uint8 opentype, int count, const struct rodex_item *items);
typedef int (*HPMHOOK_pre_mapif_load_guild_storage) (int *fd, int *account_id, int *guild_id, char *flag);
typedef int (*HPMHOOK_post_mapif_load_guild_storage) (int retVal___, int fd, int account_id, int guild_id, char flag);
typedef int (*HPMHOOK_pre_mapif_save_guild_storage_ack) (int *fd, int *account_id, int *guild_id, int *fail);
@@ -6608,6 +6620,10 @@ typedef void (*HPMHOOK_pre_rodex_delete_mail) (struct map_session_data **sd, int
typedef void (*HPMHOOK_post_rodex_delete_mail) (struct map_session_data *sd, int64 mail_id);
typedef void (*HPMHOOK_pre_rodex_clean) (struct map_session_data **sd, int8 *flag);
typedef void (*HPMHOOK_post_rodex_clean) (struct map_session_data *sd, int8 flag);
+typedef void (*HPMHOOK_pre_rodex_getZenyAck) (struct map_session_data **sd, int64 *mail_id, int8 *opentype, int64 *zeny);
+typedef void (*HPMHOOK_post_rodex_getZenyAck) (struct map_session_data *sd, int64 mail_id, int8 opentype, int64 zeny);
+typedef void (*HPMHOOK_pre_rodex_getItemsAck) (struct map_session_data **sd, int64 *mail_id, int8 *opentype, int *count, const struct rodex_item **items);
+typedef void (*HPMHOOK_post_rodex_getItemsAck) (struct map_session_data *sd, int64 mail_id, int8 opentype, int count, const struct rodex_item *items);
#endif // MAP_RODEX_H
#ifdef MAP_SCRIPT_H /* script */
typedef void (*HPMHOOK_pre_script_init) (bool *minimal);
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
index dbabf8ed4..9302a8d19 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
@@ -764,6 +764,10 @@ struct {
struct HPMHookPoint *HP_inter_rodex_savemessage_post;
struct HPMHookPoint *HP_inter_rodex_updatemail_pre;
struct HPMHookPoint *HP_inter_rodex_updatemail_post;
+ struct HPMHookPoint *HP_inter_rodex_getzeny_pre;
+ struct HPMHookPoint *HP_inter_rodex_getzeny_post;
+ struct HPMHookPoint *HP_inter_rodex_getitems_pre;
+ struct HPMHookPoint *HP_inter_rodex_getitems_post;
struct HPMHookPoint *HP_inter_storage_tosql_pre;
struct HPMHookPoint *HP_inter_storage_tosql_post;
struct HPMHookPoint *HP_inter_storage_fromsql_pre;
@@ -1224,6 +1228,10 @@ struct {
struct HPMHookPoint *HP_mapif_parse_rodex_checkname_post;
struct HPMHookPoint *HP_mapif_rodex_checkname_pre;
struct HPMHookPoint *HP_mapif_rodex_checkname_post;
+ struct HPMHookPoint *HP_mapif_rodex_getzenyack_pre;
+ struct HPMHookPoint *HP_mapif_rodex_getzenyack_post;
+ struct HPMHookPoint *HP_mapif_rodex_getitemsack_pre;
+ struct HPMHookPoint *HP_mapif_rodex_getitemsack_post;
struct HPMHookPoint *HP_mapif_load_guild_storage_pre;
struct HPMHookPoint *HP_mapif_load_guild_storage_post;
struct HPMHookPoint *HP_mapif_save_guild_storage_ack_pre;
@@ -2403,6 +2411,10 @@ struct {
int HP_inter_rodex_savemessage_post;
int HP_inter_rodex_updatemail_pre;
int HP_inter_rodex_updatemail_post;
+ int HP_inter_rodex_getzeny_pre;
+ int HP_inter_rodex_getzeny_post;
+ int HP_inter_rodex_getitems_pre;
+ int HP_inter_rodex_getitems_post;
int HP_inter_storage_tosql_pre;
int HP_inter_storage_tosql_post;
int HP_inter_storage_fromsql_pre;
@@ -2863,6 +2875,10 @@ struct {
int HP_mapif_parse_rodex_checkname_post;
int HP_mapif_rodex_checkname_pre;
int HP_mapif_rodex_checkname_post;
+ int HP_mapif_rodex_getzenyack_pre;
+ int HP_mapif_rodex_getzenyack_post;
+ int HP_mapif_rodex_getitemsack_pre;
+ int HP_mapif_rodex_getitemsack_post;
int HP_mapif_load_guild_storage_pre;
int HP_mapif_load_guild_storage_post;
int HP_mapif_save_guild_storage_ack_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
index f666ad1fd..60162c1a8 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
@@ -416,6 +416,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_rodex->checkname, HP_inter_rodex_checkname) },
{ HP_POP(inter_rodex->savemessage, HP_inter_rodex_savemessage) },
{ HP_POP(inter_rodex->updatemail, HP_inter_rodex_updatemail) },
+ { HP_POP(inter_rodex->getzeny, HP_inter_rodex_getzeny) },
+ { HP_POP(inter_rodex->getitems, HP_inter_rodex_getitems) },
/* inter_storage_interface */
{ HP_POP(inter_storage->tosql, HP_inter_storage_tosql) },
{ HP_POP(inter_storage->fromsql, HP_inter_storage_fromsql) },
@@ -650,6 +652,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->rodex_send, HP_mapif_rodex_send) },
{ HP_POP(mapif->parse_rodex_checkname, HP_mapif_parse_rodex_checkname) },
{ HP_POP(mapif->rodex_checkname, HP_mapif_rodex_checkname) },
+ { HP_POP(mapif->rodex_getzenyack, HP_mapif_rodex_getzenyack) },
+ { HP_POP(mapif->rodex_getitemsack, HP_mapif_rodex_getitemsack) },
{ HP_POP(mapif->load_guild_storage, HP_mapif_load_guild_storage) },
{ HP_POP(mapif->save_guild_storage_ack, HP_mapif_save_guild_storage_ack) },
{ HP_POP(mapif->parse_LoadGuildStorage, HP_mapif_parse_LoadGuildStorage) },
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index edffe7c11..2b7e25e5d 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -9904,15 +9904,15 @@ int64 HP_inter_rodex_savemessage(struct rodex_message *msg) {
}
return retVal___;
}
-bool HP_inter_rodex_updatemail(int64 mail_id, int8 flag) {
+bool HP_inter_rodex_updatemail(int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag) {
int hIndex = 0;
bool retVal___ = false;
if (HPMHooks.count.HP_inter_rodex_updatemail_pre > 0) {
- bool (*preHookFunc) (int64 *mail_id, int8 *flag);
+ bool (*preHookFunc) (int *fd, int *account_id, int *char_id, int64 *mail_id, uint8 *opentype, int8 *flag);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_rodex_updatemail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_rodex_updatemail_pre[hIndex].func;
- retVal___ = preHookFunc(&mail_id, &flag);
+ retVal___ = preHookFunc(&fd, &account_id, &char_id, &mail_id, &opentype, &flag);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -9920,13 +9920,67 @@ bool HP_inter_rodex_updatemail(int64 mail_id, int8 flag) {
}
}
{
- retVal___ = HPMHooks.source.inter_rodex.updatemail(mail_id, flag);
+ retVal___ = HPMHooks.source.inter_rodex.updatemail(fd, account_id, char_id, mail_id, opentype, flag);
}
if (HPMHooks.count.HP_inter_rodex_updatemail_post > 0) {
- bool (*postHookFunc) (bool retVal___, int64 mail_id, int8 flag);
+ bool (*postHookFunc) (bool retVal___, int fd, int account_id, int char_id, int64 mail_id, uint8 opentype, int8 flag);
for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_rodex_updatemail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_rodex_updatemail_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mail_id, flag);
+ retVal___ = postHookFunc(retVal___, fd, account_id, char_id, mail_id, opentype, flag);
+ }
+ }
+ return retVal___;
+}
+int64 HP_inter_rodex_getzeny(int64 mail_id) {
+ int hIndex = 0;
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_inter_rodex_getzeny_pre > 0) {
+ int64 (*preHookFunc) (int64 *mail_id);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_rodex_getzeny_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_inter_rodex_getzeny_pre[hIndex].func;
+ retVal___ = preHookFunc(&mail_id);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.inter_rodex.getzeny(mail_id);
+ }
+ if (HPMHooks.count.HP_inter_rodex_getzeny_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int64 mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_rodex_getzeny_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_inter_rodex_getzeny_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, mail_id);
+ }
+ }
+ return retVal___;
+}
+int HP_inter_rodex_getitems(int64 mail_id, struct rodex_item *items) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_inter_rodex_getitems_pre > 0) {
+ int (*preHookFunc) (int64 *mail_id, struct rodex_item **items);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_rodex_getitems_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_inter_rodex_getitems_pre[hIndex].func;
+ retVal___ = preHookFunc(&mail_id, &items);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.inter_rodex.getitems(mail_id, items);
+ }
+ if (HPMHooks.count.HP_inter_rodex_getitems_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 mail_id, struct rodex_item *items);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_rodex_getitems_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_inter_rodex_getitems_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, mail_id, items);
}
}
return retVal___;
@@ -16047,6 +16101,58 @@ void HP_mapif_rodex_checkname(int fd, int reqchar_id, int target_char_id, int ta
}
return;
}
+void HP_mapif_rodex_getzenyack(int fd, int char_id, int64 mail_id, uint8 opentype, int64 zeny) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mapif_rodex_getzenyack_pre > 0) {
+ void (*preHookFunc) (int *fd, int *char_id, int64 *mail_id, uint8 *opentype, int64 *zeny);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_rodex_getzenyack_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_rodex_getzenyack_pre[hIndex].func;
+ preHookFunc(&fd, &char_id, &mail_id, &opentype, &zeny);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mapif.rodex_getzenyack(fd, char_id, mail_id, opentype, zeny);
+ }
+ if (HPMHooks.count.HP_mapif_rodex_getzenyack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, int64 mail_id, uint8 opentype, int64 zeny);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_rodex_getzenyack_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_rodex_getzenyack_post[hIndex].func;
+ postHookFunc(fd, char_id, mail_id, opentype, zeny);
+ }
+ }
+ return;
+}
+void HP_mapif_rodex_getitemsack(int fd, int char_id, int64 mail_id, uint8 opentype, int count, const struct rodex_item *items) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mapif_rodex_getitemsack_pre > 0) {
+ void (*preHookFunc) (int *fd, int *char_id, int64 *mail_id, uint8 *opentype, int *count, const struct rodex_item **items);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_rodex_getitemsack_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_rodex_getitemsack_pre[hIndex].func;
+ preHookFunc(&fd, &char_id, &mail_id, &opentype, &count, &items);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mapif.rodex_getitemsack(fd, char_id, mail_id, opentype, count, items);
+ }
+ if (HPMHooks.count.HP_mapif_rodex_getitemsack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, int64 mail_id, uint8 opentype, int count, const struct rodex_item *items);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_rodex_getitemsack_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_rodex_getitemsack_post[hIndex].func;
+ postHookFunc(fd, char_id, mail_id, opentype, count, items);
+ }
+ }
+ return;
+}
int HP_mapif_load_guild_storage(int fd, int account_id, int guild_id, char flag) {
int hIndex = 0;
int retVal___ = 0;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 5648dd267..a54680a7a 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2900,6 +2900,10 @@ struct {
struct HPMHookPoint *HP_intif_rodex_sendmail_post;
struct HPMHookPoint *HP_intif_rodex_checkname_pre;
struct HPMHookPoint *HP_intif_rodex_checkname_post;
+ struct HPMHookPoint *HP_intif_pGetZenyAck_pre;
+ struct HPMHookPoint *HP_intif_pGetZenyAck_post;
+ struct HPMHookPoint *HP_intif_pGetItemsAck_pre;
+ struct HPMHookPoint *HP_intif_pGetItemsAck_post;
struct HPMHookPoint *HP_intif_clan_kickoffline_pre;
struct HPMHookPoint *HP_intif_clan_kickoffline_post;
struct HPMHookPoint *HP_intif_clan_membercount_pre;
@@ -5122,6 +5126,10 @@ struct {
struct HPMHookPoint *HP_rodex_delete_mail_post;
struct HPMHookPoint *HP_rodex_clean_pre;
struct HPMHookPoint *HP_rodex_clean_post;
+ struct HPMHookPoint *HP_rodex_getZenyAck_pre;
+ struct HPMHookPoint *HP_rodex_getZenyAck_post;
+ struct HPMHookPoint *HP_rodex_getItemsAck_pre;
+ struct HPMHookPoint *HP_rodex_getItemsAck_post;
struct HPMHookPoint *HP_script_init_pre;
struct HPMHookPoint *HP_script_init_post;
struct HPMHookPoint *HP_script_final_pre;
@@ -9587,6 +9595,10 @@ struct {
int HP_intif_rodex_sendmail_post;
int HP_intif_rodex_checkname_pre;
int HP_intif_rodex_checkname_post;
+ int HP_intif_pGetZenyAck_pre;
+ int HP_intif_pGetZenyAck_post;
+ int HP_intif_pGetItemsAck_pre;
+ int HP_intif_pGetItemsAck_post;
int HP_intif_clan_kickoffline_pre;
int HP_intif_clan_kickoffline_post;
int HP_intif_clan_membercount_pre;
@@ -11809,6 +11821,10 @@ struct {
int HP_rodex_delete_mail_post;
int HP_rodex_clean_pre;
int HP_rodex_clean_post;
+ int HP_rodex_getZenyAck_pre;
+ int HP_rodex_getZenyAck_post;
+ int HP_rodex_getItemsAck_pre;
+ int HP_rodex_getItemsAck_post;
int HP_script_init_pre;
int HP_script_init_post;
int HP_script_final_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 6ab056dfd..3a6ab1787 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1487,6 +1487,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(intif->rodex_updatemail, HP_intif_rodex_updatemail) },
{ HP_POP(intif->rodex_sendmail, HP_intif_rodex_sendmail) },
{ HP_POP(intif->rodex_checkname, HP_intif_rodex_checkname) },
+ { HP_POP(intif->pGetZenyAck, HP_intif_pGetZenyAck) },
+ { HP_POP(intif->pGetItemsAck, HP_intif_pGetItemsAck) },
{ HP_POP(intif->clan_kickoffline, HP_intif_clan_kickoffline) },
{ HP_POP(intif->clan_membercount, HP_intif_clan_membercount) },
{ HP_POP(intif->request_accinfo, HP_intif_request_accinfo) },
@@ -2624,6 +2626,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(rodex->get_items, HP_rodex_get_items) },
{ HP_POP(rodex->delete_mail, HP_rodex_delete_mail) },
{ HP_POP(rodex->clean, HP_rodex_clean) },
+ { HP_POP(rodex->getZenyAck, HP_rodex_getZenyAck) },
+ { HP_POP(rodex->getItemsAck, HP_rodex_getItemsAck) },
/* script_interface */
{ HP_POP(script->init, HP_script_init) },
{ HP_POP(script->final, HP_script_final) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 26cf8ef00..f1bc87e5a 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -38047,15 +38047,15 @@ int HP_intif_rodex_checkhasnew(struct map_session_data *sd) {
}
return retVal___;
}
-int HP_intif_rodex_updatemail(int64 mail_id, int8 flag) {
+int HP_intif_rodex_updatemail(struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_intif_rodex_updatemail_pre > 0) {
- int (*preHookFunc) (int64 *mail_id, int8 *flag);
+ int (*preHookFunc) (struct map_session_data **sd, int64 *mail_id, uint8 *opentype, int8 *flag);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_rodex_updatemail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_rodex_updatemail_pre[hIndex].func;
- retVal___ = preHookFunc(&mail_id, &flag);
+ retVal___ = preHookFunc(&sd, &mail_id, &opentype, &flag);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -38063,13 +38063,13 @@ int HP_intif_rodex_updatemail(int64 mail_id, int8 flag) {
}
}
{
- retVal___ = HPMHooks.source.intif.rodex_updatemail(mail_id, flag);
+ retVal___ = HPMHooks.source.intif.rodex_updatemail(sd, mail_id, opentype, flag);
}
if (HPMHooks.count.HP_intif_rodex_updatemail_post > 0) {
- int (*postHookFunc) (int retVal___, int64 mail_id, int8 flag);
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 mail_id, uint8 opentype, int8 flag);
for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_rodex_updatemail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_rodex_updatemail_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mail_id, flag);
+ retVal___ = postHookFunc(retVal___, sd, mail_id, opentype, flag);
}
}
return retVal___;
@@ -38128,6 +38128,58 @@ int HP_intif_rodex_checkname(struct map_session_data *sd, const char *name) {
}
return retVal___;
}
+void HP_intif_pGetZenyAck(int fd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_intif_pGetZenyAck_pre > 0) {
+ void (*preHookFunc) (int *fd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGetZenyAck_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_intif_pGetZenyAck_pre[hIndex].func;
+ preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.intif.pGetZenyAck(fd);
+ }
+ if (HPMHooks.count.HP_intif_pGetZenyAck_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGetZenyAck_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_intif_pGetZenyAck_post[hIndex].func;
+ postHookFunc(fd);
+ }
+ }
+ return;
+}
+void HP_intif_pGetItemsAck(int fd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_intif_pGetItemsAck_pre > 0) {
+ void (*preHookFunc) (int *fd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGetItemsAck_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_intif_pGetItemsAck_pre[hIndex].func;
+ preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.intif.pGetItemsAck(fd);
+ }
+ if (HPMHooks.count.HP_intif_pGetItemsAck_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGetItemsAck_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_intif_pGetItemsAck_post[hIndex].func;
+ postHookFunc(fd);
+ }
+ }
+ return;
+}
int HP_intif_clan_kickoffline(int clan_id, int kick_interval) {
int hIndex = 0;
int retVal___ = 0;
@@ -68218,6 +68270,58 @@ void HP_rodex_clean(struct map_session_data *sd, int8 flag) {
}
return;
}
+void HP_rodex_getZenyAck(struct map_session_data *sd, int64 mail_id, int8 opentype, int64 zeny) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rodex_getZenyAck_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int64 *mail_id, int8 *opentype, int64 *zeny);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_getZenyAck_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rodex_getZenyAck_pre[hIndex].func;
+ preHookFunc(&sd, &mail_id, &opentype, &zeny);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rodex.getZenyAck(sd, mail_id, opentype, zeny);
+ }
+ if (HPMHooks.count.HP_rodex_getZenyAck_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int64 mail_id, int8 opentype, int64 zeny);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_getZenyAck_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rodex_getZenyAck_post[hIndex].func;
+ postHookFunc(sd, mail_id, opentype, zeny);
+ }
+ }
+ return;
+}
+void HP_rodex_getItemsAck(struct map_session_data *sd, int64 mail_id, int8 opentype, int count, const struct rodex_item *items) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rodex_getItemsAck_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int64 *mail_id, int8 *opentype, int *count, const struct rodex_item **items);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_getItemsAck_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rodex_getItemsAck_pre[hIndex].func;
+ preHookFunc(&sd, &mail_id, &opentype, &count, &items);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rodex.getItemsAck(sd, mail_id, opentype, count, items);
+ }
+ if (HPMHooks.count.HP_rodex_getItemsAck_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int64 mail_id, int8 opentype, int count, const struct rodex_item *items);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_getItemsAck_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rodex_getItemsAck_post[hIndex].func;
+ postHookFunc(sd, mail_id, opentype, count, items);
+ }
+ }
+ return;
+}
/* script_interface */
void HP_script_init(bool minimal) {
int hIndex = 0;