From 21ec9caab9010b3109050dd891228c191e2b0dd0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 30 Nov 2014 18:30:50 +0300 Subject: Add script command for change music. New script command: changemusic mapname, music --- src/map/send.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/map/send.c') diff --git a/src/map/send.c b/src/map/send.c index b3ab051..be913e0 100644 --- a/src/map/send.c +++ b/src/map/send.c @@ -150,3 +150,19 @@ void send_advmoving(struct unit_data* ud, struct block_list *tbl, enum send_targ clif->send(buf, i, tbl, target); aFree(buf); } + +void send_changemusic_brodcast(const int map, const char *music) +{ + if (!music) + return; + + struct block_list bl; + const int sz = strlen (music) + 5; + char buf[sz]; + + bl.m = map; + WBUFW (buf, 0) = 0xb05; + WBUFW (buf, 2) = sz; + strcpy ((char *)WBUFP (buf, 4), music); + clif->send (buf, sz, &bl, ALL_SAMEMAP); +} -- cgit v1.2.3-70-g09d2