summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c24
-rw-r--r--src/map/clif.h4
-rw-r--r--src/map/mercenary.c2
3 files changed, 16 insertions, 14 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index ee4e20d79..d9989b865 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8175,12 +8175,9 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
WFIFOSET(fd, WFIFOW(fd, 2));
}
-/*==========================================
- * View player equip request denied
- * R 0291 <message>.W
- * TODO: this looks like a general-purpose packet to print msgstringtable entries.
- *------------------------------------------*/
-void clif_viewequip_fail(struct map_session_data* sd)
+/// Display msgstringtable.txt string (ZC_MSG)
+/// R 0291 <message>.W
+void clif_msg(struct map_session_data* sd, unsigned short id)
{
int fd;
nullpo_retv(sd);
@@ -8188,10 +8185,16 @@ void clif_viewequip_fail(struct map_session_data* sd)
WFIFOHEAD(fd, packet_len(0x291));
WFIFOW(fd, 0) = 0x291;
- WFIFOW(fd, 2) = 0x54d; // This controls which message is displayed. 0x54d is the correct one. Maybe it's used for something else too?
+ WFIFOW(fd, 2) = id; // zero-based msgstringtable.txt index
WFIFOSET(fd, packet_len(0x291));
}
+/// View player equip request denied
+void clif_viewequip_fail(struct map_session_data* sd)
+{
+ clif_msg(sd, 0x54d);
+}
+
/// Validates one global/guild/party/whisper message packet and tries to recognize its components.
/// Returns true if the packet was parsed successfully.
/// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00
@@ -13593,12 +13596,9 @@ void clif_parse_mercenary_action(int fd, struct map_session_data* sd)
* 2 = Your mercenary soldier has been fired.
* 3 = Your mercenary soldier has ran away.
*------------------------------------------*/
-void clif_mercenary_message(int fd, int message)
+void clif_mercenary_message(struct map_session_data* sd, int message)
{
- WFIFOHEAD(fd,4);
- WFIFOW(fd,0) = 0x0291;
- WFIFOW(fd,2) = 1266 + message;
- WFIFOSET(fd,4);
+ clif_msg(sd, 1266 + message);
}
/*------------------------------------------
diff --git a/src/map/clif.h b/src/map/clif.h
index 3f141e68d..f07a75898 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -504,6 +504,8 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
void clif_viewequip_fail(struct map_session_data* sd);
void clif_equipcheckbox(struct map_session_data* sd);
+void clif_msg(struct map_session_data* sd, unsigned short id);
+
//quest system [Kevin] [Inkfish]
void clif_quest_send_list(struct map_session_data * sd);
void clif_quest_send_mission(struct map_session_data * sd);
@@ -545,7 +547,7 @@ void clif_Adopt_reply(struct map_session_data *sd, int type);
// MERCENARIES
void clif_mercenary_info(struct map_session_data *sd);
void clif_mercenary_skillblock(struct map_session_data *sd);
-void clif_mercenary_message(int fd, int message);
+void clif_mercenary_message(struct map_session_data* sd, int message);
void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
// RENTAL SYSTEM
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 53f70a462..79bec2da6 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -258,7 +258,7 @@ int merc_delete(struct mercenary_data *md, int reply)
case 1: mercenary_set_faith(md, -1); break; // -1 Loyalty on Mercenary killed
}
- clif_mercenary_message(sd->fd, reply);
+ clif_mercenary_message(sd, reply);
return unit_remove_map(&md->bl, CLR_OUTSIGHT);
}