//******************************************************************************
//	"CTI"			Cut Throat Island			Added 6-15-06
//******************************************************************************

void InitMusic()
{
	int n = 0;
	ref tmpref;

	//============ MAIN MENU ================================
	// added by NK so it can be done in code.
	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_main_menu";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Main_Title_Morgans_Ride.ogg";
	//============ MAIN THEME ===============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_main_theme";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Main_Title_Morgans_Ride.ogg";
	//============ FINAL THEME ==============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_final_theme";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Its_Only_Gold_End_Credits.ogg";
	//============ INDOOR PLACES ============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_shop";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Taverna.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Sailing01.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_shipyard";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Taverna.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Sailing01.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_tavern";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Taverna.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Sailing01.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_YoHo_With_Vocals.ogg";
	tmpref.files.l4.name = "MUSIC\CTI\CTI_YoHo_instrumental.ogg";
	tmpref.files.l5.name = "MUSIC\CTI\CTI_The_Pirate_I_was_meant_to_be.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_church";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Church_Theme.ogg";
	//============ INCA TEMPLE, CAVES, DUNGEON, JAILS =======
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_coridor";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_To_The_Bottom_Of_The_Sea.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Dawgs_Demise_The_Triumph.ogg";
	//============ JUNGLE SHORE, JUNGLE =====================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_jungle";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Shaw_Steals_The_Map.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Charting_The_Course.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Dawgs_Demise_The_Triumph.ogg";
	//============ GOVERNOR =================================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_gubernator";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Governors_Theme.ogg";
	//============ SPOKPLAVANIE =============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_spokplavanie";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Its_Only_Gold_End_Credits.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Setting_Sail.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Main_Title_Morgans_Ride.ogg";
	tmpref.files.l4.name = "MUSIC\CTI\CTI_The_Rescue.ogg";
	tmpref.files.l5.name = "MUSIC\CTI\CTI_Morgan_Takes_The_Ship.ogg";
	tmpref.files.l6.name = "MUSIC\CTI\CTI_First_Kiss.ogg";
	//============ ENPLAVANIE ===============================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_enplavanie";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Its_Only_Gold_End_Credits.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Setting_Sail.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Main_Title_Morgans_Ride.ogg";
	tmpref.files.l4.name = "MUSIC\CTI\CTI_The_Rescue.ogg";
	tmpref.files.l5.name = "MUSIC\CTI\CTI_Morgan_Takes_The_Ship.ogg";
	tmpref.files.l6.name = "MUSIC\CTI\CTI_First_Kiss.ogg";
	//============ GOROD, PORT ==============================
	n++;

	//=========================| MUSIC FROM SEADOGS |=========================//MAXIMUS -->
	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_eng_town";
	tmpref.files.l1.name = "MUSIC\Eng_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_fra_town";
	tmpref.files.l1.name = "MUSIC\Fra_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_spa_town";
	tmpref.files.l1.name = "MUSIC\Spa_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_pir_town";
	tmpref.files.l1.name = "MUSIC\Pir_Town.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_hol_town";
	tmpref.files.l1.name = "MUSIC\Hol_Town.ogg";
	n++;
	//=========================| MUSIC FROM SEADOGS |=========================//MAXIMUS <--

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_gorod";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_The_Funeral.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Its_Only_Gold_End_Credits.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Discovery_Of_The_Treasure.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_gorod_2";
	tmpref.files.l1.name = "MUSIC\Gorod-2.ogg";
	n++;

	//============ SHIP AT SEA ==============================
	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_map";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_The_Funeral.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Its_Only_Gold_End_Credits.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_To_The_Bottom_Of_The_Sea.ogg";
	tmpref.files.l4.name = "MUSIC\CTI\CTI_Discovery_Of_The_Treasure.ogg";
	tmpref.files.l5.name = "MUSIC\CTI\CTI_First_Kiss.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_storm";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_The_Storm_Begins.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_End_storm";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_End_storm.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Discovery_Of_The_Treasure.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_abordage";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Shaw_Steals_The_Map.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_The_Big_Jump.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Morgan_Captured_Sword_Fight.ogg";
	tmpref.files.l4.name = "MUSIC\CTI\CTI_Carriage_Chase.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_sea_battle";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Main_Title_Morgans_Ride.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Carriage_Chase.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Morgan_Takes_The_Ship.ogg";
	tmpref.files.l4.name = "MUSIC\CTI\CTI_The_Rescue.ogg";
	tmpref.files.l5.name = "MUSIC\CTI\CTI_Morgan_Captured_Sword_Fight.ogg";
	tmpref.files.l6.name = "MUSIC\CTI\CTI_Shaw_Steals_The_Map.ogg";
	tmpref.files.l7.name = "MUSIC\CTI\CTI_Escape_From_Mordechais.ogg";
	tmpref.files.l8.name = "MUSIC\CTI\CTI_Charting_The_Course.ogg";
	tmpref.files.l9.name = "MUSIC\CTI\CTI_The_Battle.ogg";
	tmpref.files.l10.name = "MUSIC\CTI\CTI_Dawgs_Demise_The_Triumph.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_ship_victory";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Setting_Sail.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_ship_dead";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_To_The_Bottom_Of_The_Sea.ogg";
	//============ MELEE FIGHTING ===========================
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_bitva";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Escape_From_Mordechais.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_Morgan_Captured_Sword_Fight.ogg";
	tmpref.files.l3.name = "MUSIC\CTI\CTI_Carriage_Chase.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_victory";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Setting_Sail.ogg";
	n++;

	makeref(tmpref, Music_Alias[n]);
	tmpref.id = "music_death";
	tmpref.files.l1.name = "MUSIC\CTI\CTI_Dawgs_Demise_The_Triumph.ogg";
	tmpref.files.l2.name = "MUSIC\CTI\CTI_The_Funeral.ogg";
	n++;

	trace("InitMusic: created " + n + " entries.");
}

void RegisterMusicScheme()
{
	//if (CheckDirectory("RESOURCE\Sounds\MUSIC\CTI", ".ogg") == 0) return;
	ref rms; makeref(rms, registered_music_schemes);
	int n = GetAttributesNum(rms);
	string lnode = "l" + n;
	rms.(lnode).id = "cti";
	rms.(lnode).resdir = "CTI";
	switch (LanguageGetLanguage())
	{
		case "Polish":
			rms.(lnode).name = "Wyspa piratów";
		break;
		// default:
			rms.(lnode).name = "Cutthroat Island";
	}
}
