// Authors: Gumi, Jesusalva // @music atcommand // changes the music for all players on the map // // group lv: 80 // group char lv: 80 // log: True // // usage: // @music // // example: // @music forest - script @music 32767,{ end; function listMusic { dispbottom "ship, city, ghoul, surreal, magic, forest, mythica, acid, misuse, prelude, sunrise, peace, peace2, peace3, toast, woodland2, fortress, adonthell"; dispbottom "unforgiving, deepcave, 8bit, action, hurns, fields, tulim, candor, lof, icecave, manacave, adventure, dance, academy, shrine, boss, ruins, minstrel"; dispbottom "sprint, valkyries"; return; } OnCall: if (!is_gm()) { end; } // TODO: tmw-like argv splitter getmapxy .@map$, .@void, .@void, UNITTYPE_PC; // get map .@key$ = strtolower(.@atcmd_parameters$[0]); .@m$ = htget(.hash, .@key$, "Not found"); if (.@m$ == "Not found") { //.@m$ = implode(.@atcmd_parameters$[0], " "); dispbottom "Invalid music key. Current accepted values are:"; 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, 0; .hash = htnew; // create hashtable htput(.hash, "ship", "sail_away.ogg"); htput(.hash, "city", "bartk_adventure.ogg"); htput(.hash, "ghoul", "eric_matyas_ghouls.ogg"); htput(.hash, "surreal", "eric_matyas_surreal.ogg"); htput(.hash, "magic", "magick_real.ogg"); htput(.hash, "forest", "dariunas_forest.ogg"); htput(.hash, "mythica", "mythica.ogg"); htput(.hash, "acid", "3b5.ogg"); htput(.hash, "misuse", "misuse.ogg"); htput(.hash, "prelude", "water_prelude.ogg"); htput(.hash, "sunrise", "tws_birds_in_the_sunrise.ogg"); htput(.hash, "peace", "peace.ogg"); htput(.hash, "peace2", "peace2.ogg"); htput(.hash, "peace3", "peace3.ogg"); htput(.hash, "toast", "dragon_and_toast.ogg"); htput(.hash, "woodland2", "New_Woodlands.ogg"); htput(.hash, "unforgiving","Unforgiving_Lands.ogg"); htput(.hash, "deepcave", "Deep_Cave.ogg"); htput(.hash, "8bit", "8bit_the_hero.ogg"); htput(.hash, "action", "Arabesque.ogg"); htput(.hash, "hurns", "caketown.ogg"); htput(.hash, "fields", "woodland_fantasy.ogg"); htput(.hash, "icecave", "icecave.ogg"); htput(.hash, "tulim", "mvrasseli_nochains.ogg"); htput(.hash, "candor", "school_of_quirks.ogg"); htput(.hash, "lof", "steam.ogg"); htput(.hash, "adventure", "tmw_adventure.ogg"); htput(.hash, "manacave", "tws_green_island.ogg"); htput(.hash, "dance", "dance_monster.ogg"); htput(.hash, "academy", "academy_bells.ogg"); htput(.hash, "shrine", "Misty_Shrine.ogg"); htput(.hash, "boss", "let_the_battles_begin.ogg"); htput(.hash, "ruins", "Ruins.ogg"); htput(.hash, "fortress", "sidequests.ogg"); htput(.hash, "minstrel", "PerituneMaterial_Minstrel2_Harp.ogg"); htput(.hash, "adonthell", "adonthell.ogg"); htput(.hash, "sprint", "forest-sprint.ogg"); htput(.hash, "valkyries", "valkyries.ogg"); }