summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/clif.c39
2 files changed, 31 insertions, 9 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 6934a6c21..06f5fba3b 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,7 @@
Date Added
2011/10/16
+ * Added support for new act/damage packet 0x2e1 (ZC_NOTIFY_ACT2) for clients 2007-11-13Sakexe and newer. [Ai4rei]
* Added a message indicating how many concurrent connections the server was compiled to support. [Ai4rei]
* Added field for the change slot feature to character select list packet for 2011-09-28aRagexeRE and newer. [Ai4rei]
* Changed function-like macros into inline functions where it seemed appropriate (topic:264007). [Ai4rei]
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,