summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-09-26 10:39:17 -0300
committerJesusaves <cpntb1@ymail.com>2020-09-26 10:39:17 -0300
commit7bd8183936b5f01ef789822d1f114e85ac391d47 (patch)
tree0fe4d1f6227a642416c0c46ab405147d2ca801d2 /src/emap/script_buildins.c
parent7fc3f47e2660ae5b88a4dcdc1c1ca2e6f41ecd9e (diff)
downloadevol-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.c24
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);