diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-09-26 10:39:17 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-09-26 10:39:17 -0300 |
commit | 7bd8183936b5f01ef789822d1f114e85ac391d47 (patch) | |
tree | 0fe4d1f6227a642416c0c46ab405147d2ca801d2 /src/emap/script_buildins.c | |
parent | 7fc3f47e2660ae5b88a4dcdc1c1ca2e6f41ecd9e (diff) | |
download | evol-hercules-7bd8183936b5f01ef789822d1f114e85ac391d47.tar.gz evol-hercules-7bd8183936b5f01ef789822d1f114e85ac391d47.tar.bz2 evol-hercules-7bd8183936b5f01ef789822d1f114e85ac391d47.tar.xz evol-hercules-7bd8183936b5f01ef789822d1f114e85ac391d47.zip |
changeplayermusic() script function
required for clientdata!174
Tested in Moubootaur Legends
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); |