diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-30 18:30:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-30 18:30:50 +0300 |
commit | 21ec9caab9010b3109050dd891228c191e2b0dd0 (patch) | |
tree | a2aea1f87a6e9405922b3357273fd342d41c9385 /src/map/script.c | |
parent | 5232d8fa98cbfb7a85e15b182eeb1e22d5b7376a (diff) | |
download | plugin-21ec9caab9010b3109050dd891228c191e2b0dd0.tar.gz plugin-21ec9caab9010b3109050dd891228c191e2b0dd0.tar.bz2 plugin-21ec9caab9010b3109050dd891228c191e2b0dd0.tar.xz plugin-21ec9caab9010b3109050dd891228c191e2b0dd0.zip |
Add script command for change music.
New script command: changemusic mapname, music
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 9cb26c5..6d9a5d0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -801,3 +801,17 @@ BUILDIN(clear) send_npccommand(script->rid2sd (st), st->oid, 9); return true; } + +BUILDIN(changeMusic) +{ + const char *const mapName = script_getstr(st, 2); + const char *const music = script_getstr(st, 3); + if (!music || !mapName) + return 0; + const int m = map->mapname2mapid(mapName); + if (m < 0) + return false; + + send_changemusic_brodcast(m, music); + return true; +} |