summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-10-11 16:17:11 +0000
committerJesusaves <cpntb1@ymail.com>2020-10-11 16:17:11 +0000
commite7ff598d02c8559661bcd39ad63e7a6d2577f3d0 (patch)
tree0fe4d1f6227a642416c0c46ab405147d2ca801d2 /src/emap/script_buildins.c
parent7fc3f47e2660ae5b88a4dcdc1c1ca2e6f41ecd9e (diff)
parent7bd8183936b5f01ef789822d1f114e85ac391d47 (diff)
downloadevol-hercules-e7ff598d02c8559661bcd39ad63e7a6d2577f3d0.tar.gz
evol-hercules-e7ff598d02c8559661bcd39ad63e7a6d2577f3d0.tar.bz2
evol-hercules-e7ff598d02c8559661bcd39ad63e7a6d2577f3d0.tar.xz
evol-hercules-e7ff598d02c8559661bcd39ad63e7a6d2577f3d0.zip
Merge branch 'jesusalva/music' into 'master'
changeplayermusic() script function See merge request evol/evol-hercules!29
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);