summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-04-25 03:42:35 +0300
committerAndrei Karas <akaras@inbox.ru>2019-05-05 22:24:25 +0300
commit3cde52381fe5ea8643e6b78393384df0cae696e1 (patch)
treee309eae4d72b98843f917545f08dfa7ff3a70c26
parentc30d340136982c6b931099ccc6248bcee3d8b693 (diff)
downloadhercules-3cde52381fe5ea8643e6b78393384df0cae696e1.tar.gz
hercules-3cde52381fe5ea8643e6b78393384df0cae696e1.tar.bz2
hercules-3cde52381fe5ea8643e6b78393384df0cae696e1.tar.xz
hercules-3cde52381fe5ea8643e6b78393384df0cae696e1.zip
Add packet ZC_ACK_CLOSE_ROULETTE
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/packets_struct.h8
3 files changed, 23 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 336bbb752..fb39d7427 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -20555,6 +20555,19 @@ static void clif_roulette_generate_ack(struct map_session_data *sd, enum GENERAT
#endif
}
+static void clif_roulette_close(struct map_session_data *sd)
+{
+#if PACKETVER_MAIN_NUM >= 20141008 || PACKETVER_RE_NUM >= 20140903 || defined(PACKETVER_ZERO)
+ nullpo_retv(sd);
+
+ struct PACKET_ZC_ACK_CLOSE_ROULETTE p;
+ p.packetType = HEADER_ZC_ACK_CLOSE_ROULETTE;
+ p.result = 0; // close window
+
+ clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
+}
+
/**
* Stackable items merger
*/
@@ -23328,6 +23341,7 @@ void clif_defaults(void)
/* */
clif->parse_roulette_db = clif_parse_roulette_db;
clif->roulette_generate_ack = clif_roulette_generate_ack;
+ clif->roulette_close = clif_roulette_close;
/* Merge Items */
clif->openmergeitem = clif_openmergeitem;
clif->cancelmergeitem = clif_cancelmergeitem;
diff --git a/src/map/clif.h b/src/map/clif.h
index 1f3f39874..84e675afb 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1262,6 +1262,7 @@ struct clif_interface {
/* */
bool (*parse_roulette_db) (void);
void (*roulette_generate_ack) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID);
+ void (*roulette_close) (struct map_session_data *sd);
/* Merge Items */
void (*openmergeitem) (int fd, struct map_session_data *sd);
void (*cancelmergeitem) (int fd, struct map_session_data *sd);
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 445e9a3e2..a9dba1720 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -3277,6 +3277,14 @@ struct PACKET_ZC_BAN_LIST {
DEFINE_PACKET_HEADER(ZC_BAN_LIST, 0x0163);
#endif
+#if PACKETVER_MAIN_NUM >= 20141008 || PACKETVER_RE_NUM >= 20140903 || defined(PACKETVER_ZERO)
+struct PACKET_ZC_ACK_CLOSE_ROULETTE {
+ int16 packetType;
+ uint8 result;
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_ACK_CLOSE_ROULETTE, 0x0a1e);
+#endif
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris