From bf5b2da6f9a395e280c5806456cfe3f7ccf3aaa6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Oct 2018 23:11:40 +0300 Subject: Add packet ZC_ITEM_PREVIEW. It allow show item preview in already opened preview window. --- src/map/clif.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index ab1e88ffc..62b9a4ca9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21961,6 +21961,26 @@ static void clif_camera_change(struct map_session_data *sd, float range, float r #endif } +// show item preview in already opened preview window +static void clif_item_preview(struct map_session_data *sd, int n) +{ +#if PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) + nullpo_retv(sd); + Assert_retv(n >= 0 && n < MAX_INVENTORY); + + struct PACKET_ZC_ITEM_PREVIEW p; + p.packetType = itemPreview; + p.index = n + 2; +#if PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 + p.isDamaged = (sd->status.inventory[n].attribute & ATTR_BROKEN) != 0 ? 1 : 0; +#endif + p.refiningLevel = sd->status.inventory[n].refine; + clif->addcards(&p.slot, &sd->status.inventory[n]); + clif->add_item_options(&p.option_data[0], &sd->status.inventory[n]); + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -23127,6 +23147,7 @@ void clif_defaults(void) clif->camera_showWindow = clif_camera_showWindow; clif->camera_change = clif_camera_change; + clif->item_preview = clif_item_preview; // -- Pet Evolution clif->pPetEvolution = clif_parse_pet_evolution; -- cgit v1.2.3-70-g09d2