diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-17 13:33:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-17 13:33:56 +0300 |
commit | 1e21393782af0df7c528dba5a2f0a80ea0c7e4ab (patch) | |
tree | 3ff648f4638426b6401bd8a62d5d0babc65bde30 /src/map/send.c | |
parent | c7a03f4a20ae7a39277417ee566211f7dd94130a (diff) | |
download | plugin-1e21393782af0df7c528dba5a2f0a80ea0c7e4ab.tar.gz plugin-1e21393782af0df7c528dba5a2f0a80ea0c7e4ab.tar.bz2 plugin-1e21393782af0df7c528dba5a2f0a80ea0c7e4ab.tar.xz plugin-1e21393782af0df7c528dba5a2f0a80ea0c7e4ab.zip |
add pet talk packet.
Changed server version to 5.
Diffstat (limited to 'src/map/send.c')
-rw-r--r-- | src/map/send.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map/send.c b/src/map/send.c index 179e199..097622a 100644 --- a/src/map/send.c +++ b/src/map/send.c @@ -10,9 +10,11 @@ #include "../../../common/mmo.h" #include "../../../common/socket.h" #include "../../../common/strlib.h" +#include "../../../map/clif.h" #include "../../../map/mob.h" #include "../../../map/npc.h" #include "../../../map/pc.h" +#include "../../../map/pet.h" #include "../../../map/unit.h" #include "map/send.h" @@ -257,3 +259,18 @@ void send_join_ack(int fd, const char *const name, int flag) WFIFOB (fd, 26) = flag; WFIFOSET (fd, 27); } + +void send_pet_say(struct map_session_data *sd, const char *const message) +{ + if (!sd || !sd->pd) + return; + + const char *const name = sd->pd->pet.name; + const int len = 24 + 4 + strlen(message); + char *buf = NULL; + CREATE(buf, char, len); + + snprintf(buf, len, "%s : %s", name, message); + buf[len - 1] = 0; + clif->GlobalMessage(&sd->pd->bl, buf); +} |