summaryrefslogtreecommitdiff
path: root/npc/commands/music.txt
diff options
context:
space:
mode:
authorSaulc <lucashelaine14@gmail.com>2018-01-13 20:50:42 +0100
committerSaulc <lucashelaine14@gmail.com>2018-01-13 20:50:42 +0100
commit20df2abc1aca00d6aa5dc78347133890f36b32f3 (patch)
tree4ad4a8bb8b0605473a702e314799a4626347721a /npc/commands/music.txt
downloadserverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.gz
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.bz2
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.tar.xz
serverdata-20df2abc1aca00d6aa5dc78347133890f36b32f3.zip
Initial commit
Diffstat (limited to 'npc/commands/music.txt')
-rw-r--r--npc/commands/music.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/npc/commands/music.txt b/npc/commands/music.txt
new file mode 100644
index 000000000..e794060fc
--- /dev/null
+++ b/npc/commands/music.txt
@@ -0,0 +1,46 @@
+// @music atcommand
+// changes the music for all players on the map
+//
+// group lv: 2
+// group char lv: 99
+// log: True
+//
+// usage:
+// @music <short name>
+//
+// example:
+// @music fun
+
+- script @music 32767,{
+ end;
+
+OnCall:
+ if (!is_evtc())
+ {
+ end;
+ }
+
+ // TODO: tmw-like argv splitter
+ getmapxy .@map$, .@void, .@void, UNITTYPE_PC; // get map
+
+ .@key$ = .@atcmd_parameters$[0];
+ .@m$ = htget(.hash, .@key$, "Not found");
+
+ if (.@m$ == "Not found")
+ {
+ .@m$ = implode(.@atcmd_parameters$[0], " ");
+ }
+
+ changemusic .@map$, .@m$ + ".ogg";
+ end;
+
+OnInit:
+ bindatcmd "music", "@music::OnCall", 0, 99, 1;
+
+ .hash = htnew; // create hashtable
+ htput(.hash, "forest", "bartk - in the forest of the birches");
+ htput(.hash, "adventure", "bartk - the adventure begins");
+ htput(.hash, "fun", "eric matyas - ghoulish fun");
+ htput(.hash, "surreal", "eric matyas - surreal place");
+ htput(.hash, "ocean", "ezili - ocean sounds");
+}