    local Channeled = {
		[117952] = {'Crackling Jade Lightning',3,0,},
		
    }
	
	local Cast = {
		[116670] = {'Vivify',2,0,},
		[126892] = {'Zen Pilgrimage',1,0,},
	
	}
     
     local Instants = {
        [115203] = {'Fortifying Brew',1,0,}, 
        [115072] = {'Expel Harm',1,0,},
        --[109132] = {'Roll',3,0,}, Disable
		--[115008] = {'Roll',3,0,}, --[[ Chi Torpedo ]] Disable
		[116841] = {'Roll',3,0,}, --[[ Tigers Lust ]]
        [115178] = {'Resuscitate',1,0,},
        [116705] = {'Spear Hand Strike',1,0,},
        [100780] = {'Tiger Palm',5,0,},
        [121253] = {'Keg Smash',5,0,},
        [115078] = {'Paralysis',2,0,},
        [205523] = {'Blackout Strike',5,0,},
        [115098] = {'Chi Wave',1,0,},
        [119381] = {'Leg Sweep',1,0,},
        [115308] = {'Ironskin Brew',3,0,},
        [119582] = {'Purifying Brew',4,0,},
		[122783] = {'Diffuse Magic',1,0,},
		[123986] = {'Chi Burst',1,0,},
		[122280] = {'Healing Elixirs',1,0,},
		[122278] = {'Dampen Harm',3,0,},
		[115546] = {'Provoke',20,0,},
		[115315] = {'Provoke',20,0,}, --[[ Summon Black Ox Statue ]]
		--[115181] = {'Breath of Fire',1,0,}, Disable
		[116847] = {'Rushing Jade Wind',3,0,},
		[116844] = {'Ring of Peace',1,0,},
		[119996] = {'TranscendenceTransfer',1,0,},
		[101643] = {'Transcendence',1,0,},
    }
	 
    
	
   local SoundPath = [[Interface\AddOns\JojoMonk_JosephJoestar\sounds\]];
     
    local f = CreateFrame('frame');
	f:RegisterUnitEvent('UNIT_SPELLCAST_CHANNEL_START', 'player');
    f:RegisterUnitEvent('UNIT_SPELLCAST_SUCCEEDED', 'player');
	f:RegisterUnitEvent('UNIT_SPELLCAST_START','player');
    f:RegisterEvent('PLAYER_DEAD');
	
	
	
    f:SetScript('OnEvent', function(self, event, unit, _, spellID)
		if(JojoMonk_Config.ActiveSFX == true and JojoMonk_Config.ActiveCharacter == L['Joseph_Joestar_drop'])then
			if event == 'UNIT_SPELLCAST_CHANNEL_START' and Channeled[spellID] then
				if Channeled[spellID][2] ~= 1 then
					repeat
						rand_spell = math.random(1,Channeled[spellID][2]);
					until rand_spell ~= Channeled[spellID][3];
					Channeled[spellID][3] = rand_spell;
				else
					rand_spell = 1;
				end
				PlaySoundFile(SoundPath .. Channeled[spellID][1] .. '_' .. rand_spell .. '.ogg', 'SFX');
			elseif event == 'UNIT_SPELLCAST_SUCCEEDED' and Instants[spellID] then
				if Instants[spellID][2] ~= 1 then
					repeat
						rand_spell = math.random(1,Instants[spellID][2]);
					until rand_spell ~= Instants[spellID][3];
					Instants[spellID][3] = rand_spell;
				else
					rand_spell = 1;
				end
				PlaySoundFile(SoundPath .. Instants[spellID][1] .. '_' .. rand_spell .. '.ogg', 'SFX');
			elseif event == 'UNIT_SPELLCAST_START' and Cast[spellID] then
				if Cast[spellID][2] ~= 1 then
					repeat
						rand_spell = math.random(1,Cast[spellID][2]);
					until rand_spell ~= Cast[spellID][3];
					Cast[spellID][3] = rand_spell;
				else
					rand_spell = 1;
				end
				PlaySoundFile(SoundPath .. Cast[spellID][1] .. '_' .. rand_spell .. '.ogg', 'SFX');
			elseif event == 'PLAYER_DEAD' then
				PlaySoundFile(SoundPath .. 'DeadSound_' .. math.random(1,1) .. '.ogg', 'SFX');
			end
		end
		
	end)
	

     
    
	
	
	
	local frame = CreateFrame("FRAME");
	frame:RegisterEvent("ADDON_LOADED"); 
	frame:RegisterEvent("PLAYER_LOGOUT");

	function frame:OnEvent(event, arg1)
		if event == "ADDON_LOADED" and arg1 == "JojoMonk_JosephJoestar" then
			--[[if jojo_sound == nil then
				print("Thanks for using Jojo's Monk_Joseph Joestar addon ! Initialisation...");
				print("The addon is ready, enjoy !");
				jojo_sound = 1;]]
			if JojoMonk_Config.ActiveCharacter == L['Joseph_Joestar_drop'] then 
				print("Jojo's Monk_Joseph Joestar SFX is select.");
			end
		end
	end
	frame:SetScript("OnEvent", frame.OnEvent);
	--[[SLASH_JOJOSFX1 = "/jojosfx";

	function SlashCmdList.JOJOSFX(option)
		if option == "on" then
			print("Jojo's Monk_Joseph Joestar SFX -> activate");
			jojo_sound = 1;
		elseif option == "off" then
			print("Jojo's Monk_Joseph Joestar SFX -> desactivate");
			jojo_sound = 0;
		else
			print("Jojo's Monk_Joseph Joestar SFX command : /jojosfx <on-off>");
		end
	end
	
	]]
	
	
	
	
	
	
	
	