summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-11-24 05:57:43 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-12 21:18:06 +0300
commitc76f8ded8743966abe10a15a3a03604d76d2d5df (patch)
treeef5f4b6557c4913cfa8a03de1c1ce526185c955e /src
parent1f7f90156632811bcf7f0102325ba504428bc44a (diff)
downloadhercules-c76f8ded8743966abe10a15a3a03604d76d2d5df.tar.gz
hercules-c76f8ded8743966abe10a15a3a03604d76d2d5df.tar.bz2
hercules-c76f8ded8743966abe10a15a3a03604d76d2d5df.tar.xz
hercules-c76f8ded8743966abe10a15a3a03604d76d2d5df.zip
Add packet ZC_ENCHANT_EQUIPMENT
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c16
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/packets_struct.h15
3 files changed, 32 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 19f7a082a..00d3d8908 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -21991,6 +21991,21 @@ static void clif_item_preview(struct map_session_data *sd, int n)
#endif
}
+// insert cardId into equipped item in pos equipment slot into slot cardSlot.
+static void clif_enchant_equipment(struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId)
+{
+#if PACKETVER_MAIN_NUM >= 20160831 || PACKETVER_RE_NUM >= 20151118 || defined(PACKETVER_ZERO)
+ nullpo_retv(sd);
+ Assert_retv(cardSlot >= 0 && cardSlot <= 3);
+ struct PACKET_ZC_ENCHANT_EQUIPMENT p;
+ p.packetType = HEADER_ZC_ENCHANT_EQUIPMENT;
+ p.wearState = pos;
+ p.cardSlot = cardSlot;
+ p.itemId = cardId;
+ clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
+}
+
/*==========================================
* Main client packet processing function
*------------------------------------------*/
@@ -23157,6 +23172,7 @@ void clif_defaults(void)
clif->camera_showWindow = clif_camera_showWindow;
clif->camera_change = clif_camera_change;
clif->item_preview = clif_item_preview;
+ clif->enchant_equipment = clif_enchant_equipment;
// -- Pet Evolution
clif->pPetEvolution = clif_parse_pet_evolution;
diff --git a/src/map/clif.h b/src/map/clif.h
index 593dc15c1..088e7827e 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1554,6 +1554,7 @@ struct clif_interface {
void (*camera_showWindow) (struct map_session_data *sd);
void (*camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target);
void (*item_preview) (struct map_session_data *sd, int n);
+ void (*enchant_equipment) (struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId);
};
#ifdef HERCULES_CORE
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 357627ce7..c1b93e781 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -2919,6 +2919,21 @@ DEFINE_PACKET_HEADER(ZC_ITEM_PREVIEW, 0x0ab9);
#endif // PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 || PACKETVER_ZERO_NUM >= 20181024
#endif // PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO)
+#if PACKETVER_MAIN_NUM >= 20160831 || PACKETVER_RE_NUM >= 20151118 || defined(PACKETVER_ZERO)
+struct PACKET_ZC_ENCHANT_EQUIPMENT {
+ int16 packetType;
+ int16 wearState;
+ int16 cardSlot;
+#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
+ int32 itemId;
+#else
+ int16 itemId;
+#endif
+ int8 equipFlag;
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_ENCHANT_EQUIPMENT, 0x0a3f);
+#endif // PACKETVER_MAIN_NUM >= 20160831 || PACKETVER_RE_NUM >= 20151118 || defined(PACKETVER_ZERO)
+
#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