diff options
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r-- | src/emap/script_buildins.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 85e81b2..263e3a6 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -921,6 +921,30 @@ BUILDIN(changeMusic) return true; } +// changePlayerMusic(music) +BUILDIN(changePlayerMusic) +{ + const char *const music = script_getstr(st, 2); + if (!music) + { + ShowWarning("invalid music file\n"); + script->reportsrc(st); + return false; + } + + struct map_session_data *sd = NULL; + sd = script->rid2sd(st); + if (sd == NULL) + { + ShowWarning("player not attached\n"); + script->reportsrc(st); + return false; + } + + send_changemusic(sd->fd, music); + return true; +} + BUILDIN(setNpcDialogTitle) { const char *const name = script_getstr(st, 2); |