From 6110a96ccfca527dfd96f04fcfda5153593b0bd1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2016 18:12:14 +0300 Subject: Add packet id clif_skill_nodamage for 20131223 (0x9c7 / ZC_USE_SKILL2) Based on 3CeaM commit: commit f89805da42c792aa9bf4274eb5a30756c06fece7 Author: rytech16 Date: Sat Apr 23 13:16:49 2016 +0000 git-svn-id: svn://svn.code.sf.net/p/v1-3ceam/code/trunk@805 cad27aaa-dce3-4a30-a00a-e4fd67c11881 --- src/map/clif.c | 45 +++++++++++++++++++++++++++++---------------- src/map/packets.h | 1 + 2 files changed, 30 insertions(+), 16 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index ce88b32da..397d80ec3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5208,33 +5208,46 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic } #endif // 0 -/// Non-damaging skill effect (ZC_USE_SKILL). -/// 011a .W .W .L .L .B -int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail) +/// Non-damaging skill effect. +/// 011a .W .W .L .L .B (ZC_USE_SKILL) +/// 09cb .W .L .L .L .B (ZC_USE_SKILL2) +int clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail) { unsigned char buf[32]; + short offset = 0; +#if PACKETVER < 20131223 + short cmd = 0x11a; +#else + short cmd = 0x9cb; +#endif + int len = packet_len(cmd); nullpo_ret(dst); - WBUFW(buf,0)=0x11a; - WBUFW(buf,2)=skill_id; - WBUFW(buf,4)=min(heal, INT16_MAX); - WBUFL(buf,6)=dst->id; - WBUFL(buf,10)=src?src->id:0; - WBUFB(buf,14)=fail; + WBUFW(buf, 0) = cmd; + WBUFW(buf, 2) = skill_id; +#if PACKETVER < 20131223 + WBUFW(buf, 4) = min(heal, INT16_MAX); +#else + WBUFL(buf, 4) = min(heal, INT_MAX); + offset += 2; +#endif + WBUFL(buf, 6 + offset) = dst->id; + WBUFL(buf, 10 + offset) = src ? src->id : 0; + WBUFB(buf, 14 + offset) = fail; if (clif->isdisguised(dst)) { - clif->send(buf,packet_len(0x11a),dst,AREA_WOS); - WBUFL(buf,6)=-dst->id; - clif->send(buf,packet_len(0x11a),dst,SELF); + clif->send(buf, len, dst, AREA_WOS); + WBUFL(buf, 6 + offset) = -dst->id; + clif->send(buf, len, dst, SELF); } else - clif->send(buf,packet_len(0x11a),dst,AREA); + clif->send(buf, len, dst, AREA); if (src && clif->isdisguised(src)) { - WBUFL(buf,10)=-src->id; + WBUFL(buf, 10 + offset) = -src->id; if (clif->isdisguised(dst)) - WBUFL(buf,6)=dst->id; - clif->send(buf,packet_len(0x11a),src,SELF); + WBUFL(buf, 6 + offset) = dst->id; + clif->send(buf, len, src, SELF); } return fail; diff --git a/src/map/packets.h b/src/map/packets.h index 0badd94f5..f8ceb266f 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2580,6 +2580,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0361,5,clif->pHomMenu,2,4); packet(0x08A4,36,clif->pStoragePassword,0); packet(0x09df,7); + packet(0x09cb,17); #endif // 2013-12-30aRagexe - Yommy -- cgit v1.2.3-70-g09d2