summaryrefslogtreecommitdiff
path: root/npc/commands/music.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-01-25 13:25:54 -0300
committerJesusaves <cpntb1@ymail.com>2020-01-25 13:25:54 -0300
commit15980870495e892fd5bd1381b62df1a6cceb298c (patch)
tree4b81cab9303ff6d601270fa57087f7177d38cd18 /npc/commands/music.txt
parentee0388655c35811fcadf57f9e5d3381f8de6cc02 (diff)
downloadserverdata-15980870495e892fd5bd1381b62df1a6cceb298c.tar.gz
serverdata-15980870495e892fd5bd1381b62df1a6cceb298c.tar.bz2
serverdata-15980870495e892fd5bd1381b62df1a6cceb298c.tar.xz
serverdata-15980870495e892fd5bd1381b62df1a6cceb298c.zip
New command for SPONSORS only: @mymusic
Allows sponsors to change the music track currently playing on their game. All game soundtracks are available for selection. Non-sponsors can make themselves useful by hacking their client code instead %%o
Diffstat (limited to 'npc/commands/music.txt')
-rw-r--r--npc/commands/music.txt24
1 files changed, 22 insertions, 2 deletions
diff --git a/npc/commands/music.txt b/npc/commands/music.txt
index d89bfc7db..812e1f465 100644
--- a/npc/commands/music.txt
+++ b/npc/commands/music.txt
@@ -15,6 +15,12 @@
- script @music 32767,{
end;
+function listMusic {
+ dispbottom "ship, city, ghoul, surreal, magic, forest, mythica, acid, misuse, prelude, sunrise, peace, peace2, peace3, toast, woodland2";
+ dispbottom "unforgiving, deepcave, 8bit, action, hurns, fields, tulim, candor, lof, icecave, manacave, adventure, dance, academy, shrine, boss, ruins";
+ return;
+}
+
OnCall:
if (!is_gm()) {
end;
@@ -29,15 +35,29 @@ OnCall:
if (.@m$ == "Not found") {
//.@m$ = implode(.@atcmd_parameters$[0], " ");
dispbottom "Invalid music key. Current accepted values are:";
- dispbottom "ship, city, ghoul, surreal, magic, forest, mythica, acid, misuse, prelude, sunrise, peace, peace2, peace3, toast, woodland2";
- dispbottom "unforgiving, deepcave, 8bit, action, hurns, fields, tulim, candor, lof, icecave, manacave, adventure, dance, academy, shrine, boss, ruins";
+ listMusic();
} else {
changemusic .@map$, .@m$;
}
end;
+OnMyself:
+ .@key$ = strtolower(.@atcmd_parameters$[0]);
+ .@m$ = htget(.hash, .@key$, "Not found");
+
+ if (.@m$ == "Not found") {
+ //.@m$ = implode(.@atcmd_parameters$[0], " ");
+ dispbottom l("Invalid music key. Current accepted values are:");
+ listMusic();
+ } else {
+ //debugmes "Casting with: %s", .@m$;
+ changeplayermusic .@m$;
+ }
+ end;
+
OnInit:
bindatcmd "music", "@music::OnCall", 60, 80, 1;
+ bindatcmd "mymusic", "@music::OnMyself", 1, 80, 1;
.hash = htnew; // create hashtable
htput(.hash, "ship", "sail_away.ogg");