summaryrefslogtreecommitdiff
path: root/src/emap/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-28 18:36:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-28 18:36:58 +0300
commit07758e21abf23ad6742b0f6aacedbb7c60c81e98 (patch)
tree7f5b9b0bd7107426f97bc91150b52d2655e0d3f4 /src/emap/clif.c
parent7218f15b792d6ae2bf88b65f6901ae5aa86ecb7a (diff)
downloadplugin-07758e21abf23ad6742b0f6aacedbb7c60c81e98.tar.gz
plugin-07758e21abf23ad6742b0f6aacedbb7c60c81e98.tar.bz2
plugin-07758e21abf23ad6742b0f6aacedbb7c60c81e98.tar.xz
plugin-07758e21abf23ad6742b0f6aacedbb7c60c81e98.zip
Add support for team id for battleground players.
New script function: setbgteam bgid, num It set for 'bgid' team id to 'num'.
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r--src/emap/clif.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c
index 9583ac3..117a7c6 100644
--- a/src/emap/clif.c
+++ b/src/emap/clif.c
@@ -389,6 +389,28 @@ int eclif_send_actual(int *fd, void *buf, int *len)
return 0;
}
}
+ if (packet == 0x2dd)
+ {
+ struct SessionExt *data = session_get(*fd);
+ if (!data)
+ return 0;
+ if (data->clientVersion >= 12)
+ { // not sending old packets to new clients
+ hookStop();
+ return 0;
+ }
+ }
+ if (packet == 0xb1a)
+ {
+ struct SessionExt *data = session_get(*fd);
+ if (!data)
+ return 0;
+ if (data->clientVersion < 12)
+ { // not sending new packets to old clients
+ hookStop();
+ return 0;
+ }
+ }
}
return 0;
}
@@ -615,3 +637,37 @@ void eclif_dropflooritem(struct flooritem_data* fitem)
clif->send(&buf, 28, &fitem->bl, AREA);
}
+
+void eclif_sendbgemblem_area(struct map_session_data *sd)
+{
+ unsigned char buf[34];
+ struct SessionExt *data = session_get_bysd(sd);
+ if (!sd || !data || data->clientVersion < 12)
+ return;
+
+ WBUFW(buf, 0) = 0xb1a;
+ WBUFL(buf, 2) = sd->bl.id;
+ safestrncpy((char*)WBUFP(buf,6), sd->status.name, NAME_LENGTH); // name don't show in screen.
+ WBUFW(buf, 30) = sd->bg_id;
+ WBUFW(buf, 32) = data->teamId;
+ clif->send(buf, 34, &sd->bl, AREA);
+}
+
+void eclif_sendbgemblem_single(int *fdPtr, struct map_session_data *sd)
+{
+ int fd = *fdPtr;
+ struct SessionExt *data = session_get_bysd(sd);
+ struct SessionExt *ddata = session_get_bysd(sd);
+ if (!sd || !data || !ddata || ddata->clientVersion < 12)
+ return;
+
+ WFIFOHEAD(fd, 34);
+ WFIFOW(fd, 0) = 0xb1a;
+ WFIFOL(fd, 2) = sd->bl.id;
+ safestrncpy((char*)WFIFOP(fd, 6), sd->status.name, NAME_LENGTH);
+ WFIFOW(fd, 30) = sd->bg_id;
+ WFIFOW(fd, 32) = data->teamId;
+ WFIFOSET(fd, 34);
+ hookStop();
+ return;
+}