summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-10-16 15:35:29 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-10-16 15:35:29 +0000
commita98bb7596053a289eb2dedb273555b25e104eb6d (patch)
tree8de0a9abae638bbf6bf95c39d0c5e3118597fd78 /src/map/clif.c
parentdb85b6483e9e9d67a28f1ba946c83bd0fca6e120 (diff)
downloadhercules-a98bb7596053a289eb2dedb273555b25e104eb6d.tar.gz
hercules-a98bb7596053a289eb2dedb273555b25e104eb6d.tar.bz2
hercules-a98bb7596053a289eb2dedb273555b25e104eb6d.tar.xz
hercules-a98bb7596053a289eb2dedb273555b25e104eb6d.zip
* Added support for new act/damage packet 0x2e1 (ZC_NOTIFY_ACT2) for clients 2007-11-13Sakexe and newer.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14979 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e75c4f6bc..4fcf20b10 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3845,8 +3845,8 @@ static int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int da
/*==========================================
* Sends a 'damage' packet (src performs action on dst)
- * R 008a <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.W <div>.W <type>.B <damage2>.W
- * R 02e1 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <div>.W <type>.B <damage2>.L
+ * R 008a <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.W <div>.W <type>.B <damage2>.W (ZC_NOTIFY_ACT)
+ * R 02e1 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <div>.W <type>.B <damage2>.L (ZC_NOTIFY_ACT2)
*
* type=00 damage [param1: total damage, param2: div, param3: assassin dual-wield damage]
* type=01 pick up item
@@ -3860,8 +3860,13 @@ static int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int da
*------------------------------------------*/
int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int damage, int div, int type, int damage2)
{
- unsigned char buf[256];
+ unsigned char buf[33];
struct status_change *sc;
+#if PACKETVER < 20071113
+ const int cmd = 0x8a;
+#else
+ const int cmd = 0x2e1;
+#endif
nullpo_ret(src);
nullpo_ret(dst);
@@ -3875,12 +3880,13 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
}
}
- WBUFW(buf,0)=0x8a;
+ WBUFW(buf,0)=cmd;
WBUFL(buf,2)=src->id;
WBUFL(buf,6)=dst->id;
WBUFL(buf,10)=tick;
WBUFL(buf,14)=sdelay;
WBUFL(buf,18)=ddelay;
+#if PACKETVER < 20071113
if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) {
WBUFW(buf,22)=damage?div:0;
WBUFW(buf,27)=damage2?div:0;
@@ -3890,20 +3896,35 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
}
WBUFW(buf,24)=div;
WBUFB(buf,26)=type;
+#else
+ if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) {
+ WBUFL(buf,22)=damage?div:0;
+ WBUFL(buf,29)=damage2?div:0;
+ } else {
+ WBUFL(buf,22)=damage;
+ WBUFL(buf,29)=damage2;
+ }
+ WBUFW(buf,26)=div;
+ WBUFB(buf,28)=type;
+#endif
if(disguised(dst)) {
- clif_send(buf,packet_len(0x8a),dst,AREA_WOS);
+ clif_send(buf,packet_len(cmd),dst,AREA_WOS);
WBUFL(buf,6) = -dst->id;
- clif_send(buf,packet_len(0x8a),dst,SELF);
+ clif_send(buf,packet_len(cmd),dst,SELF);
} else
- clif_send(buf,packet_len(0x8a),dst,AREA);
+ clif_send(buf,packet_len(cmd),dst,AREA);
if(disguised(src)) {
WBUFL(buf,2) = -src->id;
if (disguised(dst))
WBUFL(buf,6) = dst->id;
if(damage > 0) WBUFW(buf,22) = -1;
+#if PACKETVER < 20071113
if(damage2 > 0) WBUFW(buf,27) = -1;
- clif_send(buf,packet_len(0x8a),src,SELF);
+#else
+ if(damage2 > 0) WBUFW(buf,29) = -1;
+#endif
+ clif_send(buf,packet_len(cmd),src,SELF);
}
//Return adjusted can't walk delay for further processing.
return clif_calc_walkdelay(dst,ddelay,type,damage+damage2,div);
@@ -15091,7 +15112,7 @@ static int packetdb_readdb(void)
//#0x02C0
0, 0, 0, 0, 0, 30, 30, 0, 0, 3, 0, 65, 4, 71, 10, 0,
0, 0, 0, 0, 29, 0, 6, -1, 10, 10, 3, 0, -1, 32, 6, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 59, 60, 8,
+ 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 59, 60, 8,
10, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
//#0x0300
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,