summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorIbrahim Zidan <brahem@aotsw.com>2019-04-27 23:14:09 +0200
committerIbrahim Zidan <brahem@aotsw.com>2019-05-05 23:40:43 +0200
commit8598e0cbf421eded6943d416f7da8881997c960a (patch)
tree35c1c6c6af1efddba2c91c1f5ca867f7c6b62f26 /src/map/clif.c
parentfdcd121237eb03cc264dbd8ad1371603bd6622c7 (diff)
downloadhercules-8598e0cbf421eded6943d416f7da8881997c960a.tar.gz
hercules-8598e0cbf421eded6943d416f7da8881997c960a.tar.bz2
hercules-8598e0cbf421eded6943d416f7da8881997c960a.tar.xz
hercules-8598e0cbf421eded6943d416f7da8881997c960a.zip
Implement Refine success/failure announcement feature
Currently as far as we know kRO only sends this on success in refining an item through the refinery ui, from level 10 all the way to 20. Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index b8a54166a..462991510 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -22574,6 +22574,23 @@ static void clif_parse_RefineryUIClose(int fd, struct map_session_data *sd)
#endif
}
+static void clif_announce_refine_status(struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target)
+{
+#if PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO)
+ nullpo_retv(sd);
+
+ Assert_retv(refine_level > 0 && refine_level <= INT8_MAX);
+
+ struct PACKET_ZC_REFINE_STATUS p;
+ p.packetType = HEADER_ZC_REFINE_STATUS;
+ safestrncpy(p.name, sd->status.name, NAME_LENGTH);
+ p.itemId = item_id;
+ p.refine_level = refine_level;
+ p.status = (success) ? true : false;
+ clif->send(&p, sizeof(p), &sd->bl, target);
+#endif
+}
+
/*==========================================
* Main client packet processing function
*------------------------------------------*/
@@ -23792,4 +23809,5 @@ void clif_defaults(void)
clif->AddItemRefineryUIAck = clif_AddItemRefineryUIAck;
clif->pRefineryUIClose = clif_parse_RefineryUIClose;
clif->pRefineryUIRefine = clif_parse_RefineryUIRefine;
+ clif->announce_refine_status = clif_announce_refine_status;
}