summaryrefslogtreecommitdiff
path: root/src/map/parse.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-25 13:40:10 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-25 13:40:10 +0300
commitb35860a736d42d0320e9a7afbf9d56b7b95214f9 (patch)
tree9586546b1f7a61f1e0e12d5b7344821c8e326dd7 /src/map/parse.c
parentdf032822a50b15877d43920522cabf85fff78589 (diff)
downloadevol-hercules-b35860a736d42d0320e9a7afbf9d56b7b95214f9.tar.gz
evol-hercules-b35860a736d42d0320e9a7afbf9d56b7b95214f9.tar.bz2
evol-hercules-b35860a736d42d0320e9a7afbf9d56b7b95214f9.tar.xz
evol-hercules-b35860a736d42d0320e9a7afbf9d56b7b95214f9.zip
Add packet for homunculus/mercenary talk.
Diffstat (limited to 'src/map/parse.c')
-rw-r--r--src/map/parse.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/map/parse.c b/src/map/parse.c
index 97aac6f..ba73516 100644
--- a/src/map/parse.c
+++ b/src/map/parse.c
@@ -12,6 +12,8 @@
#include "../../../common/strlib.h"
#include "../../../map/channel.h"
#include "../../../map/clif.h"
+#include "../../../map/homunculus.h"
+#include "../../../map/mercenary.h"
#include "../../../map/pc.h"
#include "../../../map/pet.h"
#include "../../../map/unit.h"
@@ -110,11 +112,14 @@ void map_parse_pet_say(int fd)
char message[500];
struct map_session_data* sd = (struct map_session_data*)session[fd]->session_data;
+ if (!sd || !sd->pd)
+ return;
+
const int len = RFIFOW(fd, 2);
if (len > 500 || len < 6)
return;
safestrncpy(message, (char*)RFIFOP(fd, 4), len - 4);
- send_pet_say(sd, message);
+ send_slave_say(sd, &sd->pd->bl, sd->pd->pet.name, message);
}
void map_parse_pet_emote(int fd)
@@ -166,3 +171,18 @@ void map_parse_pet_dir(int fd)
return;
unit->setdir(&sd->pd->bl, RFIFOB(fd, 8));
}
+
+void map_parse_homun_say(int fd)
+{
+ char message[500];
+
+ struct map_session_data* sd = (struct map_session_data*)session[fd]->session_data;
+ const int len = RFIFOW(fd, 2);
+ if (len > 500 || len < 6)
+ return;
+ safestrncpy(message, (char*)RFIFOP(fd, 4), len - 4);
+ if (sd->md && sd->md->db)
+ send_slave_say(sd, &sd->md->bl, sd->md->db->name, message);
+ else if (sd->hd && homun_alive(sd->hd))
+ send_slave_say(sd, &sd->hd->bl, sd->hd->homunculus.name, message);
+}