summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-08 18:12:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-12 01:03:20 +0300
commit6110a96ccfca527dfd96f04fcfda5153593b0bd1 (patch)
treebaf45a95ef312423903d83951ff1715ee816fadd /src
parent5b67dd0f17949beb1a54ee0ac13bd9b07c1bdd40 (diff)
downloadhercules-6110a96ccfca527dfd96f04fcfda5153593b0bd1.tar.gz
hercules-6110a96ccfca527dfd96f04fcfda5153593b0bd1.tar.bz2
hercules-6110a96ccfca527dfd96f04fcfda5153593b0bd1.tar.xz
hercules-6110a96ccfca527dfd96f04fcfda5153593b0bd1.zip
Add packet id clif_skill_nodamage for 20131223 (0x9c7 / ZC_USE_SKILL2)
Based on 3CeaM commit: commit f89805da42c792aa9bf4274eb5a30756c06fece7 Author: rytech16 <rytech16@cad27aaa-dce3-4a30-a00a-e4fd67c11881> 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
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c45
-rw-r--r--src/map/packets.h1
2 files changed, 30 insertions, 16 deletions
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 <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.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 <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.B (ZC_USE_SKILL)
+/// 09cb <skill id>.W <skill lv>.L <dst id>.L <src id>.L <result>.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