diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 8adbf132dd..d20b74082c 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -9896,7 +9896,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t if(sc_start4(src,src, SC_BLADESTOP, 100, sd?pc_checkskill(sd, MO_BLADESTOP):5, 0, 0, target->id, duration)) { //Target locked. clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, DMG_NORMAL, 0, false); //Display MISS. - clif_bladestop(target, src->id, 1); + clif_bladestop( *target, src->id, true ); sc_start4(src,target, SC_BLADESTOP, 100, skill_lv, 0, 0, src->id, duration); return ATK_BLOCK; } diff --git a/src/map/clif.cpp b/src/map/clif.cpp index bb23abad8b..c0c5ccf22a 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -8477,38 +8477,34 @@ void clif_spiritball( struct block_list *bl, struct block_list* target, enum sen clif_send( &p, sizeof( p ), target == nullptr ? bl : target, send_target ); } -/// Notifies clients in area of a character's combo delay (ZC_COMBODELAY). -/// 01d2 .L .L -void clif_combo_delay(struct block_list *bl,t_tick wait) -{ - unsigned char buf[32]; - nullpo_retv(bl); +/// Notifies clients in area of a character's combo delay. +/// 01d2 .L .L (ZC_COMBODELAY) +void clif_combo_delay( block_list& bl, t_tick wait ){ + PACKET_ZC_COMBODELAY packet{}; - WBUFW(buf,0)=0x1d2; - WBUFL(buf,2)=bl->id; - WBUFL(buf,6)=client_tick(wait); - clif_send(buf,packet_len(0x1d2),bl,AREA); + packet.packetType = HEADER_ZC_COMBODELAY; + packet.AID = bl.id; + packet.delay = client_tick( wait ); + + clif_send( &packet, sizeof( packet ), &bl, AREA ); } -/// Notifies clients in area that a character has blade-stopped another (ZC_BLADESTOP). -/// 01d1 .L .L .L +/// Notifies clients in area that a character has blade-stopped another. +/// 01d1 .L .L .L (ZC_BLADESTOP) /// flag: /// 0 = inactive /// 1 = active -void clif_bladestop(struct block_list *src, int dst_id, int active) -{ - unsigned char buf[32]; +void clif_bladestop( block_list& src, uint32 target_id, bool active ){ + PACKET_ZC_BLADESTOP packet{}; - nullpo_retv(src); + packet.packetType = HEADER_ZC_BLADESTOP; + packet.srcId = src.id; + packet.targetId = target_id; + packet.flag = active; - WBUFW(buf,0)=0x1d1; - WBUFL(buf,2)=src->id; - WBUFL(buf,6)=dst_id; - WBUFL(buf,10)=active; - - clif_send(buf,packet_len(0x1d1),src,AREA); + clif_send( &packet, sizeof( packet ), &src, AREA ); } diff --git a/src/map/clif.hpp b/src/map/clif.hpp index 058dddb785..7dec007c13 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -950,8 +950,8 @@ void clif_spiritball( struct block_list *bl, struct block_list* target = nullptr void clif_soulball( map_session_data *sd, struct block_list* target = nullptr, enum send_target send_target = AREA ); void clif_servantball( map_session_data& sd, struct block_list* target = nullptr, enum send_target send_target = AREA ); void clif_abyssball( map_session_data& sd, struct block_list* target = nullptr, enum send_target send_target = AREA ); -void clif_combo_delay(struct block_list *bl,t_tick wait); -void clif_bladestop(struct block_list *src, int dst_id, int active); +void clif_combo_delay( block_list& bl, t_tick wait ); +void clif_bladestop( block_list& src, uint32 target_id, bool active ); void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target); #define clif_status_load(bl, type, flag) clif_status_change((bl), (type), (flag), 0, 0, 0, 0) diff --git a/src/map/clif_packetdb.hpp b/src/map/clif_packetdb.hpp index 958a7fff47..c1c8a9bf59 100644 --- a/src/map/clif_packetdb.hpp +++ b/src/map/clif_packetdb.hpp @@ -285,8 +285,6 @@ parseable_packet(0x01ce,6,clif_parse_AutoSpell,2); packet(0x01cf,28); packet(0x01d0,8); - packet(0x01d1,14); - packet(0x01d2,10); parseable_packet(0x01d5,-1,clif_parse_NpcStringInput,2,4,8); packet(0x01d7,11); packet(0x01d8,54); diff --git a/src/map/packets.hpp b/src/map/packets.hpp index d15e3646ea..e36f5d098d 100644 --- a/src/map/packets.hpp +++ b/src/map/packets.hpp @@ -1082,6 +1082,21 @@ struct PACKET_ZC_PET_ACT { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_PET_ACT, 0x1aa); +struct PACKET_ZC_COMBODELAY { + int16 packetType; + uint32 AID; + uint32 delay; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_COMBODELAY, 0x1d2); + +struct PACKET_ZC_BLADESTOP { + int16 packetType; + uint32 srcId; + uint32 targetId; + uint32 flag; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_BLADESTOP, 0x1d1); + // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 ) #pragma pack( pop ) diff --git a/src/map/skill.cpp b/src/map/skill.cpp index dcef9932cd..dab402a2fe 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -3346,7 +3346,7 @@ void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_li if(sd && duration==1) duration = DIFF_TICK(sd->ud.canact_tick, tick); //Auto calc duration duration = i64max(status_get_amotion(src),duration); //Never less than aMotion sc_start4(src,src,SC_COMBO,100,skill_id,target_id,nodelay,0,duration); - clif_combo_delay(src, duration); + clif_combo_delay( *src, duration ); } } @@ -11551,7 +11551,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui if( sc_start2(src,bl, type, 100, skill_lv, src->id, skill_get_time(skill_id, skill_lv))) { if( bl->type == BL_MOB ) mob_unlocktarget((TBL_MOB*)bl,gettick()); - clif_bladestop(src, bl->id, 1); + clif_bladestop( *src, bl->id, true ); map_freeblock_unlock(); return 1; } @@ -11573,7 +11573,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui if( sc_start2(src,bl, type, 50, skill_lv, src->id, skill_get_time(skill_id, skill_lv))) { if( bl->type == BL_MOB ) mob_unlocktarget((TBL_MOB*)bl,gettick()); - clif_bladestop(src, bl->id, 1); + clif_bladestop( *src, bl->id, true ); map_freeblock_unlock(); return 1; } diff --git a/src/map/status.cpp b/src/map/status.cpp index 2dcd7a2f56..aa3539d46e 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -13365,7 +13365,7 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) tsc->getSCE(SC_BLADESTOP)->val4 = 0; status_change_end(tbl, SC_BLADESTOP); } - clif_bladestop(bl, tid2, 0); + clif_bladestop( *bl, tid2, false ); } break; case SC_DANCING: @@ -13614,7 +13614,7 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) status_change *sc2 = status_get_sc(src); if( sc2 && sc2->getSCE(SC_CURSEDCIRCLE_ATKER) && --(sc2->getSCE(SC_CURSEDCIRCLE_ATKER)->val2) == 0 ) { - clif_bladestop(bl, sce->val2, 0); + clif_bladestop( *bl, sce->val2, false ); status_change_end(src, SC_CURSEDCIRCLE_ATKER); } } @@ -15005,7 +15005,7 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) break; case SC_CURSEDCIRCLE_TARGET: if( tsc && tsc->getSCE(SC_CURSEDCIRCLE_TARGET) && tsc->getSCE(SC_CURSEDCIRCLE_TARGET)->val2 == src->id ) { - clif_bladestop(bl, tsc->getSCE(SC_CURSEDCIRCLE_TARGET)->val2, 0); + clif_bladestop( *bl, tsc->getSCE(SC_CURSEDCIRCLE_TARGET)->val2, false ); status_change_end(bl, type); } break;