diff options
author | Wushin <pasekei@gmail.com> | 2016-05-11 16:49:56 -0500 |
---|---|---|
committer | Wushin <pasekei@gmail.com> | 2016-05-11 16:49:56 -0500 |
commit | d0dc01460197e2ac35fe4b015a9ed9af6d4d6442 (patch) | |
tree | 450d6677545136f4c9bed090d2d9ac88331418b8 /world/map/npc/commands/music.txt | |
parent | 74b1de6a5824ab657a338cb0adee0fbc0dcc01a0 (diff) | |
parent | 3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d (diff) | |
download | serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.tar.gz serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.tar.bz2 serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.tar.xz serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.zip |
Merge pull request #503 from mekolat/atcmd
atcommand modifications
Diffstat (limited to 'world/map/npc/commands/music.txt')
-rw-r--r-- | world/map/npc/commands/music.txt | 34 |
1 files changed, 34 insertions, 0 deletions
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; +} |