|
@@ -1984,16 +1984,14 @@ void clif_homskillup( homun_data& hd, uint16 skill_id ){
|
|
/// result:
|
|
/// result:
|
|
/// 0 = failure
|
|
/// 0 = failure
|
|
/// 1 = success
|
|
/// 1 = success
|
|
-void clif_hom_food( map_session_data *sd, int foodid, int fail ){
|
|
|
|
- nullpo_retv( sd );
|
|
|
|
-
|
|
|
|
- struct PACKET_ZC_FEED_MER p;
|
|
|
|
|
|
+void clif_hom_food( map_session_data& sd, int32 foodid, bool success ){
|
|
|
|
+ PACKET_ZC_FEED_MER packet{};
|
|
|
|
|
|
- p.packetType = 0x22f;
|
|
|
|
- p.result = fail;
|
|
|
|
- p.itemId = client_nameid( foodid );
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_FEED_MER;
|
|
|
|
+ packet.result = success;
|
|
|
|
+ packet.itemId = client_nameid( foodid );
|
|
|
|
|
|
- clif_send( &p, sizeof( p ), &sd->bl, SELF );
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -3118,7 +3116,7 @@ void clif_inventorylist( map_session_data *sd ){
|
|
}
|
|
}
|
|
|
|
|
|
if( sd->equip_index[EQI_AMMO] >= 0 )
|
|
if( sd->equip_index[EQI_AMMO] >= 0 )
|
|
- clif_arrowequip( sd, sd->equip_index[EQI_AMMO] );
|
|
|
|
|
|
+ clif_arrowequip( *sd );
|
|
|
|
|
|
if( equip ) {
|
|
if( equip ) {
|
|
itemlist_equip.PacketType = inventorylistequipType;
|
|
itemlist_equip.PacketType = inventorylistequipType;
|
|
@@ -3898,29 +3896,20 @@ void clif_updatestatus( map_session_data& sd, enum _sp type ){
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Notifies client of a parameter change of an another player (ZC_PAR_CHANGE_USER).
|
|
|
|
-/// 01ab <account id>.L <var id>.W <value>.L
|
|
|
|
-void clif_changestatus(map_session_data* sd,int type,int val)
|
|
|
|
-{
|
|
|
|
- unsigned char buf[12];
|
|
|
|
|
|
+/// Notifies client of a parameter change of an another player.
|
|
|
|
+/// 01ab <account id>.L <var id>.W <value>.L (ZC_PAR_CHANGE_USER)
|
|
|
|
+/// var id:
|
|
|
|
+/// SP_MANNER
|
|
|
|
+/// ?
|
|
|
|
+void clif_changemanner( map_session_data& sd ) {
|
|
|
|
+ PACKET_ZC_PAR_CHANGE_USER packet{};
|
|
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_PAR_CHANGE_USER;
|
|
|
|
+ packet.gid = sd.bl.id;
|
|
|
|
+ packet.type = static_cast<decltype(packet.type)>(SP_MANNER);
|
|
|
|
+ packet.value = sd.status.manner;
|
|
|
|
|
|
- WBUFW(buf,0)=0x1ab;
|
|
|
|
- WBUFL(buf,2)=sd->bl.id;
|
|
|
|
- WBUFW(buf,6)=type;
|
|
|
|
-
|
|
|
|
- switch(type)
|
|
|
|
- {
|
|
|
|
- case SP_MANNER:
|
|
|
|
- WBUFL(buf,8)=val;
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- ShowError("clif_changestatus : unrecognized type %d.\n",type);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- clif_send(buf,packet_len(0x1ab),&sd->bl,AREA_WOS);
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, AREA_WOS );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -4108,104 +4097,100 @@ void clif_refreshlook(struct block_list *bl, int id, int type, int val, enum sen
|
|
/// <int>.B <need int>.B <dex>.B <need dex>.B <luk>.B <need luk>.B <atk>.W <atk2>.W
|
|
/// <int>.B <need int>.B <dex>.B <need dex>.B <luk>.B <need luk>.B <atk>.W <atk2>.W
|
|
/// <matk min>.W <matk max>.W <def>.W <def2>.W <mdef>.W <mdef2>.W <hit>.W
|
|
/// <matk min>.W <matk max>.W <def>.W <def2>.W <mdef>.W <mdef2>.W <hit>.W
|
|
/// <flee>.W <flee2>.W <crit>.W <aspd>.W <aspd2>.W
|
|
/// <flee>.W <flee2>.W <crit>.W <aspd>.W <aspd2>.W
|
|
-void clif_initialstatus(map_session_data *sd) {
|
|
|
|
- int fd, mdef2;
|
|
|
|
- unsigned char *buf;
|
|
|
|
-
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
-
|
|
|
|
- fd=sd->fd;
|
|
|
|
- WFIFOHEAD(fd, packet_len(0xbd));
|
|
|
|
- buf = WFIFOP(fd,0);
|
|
|
|
|
|
+void clif_initialstatus( map_session_data& sd ) {
|
|
|
|
+ PACKET_ZC_STATUS packet{};
|
|
|
|
+
|
|
|
|
+ packet.packetType = HEADER_ZC_STATUS;
|
|
|
|
+
|
|
|
|
+ packet.point = min(sd.status.status_point, INT16_MAX);
|
|
|
|
+ packet.str = min(sd.status.str, UINT8_MAX);
|
|
|
|
+ packet.standardStr = pc_need_status_point( &sd, SP_STR, 1 );
|
|
|
|
+ packet.agi = min(sd.status.agi, UINT8_MAX);
|
|
|
|
+ packet.standardAgi = pc_need_status_point( &sd, SP_AGI,1 );
|
|
|
|
+ packet.vit = min(sd.status.vit, UINT8_MAX);
|
|
|
|
+ packet.standardVit = pc_need_status_point( &sd, SP_VIT,1 );
|
|
|
|
+ packet.int_ = min(sd.status.int_, UINT8_MAX);
|
|
|
|
+ packet.standardInt = pc_need_status_point( &sd, SP_INT,1 );
|
|
|
|
+ packet.dex = min(sd.status.dex, UINT8_MAX);
|
|
|
|
+ packet.standardDex = pc_need_status_point( &sd, SP_DEX,1 );
|
|
|
|
+ packet.luk = min(sd.status.luk, UINT8_MAX);
|
|
|
|
+ packet.standardLuk = pc_need_status_point( &sd, SP_LUK,1 );
|
|
|
|
+
|
|
|
|
+ packet.attPower = pc_leftside_atk( &sd );
|
|
|
|
+ packet.refiningPower = pc_rightside_atk( &sd );
|
|
|
|
+ packet.max_mattPower = pc_rightside_matk( &sd );
|
|
|
|
+ packet.min_mattPower = pc_leftside_matk( &sd );
|
|
|
|
+ packet.itemdefPower = pc_leftside_def( &sd );
|
|
|
|
+ packet.plusdefPower = pc_rightside_def( &sd );
|
|
|
|
+ packet.mdefPower = pc_leftside_mdef( &sd );
|
|
|
|
|
|
- WBUFW(buf,0) = 0xbd;
|
|
|
|
- WBUFW(buf,2) = min(sd->status.status_point, INT16_MAX);
|
|
|
|
- WBUFB(buf,4) = min(sd->status.str, UINT8_MAX);
|
|
|
|
- WBUFB(buf,5) = pc_need_status_point(sd,SP_STR,1);
|
|
|
|
- WBUFB(buf,6) = min(sd->status.agi, UINT8_MAX);
|
|
|
|
- WBUFB(buf,7) = pc_need_status_point(sd,SP_AGI,1);
|
|
|
|
- WBUFB(buf,8) = min(sd->status.vit, UINT8_MAX);
|
|
|
|
- WBUFB(buf,9) = pc_need_status_point(sd,SP_VIT,1);
|
|
|
|
- WBUFB(buf,10) = min(sd->status.int_, UINT8_MAX);
|
|
|
|
- WBUFB(buf,11) = pc_need_status_point(sd,SP_INT,1);
|
|
|
|
- WBUFB(buf,12) = min(sd->status.dex, UINT8_MAX);
|
|
|
|
- WBUFB(buf,13) = pc_need_status_point(sd,SP_DEX,1);
|
|
|
|
- WBUFB(buf,14) = min(sd->status.luk, UINT8_MAX);
|
|
|
|
- WBUFB(buf,15) = pc_need_status_point(sd,SP_LUK,1);
|
|
|
|
-
|
|
|
|
- WBUFW(buf,16) = pc_leftside_atk(sd);
|
|
|
|
- WBUFW(buf,18) = pc_rightside_atk(sd);
|
|
|
|
- WBUFW(buf,20) = pc_rightside_matk(sd);
|
|
|
|
- WBUFW(buf,22) = pc_leftside_matk(sd);
|
|
|
|
- WBUFW(buf,24) = pc_leftside_def(sd);
|
|
|
|
- WBUFW(buf,26) = pc_rightside_def(sd);
|
|
|
|
- WBUFW(buf,28) = pc_leftside_mdef(sd);
|
|
|
|
- mdef2 = pc_rightside_mdef(sd);
|
|
|
|
- WBUFW(buf,30) =
|
|
|
|
-#ifndef RENEWAL
|
|
|
|
- ( mdef2 < 0 ) ? 0 : //Negative check for Frenzy'ed characters.
|
|
|
|
|
|
+#ifdef RENEWAL
|
|
|
|
+ packet.plusmdefPower = pc_rightside_mdef( &sd );
|
|
|
|
+#else
|
|
|
|
+ // Negative check for Frenzy'ed characters.
|
|
|
|
+ packet.plusmdefPower = std::max( pc_rightside_mdef( &sd ), 0 );
|
|
#endif
|
|
#endif
|
|
- mdef2;
|
|
|
|
- WBUFW(buf,32) = sd->battle_status.hit;
|
|
|
|
- WBUFW(buf,34) = sd->battle_status.flee;
|
|
|
|
- WBUFW(buf,36) = sd->battle_status.flee2/10;
|
|
|
|
- WBUFW(buf,38) = sd->battle_status.cri/10;
|
|
|
|
- WBUFW(buf,40) = sd->battle_status.amotion; // aspd
|
|
|
|
- WBUFW(buf,42) = 0; // always 0 (plusASPD)
|
|
|
|
-
|
|
|
|
- WFIFOSET(fd, packet_len(0xbd));
|
|
|
|
|
|
|
|
- clif_updatestatus(*sd, SP_STR);
|
|
|
|
- clif_updatestatus(*sd, SP_AGI);
|
|
|
|
- clif_updatestatus(*sd, SP_VIT);
|
|
|
|
- clif_updatestatus(*sd, SP_INT);
|
|
|
|
- clif_updatestatus(*sd, SP_DEX);
|
|
|
|
- clif_updatestatus(*sd, SP_LUK);
|
|
|
|
|
|
+ packet.hitSuccessValue = sd.battle_status.hit;
|
|
|
|
+ packet.avoidSuccessValue = sd.battle_status.flee;
|
|
|
|
+ packet.plusAvoidSuccessValue = sd.battle_status.flee2 / 10;
|
|
|
|
+ packet.criticalSuccessValue = sd.battle_status.cri / 10;
|
|
|
|
+ packet.ASPD = sd.battle_status.amotion;
|
|
|
|
+ packet.plusASPD = 0;
|
|
|
|
|
|
- clif_updatestatus(*sd, SP_ATTACKRANGE);
|
|
|
|
- clif_updatestatus(*sd, SP_ASPD);
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
|
|
|
|
-#ifdef RENEWAL
|
|
|
|
- clif_updatestatus(*sd, SP_POW);
|
|
|
|
- clif_updatestatus(*sd, SP_STA);
|
|
|
|
- clif_updatestatus(*sd, SP_WIS);
|
|
|
|
- clif_updatestatus(*sd, SP_SPL);
|
|
|
|
- clif_updatestatus(*sd, SP_CON);
|
|
|
|
- clif_updatestatus(*sd, SP_CRT);
|
|
|
|
- clif_updatestatus(*sd, SP_PATK);
|
|
|
|
- clif_updatestatus(*sd, SP_SMATK);
|
|
|
|
- clif_updatestatus(*sd, SP_RES);
|
|
|
|
- clif_updatestatus(*sd, SP_MRES);
|
|
|
|
- clif_updatestatus(*sd, SP_HPLUS);
|
|
|
|
- clif_updatestatus(*sd, SP_CRATE);
|
|
|
|
- clif_updatestatus(*sd, SP_TRAITPOINT);
|
|
|
|
- clif_updatestatus(*sd, SP_AP);
|
|
|
|
- clif_updatestatus(*sd, SP_MAXAP);
|
|
|
|
- clif_updatestatus(*sd, SP_UPOW);
|
|
|
|
- clif_updatestatus(*sd, SP_USTA);
|
|
|
|
- clif_updatestatus(*sd, SP_UWIS);
|
|
|
|
- clif_updatestatus(*sd, SP_USPL);
|
|
|
|
- clif_updatestatus(*sd, SP_UCON);
|
|
|
|
- clif_updatestatus(*sd, SP_UCRT);
|
|
|
|
-#endif
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-/// Marks an ammunition item in inventory as equipped (ZC_EQUIP_ARROW).
|
|
|
|
-/// 013c <index>.W
|
|
|
|
-void clif_arrowequip(map_session_data *sd,int val) {
|
|
|
|
- int fd;
|
|
|
|
|
|
+ clif_updatestatus(sd, SP_STR);
|
|
|
|
+ clif_updatestatus(sd, SP_AGI);
|
|
|
|
+ clif_updatestatus(sd, SP_VIT);
|
|
|
|
+ clif_updatestatus(sd, SP_INT);
|
|
|
|
+ clif_updatestatus(sd, SP_DEX);
|
|
|
|
+ clif_updatestatus(sd, SP_LUK);
|
|
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
|
|
+ clif_updatestatus(sd, SP_ATTACKRANGE);
|
|
|
|
+ clif_updatestatus(sd, SP_ASPD);
|
|
|
|
|
|
|
|
+#ifdef RENEWAL
|
|
|
|
+ clif_updatestatus(sd, SP_POW);
|
|
|
|
+ clif_updatestatus(sd, SP_STA);
|
|
|
|
+ clif_updatestatus(sd, SP_WIS);
|
|
|
|
+ clif_updatestatus(sd, SP_SPL);
|
|
|
|
+ clif_updatestatus(sd, SP_CON);
|
|
|
|
+ clif_updatestatus(sd, SP_CRT);
|
|
|
|
+ clif_updatestatus(sd, SP_PATK);
|
|
|
|
+ clif_updatestatus(sd, SP_SMATK);
|
|
|
|
+ clif_updatestatus(sd, SP_RES);
|
|
|
|
+ clif_updatestatus(sd, SP_MRES);
|
|
|
|
+ clif_updatestatus(sd, SP_HPLUS);
|
|
|
|
+ clif_updatestatus(sd, SP_CRATE);
|
|
|
|
+ clif_updatestatus(sd, SP_TRAITPOINT);
|
|
|
|
+ clif_updatestatus(sd, SP_AP);
|
|
|
|
+ clif_updatestatus(sd, SP_MAXAP);
|
|
|
|
+ clif_updatestatus(sd, SP_UPOW);
|
|
|
|
+ clif_updatestatus(sd, SP_USTA);
|
|
|
|
+ clif_updatestatus(sd, SP_UWIS);
|
|
|
|
+ clif_updatestatus(sd, SP_USPL);
|
|
|
|
+ clif_updatestatus(sd, SP_UCON);
|
|
|
|
+ clif_updatestatus(sd, SP_UCRT);
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/// Marks an ammunition item in inventory as equipped.
|
|
|
|
+/// 013c <index>.W (ZC_EQUIP_ARROW)
|
|
|
|
+void clif_arrowequip( map_session_data& sd ) {
|
|
#if PACKETVER >= 20121128
|
|
#if PACKETVER >= 20121128
|
|
- clif_status_change(&sd->bl, EFST_CLIENT_ONLY_EQUIP_ARROW, 1, INFINITE_TICK, 0, 0, 0);
|
|
|
|
|
|
+ clif_status_change(&sd.bl, EFST_CLIENT_ONLY_EQUIP_ARROW, 1, INFINITE_TICK, 0, 0, 0);
|
|
#endif
|
|
#endif
|
|
- fd=sd->fd;
|
|
|
|
- WFIFOHEAD(fd, packet_len(0x013c));
|
|
|
|
- WFIFOW(fd,0) = 0x013c;
|
|
|
|
- WFIFOW(fd,2) = val + 2; //Item ID of the arrow
|
|
|
|
- WFIFOSET(fd, packet_len(0x013c));
|
|
|
|
|
|
+
|
|
|
|
+ PACKET_ZC_EQUIP_ARROW packet{};
|
|
|
|
+
|
|
|
|
+ packet.packetType = HEADER_ZC_EQUIP_ARROW;
|
|
|
|
+
|
|
|
|
+ // Inventory index of the arrow
|
|
|
|
+ packet.index = client_index( sd.equip_index[EQI_AMMO] );
|
|
|
|
+
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -5982,17 +5967,15 @@ void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x,
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Notifies clients in area, that an object canceled casting (ZC_DISPEL).
|
|
|
|
-/// 01b9 <id>.L
|
|
|
|
-void clif_skillcastcancel(struct block_list* bl)
|
|
|
|
-{
|
|
|
|
- unsigned char buf[16];
|
|
|
|
|
|
+/// Notifies clients in area, that an object canceled casting.
|
|
|
|
+/// 01b9 <id>.L (ZC_DISPEL)
|
|
|
|
+void clif_skillcastcancel( block_list& bl ){
|
|
|
|
+ PACKET_ZC_DISPEL packet{};
|
|
|
|
|
|
- nullpo_retv(bl);
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_DISPEL;
|
|
|
|
+ packet.gid = bl.id;
|
|
|
|
|
|
- WBUFW(buf,0) = 0x1b9;
|
|
|
|
- WBUFL(buf,2) = bl->id;
|
|
|
|
- clif_send(buf,packet_len(0x1b9), bl, AREA);
|
|
|
|
|
|
+ clif_send( &packet, sizeof(PACKET_ZC_DISPEL), &bl, AREA );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -6045,21 +6028,17 @@ void clif_skill_fail( map_session_data& sd, uint16 skill_id, enum useskill_fail_
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Skill cooldown display icon (ZC_SKILL_POSTDELAY).
|
|
|
|
-/// 043d <skill ID>.W <tick>.L
|
|
|
|
-void clif_skill_cooldown(map_session_data *sd, uint16 skill_id, t_tick tick)
|
|
|
|
-{
|
|
|
|
-#if PACKETVER>=20081112
|
|
|
|
- int fd;
|
|
|
|
|
|
+/// Skill cooldown display icon.
|
|
|
|
+/// 043d <skill ID>.W <tick>.L (ZC_SKILL_POSTDELAY)
|
|
|
|
+void clif_skill_cooldown( map_session_data &sd, uint16 skill_id, t_tick tick ){
|
|
|
|
+#if PACKETVER_MAIN_NUM >= 20081112 || PACKETVER_RE_NUM >= 20081111 || defined(PACKETVER_ZERO)
|
|
|
|
+ PACKET_ZC_SKILL_POSTDELAY packet{};
|
|
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
|
|
+ packet.PacketType = HEADER_ZC_SKILL_POSTDELAY;
|
|
|
|
+ packet.SKID = skill_id;
|
|
|
|
+ packet.DelayTM = client_tick(tick);
|
|
|
|
|
|
- fd=sd->fd;
|
|
|
|
- WFIFOHEAD(fd,packet_len(0x43d));
|
|
|
|
- WFIFOW(fd,0) = 0x43d;
|
|
|
|
- WFIFOW(fd,2) = skill_id;
|
|
|
|
- WFIFOL(fd,4) = client_tick(tick);
|
|
|
|
- WFIFOSET(fd,packet_len(0x43d));
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6321,8 +6300,8 @@ void clif_skill_warppoint( map_session_data* sd, uint16 skill_id, uint16 skill_l
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Memo message (ZC_ACK_REMEMBER_WARPPOINT).
|
|
|
|
-/// 011e <type>.B
|
|
|
|
|
|
+/// Memo message.
|
|
|
|
+/// 011e <type>.B (ZC_ACK_REMEMBER_WARPPOINT)
|
|
/// type:
|
|
/// type:
|
|
/// 0 = "Saved location as a Memo Point for Warp skill." in color 0xFFFF00 (cyan)
|
|
/// 0 = "Saved location as a Memo Point for Warp skill." in color 0xFFFF00 (cyan)
|
|
/// 1 = "Skill Level is not high enough." in color 0x0000FF (red)
|
|
/// 1 = "Skill Level is not high enough." in color 0x0000FF (red)
|
|
@@ -6330,39 +6309,33 @@ void clif_skill_warppoint( map_session_data* sd, uint16 skill_id, uint16 skill_l
|
|
///
|
|
///
|
|
/// @param sd Who receives the message
|
|
/// @param sd Who receives the message
|
|
/// @param type What message
|
|
/// @param type What message
|
|
-void clif_skill_memomessage(map_session_data* sd, int type)
|
|
|
|
-{
|
|
|
|
- int fd;
|
|
|
|
|
|
+void clif_skill_memomessage( map_session_data& sd, e_ack_remember_warppoint_result result ){
|
|
|
|
+ PACKET_ZC_ACK_REMEMBER_WARPPOINT packet{};
|
|
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_ACK_REMEMBER_WARPPOINT;
|
|
|
|
+ packet.type = static_cast<decltype(packet.type)>(result);
|
|
|
|
|
|
- fd=sd->fd;
|
|
|
|
- WFIFOHEAD(fd,packet_len(0x11e));
|
|
|
|
- WFIFOW(fd,0)=0x11e;
|
|
|
|
- WFIFOB(fd,2)=type;
|
|
|
|
- WFIFOSET(fd,packet_len(0x11e));
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Teleport message (ZC_NOTIFY_MAPINFO).
|
|
|
|
-/// 0189 <type>.W
|
|
|
|
|
|
+/// Teleport message.
|
|
|
|
+/// 0189 <type>.W (ZC_NOTIFY_MAPINFO)
|
|
/// type:
|
|
/// type:
|
|
/// 0 = "Unable to Teleport in this area" in color 0xFFFF00 (cyan)
|
|
/// 0 = "Unable to Teleport in this area" in color 0xFFFF00 (cyan)
|
|
/// 1 = "Saved point cannot be memorized." in color 0x0000FF (red)
|
|
/// 1 = "Saved point cannot be memorized." in color 0x0000FF (red)
|
|
|
|
+/// 2 = "This skill cannot be used in this area"
|
|
|
|
+/// 3 = "This item cannot be used in this area"
|
|
///
|
|
///
|
|
/// @param sd Who receives the message
|
|
/// @param sd Who receives the message
|
|
/// @param type What message
|
|
/// @param type What message
|
|
-void clif_skill_teleportmessage(map_session_data *sd, int type)
|
|
|
|
-{
|
|
|
|
- int fd;
|
|
|
|
|
|
+void clif_skill_teleportmessage( map_session_data& sd, e_notify_mapinfo_result result ){
|
|
|
|
+ PACKET_ZC_NOTIFY_MAPINFO packet{};
|
|
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_NOTIFY_MAPINFO;
|
|
|
|
+ packet.type = static_cast<decltype(packet.type)>(result);
|
|
|
|
|
|
- fd=sd->fd;
|
|
|
|
- WFIFOHEAD(fd,packet_len(0x189));
|
|
|
|
- WFIFOW(fd,0)=0x189;
|
|
|
|
- WFIFOW(fd,2)=type;
|
|
|
|
- WFIFOSET(fd,packet_len(0x189));
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -6914,23 +6887,22 @@ void clif_heal(int fd,int type,int val) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Displays resurrection effect (ZC_RESURRECTION).
|
|
|
|
-/// 0148 <id>.L <type>.W
|
|
|
|
|
|
+/// Displays resurrection effect.
|
|
|
|
+/// 0148 <id>.L <type>.W (ZC_RESURRECTION)
|
|
/// type:
|
|
/// type:
|
|
/// ignored
|
|
/// ignored
|
|
-void clif_resurrection(struct block_list *bl,int type)
|
|
|
|
-{
|
|
|
|
- unsigned char buf[16];
|
|
|
|
|
|
+void clif_resurrection( block_list& bl ){
|
|
|
|
+ PACKET_ZC_RESURRECTION packet{};
|
|
|
|
|
|
- nullpo_retv(bl);
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_RESURRECTION;
|
|
|
|
+ packet.gid = bl.id;
|
|
|
|
+ packet.type = 0;
|
|
|
|
|
|
- WBUFW(buf,0)=0x148;
|
|
|
|
- WBUFL(buf,2)=bl->id;
|
|
|
|
- WBUFW(buf,6)=0;
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &bl, AREA );
|
|
|
|
|
|
- clif_send(buf,packet_len(0x148),bl,type==1 ? AREA : AREA_WOS);
|
|
|
|
- if (disguised(bl))
|
|
|
|
- clif_spawn(bl);
|
|
|
|
|
|
+ if (disguised(&bl)) {
|
|
|
|
+ clif_spawn(&bl);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -6971,19 +6943,15 @@ void clif_map_property(struct block_list *bl, enum map_property property, enum s
|
|
clif_send(buf,packet_len(cmd),bl,t);
|
|
clif_send(buf,packet_len(cmd),bl,t);
|
|
}
|
|
}
|
|
|
|
|
|
-/// Set the map type (ZC_NOTIFY_MAPPROPERTY2).
|
|
|
|
-/// 01d6 <type>.W
|
|
|
|
-void clif_map_type(map_session_data* sd, enum map_type type)
|
|
|
|
-{
|
|
|
|
- int fd;
|
|
|
|
|
|
+/// Set the map type.
|
|
|
|
+/// 01d6 <type>.W (ZC_NOTIFY_MAPPROPERTY2)
|
|
|
|
+void clif_map_type( map_session_data& sd, e_map_type type ){
|
|
|
|
+ PACKET_ZC_NOTIFY_MAPPROPERTY2 packet{};
|
|
|
|
|
|
- nullpo_retv(sd);
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_NOTIFY_MAPPROPERTY2;
|
|
|
|
+ packet.type = static_cast<decltype(packet.type)>(type);
|
|
|
|
|
|
- fd=sd->fd;
|
|
|
|
- WFIFOHEAD(fd,packet_len(0x1D6));
|
|
|
|
- WFIFOW(fd,0)=0x1D6;
|
|
|
|
- WFIFOW(fd,2)=type;
|
|
|
|
- WFIFOSET(fd,packet_len(0x1D6));
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -7032,22 +7000,23 @@ void clif_map_property_mapall(int map_idx, enum map_property property)
|
|
clif_map_property( &bl, property, ALL_SAMEMAP );
|
|
clif_map_property( &bl, property, ALL_SAMEMAP );
|
|
}
|
|
}
|
|
|
|
|
|
-/// Notifies the client about the result of a refine attempt (ZC_ACK_ITEMREFINING).
|
|
|
|
-/// 0188 <result>.W <index>.W <refine>.W
|
|
|
|
|
|
+/// Notifies the client about the result of a refine attempt.
|
|
|
|
+/// 0188 <result>.W <index>.W <refine>.W (ZC_ACK_ITEMREFINING)
|
|
/// result:
|
|
/// result:
|
|
/// 0 = success
|
|
/// 0 = success
|
|
/// 1 = failure
|
|
/// 1 = failure
|
|
/// 2 = downgrade
|
|
/// 2 = downgrade
|
|
-void clif_refine(int fd, int fail, int index, int val)
|
|
|
|
-{
|
|
|
|
- WFIFOHEAD(fd,packet_len(0x188));
|
|
|
|
- WFIFOW(fd,0)=0x188;
|
|
|
|
- WFIFOW(fd,2)=fail;
|
|
|
|
- WFIFOW(fd,4)=index+2;
|
|
|
|
- WFIFOW(fd,6)=val;
|
|
|
|
- WFIFOSET(fd,packet_len(0x188));
|
|
|
|
-}
|
|
|
|
|
|
+/// 3 = failure (?)
|
|
|
|
+void clif_refine( map_session_data& sd, uint16 index, e_ack_itemrefining result ){
|
|
|
|
+ PACKET_ZC_ACK_ITEMREFINING packet{};
|
|
|
|
+
|
|
|
|
+ packet.packetType = HEADER_ZC_ACK_ITEMREFINING;
|
|
|
|
+ packet.result = static_cast<decltype(packet.result)>(result);
|
|
|
|
+ packet.index = client_index( index );
|
|
|
|
+ packet.value = static_cast<decltype(packet.value)>( sd.inventory.u.items_inventory[index].refine );
|
|
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
|
|
+}
|
|
|
|
|
|
/// Notifies the client about the result of a weapon refine attempt (ZC_ACK_WEAPONREFINE).
|
|
/// Notifies the client about the result of a weapon refine attempt (ZC_ACK_WEAPONREFINE).
|
|
/// 0223 <result>.L <nameid>.W
|
|
/// 0223 <result>.L <nameid>.W
|
|
@@ -8493,21 +8462,19 @@ void clif_pet_emotion(struct pet_data *pd,int param)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/// Result of request to feed a pet (ZC_FEED_PET).
|
|
|
|
-/// 01a3 <result>.B <name id>.W
|
|
|
|
|
|
+/// Result of request to feed a pet.
|
|
|
|
+/// 01a3 <result>.B <name id>.W (ZC_FEED_PET)
|
|
/// result:
|
|
/// result:
|
|
/// 0 = failure
|
|
/// 0 = failure
|
|
/// 1 = success
|
|
/// 1 = success
|
|
-void clif_pet_food( map_session_data *sd, int foodid,int fail ){
|
|
|
|
- nullpo_retv( sd );
|
|
|
|
-
|
|
|
|
- struct PACKET_ZC_FEED_PET p;
|
|
|
|
|
|
+void clif_pet_food( map_session_data& sd, int32 foodid, bool success ){
|
|
|
|
+ PACKET_ZC_FEED_PET packet{};
|
|
|
|
|
|
- p.packetType = 0x1a3;
|
|
|
|
- p.result = fail;
|
|
|
|
- p.itemId = client_nameid( foodid );
|
|
|
|
|
|
+ packet.packetType = HEADER_ZC_FEED_PET;
|
|
|
|
+ packet.result = success;
|
|
|
|
+ packet.itemId = client_nameid( foodid );
|
|
|
|
|
|
- clif_send( &p, sizeof( p ), &sd->bl, SELF );
|
|
|
|
|
|
+ clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
|
}
|
|
}
|
|
|
|
|
|
/// Send pet auto feed info.
|
|
/// Send pet auto feed info.
|
|
@@ -11039,7 +11006,7 @@ void clif_parse_LoadEndAck(int fd,map_session_data *sd)
|
|
clif_updatestatus(*sd,SP_JOBEXP);
|
|
clif_updatestatus(*sd,SP_JOBEXP);
|
|
clif_updatestatus(*sd,SP_NEXTJOBEXP);
|
|
clif_updatestatus(*sd,SP_NEXTJOBEXP);
|
|
clif_updatestatus(*sd,SP_SKILLPOINT);
|
|
clif_updatestatus(*sd,SP_SKILLPOINT);
|
|
- clif_initialstatus(sd);
|
|
|
|
|
|
+ clif_initialstatus( *sd );
|
|
|
|
|
|
if (sd->sc.option&OPTION_FALCON)
|
|
if (sd->sc.option&OPTION_FALCON)
|
|
clif_status_load(&sd->bl, EFST_FALCON, 1);
|
|
clif_status_load(&sd->bl, EFST_FALCON, 1);
|
|
@@ -11161,7 +11128,7 @@ void clif_parse_LoadEndAck(int fd,map_session_data *sd)
|
|
|
|
|
|
if( mapdata->getMapFlag(MF_BATTLEGROUND) )
|
|
if( mapdata->getMapFlag(MF_BATTLEGROUND) )
|
|
{
|
|
{
|
|
- clif_map_type(sd, MAPTYPE_BATTLEFIELD); // Battleground Mode
|
|
|
|
|
|
+ clif_map_type( *sd, MAPTYPE_BATTLEFIELD ); // Battleground Mode
|
|
if( map_getmapflag(sd->bl.m, MF_BATTLEGROUND) == 2 )
|
|
if( map_getmapflag(sd->bl.m, MF_BATTLEGROUND) == 2 )
|
|
clif_bg_updatescore_single(sd);
|
|
clif_bg_updatescore_single(sd);
|
|
}
|
|
}
|
|
@@ -22548,7 +22515,7 @@ void clif_parse_refineui_refine( int fd, map_session_data* sd ){
|
|
item->refine = cap_value( item->refine + 1, 0, MAX_REFINE );
|
|
item->refine = cap_value( item->refine + 1, 0, MAX_REFINE );
|
|
log_pick_pc( sd, LOG_TYPE_OTHER, 1, item );
|
|
log_pick_pc( sd, LOG_TYPE_OTHER, 1, item );
|
|
clif_misceffect( &sd->bl, 3 );
|
|
clif_misceffect( &sd->bl, 3 );
|
|
- clif_refine( fd, 0, index, item->refine );
|
|
|
|
|
|
+ clif_refine( *sd, index, ITEMREFINING_SUCCESS );
|
|
if (info->broadcast_success) {
|
|
if (info->broadcast_success) {
|
|
clif_broadcast_refine_result(*sd, item->nameid, item->refine, true);
|
|
clif_broadcast_refine_result(*sd, item->nameid, item->refine, true);
|
|
}
|
|
}
|
|
@@ -22564,20 +22531,20 @@ void clif_parse_refineui_refine( int fd, map_session_data* sd ){
|
|
}
|
|
}
|
|
// Blacksmith blessings were used to prevent breaking and downgrading
|
|
// Blacksmith blessings were used to prevent breaking and downgrading
|
|
if( blacksmith_amount > 0 ){
|
|
if( blacksmith_amount > 0 ){
|
|
- clif_refine( fd, 3, index, item->refine );
|
|
|
|
|
|
+ clif_refine( *sd, index, ITEMREFINING_FAILURE2 );
|
|
clif_refineui_info( sd, index );
|
|
clif_refineui_info( sd, index );
|
|
// Delete the item if it is breakable
|
|
// Delete the item if it is breakable
|
|
}else if( cost->breaking_rate > 0 && ( rnd() % 10000 ) < cost->breaking_rate ){
|
|
}else if( cost->breaking_rate > 0 && ( rnd() % 10000 ) < cost->breaking_rate ){
|
|
- clif_refine( fd, 1, index, item->refine );
|
|
|
|
|
|
+ clif_refine( *sd, index, ITEMREFINING_FAILURE );
|
|
pc_delitem( sd, index, 1, 0, 2, LOG_TYPE_CONSUME );
|
|
pc_delitem( sd, index, 1, 0, 2, LOG_TYPE_CONSUME );
|
|
// Downgrade the item if necessary
|
|
// Downgrade the item if necessary
|
|
}else if( cost->downgrade_amount > 0 ){
|
|
}else if( cost->downgrade_amount > 0 ){
|
|
item->refine = cap_value( item->refine - cost->downgrade_amount, 0, MAX_REFINE );
|
|
item->refine = cap_value( item->refine - cost->downgrade_amount, 0, MAX_REFINE );
|
|
- clif_refine( fd, 2, index, item->refine );
|
|
|
|
|
|
+ clif_refine( *sd, index, ITEMREFINING_DOWNGRADE );
|
|
clif_refineui_info(sd, index);
|
|
clif_refineui_info(sd, index);
|
|
// Only show failure, but dont do anything
|
|
// Only show failure, but dont do anything
|
|
}else{
|
|
}else{
|
|
- clif_refine( fd, 3, index, item->refine );
|
|
|
|
|
|
+ clif_refine( *sd, index, ITEMREFINING_FAILURE2 );
|
|
clif_refineui_info( sd, index );
|
|
clif_refineui_info( sd, index );
|
|
}
|
|
}
|
|
|
|
|