From 15980870495e892fd5bd1381b62df1a6cceb298c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 25 Jan 2020 13:25:54 -0300 Subject: 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 --- npc/commands/music.txt | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'npc') 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"); -- cgit v1.2.3-70-g09d2