From 031cdbe5b3f108d7a732c230d061c567de723a75 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 May 2018 04:50:16 +0300 Subject: Add autogenerated messages list headers with original strings and translation. Also add packet version checks for used messages. --- src/map/clif.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 2546b07b3..53838138b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -41,6 +41,7 @@ #include "map/mail.h" #include "map/map.h" #include "map/mercenary.h" +#include "map/messages.h" #include "map/mob.h" #include "map/npc.h" #include "map/party.h" @@ -5638,7 +5639,7 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id clif_menuskill_clear(sd); if( skill_id != AM_PHARMACY ) { // AM_PHARMACY is used to Cooking. // It fails. -#if PACKETVER >= 20090922 +#if PACKETVER >= 20091013 clif->msgtable_skill(sd, skill_id, MSG_SKILL_MATERIAL_FAIL); #else WFIFOW(fd,2) = 6 + 2 * c; @@ -10916,7 +10917,7 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd) return; } if (sd->npc_id || sd->state.workinprogress & 2) { -#if PACKETVER >= 20110309 +#if PACKETVER >= 20110308 clif->msgtable(sd, MSG_BUSY); #else clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); @@ -10933,7 +10934,7 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd) break; case BL_NPC: if (sd->ud.skill_id < RK_ENCHANTBLADE && sd->ud.skilltimer != INVALID_TIMER) { // TODO: should only work with none 3rd job skills -#if PACKETVER >= 20110309 +#if PACKETVER >= 20110308 clif->msgtable(sd, MSG_BUSY); #else clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); @@ -11330,7 +11331,7 @@ void clif_parse_ChangeCart(int fd, struct map_session_data *sd) return; if (sd->npc_id || sd->state.workinprogress & 1) { -#if PACKETVER >= 20110309 +#if PACKETVER >= 20110308 clif->msgtable(sd, MSG_BUSY); #else clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); @@ -11541,7 +11542,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) pc->update_idle_time(sd, BCIDLE_USESKILLTOID); if (sd->npc_id || sd->state.workinprogress & 1) { -#if PACKETVER >= 20110309 +#if PACKETVER >= 20110308 clif->msgtable(sd, MSG_BUSY); #else clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); @@ -11640,7 +11641,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski } if (sd->state.workinprogress & 1) { -#if PACKETVER >= 20110309 +#if PACKETVER >= 20110308 clif->msgtable(sd, MSG_BUSY); #else clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48)); @@ -16133,10 +16134,13 @@ void clif_parse_ViewPlayerEquip(int fd, struct map_session_data* sd) { if (!tsd) return; - if( tsd->status.show_equip || pc_has_permission(sd, PC_PERM_VIEW_EQUIPMENT) ) + if (tsd->status.show_equip || pc_has_permission(sd, PC_PERM_VIEW_EQUIPMENT)) { clif->viewequip_ack(sd, tsd); - else + } else { +#if PACKETVER >= 20070918 clif->msgtable(sd, MSG_OPEN_EQUIPEDITEM_REFUSED); +#endif + } } void clif_parse_cz_config(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -16661,7 +16665,9 @@ void clif_parse_mercenary_action(int fd, struct map_session_data* sd) /// 3 = Your mercenary soldier has ran away. void clif_mercenary_message(struct map_session_data* sd, int message) { +#if PACKETVER >= 20070227 clif->msgtable(sd, MSG_MER_FINISH + message); +#endif } /// Notification about the remaining time of a rental item (ZC_CASH_TIME_COUNTER). @@ -20507,7 +20513,9 @@ void clif_parse_open_ui_request(int fd, struct map_session_data *sd) const struct PACKET_CZ_OPEN_UI *p = RP2PTR(fd); if (clif->attendance_getendtime() < time(NULL)) { +#if PACKETVER >= 20180207 clif->msgtable_color(sd, MSG_ATTENDANCE_UNAVAILABLE, COLOR_RED); +#endif return; } -- cgit v1.2.3-60-g2f50