diff options
author | mekolat <mekolat@users.noreply.github.com> | 2016-05-07 20:20:22 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-05-07 20:20:22 -0400 |
commit | fac2b3f47f7367655b69bcffa529ccd8a1bbca30 (patch) | |
tree | 21ffee6f5f829c867182bf098c687d0f2aeb5ca1 | |
parent | 29e5e55df71dd3badd4036792fd43772c3cff005 (diff) | |
download | serverdata-fac2b3f47f7367655b69bcffa529ccd8a1bbca30.tar.gz serverdata-fac2b3f47f7367655b69bcffa529ccd8a1bbca30.tar.bz2 serverdata-fac2b3f47f7367655b69bcffa529ccd8a1bbca30.tar.xz serverdata-fac2b3f47f7367655b69bcffa529ccd8a1bbca30.zip |
add @music command
-rw-r--r-- | world/map/conf/permissions.txt | 1 | ||||
-rw-r--r-- | world/map/npc/commands/_import.txt | 1 | ||||
-rw-r--r-- | world/map/npc/commands/music.txt | 34 |
3 files changed, 36 insertions, 0 deletions
diff --git a/world/map/conf/permissions.txt b/world/map/conf/permissions.txt index db9da9c6..c76fbf9c 100644 --- a/world/map/conf/permissions.txt +++ b/world/map/conf/permissions.txt @@ -12,6 +12,7 @@ CMD_WARP 40 CMD_CHARWARP 60 CMD_MUTE 60 CMD_NPCTALK 40 +CMD_MUSIC 40 // special permissions below MAP_LOUNGE 20 // level to enter the GM Lounge & talk to Numa diff --git a/world/map/npc/commands/_import.txt b/world/map/npc/commands/_import.txt index 90cdb5b5..48455487 100644 --- a/world/map/npc/commands/_import.txt +++ b/world/map/npc/commands/_import.txt @@ -12,3 +12,4 @@ npc: npc/commands/hug.txt npc: npc/commands/warp.txt npc: npc/commands/mute.txt npc: npc/commands/npctalk.txt +npc: npc/commands/music.txt diff --git a/world/map/npc/commands/music.txt b/world/map/npc/commands/music.txt new file mode 100644 index 00000000..cbd9fed1 --- /dev/null +++ b/world/map/npc/commands/music.txt @@ -0,0 +1,34 @@ +-|script|@music|32767 +{ + callfunc "argv_splitter"; + if (GM < CMD_MUSIC && GM < G_SYSOP) goto L_GM; + if (@argv$[0] == "") goto L_Failed; + + gmlog "@music " + @args$; + set .@find, array_search(@argv$[0], .find$); + if (.@find >= 0) + set @argv$[0], .replace$[max(.@find, 0)]; + set .file$, @argv$[0]; + areatimer 0, getmap(), (POS_X - .range), (POS_Y - .range), (POS_X + .range), (POS_Y + .range), 0, strnpcinfo(0)+"::OnPC"; + message strcharinfo(0), "music : The music has ben temporarily changed."; + end; + +OnPC: + music .file$ + ".ogg"; + end; + +L_Failed: + message strcharinfo(0), "music : You must specify a music file."; + end; + +L_GM: + message strcharinfo(0), "music : GM command is level "+ CMD_MUSIC +", but you are level " + GM; + end; + +OnInit: + setarray .find$, "this", "cave", "chilling", "clouds", "dimond", "explorers", "gy", "reid", "magick", "mystique", "night", "ride", "sail", "snow", "forest", "xmas"; + setarray .replace$, "this", "cavesong", "chilling-environment", "clouds-calling", "dimonds-cove", "explorers-melody", "graveyard", "inquisitive-inn", "magick-real", "mystique-forest", "night-is-calling", "ride-of-the-valkyries", "sail-away", "snow-village", "the-forest", "white-christmas"; + set .range, 14; // FIXME: make this a const + registercmd chr(ATCMD_SYMBOL) + "music", strnpcinfo(0); + end; +} |