SHADERMOD_VERSION = "|cFFFFFFFFv3.24 Modded";

--Message Color : Grey
DISPLAY_RED = ".55";
DISPLAY_GREEN = ".55";
DISPLAY_BLUE = ".5"; 
-- Message Color : Red
FDISPLAY_RED = ".7";
FDISPLAY_GREEN = ".1";
FDISPLAY_BLUE = ".1"; 
-- Message Color : Blue
ADISPLAY_RED = ".2";
ADISPLAY_GREEN = ".2";
ADISPLAY_BLUE = ".8";

function SMOnLoad()
	this:RegisterEvent("VARIABLES_LOADED");
	this:RegisterEvent("CHAT_MSG_COMBAT_SELF_HITS");
	this:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE");
	this:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF");
	this:RegisterEvent("CHAT_MSG_COMBAT_SELF_MISSES");
	this:RegisterEvent("PLAYER_ENTERING_WORLD");
	this:RegisterEvent("PLAYER_REGEN_ENABLED");
	this:RegisterEvent("UNIT_COMBO_POINTS");
	this:RegisterEvent("PLAYER_TARGET_CHANGED");
	this:RegisterEvent("UNIT_HEALTH");
	this:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH");
	this:RegisterEvent("CHAT_MSG_COMBAT_FRIENDLY_DEATH");
	this:RegisterEvent("CHAT_MSG_SYSTEM");
	this:RegisterEvent("DUEL_INBOUNDS");
	this:RegisterEvent("DUEL_FINISHED");
	this:RegisterEvent("DUEL_REQUESTED");
	this:RegisterEvent("DUEL_OUTOFBOUNDS");
	this:RegisterEvent("UNIT_NAME_UPDATE");
	this:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL");
	this:RegisterEvent("CHAT_MSG_BG_SYSTEM_ALLIANCE");
	this:RegisterEvent("CHAT_MSG_BG_SYSTEM_HORDE");
	this:RegisterEvent("ZONE_CHANGED_NEW_AREA");
	this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");

	KillingBlow = 0;
	KillingBlowMsg =".";
	CritDmg = 0;
	CritCombo = 0;
	CritComboDmg = 0;
	CritDmgHeal = 0;
	CritComboHeal = 0;
	CritComboHealDmg = 0;
	CurrentSpell = 0;
	CritMsg = ".";

	SMMessageFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
	SMMessageFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
	SMMessageFrameBackground:SetAlpha(0.0);
	SMMessageFrame:EnableMouse(false);

	SM_OUT = {};
	SM_OUT.EXEC_ANNOUNCED = false;
	SMFightAnnounced = 0;
	SMFightBgAnnounced = 0;
	SMThreeBgAnnounced = 0;
	SMTwoBgAnnounced = 0;
	SMOneBgAnnounced = 0;

	DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod " .. SHADERMOD_VERSION .. " |cFF00FF00by |cFF00FFFFSky-|cFF0000FFDexter.  |cFFFF0000.:Loaded:. |cFFFFFFFF: /sm for options", .2, .0);

	SMPlayerRealm = GetCVar("realmName");
	SMPlayerName = UnitName("player");

	UIPanelWindows["ShaderModOptionsFrame"] = {area = "center", pushable = 0};
	UIPanelWindows["ShaderModOptionsFrame2"] = {area = "center", pushable = 0};
end

function SMInitialize()
	SlashCmdList["CritCombo"] = SMCommand;
	SLASH_CritCombo1 = "/ShaderMod";
	SLASH_CritCombo2 = "/ShaderM";
	SLASH_CritCombo3 = "/sm"

	SMInitializeSMData();
	SMSetFontSizes();
	SMSetDuelFontSizes();
	SMSetKillingBlowFontSizes();
	player = UnitName("player");
end

function SMSetDefaultOptions()
	SMData[SMPlayerRealm][SMPlayerName].Reset_Combo = true;
	SMData[SMPlayerRealm][SMPlayerName].Announce_Display = false;
	SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits = false;
	SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display = true;
	SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display = true;
	SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display = true;
	SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Yeah = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Oh_Yeah = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Unstoppable = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Killing_Spree = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Dominating = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ultra_Kill = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Wicked_Sick = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_God_Like = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Holy_Shit = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Monster_Kill = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ludicrous_Kill = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ownage = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Yeah = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Oh_Yeah = false;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Unstoppable = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Killing_Spree = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Dominating = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ultra_Kill = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Wicked_Sick = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_God_Like = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Holy_Shit = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Monster_Kill = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ludicrous_Kill = true;
	SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ownage = true;
	SMData[SMPlayerRealm][SMPlayerName].JustifyH_Left = true;
	SMData[SMPlayerRealm][SMPlayerName].JustifyH_Center = false;
	SMData[SMPlayerRealm][SMPlayerName].JustifyH_Right = false;
	SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Visible = true;
	SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Locked = false;
	SMData[SMPlayerRealm][SMPlayerName].White_Crits = false;
	SMData[SMPlayerRealm][SMPlayerName].No_White_Normal = false;
	SMData[SMPlayerRealm][SMPlayerName].Heal = false;
	SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos = false;
	SMData[SMPlayerRealm][SMPlayerName]["Channel"] = "Party";
	SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] = "4";
	SMData[SMPlayerRealm][SMPlayerName]["Splash"] = "3";
	SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display = true;
	SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound = true;
	SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow = false;
	SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Death = true;
	SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Bg = true;
	SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound = true;
	SMData[SMPlayerRealm][SMPlayerName].Duel = true;
	SMData[SMPlayerRealm][SMPlayerName].Duel_Sound = true;
	SMData[SMPlayerRealm][SMPlayerName].Bg = true;
	SMData[SMPlayerRealm][SMPlayerName].Bg_Sound = true;
	SMData[SMPlayerRealm][SMPlayerName].Bg_Text = true;
end

SMSavedVars = { 
	SMFontSize = 30;
	SMDuelFontSize = 30;
	SMKillingBlowFontSize = 30;
};

function getVar( varName)
	return SMSavedVars[varName];
end

function SMUpdate()
	ChannelBox:SetText(SMData[SMPlayerRealm][SMPlayerName]["Channel"]);
	AnnounceBox:SetText(SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"]);
	SplashBox:SetText(SMData[SMPlayerRealm][SMPlayerName]["Splash"]);
end 

function SM_OnUpdate()
	if (ShaderModInFight == 1) then
		local t = GetTime() - ShaderModTimer;
		local s = floor(t);
		if (s == 1) then
			SMFight();
		end
	end
	if (ShaderModInFightBg == 1) then
		local t = GetTime() - ShaderModTimerBg;
		local s = floor(t);
		if (s == 27) then
			SMThreeBg();
		end
	end
	if (ShaderModInFightBg == 1) then
		local t = GetTime() - ShaderModTimerBg;
		local s = floor(t);
		if (s == 28) then
			SMTwoBg();
		end
	end
	if (ShaderModInFightBg == 1) then
		local t = GetTime() - ShaderModTimerBg;
		local s = floor(t);
		if (s == 29) then
			SMOneBg();
		end
	end
	if (ShaderModInFightBg == 1) then
		local t = GetTime() - ShaderModTimerBg;
		local s = floor(t);
		if (s == 30) then
			SMFightBg();
		end
	end
end

function SM_SetChannel()
	SMData[SMPlayerRealm][SMPlayerName]["Channel"] = this:GetText();
end

function SM_SetAnnounceBox()
	SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] = this:GetText();
end

function SM_SetSplashBox()
	SMData[SMPlayerRealm][SMPlayerName]["Splash"] = this:GetText();
end

function setVar( varName, value)
	SMSavedVars[varName] = value;
end

function SMFontSize_OnValueChanged()
	setVar("SMFontSize", this:GetValue());
	getglobal(this:GetName() .. "Text"):SetText(SM_FONT_SIZE .. " " .. this:GetValue());
	SMSetFontSizes();
end

function SMFontSize_OnShow()
	getglobal(this:GetName().."High"):SetText("32");
	getglobal(this:GetName().."Low"):SetText("8");

	this:SetMinMaxValues(8, 32);
	this:SetValueStep(1);
	this:SetValue(getVar("SMFontSize"));

	getglobal(this:GetName() .. "Text"):SetText(SM_FONT_SIZE .. " " .. this:GetValue());
end

function SMSetFontSizes()
	local font, fontHeight, flags = SMMessageFrame:GetFont();
 	SMMessageFrame:SetFont(font, getVar("SMFontSize"), flags);
end

function SMDuelFontSize_OnValueChanged()
	setVar("SMDuelFontSize", this:GetValue());
	getglobal(this:GetName() .. "Text"):SetText(SM_DUEL_FONT_SIZE .. " " .. this:GetValue());
	SMSetDuelFontSizes();
end

function SMDuelFontSize_OnShow()
	getglobal(this:GetName().."High"):SetText("32");
	getglobal(this:GetName().."Low"):SetText("8");

	this:SetMinMaxValues(8, 32);
	this:SetValueStep(1);
	this:SetValue(getVar("SMDuelFontSize"));

	getglobal(this:GetName() .. "Text"):SetText(SM_DUEL_FONT_SIZE .. " " .. this:GetValue());
end

function SMSetDuelFontSizes()
	local font, fontHeight, flags = SMDuelFrame:GetFont();
 	SMDuelFrame:SetFont(font, getVar("SMDuelFontSize"), flags);
end

function SMKillingBlowFontSize_OnValueChanged()
	setVar("SMKillingBlowFontSize", this:GetValue());
	getglobal(this:GetName() .. "Text"):SetText(SM_KILLINGBLOW_FONT_SIZE .. " " .. this:GetValue());
	SMSetKillingBlowFontSizes();
end

function SMKillingBlowFontSize_OnShow()
	getglobal(this:GetName().."High"):SetText("32");
	getglobal(this:GetName().."Low"):SetText("8");

	this:SetMinMaxValues(8, 32);
	this:SetValueStep(1);
	this:SetValue(getVar("SMKillingBlowFontSize"));

	getglobal(this:GetName() .. "Text"):SetText(SM_KILLINGBLOW_FONT_SIZE .. " " .. this:GetValue());
end

function SMSetKillingBlowFontSizes()
	local font, fontHeight, flags = SMKillingBlowFrame:GetFont();
 	SMKillingBlowFrame:SetFont(font, getVar("SMKillingBlowFontSize"), flags);
end

function SMCommand(msg)
	if (string.lower(msg) == "records") then
		DEFAULT_CHAT_FRAME:AddMessage("ShaderMod " .. SHADERMOD_VERSION .. " ", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00--- Hits Based Record ---", .65, .65, .6);
		DEFAULT_CHAT_FRAME:AddMessage("*" .. SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo .. "* crits for *" .. SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboDmg .. "* damage. ");
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00--- Damage Based Record ---", .65, .65, .6);
		DEFAULT_CHAT_FRAME:AddMessage("*" .. SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritCombo .. "* crits for *" .. SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg .. "* damage. ");
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00--- Healing Combos Based Record ---", .65, .65, .6);
		DEFAULT_CHAT_FRAME:AddMessage("*" .. SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal .. "* crits for *" .. SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHealDmg .. "* Total Healing. ");
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00--- Total Healing Based Record ---", .65, .65, .6);
		DEFAULT_CHAT_FRAME:AddMessage("*" .. SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHeal .. "* crits for *" .. SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg .. "* Total Healing. ");
		return;
	end

	if (string.lower(msg) == "help") then
		SMDisplayHelp();
		return;
	end

	if (string.lower(msg) == "lock") then
		SMMessageFrame.Locked = true;
		SMMessageFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
		SMMessageFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
		SMMessageFrameBackground:SetAlpha(0.0);
		SMMessageFrame:EnableMouse(false);
		ShaderModMessageFrame.Locked = true;
		ShaderModMessageFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
		ShaderModMessageFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
		ShaderModMessageFrameBackground:SetAlpha(0.0);
		ShaderModMessageFrame:EnableMouse(false);
		SMKillingBlowFrame.Locked = true;
		SMKillingBlowFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
		SMKillingBlowFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
		SMKillingBlowFrameBackground:SetAlpha(0.0);
		SMKillingBlowFrame:EnableMouse(false);
		SMDuelFrame.Locked = true;
		SMDuelFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
		SMDuelFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
		SMDuelFrameBackground:SetAlpha(0.0);
		SMDuelFrame:EnableMouse(false);
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: All Frames : |cFF00FF00Now |cFFFF0000Locked.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "unlock") then
		SMMessageFrame.Locked = false;
		SMMessageFrame:SetBackdropColor( 1.0, 1.0, 1.0, 1.0 );
		SMMessageFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 1.0 );
		SMMessageFrameBackground:SetAlpha(1.0); 
		SMMessageFrame:EnableMouse(true);
		SMMessageFrame:AddMessage("Combat Log Frame", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
		ShaderModMessageFrame.Locked = false;
		ShaderModMessageFrame:SetBackdropColor( 1.0, 1.0, 1.0, 1.0 );
		ShaderModMessageFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 1.0 );
		ShaderModMessageFrameBackground:SetAlpha(1.0); 
		ShaderModMessageFrame:EnableMouse(true);
		ShaderModMessageFrame:AddMessage("Splash Combo Frame", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
		SMKillingBlowFrame.Locked = false;
		SMKillingBlowFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
		SMKillingBlowFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
		SMKillingBlowFrameBackground:SetAlpha(1.0);
		SMKillingBlowFrame:EnableMouse(true);
		SMKillingBlowFrame:AddMessage("Killing Blow Frame", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
		SMDuelFrame.Locked = false;
		SMDuelFrame:SetBackdropColor( 1.0, 1.0, 1.0, 0.0 );
		SMDuelFrame:SetBackdropBorderColor( 1.0, 1.0, 1.0, 0.0 );
		SMDuelFrameBackground:SetAlpha(1.0);
		SMDuelFrame:EnableMouse(true);
		SMDuelFrame:AddMessage("Duel Enhancer Frame", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: All Frames : |cFF00FF00Now |cFFFF0000Unlocked.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "minimap lock") then
		SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Locked = true;
		SMMiniMapButton.Locked = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Minimap Button : |cFF00FF00Now |cFFFF0000Locked ", .2, .0);
	  return;
	end

	if (string.lower(msg) == "minimap unlock") then
		SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Locked = false;
		SMMiniMapButton.Locked = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Minimap Button : |cFF00FF00Now |cFFFF0000Unlocked ", .2, .0);
	  return;
	end

	if (string.lower(msg) == "hide log") then
		SMMessageFrame.Visible = false;
		SMMessageFrame:Hide();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Combat log : |cFF00FF00Now |cFFFF0000Hidden.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "hide review") then
		ShaderModMessageFrame.Visible = false;
		ShaderModMessageFrame:Hide();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Splash Combo Review : |cFF00FF00Now |cFFFF0000Hidden.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "hide killingblow") then
		SMKillingBlowFrame.Visible = false;
		SMKillingBlowFrame:Hide();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Killing Blow Frame : |cFF00FF00Now |cFFFF0000Hidden.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "hide duel") then
		SMDuelFrame.Visible = false;
		SMDuelFrame:Hide();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Duel Enhancer Frame : |cFF00FF00Now |cFFFF0000Hidden.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "hide") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM Hide --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Hide Log - Hide Combat Log Frame", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Hide Review - Hide Splash Combo Review Frame", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Hide KillingBlow - Hide Killing Blow Frame", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Hide Duel - Hide Duel Enhancer Frame", .2, .0);
	  return;
	end

	if (string.lower(msg) == "show log") then
		SMMessageFrame.Visible = true;
		SMMessageFrame:Show();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Combat log : |cFF00FF00Now |cFFFF0000Visible.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "show review") then
		ShaderModMessageFrame.Visible = true;
		ShaderModMessageFrame:Show();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Splash Combo Review : |cFF00FF00Now |cFFFF0000Visible.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "show killingblow") then
		SMKillingBlowFrame.Visible = true;
		SMKillingBlowFrame:Show();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Killing Blow Frame : |cFF00FF00Now |cFFFF0000Visible.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "show duel") then
		SMDuelFrame.Visible = true;
		SMDuelFrame:Show();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Duel Enhancer Frame : |cFF00FF00Now |cFFFF0000Visible.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "show") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM Show --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Show Log - Show Combat Log Frame", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Show Review - Show Splash Combo Review Frame", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Show KillingBlow - Show Killing Blow Frame", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Show Duel - Show Duel Enhancer Frame", .2, .0);
	  return;
	end

	if (string.lower(msg) == "minimap show") then
		SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Visible = true;
		SMMiniMapButton:Show();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Minimap Button : |cFF00FF00Now |cFFFF0000Visible ", .2, .0);
	  return;
	end

	if (string.lower(msg) == "minimap hide") then
		SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Visible = false;
		SMMiniMapButton:Hide();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: Minimap Button : |cFF00FF00Now |cFFFF0000Hidden ", .2, .0);
	  return;
	end

	if (string.lower(msg) == "minimap") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM Minimap --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Minimap Show ", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Minimap Hide", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Minimap Lock", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Minimap Unlock", .2, .0);
	  return;
	end

	if (string.lower(msg) == "menu") then
		PlaySound("igMainMenuOpen");
		ShowUIPanel(ShaderModOptionsFrame);
	  return;
	end

	if (string.lower(msg) == "options") then
		PlaySound("igMainMenuOpen");
		ShowUIPanel(ShaderModOptionsFrame);
	  return;
	end
	
	if (string.lower(msg) == "menu2") then
		PlaySound("igMainMenuOpen");
		ShowUIPanel(ShaderModOptionsFrame2);
	  return;
	end

	if (string.lower(msg) == "options2") then
		PlaySound("igMainMenuOpen");
		ShowUIPanel(ShaderModOptionsFrame2);
	  return;
	end

	if (string.lower(msg) == "version") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFCurrent Version: " .. SHADERMOD_VERSION.." |cFF00FF00by |cFF00FFFFSky-|cFF0000FFDexter. ", .2, .0);
	  return;
	end

	if (string.lower(msg) == "duel") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM Duel --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Duel On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Duel Sound On/Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "duel on") then
		SMData[SMPlayerRealm][SMPlayerName].Duel = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFDuel Enhancer : ON.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "duel off") then
		SMData[SMPlayerRealm][SMPlayerName].Duel = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFDuel Enhancer : OFF.", .2, .0);
	  return;
	end

		if (string.lower(msg) == "bg") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM Bg --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Bg On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Bg Sound On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM Bg Text On/Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "bg on") then
		SMData[SMPlayerRealm][SMPlayerName].Bg = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFBg Enhancer : ON.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "bg off") then
		SMData[SMPlayerRealm][SMPlayerName].Bg = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFBg Enhancer : OFF.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow on") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow Frame = On", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow off") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow Frame = Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow sound off") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow - Sound = Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow sound on") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow - Sound = On", .2, .0);
	  return;
	end

	if (string.lower(msg) == "duel sound off") then
		SMData[SMPlayerRealm][SMPlayerName].Duel_Sound = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFDuel Enhancer - Sound = Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "duel sound on") then
		SMData[SMPlayerRealm][SMPlayerName].Duel_Sound = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFDuel Enhancer - Sound = On", .2, .0);
	  return;
	end

	if (string.lower(msg) == "bg sound off") then
		SMData[SMPlayerRealm][SMPlayerName].Bg_Sound = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFBg Enhancer - Sound = Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "bg sound on") then
		SMData[SMPlayerRealm][SMPlayerName].Bg_Sound = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFBg Enhancer - Sound = On", .2, .0);
	  return;
	end
	
	if (string.lower(msg) == "bg text off") then
		SMData[SMPlayerRealm][SMPlayerName].Bg_Text = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFBg Enhancer - Text = Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "bg text on") then
		SMData[SMPlayerRealm][SMPlayerName].Bg_Text = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFBg Enhancer - Text = On", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow sound") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM KillingBlow Sound --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow Sound On/Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM KillingBlow --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow Reset BG On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow Reset Death On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow Sound On/Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow reset") then
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00-- /SM KillingBlow Reset --", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow Reset BG On/Off", .2, .0);
		DEFAULT_CHAT_FRAME:AddMessage("/SM KillingBlow Reset Death On/Off", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow reset bg on") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Bg = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow : Will now reset when entering Battlegrounds.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow reset bg off") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Bg = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow : Will not reset when entering Battlegrounds.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow reset death on") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Death = true;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow : Will now reset when you die.", .2, .0);
	  return;
	end

	if (string.lower(msg) == "killingblow reset death off") then
		SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Death = false;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFKilling Blow : Will not reset if you die", .2, .0);
	  return;
	end

	if (string.lower(msg) == "resetconfig") then
		SMSetDefaultOptions();
		SMResetAll();
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFFConfiguration Reset.", .2, .0);
	  return;
	end

	SMDisplayHelp();
end


function SMOnEvent(event, arg1)
if (event == "VARIABLES_LOADED") then 
		SMInitialize(); 
	if (SMData[SMPlayerRealm][SMPlayerName].JustifyH_Left == true) then
		SMMessageFrame:SetJustifyH("Left");
	end	
	if (SMData[SMPlayerRealm][SMPlayerName].JustifyH_Center == true) then
		SMMessageFrame:SetJustifyH("Center");
	end
	if (SMData[SMPlayerRealm][SMPlayerName].JustifyH_Right == true) then
		SMMessageFrame:SetJustifyH("Right");
	end
	if (SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Visible == false) then
		SMMiniMapButton:Hide();
	end
	if (SMData[SMPlayerRealm][SMPlayerName].SMiniMapButton_Locked == true) then
		SMMiniMapButton.Locked = true;
	end	
end
	SMKillingBlow();
	SMDuel();
	SMBg();
	SMFlags();
    		if (event == "UNIT_HEALTH") then
			if (UnitClass("player") == MAGE) then
    				local targetHealth = UnitHealth("target");
		    		if (targetHealth < 20 and targetHealth > 0) and (not SM_OUT.EXEC_ANNOUNCED) and UnitIsEnemy("player", "target") then
		    				if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute == true) then
							SMMessageFrame:AddMessage("Execute Range - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
		    				SM_OUT.EXEC_ANNOUNCED = true;
		    		elseif (targetHealth <= 0) then
		    				SM_OUT.EXEC_ANNOUNCED = false;
		    		end
		    		if (targetHealth < 20 and targetHealth > 0) and (not SM_OUT.EXEC_ANNOUNCED) and UnitIsEnemy then
		    				if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute == true) then
							SMMessageFrame:AddMessage("Execute Range - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
		    				SM_OUT.EXEC_ANNOUNCED = true;
		    		elseif (targetHealth <= 0) then
		    				SM_OUT.EXEC_ANNOUNCED = false;
		    		end
				if (event == "PLAYER_TARGET_CHANGED") then
						SM_OUT.EXEC_ANNOUNCED = false;
				end
			end
			if ((UnitClass("player") == WARRIOR) or (UnitClass("player") == PALADIN)) then
    				local targetHealth = UnitHealth("target");
		    		if (targetHealth < 20 and targetHealth > 0) and (not SM_OUT.EXEC_ANNOUNCED) and UnitIsEnemy("player", "target") then
		    				if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute == true) then
							SMMessageFrame:AddMessage("Execute Range - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
		    				SM_OUT.EXEC_ANNOUNCED = true;
		    		elseif (targetHealth <= 0) then
		    				SM_OUT.EXEC_ANNOUNCED = false;
		    		end
		    		if (targetHealth < 20 and targetHealth > 0) and (not SM_OUT.EXEC_ANNOUNCED) and UnitIsEnemy then
		    				if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute == true) then
							SMMessageFrame:AddMessage("Execute Range - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
		    				SM_OUT.EXEC_ANNOUNCED = true;
		    		elseif (targetHealth <= 0) then
		    				SM_OUT.EXEC_ANNOUNCED = false;
		    		end
				
				if (event == "PLAYER_TARGET_CHANGED") then
						SM_OUT.EXEC_ANNOUNCED = false;
				end
			end
			if ((UnitClass("player") == ROGUE) or 
				(UnitClass("player") == PRIEST) or 
				(UnitClass("player") == WARLOCK) or
				(UnitClass("player") == HUNTER) or
				(UnitClass("player") == DRUID) or
				(UnitClass("player") == SHAMAN)) then
    				local targetHealth = UnitHealth("target");
		    		if (targetHealth < 20 and targetHealth > 0) and (not SM_OUT.EXEC_ANNOUNCED) and UnitIsEnemy("player", "target") then
		    				if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute == true) then
							SMMessageFrame:AddMessage("Target Low HP - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
		    				SM_OUT.EXEC_ANNOUNCED = true;
		    		elseif (targetHealth <= 0) then
		    				SM_OUT.EXEC_ANNOUNCED = false;
		    		end
		    		if (targetHealth < 20 and targetHealth > 0) and (not SM_OUT.EXEC_ANNOUNCED) and UnitIsEnemy then
		    				if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute == true) then
							SMMessageFrame:AddMessage("Target Low HP - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
		    				SM_OUT.EXEC_ANNOUNCED = true;
		    		elseif (targetHealth <= 0) then
		    				SM_OUT.EXEC_ANNOUNCED = false;
		    		end
				
				if (event == "PLAYER_TARGET_CHANGED") then
						SM_OUT.EXEC_ANNOUNCED = false;
				end
			end
				
		end

if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local spellName = arg10
	local amount = arg12
	local critical = arg17
		if ((eventType == "SPELL_DAMAGE") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if ((spellName == MOONFIRE) or 
					(spellName == STARFIRE) or 
					(spellName == WRATH) or 
					(spellName == SWIPE) or 
					(spellName == MAUL) or 
					(spellName == CLAW) or
					(spellName == MAIM) or
					(spellName == LACERATE) or
					(spellName == MANGLEBEAR) or
					(spellName == MANGLECAT) or 
					(spellName == SHRED) or 
					(spellName == RAVAGE) or 
					(spellName == POUNCE) or 
					(spellName == FEROCIOUS_BITE) or 
					(spellName == RAPTOR_STRIKE) or
					(spellName == STEADY_SHOT) or
					(spellName == SILENCING_SHOT) or 
					(spellName == AUTO_SHOT) or 
					(spellName == ARCANE_SHOT) or 
					(spellName == MULTI_SHOT) or 
					(spellName == AIMED_SHOT) or 
					(spellName == ARCANE_MISSILES) or 
					(spellName == FIRE_BLAST) or 
					(spellName == FIREBALL) or
					(spellName == PYROBLAST) or  
					(spellName == INCINERATE) or 
					(spellName == SCORCH) or 
					(spellName == FROSTBOLT) or 
					(spellName == ICE_LANCE) or 
					(spellName == SMITE) or 
					(spellName == MIND_BLAST) or 
					(spellName == HOLY_FIRE) or
					(spellName == SHADOWWORD_DEATH) or 
					(spellName == BACKSTAB) or 
					(spellName == SINISTER_STRIKE) or 
					(spellName == EVISCERATE) or 
					(spellName == DEADLY_THROW) or
					(spellName == ENVENOM) or
					(spellName == SHIV) or
					(spellName == MUTILATE) or
					(spellName == AMBUSH) or 
					(spellName == BLADE_FLURRY) or 
					(spellName == RIPOSTE) or 
					(spellName == EARTH_SHOCK) or 
					(spellName == FLAME_SHOCK) or
					(spellName == LIGHTNING_BOLT) or 
					(spellName == CHAIN_LIGHTNING) or 
					(spellName == FROST_SHOCK) or  
					(spellName == SEARING_PAIN) or 
					(spellName == IMMOLATE) or 
					(spellName == SOUL_FIRE) or 
					(spellName == CONFLAGRATE) or 
					(spellName == SHADOWBURN) or 
					(spellName == SHADOW_BOLT) or 
					(spellName == HEROIC_STRIKE) or 
					(spellName == SLAM) or 
					(spellName == RETALIATION) or 
					(spellName == EXECUTE) or 
					(spellName == OVERPOWER) or 
					(spellName == CLEAVE) or 
					(spellName == VICTORY_RUSH) or
					(spellName == RAMPAGE) or
					(spellName == DEVASTATE) or
					(spellName == WHIRLWIND) or 
					(spellName == MORTAL_STRIKE) or 
					(spellName == SWEEPING_STRIKES) or 
					(spellName == CRUSADER_STRIKE) or
					(spellName == AVENGERS_STRIKE) or
					(spellName == SHIELD_SLAM) or 
					(spellName == EXORCISM) or
					(spellName == JUDGEMENT_OF_COMMAND) or
					(spellName == SEAL_OF_COMMAND) or
					(spellName == JUDGEMENT_OF_RIGHTEOUSNESS) or
					(spellName == ANOTHER_SPELL1) or
					(spellName == ANOTHER_SPELL2) or
					(spellName == ANOTHER_SPELL3) or
					(spellName == ANOTHER_SPELL4) or
					(spellName == HEMORRHAGE) or
					(spellName == HOLY_SHOCK)) then
						if (GetComboPoints("Player") == 5) then
							if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
								PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
							end
							if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
								SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
							end
						end
					CritDmg = tonumber(amount);
					LastDmg = tonumber(amount);
					CritCombo = CritCombo + 1;
					CritComboDmg = CritComboDmg + amount;
						if (CritCombo >= 1) then
							SMSoundAndDisplayDamage();
						end
					
				end
			else
					if ((spellName == MOONFIRE) or 
						(spellName == STARFIRE) or 
						(spellName == WRATH) or 
						(spellName == SWIPE) or 
						(spellName == MAUL) or 
						(spellName == CLAW) or
						(spellName == MAIM) or
						(spellName == LACERATE) or
						(spellName == MANGLEBEAR) or
						(spellName == MANGLECAT) or			
						(spellName == SHRED) or 
						(spellName == RAVAGE) or 
						(spellName == POUNCE) or 
						(spellName == FEROCIOUS_BITE) or 
						(spellName == RAPTOR_STRIKE) or
						(spellName == STEADY_SHOT) or
						(spellName == SILENCING_SHOT) or 
						(spellName == AUTO_SHOT) or 
						(spellName == ARCANE_SHOT) or 
						(spellName == MULTI_SHOT) or 
						(spellName == AIMED_SHOT) or 
						(spellName == ARCANE_MISSILES) or 
						(spellName == FIRE_BLAST) or 
						(spellName == FIREBALL) or
						(spellName == PYROBLAST) or  
						(spellName == INCINERATE) or 
						(spellName == SCORCH) or 
						(spellName == FROSTBOLT) or 
						(spellName == ICE_LANCE) or 
						(spellName == SMITE) or 
						(spellName == MIND_BLAST) or 
						(spellName == HOLY_FIRE) or
						(spellName == SHADOWWORD_DEATH) or 
						(spellName == BACKSTAB) or 
						(spellName == SINISTER_STRIKE) or 
						(spellName == EVISCERATE) or 
						(spellName == DEADLY_THROW) or
						(spellName == ENVENOM) or
						(spellName == SHIV) or
						(spellName == MUTILATE) or
						(spellName == AMBUSH) or 
						(spellName == BLADE_FLURRY) or 
						(spellName == RIPOSTE) or 
						(spellName == EARTH_SHOCK) or 
						(spellName == FLAME_SHOCK) or
						(spellName == LIGHTNING_BOLT) or 
						(spellName == CHAIN_LIGHTNING) or 
						(spellName == FROST_SHOCK) or  
						(spellName == SEARING_PAIN) or 
						(spellName == IMMOLATE) or 
						(spellName == SOUL_FIRE) or 
						(spellName == CONFLAGRATE) or 
						(spellName == SHADOWBURN) or 
						(spellName == SHADOW_BOLT) or 
						(spellName == HEROIC_STRIKE) or 
						(spellName == SLAM) or 
						(spellName == RETALIATION) or 
						(spellName == EXECUTE) or 
						(spellName == OVERPOWER) or 
						(spellName == CLEAVE) or 
						(spellName == VICTORY_RUSH) or
						(spellName == RAMPAGE) or
						(spellName == DEVASTATE) or
						(spellName == WHIRLWIND) or 
						(spellName == MORTAL_STRIKE) or 
						(spellName == SWEEPING_STRIKES) or 
						(spellName == CRUSADER_STRIKE) or
						(spellName == AVENGERS_STRIKE) or
						(spellName == SHIELD_SLAM) or 
						(spellName == EXORCISM) or
						(spellName == JUDGEMENT_OF_COMMAND) or
						(spellName == SEAL_OF_COMMAND) or
						(spellName == JUDGEMENT_OF_RIGHTEOUSNESS) or
						(spellName == ANOTHER_SPELL1) or
						(spellName == ANOTHER_SPELL2) or
						(spellName == ANOTHER_SPELL3) or
						(spellName == ANOTHER_SPELL4) or
						(spellName == HEMORRHAGE) or
						(spellName == HOLY_SHOCK)) then
							if (GetComboPoints("Player") == 5) then
								if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
									PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
								end
								if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
									SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
								end
							end
						if (CritCombo ~= 0) then
							SMCompare_Combos();
						end
						if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
							SMMessageFrame:AddMessage(" [" .. amount .. "] Damage" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
					end
			end
		end
	end
end

if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local spellName = arg10
	local amount = arg12
	local critical = arg17
		if ((eventType == "SPELL_DAMAGE") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if ((spellName == MOONFIRE) or 
				(spellName == STARFIRE) or 
				(spellName == WRATH) or 
				(spellName == SWIPE) or 
				(spellName == MAUL) or 
				(spellName == CLAW) or
				(spellName == MAIM) or
				(spellName == LACERATE) or
				(spellName == MANGLEBEAR) or
				(spellName == MANGLECAT) or 
				(spellName == SHRED) or 
				(spellName == RAVAGE) or 
				(spellName == POUNCE) or 
				(spellName == FEROCIOUS_BITE) or 
				(spellName == RAPTOR_STRIKE) or
				(spellName == STEADY_SHOT) or
				(spellName == SILENCING_SHOT) or 
				(spellName == AUTO_SHOT) or 
				(spellName == ARCANE_SHOT) or 
				(spellName == MULTI_SHOT) or 
				(spellName == AIMED_SHOT) or 
				(spellName == ARCANE_MISSILES) or 
				(spellName == FIRE_BLAST) or 
				(spellName == FIREBALL) or
				(spellName == PYROBLAST) or  
				(spellName == INCINERATE) or 
				(spellName == SCORCH) or 
				(spellName == FROSTBOLT) or 
				(spellName == ICE_LANCE) or 
				(spellName == SMITE) or 
				(spellName == MIND_BLAST) or 
				(spellName == HOLY_FIRE) or
				(spellName == SHADOWWORD_DEATH) or 
				(spellName == BACKSTAB) or 
				(spellName == SINISTER_STRIKE) or 
				(spellName == EVISCERATE) or 
				(spellName == DEADLY_THROW) or
				(spellName == ENVENOM) or
				(spellName == SHIV) or
				(spellName == MUTILATE) or
				(spellName == AMBUSH) or 
				(spellName == BLADE_FLURRY) or 
				(spellName == RIPOSTE) or 
				(spellName == EARTH_SHOCK) or 
				(spellName == FLAME_SHOCK) or
				(spellName == LIGHTNING_BOLT) or 
				(spellName == CHAIN_LIGHTNING) or 
				(spellName == FROST_SHOCK) or  
				(spellName == SEARING_PAIN) or 
				(spellName == IMMOLATE) or 
				(spellName == SOUL_FIRE) or 
				(spellName == CONFLAGRATE) or 
				(spellName == SHADOWBURN) or 
				(spellName == SHADOW_BOLT) or 
				(spellName == HEROIC_STRIKE) or 
				(spellName == SLAM) or 
				(spellName == RETALIATION) or 
				(spellName == EXECUTE) or 
				(spellName == OVERPOWER) or 
				(spellName == CLEAVE) or 
				(spellName == VICTORY_RUSH) or
				(spellName == RAMPAGE) or
				(spellName == DEVASTATE) or
				(spellName == WHIRLWIND) or 
				(spellName == MORTAL_STRIKE) or 
				(spellName == SWEEPING_STRIKES) or 
				(spellName == CRUSADER_STRIKE) or
				(spellName == AVENGERS_STRIKE) or
				(spellName == SHIELD_SLAM) or 
				(spellName == EXORCISM) or
				(spellName == JUDGEMENT_OF_COMMAND) or
				(spellName == SEAL_OF_COMMAND) or
				(spellName == JUDGEMENT_OF_RIGHTEOUSNESS) or
				(spellName == ANOTHER_SPELL1) or
				(spellName == ANOTHER_SPELL2) or
				(spellName == ANOTHER_SPELL3) or
				(spellName == ANOTHER_SPELL4) or
				(spellName == HEMORRHAGE) or
				(spellName == HOLY_SHOCK)) then
					if (GetComboPoints("Player") == 5) then
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
							SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
					end
				CritDmg = tonumber(amount);
				LastDmg = tonumber(amount);
				CritCombo = CritCombo + 1;
				CritComboDmg = CritComboDmg + amount;
					if (CritCombo >= 1) then
					SMSoundAndDisplayDamage();
					end
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].White_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false)) then
	if (event == "CHAT_MSG_COMBAT_SELF_HITS") then
		if (SMData[SMPlayerRealm][SMPlayerName].No_White_Normal == false) then
			for spellname, creaturename, damage in string.gmatch(arg1, SPELL_HIT)do
			CurrentSpell = tostring(spellname);
				if (CurrentSpell == AUTO_SHOT) then
					if (GetComboPoints("Player") == 5) then
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
							SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
					end
					if (CritCombo ~= 0) then
						SMCompare_Combos();
					end
					if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
						SMMessageFrame:AddMessage(" [" .. damage .. "] Damage" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
			end
		end
		for spellname, creaturename, damage in string.gmatch(arg1, SPELL_CRIT)do
		CurrentSpell = tostring(spellname);
			if (CurrentSpell == AUTO_SHOT) then
				if (GetComboPoints("Player") == 5) then
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
						PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
					end
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
						SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
				CritDmg = tonumber(amount);
				LastDmg = tonumber(amount);
				CritCombo = CritCombo + 1;
				CritComboDmg = CritComboDmg + amount;
				if (CritCombo >= 1) then
				SMSoundAndDisplayDamage();
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].White_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false)) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
		local eventType = arg2
		local sourceName = arg4
		local amount = arg9
		local critical = arg14
		if ((eventType == "SWING_DAMAGE") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if (GetComboPoints("Player") == 5) then
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
						PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
					end
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
						SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
				CritDmg = tonumber(amount);
				LastDmg = tonumber(amount);
				CritCombo = CritCombo + 1;
				CritComboDmg = CritComboDmg + amount;
				if (CritCombo >= 1) then
					SMSoundAndDisplayDamage();
				end
			else
				if (SMData[SMPlayerRealm][SMPlayerName].No_White_Normal == false) then
					if (GetComboPoints("Player") == 5) then
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
							PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
						end
						if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
							SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
					end
					if (CritCombo ~= 0) then
						SMCompare_Combos();
					end
					if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
						SMMessageFrame:AddMessage(" [" .. amount .. "] Damage" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
			end
		end
	end
end


if ((SMData[SMPlayerRealm][SMPlayerName].White_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true)) then
	if (event == "CHAT_MSG_COMBAT_SELF_HITS") then
		for spellname, creaturename, damage in string.gmatch(arg1, SPELL_CRIT)do
		CurrentSpell = tostring(spellname);
			if (CurrentSpell == AUTO_SHOT) then
				if (GetComboPoints("Player") == 5) then
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
						PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
					end
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
						SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
				CritDmg = tonumber(amount);
				LastDmg = tonumber(amount);
				CritCombo = CritCombo + 1;
				CritComboDmg = CritComboDmg + amount;
				if (CritCombo >= 1) then
				SMSoundAndDisplayDamage();
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].White_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true)) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local amount = arg9
	local critical = arg14
		if ((eventType == "SWING_DAMAGE") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if (GetComboPoints("Player") == 5) then
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue == true) then
						PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\finishhim.wav");
					end
					if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue == true) then
						SMMessageFrame:AddMessage("5Combos Points - Finish Him!", DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
				CritDmg = tonumber(amount);
				LastDmg = tonumber(amount);
				CritCombo = CritCombo + 1;
				CritComboDmg = CritComboDmg + amount;
				if (CritCombo >= 1) then
					SMSoundAndDisplayDamage();
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Heal == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == false)) then
	if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local spellName = arg10
	local amount = arg12
	local critical = arg13
		if ((eventType == "SPELL_HEAL") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if ((spellName == FLASHHEAL) or 
					(spellName == LESSERHEAL) or
					(spellName == DESPERATEPRAYER) or
					(spellName == HEAL) or
					(spellName == GREATERHEAL) or
					(spellName == HOLYLIGHT) or
					(spellName == LAYONHANDS) or
					(spellName == FLASHOFLIGHT) or
					(spellName == HEALINGWAVE) or
					(spellName == LESSERHEALINGWAVE) or
					(spellName == CHAINHEAL) or
					(spellName == HEALINGTOUCH) or
					(spellName == REGROWTH) or
					(spellName == MOREHEALINGSPELL) or 
					(spellName == MOREHEALINGSPELL2) or 
					(spellName == MOREHEALINGSPELL3) or 
					(spellName == SWIFTMEND)) then
						CritDmgHeal = tonumber(amount);
						LastDmg = tonumber(amount);
						CritComboHeal = CritComboHeal + 1;
						CritComboHealDmg = CritComboHealDmg + amount;
						if (CritComboHeal >= 1) then
							SMSoundAndDisplayHealing();
						end
				end
			else
				if ((spellName == FLASHHEAL) or 
					(spellName == LESSERHEAL) or
					(spellName == DESPERATEPRAYER) or
					(spellName == HEAL) or
					(spellName == GREATERHEAL) or
					(spellName == HOLYLIGHT) or
					(spellName == LAYONHANDS) or
					(spellName == FLASHOFLIGHT) or
					(spellName == HEALINGWAVE) or
					(spellName == LESSERHEALINGWAVE) or
					(spellName == CHAINHEAL) or
					(spellName == HEALINGTOUCH) or
					(spellName == REGROWTH) or
					(spellName == MOREHEALINGSPELL) or 
					(spellName == MOREHEALINGSPELL2) or 
					(spellName == MOREHEALINGSPELL3) or 
					(spellName == SWIFTMEND)) then
						if (CritComboHeal ~= 0) then
							SMCompare_Combos();
						end
						if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
							SMMessageFrame:AddMessage(" [" .. amount .. "] Healing" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
				end
			end
		end
	end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == false)) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local spellName = arg10
	local amount = arg12
	local critical = arg13
		if ((eventType == "SPELL_HEAL") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if ((spellName == FLASHHEAL) or 
					(spellName == LESSERHEAL) or
					(spellName == DESPERATEPRAYER) or
					(spellName == HEAL) or
					(spellName == GREATERHEAL) or
					(spellName == HOLYLIGHT) or
					(spellName == LAYONHANDS) or
					(spellName == FLASHOFLIGHT) or
					(spellName == HEALINGWAVE) or
					(spellName == LESSERHEALINGWAVE) or
					(spellName == CHAINHEAL) or
					(spellName == HEALINGTOUCH) or
					(spellName == REGROWTH) or
					(spellName == MOREHEALINGSPELL) or 
					(spellName == MOREHEALINGSPELL2) or 
					(spellName == MOREHEALINGSPELL3) or 
					(spellName == SWIFTMEND)) then
						CritDmgHeal = tonumber(amount);
						LastDmg = tonumber(amount);
						CritComboHeal = CritComboHeal + 1;
						CritComboHealDmg = CritComboHealDmg + amount;
						if (CritComboHeal >= 1) then
						SMSoundAndDisplayHealing();
						end
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Heal == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == true)) then
	if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local spellName = arg10
	local amount = arg12
	local critical = arg13
		if ((eventType == "SPELL_HEAL") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if ((spellName == FLASHHEAL) or 
					(spellName == LESSERHEAL) or
					(spellName == DESPERATEPRAYER) or
					(spellName == HEAL) or
					(spellName == GREATERHEAL) or
					(spellName == HOLYLIGHT) or
					(spellName == LAYONHANDS) or
					(spellName == FLASHOFLIGHT) or
					(spellName == HEALINGWAVE) or
					(spellName == LESSERHEALINGWAVE) or
					(spellName == CHAINHEAL) or
					(spellName == HEALINGTOUCH) or
					(spellName == REGROWTH) or
					(spellName == MOREHEALINGSPELL) or 
					(spellName == MOREHEALINGSPELL2) or 
					(spellName == MOREHEALINGSPELL3) or 
					(spellName == SWIFTMEND)) then
						CritDmg = tonumber(amount);
						LastDmg = tonumber(amount);
						CritCombo = CritCombo + 1;
						CritComboDmg = CritComboDmg + amount;
						if (CritCombo >= 1) then
						SMSoundAndDisplay();
						end
				end
			else
				if ((spellName == FLASHHEAL) or 
					(spellName == LESSERHEAL) or
					(spellName == DESPERATEPRAYER) or
					(spellName == HEAL) or
					(spellName == GREATERHEAL) or
					(spellName == HOLYLIGHT) or
					(spellName == LAYONHANDS) or
					(spellName == FLASHOFLIGHT) or
					(spellName == HEALINGWAVE) or
					(spellName == LESSERHEALINGWAVE) or
					(spellName == CHAINHEAL) or
					(spellName == HEALINGTOUCH) or
					(spellName == REGROWTH) or
					(spellName == MOREHEALINGSPELL) or 
					(spellName == MOREHEALINGSPELL2) or 
					(spellName == MOREHEALINGSPELL3) or 
					(spellName == SWIFTMEND)) then
						if (CritCombo ~= 0) then
							SMCompare_Combos();
						end
						if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
							SMMessageFrame:AddMessage(" [" .. amount .. "] Healing" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
						end
				end
			end
		end
	end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == true)) then
	if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
	local eventType = arg2
	local sourceName = arg4
	local spellName = arg10
	local amount = arg12
	local critical = arg13
		if ((eventType == "SPELL_HEAL") and (sourceName == UnitName("player"))) then
			if (critical ~= nil) then
				if ((spellName == FLASHHEAL) or 
					(spellName == LESSERHEAL) or
					(spellName == DESPERATEPRAYER) or
					(spellName == HEAL) or
					(spellName == GREATERHEAL) or
					(spellName == HOLYLIGHT) or
					(spellName == LAYONHANDS) or
					(spellName == FLASHOFLIGHT) or
					(spellName == HEALINGWAVE) or
					(spellName == LESSERHEALINGWAVE) or
					(spellName == CHAINHEAL) or
					(spellName == HEALINGTOUCH) or
					(spellName == REGROWTH) or
					(spellName == MOREHEALINGSPELL) or 
					(spellName == MOREHEALINGSPELL2) or 
					(spellName == MOREHEALINGSPELL3) or 
					(spellName == SWIFTMEND)) then
						CritDmg = tonumber(amount);
						LastDmg = tonumber(amount);
						CritCombo = CritCombo + 1;
						CritComboDmg = CritComboDmg + amount;
						if (CritCombo >= 1) then
						SMSoundAndDisplay();
						end
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Heal == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == false)) then
	if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false) then
		if (event == "CHAT_MSG_SPELL_SELF_BUFF") then
			CurrentSpell = 0;
			for spellname, damage in string.gmatch(arg1, HEAL_HIT_SELF)do
			CurrentSpell = tostring(spellname);
				if ((CurrentSpell == FLASHHEAL) or 
				(CurrentSpell == LESSERHEAL) or
				(CurrentSpell == DESPERATEPRAYER) or
				(CurrentSpell == HEAL) or
				(CurrentSpell == GREATERHEAL) or
				(CurrentSpell == HOLYLIGHT) or
				(CurrentSpell == LAYONHANDS) or
				(CurrentSpell == FLASHOFLIGHT) or
				(CurrentSpell == HEALINGWAVE) or
				(CurrentSpell == LESSERHEALINGWAVE) or
				(CurrentSpell == CHAINHEAL) or
				(CurrentSpell == HEALINGTOUCH) or
				(CurrentSpell == REGROWTH) or
				(CurrentSpell == MOREHEALINGSPELL) or 
				(CurrentSpell == MOREHEALINGSPELL2) or 
				(CurrentSpell == MOREHEALINGSPELL3) or 
				(CurrentSpell == SWIFTMEND)) then
					if (CritComboHeal ~= 0) then
					SMCompare_Combos();
					end
					if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
					SMMessageFrame:AddMessage(" [" .. damage .. "] Healing" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
			end
			for spellname, damage in string.gmatch(arg1, HEAL_CRIT_SELF)do
			CurrentSpell = tostring(spellname);
				if ((CurrentSpell == FLASHHEAL) or 
				(CurrentSpell == LESSERHEAL) or
				(CurrentSpell == DESPERATEPRAYER) or
				(CurrentSpell == HEAL) or
				(CurrentSpell == GREATERHEAL) or
				(CurrentSpell == HOLYLIGHT) or
				(CurrentSpell == LAYONHANDS) or
				(CurrentSpell == FLASHOFLIGHT) or
				(CurrentSpell == HEALINGWAVE) or
				(CurrentSpell == LESSERHEALINGWAVE) or
				(CurrentSpell == CHAINHEAL) or
				(CurrentSpell == HEALINGTOUCH) or
				(CurrentSpell == REGROWTH) or
				(CurrentSpell == MOREHEALINGSPELL) or 
				(CurrentSpell == MOREHEALINGSPELL2) or 
				(CurrentSpell == MOREHEALINGSPELL3) or 
				(CurrentSpell == SWIFTMEND)) then
					CritDmgHeal = tonumber(damage);
					LastDmg = tonumber(damage);
					CritComboHeal = CritComboHeal + 1;
					CritComboHealDmg = CritComboHealDmg + damage;
					if (CritComboHeal >= 1) then
					SMSoundAndDisplayHealing();
					end
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == false)) then
	if (event == "CHAT_MSG_SPELL_SELF_BUFF") then
		CurrentSpell = 0;
		for spellname, damage in string.gmatch(arg1, HEAL_CRIT_SELF)do
		CurrentSpell = tostring(spellname);
			if ((CurrentSpell == FLASHHEAL) or 
			(CurrentSpell == LESSERHEAL) or
			(CurrentSpell == DESPERATEPRAYER) or
			(CurrentSpell == HEAL) or
			(CurrentSpell == GREATERHEAL) or
			(CurrentSpell == HOLYLIGHT) or
			(CurrentSpell == LAYONHANDS) or
			(CurrentSpell == FLASHOFLIGHT) or
			(CurrentSpell == HEALINGWAVE) or
			(CurrentSpell == LESSERHEALINGWAVE) or
			(CurrentSpell == CHAINHEAL) or
			(CurrentSpell == HEALINGTOUCH) or 
			(CurrentSpell == REGROWTH) or
			(CurrentSpell == MOREHEALINGSPELL) or 
			(CurrentSpell == MOREHEALINGSPELL2) or 
			(CurrentSpell == MOREHEALINGSPELL3) or 
			(CurrentSpell == SWIFTMEND)) then
				CritDmgHeal = tonumber(damage);
				LastDmg = tonumber(damage);
				CritComboHeal = CritComboHeal + 1;
				CritComboHealDmg = CritComboHealDmg + damage;
				if (CritComboHeal >= 1) then
				SMSoundAndDisplayHealing();
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Heal == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == true)) then
	if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == false) then
		if (event == "CHAT_MSG_SPELL_SELF_BUFF") then
			CurrentSpell = 0;
			for spellname, damage in string.gmatch(arg1, HEAL_HIT_SELF)do
			CurrentSpell = tostring(spellname);
				if ((CurrentSpell == FLASHHEAL) or 
				(CurrentSpell == LESSERHEAL) or
				(CurrentSpell == DESPERATEPRAYER) or
				(CurrentSpell == HEAL) or
				(CurrentSpell == GREATERHEAL) or
				(CurrentSpell == HOLYLIGHT) or
				(CurrentSpell == LAYONHANDS) or
				(CurrentSpell == FLASHOFLIGHT) or
				(CurrentSpell == HEALINGWAVE) or
				(CurrentSpell == LESSERHEALINGWAVE) or
				(CurrentSpell == CHAINHEAL) or
				(CurrentSpell == HEALINGTOUCH) or 
				(CurrentSpell == REGROWTH) or
				(CurrentSpell == MOREHEALINGSPELL) or 
				(CurrentSpell == MOREHEALINGSPELL2) or 
				(CurrentSpell == MOREHEALINGSPELL3) or 
				(CurrentSpell == SWIFTMEND)) then
					if (CritCombo ~= 0) then
					SMCompare_Combos();
					end
					if ((SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
					SMMessageFrame:AddMessage(" [" .. damage .. "] Healing" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
					end
				end
			end
			for spellname, damage in string.gmatch(arg1, HEAL_CRIT_SELF)do
			CurrentSpell = tostring(spellname);
				if ((CurrentSpell == FLASHHEAL) or 
				(CurrentSpell == LESSERHEAL) or
				(CurrentSpell == DESPERATEPRAYER) or
				(CurrentSpell == HEAL) or
				(CurrentSpell == GREATERHEAL) or
				(CurrentSpell == HOLYLIGHT) or
				(CurrentSpell == LAYONHANDS) or
				(CurrentSpell == FLASHOFLIGHT) or
				(CurrentSpell == HEALINGWAVE) or
				(CurrentSpell == LESSERHEALINGWAVE) or
				(CurrentSpell == CHAINHEAL) or
				(CurrentSpell == HEALINGTOUCH) or 
				(CurrentSpell == REGROWTH) or
				(CurrentSpell == MOREHEALINGSPELL) or 
				(CurrentSpell == MOREHEALINGSPELL2) or 
				(CurrentSpell == MOREHEALINGSPELL3) or 
				(CurrentSpell == SWIFTMEND)) then
					CritDmg = tonumber(damage);
					LastDmg = tonumber(damage);
					CritCombo = CritCombo + 1;
					CritComboDmg = CritComboDmg + damage;
					if (CritCombo >= 1) then
					SMSoundAndDisplayDamage();
					end
				end
			end
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits == true) and (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == true)) then
	if (event == "CHAT_MSG_SPELL_SELF_BUFF") then
		CurrentSpell = 0;
		for spellname, damage in string.gmatch(arg1, HEAL_CRIT_SELF)do
		CurrentSpell = tostring(spellname);
			if ((CurrentSpell == FLASHHEAL) or 
			(CurrentSpell == LESSERHEAL) or
			(CurrentSpell == DESPERATEPRAYER) or
			(CurrentSpell == HEAL) or
			(CurrentSpell == GREATERHEAL) or
			(CurrentSpell == HOLYLIGHT) or
			(CurrentSpell == LAYONHANDS) or
			(CurrentSpell == FLASHOFLIGHT) or
			(CurrentSpell == HEALINGWAVE) or
			(CurrentSpell == LESSERHEALINGWAVE) or
			(CurrentSpell == CHAINHEAL) or
			(CurrentSpell == HEALINGTOUCH) or 
			(CurrentSpell == REGROWTH) or
			(CurrentSpell == MOREHEALINGSPELL) or 
			(CurrentSpell == MOREHEALINGSPELL2) or 
			(CurrentSpell == MOREHEALINGSPELL3) or 
			(CurrentSpell == SWIFTMEND)) then
				CritDmg = tonumber(damage);
				LastDmg = tonumber(damage);
				CritCombo = CritCombo + 1;
				CritComboDmg = CritComboDmg + damage;
				if (CritCombo >= 1) then
				SMSoundAndDisplayDamage();
				end	
			end
		end
	end
end

	if (event == "PLAYER_REGEN_ENABLED") then
		if ((SMData[SMPlayerRealm][SMPlayerName].Reset_Combo == true) and (CritCombo ~= 0)) then
			SMCompare_Combos();
		end
		if ((SMData[SMPlayerRealm][SMPlayerName].Reset_Combo == true) and (CritComboHeal ~= 0)) then
			SMCompare_Combos();
		end
	end
end

function SMMiniMap()
	if arg1=="LeftButton" then
		CritCombo = 0;
		CritComboDmg = 0;
		CritComboHeal = 0;
		CritComboHealDmg = 0;
		KillingBlow = 0;
		DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod |cFFFFFFFF: All Combos : |cFF00FF00Now |cFFFF0000Reset.", .2, .0);
			elseif arg1=="RightButton" then
			ShowUIPanel(ShaderModOptionsFrame);
	end
end

function SMSoundAndDisplayDamage()
	if (CritCombo > 0 and CritCombo < 2) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Yeah == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\yeah.wav");
		end
		CritMsg = "Yeah!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Yeah == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 1 and CritCombo < 3) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Oh_Yeah == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ohyeah.wav");
		end
		CritMsg = "Oh Yeah!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Oh_Yeah == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 2 and CritCombo < 4) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Unstoppable == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\unstoppable.wav");
		end
		CritMsg = "Unstoppable!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Unstoppable == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 3 and CritCombo < 5) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Killing_Spree == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\killer.wav");
		end
		CritMsg = "Killing Spree!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Killing_Spree == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 4 and CritCombo < 6) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Dominating == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\dominating.wav");
		end
		CritMsg = "Dominating!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Dominating == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 5 and CritCombo < 7) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ultra_Kill == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ultrakill.wav");
		end
		CritMsg = "Ultra Kill!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ultra_Kill == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 6 and CritCombo < 8) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Wicked_Sick == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\wickedsick.wav");
		end
		CritMsg = "Wicked Sick!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Wicked_Sick == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 7 and CritCombo < 10) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_God_Like == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\godlike.wav");
		end
		CritMsg = "God Like!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_God_Like == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 9 and CritCombo < 15) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Holy_Shit == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\holyshit.wav");
		end
		CritMsg = "Holy Shit!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Holy_Shit == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 14 and CritCombo < 20) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Monster_Kill == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\monsterkill.wav");
		end
		CritMsg = "Mm-mmm-Monster Kill!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Monster_Kill == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 19 and CritCombo < 22) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ludicrous_Kill == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ludicrouskill.wav");
		end
		CritMsg = "Lu-lu-lu-lu-ludicrous kill!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ludicrous_Kill == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritCombo > 21) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ownage == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ownage.wav");
		end
		CritMsg = "Ownage!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ownage == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo .. " [" .. CritComboDmg .. "] Total Damage (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end	
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsg .. " x" .. CritCombo, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
end

function SMSoundAndDisplayHealing()
	if (CritComboHeal > 0 and CritComboHeal < 2) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Yeah == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\yeah.wav");
		end
		CritMsgHeal = "Yeah!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Yeah == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 1 and CritComboHeal < 3) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Oh_Yeah == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ohyeah.wav");
		end
		CritMsgHeal = "Oh Yeah!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Oh_Yeah == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 2 and CritComboHeal < 4) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Unstoppable == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\unstoppable.wav");
		end
		CritMsgHeal = "Unstoppable!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Unstoppable == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 3 and CritComboHeal < 5) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Killing_Spree == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\killer.wav");
		end
		CritMsgHeal = "Killing Spree!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Killing_Spree == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 4 and CritComboHeal < 6) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Dominating == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\dominating.wav");
		end
		CritMsgHeal = "Dominating!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Dominating == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 5 and CritComboHeal < 7) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ultra_Kill == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ultrakill.wav");
		end
		CritMsgHeal = "Ultra Kill!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ultra_Kill == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 6 and CritComboHeal < 8) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Wicked_Sick == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\wickedsick.wav");
		end
		CritMsgHeal = "Wicked Sick!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Wicked_Sick == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 7 and CritComboHeal < 10) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_God_Like == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\godlike.wav");
		end
		CritMsgHeal = "God Like!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_God_Like == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 9 and CritComboHeal < 15) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Holy_Shit == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\holyshit.wav");
		end
		CritMsgHeal = "Holy Shit!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Holy_Shit == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 14 and CritComboHeal < 20) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Monster_Kill == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\monsterkill.wav");
		end
		CritMsgHeal = "Mm-mmm-Monster Kill!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Monster_Kill == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 19 and CritComboHeal < 22) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ludicrous_Kill == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ludicrouskill.wav");
		end
		CritMsgHeal = "Lu-lu-lu-lu-ludicrous kill!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ludicrous_Kill == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (CritComboHeal > 21) then
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ownage == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ownage.wav");
		end
		CritMsgHeal = "Ownage!";
		if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ownage == true) then
			if ((SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display == true)) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal .. " [" .. CritComboHealDmg .. "] Total Healing (+" .. LastDmg .. ")" , DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display == true) then
				SMMessageFrame:AddMessage(CritMsgHeal .. " x" .. CritComboHeal, DISPLAY_RED, DISPLAY_GREEN, DISPLAY_BLUE, 1, 3);
			end
		end
	end
end


function SMCompare_Combos()
	extra_crits_toggle = 0;
	if (CritCombo >= SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo and CritComboDmg >= SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg) then
		SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo = CritCombo;
		SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboDmg = CritComboDmg;
		SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritCombo = CritCombo;
		SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg = CritComboDmg;
	else
		if (CritCombo >= SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo) then
			if (CritCombo == SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo) then
				if (CritComboDmg > SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboDmg) then
					SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo = CritCombo;
					SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboDmg = CritComboDmg;
				end
			end
			if (CritCombo > SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo) then
				SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo = CritCombo;
				SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboDmg = CritComboDmg;
			end
		end
		
		if (CritComboDmg >= SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg) then
			if (CritComboDmg == SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg) then
				if (CritCombo > SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritCombo) then
					SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritCombo = CritCombo;
					SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg = CritComboDmg;
				end
			end
			if (CritComboDmg > SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg) then
				SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritCombo = CritCombo;
				SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg = CritComboDmg;
			end
		end
	end

	if (CritComboHeal >= SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal and CritComboHealDmg >= SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg) then
		SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal = CritComboHeal;
		SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHealDmg = CritComboHealDmg;
		SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHeal = CritComboHeal;
		SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg = CritComboHealDmg;
	else
		if (CritComboHeal >= SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal) then
			if (CritComboHeal == SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal) then
				if (CritComboHealDmg > SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHealDmg) then
					SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal = CritComboHeal;
					SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHealDmg = CritComboHealDmg;
				end
			end
			if (CritComboHeal > SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal) then
				SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal = CritComboHeal;
				SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHealDmg = CritComboHealDmg;
			end
		end
		
		if (CritComboHealDmg >= SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg) then
			if (CritComboHealDmg == SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg) then
				if (CritComboHeal > SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHeal) then
					SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHeal = CritComboHeal;
					SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg = CritComboHealDmg;
				end
			end
			if (CritComboHealDmg > SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg) then
				SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHeal = CritComboHeal;
				SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg = CritComboHealDmg;
			end
		end
	end
	
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "0") then
	Splash = 0
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "1") then
	Splash = 1
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "2") then
	Splash = 2
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "3") then
	Splash = 3
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "4") then
	Splash = 4
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "5") then
	Splash = 5
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "6") then
	Splash = 6
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "7") then
	Splash = 7
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "8") then
	Splash = 8
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "9") then
	Splash = 9
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "10") then
	Splash = 10
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "11") then
	Splash = 11
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "12") then
	Splash = 12
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "13") then
	Splash = 13
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "14") then
	Splash = 14
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "15") then
	Splash = 15
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "16") then
	Splash = 16
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "17") then
	Splash = 17
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "18") then
	Splash = 18
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "19") then
	Splash = 19
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "20") then
	Splash = 20
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "21") then
	Splash = 21
end
if (SMData[SMPlayerRealm][SMPlayerName]["Splash"] == "22") then
	Splash = 22
end

if not(Splash > 1) then
	if ((CritCombo > 0 and CritCombo < 2) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Yeah == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\yeah.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Yeah!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 2) then
	if ((CritCombo > 1 and CritCombo < 3) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Oh_Yeah == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ohyeah.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Oh Yeah!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 3) then
	if ((CritCombo > 2 and CritCombo < 4) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Unstoppable == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\unstoppable.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Unstoppable!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 4) then
	if ((CritCombo > 3 and CritCombo < 5) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Killing_Spree == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\killer.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Killing Spree!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 5) then
	if ((CritCombo > 4 and CritCombo < 6) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Dominating == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\dominating.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Dominating!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 6) then
	if ((CritCombo > 5 and CritCombo < 7) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ultra_Kill == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ultrakill.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Ultra Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 7) then
	if ((CritCombo > 6 and CritCombo < 8) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Wicked_Sick == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\wickedsick.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Wicked Sick!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 8) then
	if ((CritCombo > 7 and CritCombo < 10) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_God_Like == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\godlike.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("God Like!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 10) then
	if ((CritCombo > 9 and CritCombo < 15) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Holy_Shit == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\holyshit.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Holy Shit!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 15) then
	if ((CritCombo > 14 and CritCombo < 20) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Monster_Kill == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\monsterkill.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Mm-Mmm-Monster Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 20) then
	if ((CritCombo > 19 and CritCombo < 22) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ludicrous_Kill == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\LudicrousKill.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Lu-Lu-Lu-Ludicrous Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
if not(Splash > 21) then
	if ((CritCombo > 21) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display == true)) then
		if ((SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ownage == true) and (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound == true)) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\Ownage.wav");
		end
		ShaderModMessageFrame:AddMessage("Damage: " .. CritComboDmg, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Combo: " .. CritCombo, 1, 1, 1, 1, 3);
		ShaderModMessageFrame:AddMessage("Ownnnaaaaaggge!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end
	
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "0") then
	Annonce = 0
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "1") then
	Annonce = 1
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "2") then
	Annonce = 2
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "3") then
	Annonce = 3
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "4") then
	Annonce = 4
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "5") then
	Annonce = 5
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "6") then
	Annonce = 6
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "7") then
	Annonce = 7
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "8") then
	Annonce = 8
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "9") then
	Annonce = 9
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "10") then
	Annonce = 10
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "11") then
	Annonce = 11
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "12") then
	Annonce = 12
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "13") then
	Annonce = 13
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "14") then
	Annonce = 14
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "15") then
	Annonce = 15
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "16") then
	Annonce = 16
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "17") then
	Annonce = 17
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "18") then
	Annonce = 18
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "19") then
	Annonce = 19
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "20") then
	Annonce = 20
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "21") then
	Annonce = 21
end
if (SMData[SMPlayerRealm][SMPlayerName]["AnnounceBox"] == "22") then
	Annonce = 22
end

	
if ((SMData[SMPlayerRealm][SMPlayerName].Announce_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Heal == false)) then
	Channel = GetChannelName(SMData[SMPlayerRealm][SMPlayerName]["Channel"]);
	if ((CritCombo > 21)) then
		if not(Annonce > 21) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Ownage!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Ownage!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Ownage!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 19 and CritCombo < 22)) then
		if not(Annonce > 21) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 14 and CritCombo < 19)) then
		if not(Annonce > 15) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 9 and CritCombo < 15)) then
		if not(Annonce > 10) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Holy Shit!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Holy Shit!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Holy Shit!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 7 and CritCombo < 10)) then
		if not(Annonce > 8) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("God Like!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("God Like!!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("God Like!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel); 
		end
	end
	if ((CritCombo > 6 and CritCombo < 8)) then
		if not(Annonce > 7) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Wicked Sick!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Wicked Sick!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Wicked Sick!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel); 
		end
	end
	if ((CritCombo > 5 and CritCombo < 7)) then 
		if not(Annonce > 6) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Ultra Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Ultra Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Ultra Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end 
	end
	if ((CritCombo > 4 and CritCombo < 6)) then 
		if not(Annonce > 5) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Dominating!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Dominating!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Dominating!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 3 and CritCombo < 5)) then 
		if not(Annonce > 4)then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Killing Spree!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Killing Spree!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Killing Spree!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 2 and CritCombo < 4)) then
		if not(Annonce > 3) then 
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Unstoppable!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Unstoppable!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Unstoppable!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 1 and CritCombo < 3)) then
		if not(Annonce > 2) then 
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Oh Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Oh Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Oh Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end	
	end
	if ((CritCombo > 0 and CritCombo < 2)) then 
		if not(Annonce > 1) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
end

if ((SMData[SMPlayerRealm][SMPlayerName].Announce_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Heal == true)) then
	if (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == true) then
	Channel = GetChannelName(SMData[SMPlayerRealm][SMPlayerName]["Channel"]);
	if ((CritCombo > 21)) then
		if not(Annonce > 21) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Ownage!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Ownage!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Ownage!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 19 and CritCombo < 22)) then
		if not(Annonce > 21) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 14 and CritCombo < 19)) then
		if not(Annonce > 15) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 9 and CritCombo < 15)) then
		if not(Annonce > 10) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Holy Shit!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Holy Shit!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Holy Shit!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 7 and CritCombo < 10)) then
		if not(Annonce > 8) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("God Like!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("God Like!!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("God Like!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel); 
		end
	end
	if ((CritCombo > 6 and CritCombo < 8)) then
		if not(Annonce > 7) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Wicked Sick!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Wicked Sick!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Wicked Sick!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel); 
		end
	end
	if ((CritCombo > 5 and CritCombo < 7)) then 
		if not(Annonce > 6) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Ultra Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Ultra Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Ultra Kill!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end 
	end
	if ((CritCombo > 4 and CritCombo < 6)) then 
		if not(Annonce > 5) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Dominating!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Dominating!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Dominating!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 3 and CritCombo < 5)) then 
		if not(Annonce > 4)then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Killing Spree!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Killing Spree!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Killing Spree!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 2 and CritCombo < 4)) then
		if not(Annonce > 3) then 
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Unstoppable!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Unstoppable!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Unstoppable!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritCombo > 1 and CritCombo < 3)) then
		if not(Annonce > 2) then 
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Oh Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Oh Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Oh Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end	
	end
	if ((CritCombo > 0 and CritCombo < 2)) then 
		if not(Annonce > 1) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "RAID", nil, Channel);
			end
			SendChatMessage("Yeah!  *" .. CritCombo .. "* crits for *" .. CritComboDmg .. "* total damage! ", "CHANNEL", nil, Channel);
		end
	end
	end
 end

if ((SMData[SMPlayerRealm][SMPlayerName].Announce_Display == true) and (SMData[SMPlayerRealm][SMPlayerName].Heal == true)) then
	if (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos == false) then
	Channel = GetChannelName(SMData[SMPlayerRealm][SMPlayerName]["Channel"]);
	if ((CritComboHeal > 21)) then
		if not(Annonce > 21) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Ownage!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Ownage!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Ownage!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 19 and CritComboHeal < 22)) then
		if not(Annonce > 21) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Lu-lu-lu-lu-ludicrous Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 14 and CritComboHeal < 19)) then
		if not(Annonce > 15) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Mm-mmm-Monster Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 9 and CritComboHeal < 15)) then
		if not(Annonce > 10) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Holy Shit!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Holy Shit!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Holy Shit!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 7 and CritComboHeal < 10)) then
		if not(Annonce > 8) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("God Like!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("God Like!!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("God Like!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel); 
		end
	end
	if ((CritComboHeal > 6 and CritComboHeal < 8)) then
		if not(Annonce > 7) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Wicked Sick!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Wicked Sick!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Wicked Sick!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel); 
		end
	end
	if ((CritComboHeal > 5 and CritComboHeal < 7)) then 
		if not(Annonce > 6) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Ultra Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Ultra Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Ultra Kill!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end 
	end
	if ((CritComboHeal > 4 and CritComboHeal < 6)) then 
		if not(Annonce > 5) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Dominating!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Dominating!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Dominating!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 3 and CritComboHeal < 5)) then 
		if not(Annonce > 4)then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Killing Spree!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Killing Spree!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Killing Spree!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 2 and CritComboHeal < 4)) then
		if not(Annonce > 3) then 
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Unstoppable!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Unstoppable!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Unstoppable!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	if ((CritComboHeal > 1 and CritComboHeal < 3)) then
		if not(Annonce > 2) then 
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Oh Yeah!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Oh Yeah!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Oh Yeah!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end	
	end
	if ((CritComboHeal > 0 and CritComboHeal < 2)) then 
		if not(Annonce > 1) then
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "PARTY") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Party") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "party")) then
			SendChatMessage("Yeah!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "PARTY", nil, Channel);
			end
			if ((SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "RAID") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "Raid") or (SMData[SMPlayerRealm][SMPlayerName]["Channel"] == "raid")) then
			SendChatMessage("Yeah!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "RAID", nil, Channel);
			end
			SendChatMessage("Yeah!  *" .. CritComboHeal .. "* crits for *" .. CritComboHealDmg .. "* Total Healing! ", "CHANNEL", nil, Channel);
		end
	end
	end
 end

	CritCombo = 0;
	CritComboDmg = 0;
	CritComboHeal = 0;
	CritComboHealDmg = 0;
end

function SMInitializeSMData()
	if (SMData == nil) then
		SMData = {};
	end

	if (SMData[SMPlayerRealm] == nil) then
		SMData[SMPlayerRealm] = {};
	end

	if (SMPlayerName ~= nil and SMPlayerName ~= UNKNOWNOBJECT and SMPlayerName ~= UKNOWNBEING) then
		if (SMData[SMPlayerRealm][SMPlayerName] == nil) then
			SMData[SMPlayerRealm][SMPlayerName] = {};
			SMSetCurrentPlayerToZeros();
			SMSetDefaultOptions();
		end
	end
end

function SMSetCurrentPlayerToZeros()
	SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritCombo = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboDmg = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritCombo = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboDmg = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHeal = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordHitsCritComboHealDmg = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHeal = 0;
	SMData[SMPlayerRealm][SMPlayerName].RecordDmgCritComboHealDmg = 0;
end

function SMResetAll()
	SMData = {};
	SMInitializeSMData();
	SMSetDefaultOptions();
	SMOptionsFrame_OnShow();

	DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod " .. SHADERMOD_VERSION .. " All records and options reset.", .2, .0);
end

function SMDisplayHelp()
	DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00ShaderMod " .. SHADERMOD_VERSION .. " |cFF00FF00by |cFF00FFFFSky-|cFF0000FFDexter.", .2, .0);
	DEFAULT_CHAT_FRAME:AddMessage("[Commands] (/ShaderMod, /ShaderM, /sm)",.65,.65,.6);
	DEFAULT_CHAT_FRAME:AddMessage("   Menu - Shows the options menu.");
	DEFAULT_CHAT_FRAME:AddMessage("   Records - Shows your records.");
	DEFAULT_CHAT_FRAME:AddMessage("   Lock/Unlock - Lock or unlock messages frames.");
	DEFAULT_CHAT_FRAME:AddMessage("   Hide/Show - Hide or show messages frames.");
	DEFAULT_CHAT_FRAME:AddMessage("   MiniMap - Show MiniMap Options.");
	DEFAULT_CHAT_FRAME:AddMessage("   KillingBlow - Show KillingBlow Options.");
	DEFAULT_CHAT_FRAME:AddMessage("   ResetConfig - Reset ShaderMod Configuration (May help solve variables problems).");
end

function SMOptionsFrame_OnShow()	
	if (SMData[SMPlayerRealm][SMPlayerName].Running_Crit_Display) then
		SMCheckBoxRunning_Crit_Display:SetChecked(1);
	else
		SMCheckBoxRunning_Crit_Display:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].White_Crits) then
		SMCheckBoxEnable_White_Crits:SetChecked(1);
	else
		SMCheckBoxEnable_White_Crits:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Display) then
		SMCheckBoxEnable_Old_Combo_Display:SetChecked(1);
	else
		SMCheckBoxEnable_Old_Combo_Display:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Old_Combo_Sound) then
		SMCheckBoxEnable_Old_Combo_Sound:SetChecked(1);
	else
		SMCheckBoxEnable_Old_Combo_Sound:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].No_White_Normal) then
		SMCheckBoxEnable_No_White_Normal:SetChecked(1);
	else
		SMCheckBoxEnable_No_White_Normal:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Only_Count_Crits) then
		SMCheckBoxRunning_Only_Count_Crits:SetChecked(1);
	else
		SMCheckBoxRunning_Only_Count_Crits:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Running_Combat_Log_Display) then
		SMCheckBoxRunning_Combat_Log_Display:SetChecked(1);
	else
		SMCheckBoxRunning_Combat_Log_Display:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Running_Old_School_Display) then
		SMCheckBoxRunning_Old_School_Display:SetChecked(1);
	else
		SMCheckBoxRunning_Old_School_Display:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Running_Hit_Display) then
		SMCheckBoxRunning_Hit_Display:SetChecked(1);
	else
		SMCheckBoxRunning_Hit_Display:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Reset_Combo) then
		SMCheckBoxRunning_Reset_Combo:SetChecked(1);
	else
		SMCheckBoxRunning_Reset_Combo:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Announce_Display) then
		SMCheckBoxAnnounce_Display:SetChecked(1);
	else
		SMCheckBoxAnnounce_Display:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Rogue) then
		SMCheckBoxEnable_Sound_Finish_Him_Rogue:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Finish_Him_Rogue:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Finish_Him_Execute) then
		SMCheckBoxEnable_Sound_Finish_Him_Execute:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Finish_Him_Execute:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Execute) then
		SMCheckBoxEnable_Log_Finish_Him_Execute:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Finish_Him_Execute:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Finish_Him_Rogue) then
		SMCheckBoxEnable_Log_Finish_Him_Rogue:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Finish_Him_Rogue:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Yeah) then
		SMCheckBoxEnable_Sound_Yeah:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Yeah:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Yeah) then
		SMCheckBoxEnable_Log_Yeah:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Yeah:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Merge_Heal_And_Damage_Combos) then
		SMCheckBoxEnable_Merge_Heal_And_Damage_Combos:SetChecked(1);
	else
		SMCheckBoxEnable_Merge_Heal_And_Damage_Combos:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Heal) then
		SMCheckBoxEnable_Heal:SetChecked(1);
	else
		SMCheckBoxEnable_Heal:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Oh_Yeah) then
		SMCheckBoxEnable_Sound_Oh_Yeah:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Oh_Yeah:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Unstoppable) then
		SMCheckBoxEnable_Sound_Unstoppable:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Unstoppable:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Killing_Spree) then
		SMCheckBoxEnable_Sound_Killing_Spree:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Killing_Spree:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Dominating) then
		SMCheckBoxEnable_Sound_Dominating:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Dominating:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ultra_Kill) then
		SMCheckBoxEnable_Sound_Ultra_Kill:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Ultra_Kill:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Wicked_Sick) then
		SMCheckBoxEnable_Sound_Wicked_Sick:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Wicked_Sick:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_God_Like) then
		SMCheckBoxEnable_Sound_God_Like:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_God_Like:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Holy_Shit) then
		SMCheckBoxEnable_Sound_Holy_Shit:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Holy_Shit:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Monster_Kill) then
		SMCheckBoxEnable_Sound_Monster_Kill:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Monster_Kill:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ludicrous_Kill) then
		SMCheckBoxEnable_Sound_Ludicrous_Kill:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Ludicrous_Kill:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Sound_Ownage) then
		SMCheckBoxEnable_Sound_Ownage:SetChecked(1);
	else
		SMCheckBoxEnable_Sound_Ownage:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Oh_Yeah) then
		SMCheckBoxEnable_Log_Oh_Yeah:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Oh_Yeah:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Unstoppable) then
		SMCheckBoxEnable_Log_Unstoppable:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Unstoppable:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Killing_Spree) then
		SMCheckBoxEnable_Log_Killing_Spree:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Killing_Spree:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Dominating) then
		SMCheckBoxEnable_Log_Dominating:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Dominating:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ultra_Kill) then
		SMCheckBoxEnable_Log_Ultra_Kill:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Ultra_Kill:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Wicked_Sick) then
		SMCheckBoxEnable_Log_Wicked_Sick:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Wicked_Sick:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_God_Like) then
		SMCheckBoxEnable_Log_God_Like:SetChecked(1);
	else
		SMCheckBoxEnable_Log_God_Like:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Holy_Shit) then
		SMCheckBoxEnable_Log_Holy_Shit:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Holy_Shit:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Monster_Kill) then
		SMCheckBoxEnable_Log_Monster_Kill:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Monster_Kill:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ludicrous_Kill) then
		SMCheckBoxEnable_Log_Ludicrous_Kill:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Ludicrous_Kill:SetChecked(0);
	end

	if (SMData[SMPlayerRealm][SMPlayerName].Enable_Log_Ownage) then
		SMCheckBoxEnable_Log_Ownage:SetChecked(1);
	else
		SMCheckBoxEnable_Log_Ownage:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Duel) then
		SMCheckBoxDuel_Enhancer:SetChecked(1);
	else
		SMCheckBoxDuel_Enhancer:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound) then
		SMCheckBoxDuel_Enhancer_Sound:SetChecked(1);
	else
		SMCheckBoxDuel_Enhancer_Sound:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Bg) then
		SMCheckBoxBg_Enhancer:SetChecked(1);
	else
		SMCheckBoxBg_Enhancer:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound) then
		SMCheckBoxBg_Enhancer_Sound:SetChecked(1);
	else
		SMCheckBoxBg_Enhancer_Sound:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text) then
		SMCheckBoxBg_Enhancer_Text:SetChecked(1);
	else
		SMCheckBoxBg_Enhancer_Text:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow) then
		SMCheckBoxKilling_Blow_Enhancer:SetChecked(1);
	else
		SMCheckBoxKilling_Blow_Enhancer:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound) then
		SMCheckBoxKilling_Blow_Enhancer_Sound:SetChecked(1);
	else
		SMCheckBoxKilling_Blow_Enhancer_Sound:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Bg) then
		SMCheckBoxKilling_Blow_Enhancer_Reset_Bg:SetChecked(1);
	else
		SMCheckBoxKilling_Blow_Enhancer_Reset_Bg:SetChecked(0);
	end
	
	if (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Death) then
		SMCheckBoxKilling_Blow_Enhancer_Reset_Death:SetChecked(1);
	else
		SMCheckBoxKilling_Blow_Enhancer_Reset_Death:SetChecked(0);
	end
end

function SMCheckBoxClick(var_to_toggle)
	if ( this:GetChecked() ) then
		var_to_toggle = true;
	else
		var_to_toggle = false;
	end
end

function SMOnTooltip()
		GameTooltip:AddLine("ShaderMod")
		GameTooltip:AddLine("Left click: Reset combos\nRight click: Open options menu",.8,.8,.8,1)
		GameTooltip:Show()
end

function SMKillingBlow()
	if (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow == true) then
		if ((event == "PLAYER_ENTERING_WORLD") and (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Bg == true)) then
		KillingBlow = 0;
		end
		if ((event == "CHAT_MSG_COMBAT_FRIENDLY_DEATH") and (SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Reset_Death == true)) then
			for spellname in string.gmatch(arg1, PLAYERDEATH)do
			KillingBlow = 0;
			end
		end
		if (event == "CHAT_MSG_COMBAT_HOSTILE_DEATH") then
			for spellname in string.gmatch(arg1, KILLINGBLOW)do
			KillingBlow = KillingBlow + 1;
				if (KillingBlow >= 1) then
					SMKillingBlowAnnounce();
				end
			end
		end
	end
end

function SMKillingBlowAnnounce()
	if (KillingBlow > 0 and KillingBlow < 2) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\firstblood.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("First Blood!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 1 and KillingBlow < 3) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\doublekill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Double Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 2 and KillingBlow < 4) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\tripplekill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Tripple Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 3 and KillingBlow < 5) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\multikill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Multi Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 4 and KillingBlow < 6) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ultrakill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Ultra Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 5 and KillingBlow < 7) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\megakill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Mega Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 6 and KillingBlow < 8) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\monsterkill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Monster Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 7 and KillingBlow < 9) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\ludicrouskill.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Ludicrous Kill!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 8 and KillingBlow < 11) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\wickedsick.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Wicked Sick!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 10 and KillingBlow < 14) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\holyshit.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Holy Shit!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 13 and KillingBlow < 17) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\godlike.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("God Like!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
	if (KillingBlow > 16) then
		if(SMData[SMPlayerRealm][SMPlayerName].Display_Killing_Blow_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\Ownage.wav");
		end
		SMKillingBlowFrame:AddMessage("Frags: " .. KillingBlow, 1, 1, 1, 1, 3);
		SMKillingBlowFrame:AddMessage("Ownage!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	end
end

function SMDuel()
	if (SMData[SMPlayerRealm][SMPlayerName].Duel == true) then
		if (event == "DUEL_REQUESTED") then
			SMDuelFrame:AddMessage("Prepare to Fight!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
			if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\prepare.wav");
			end
		end
		if (event == "CHAT_MSG_SYSTEM") then
			for spellname in string.gmatch(arg1, DUELTHREE)do
			SMDuelFrame:AddMessage("3",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\three.wav");
				end
			end
			for spellname in string.gmatch(arg1, DUELTWO)do
			SMDuelFrame:AddMessage("2",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\two.wav");
				end
			end
			for spellname in string.gmatch(arg1, DUELONE)do
			SMDuelFrame:AddMessage("1",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
			ShaderModTimer = GetTime();
			ShaderModInFight = 1;
				if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\one.wav");
				end
			end
			for spellname in string.gmatch(arg1, DUELPREPARE)do
			SMDuelFrame:AddMessage("Prepare to Fight!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\prepare.wav");
				end
			end
			for winner, loser in string.gmatch(arg1, DUELEND)do
				if (player == winner) then
					SMDuelFrame:AddMessage("You Win!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
					SMFightAnnounced = 0;
					if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
						PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\youwin.wav");
					end
				end
				if (player == loser) then
					SMDuelFrame:AddMessage("You Lose!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
					SMFightAnnounced = 0;
					if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
						PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\IOUS.wav");
					end
				end
			end
		end
	end
end

function SMFight()
	if (SMFightAnnounced == 0) then
	SMDuelFrame:AddMessage("FIGHT!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	SMFightAnnounced = 1;
		if (SMData[SMPlayerRealm][SMPlayerName].Duel_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\fight.wav");
		end
	end
end

function SMBg()
	if (SMData[SMPlayerRealm][SMPlayerName].Bg == true) then
		if (event == "CHAT_MSG_BG_SYSTEM_NEUTRAL") then
			for spellname in string.gmatch(arg1, ARENA30)do
			ShaderModTimerBg = GetTime();
			ShaderModInFightBg = 1;
			end
			for spellname in string.gmatch(arg1, ARENASTART)do
			ShaderModInFightBg = 0;
			SMOneBgAnnounced = 0;
			SMTwoBgAnnounced = 0;
			SMThreeBgAnnounced = 0;
			SMFightBgAnnounced = 0;
			end
			for spellname in string.gmatch(arg1, WARSONG30)do
			ShaderModTimerBg = GetTime();
			ShaderModInFightBg = 1;
			end
			for spellname in string.gmatch(arg1, WARSONGSTART)do
			ShaderModInFightBg = 0;
			SMOneBgAnnounced = 0;
			SMTwoBgAnnounced = 0;
			SMThreeBgAnnounced = 0;
			SMFightBgAnnounced = 0;
			end
			for spellname in string.gmatch(arg1, ARATHI30)do
			ShaderModTimerBg = GetTime();
			ShaderModInFightBg = 1;
			end
			for spellname in string.gmatch(arg1, ARATHISTART)do
			ShaderModInFightBg = 0;
			SMOneBgAnnounced = 0;
			SMTwoBgAnnounced = 0;
			SMThreeBgAnnounced = 0;
			SMFightBgAnnounced = 0;
			end
			for spellname in string.gmatch(arg1, ALTERAC30)do
			ShaderModTimerBg = GetTime();
			ShaderModInFightBg = 1;
			end
			for spellname in string.gmatch(arg1, ALTERACSTART)do
			ShaderModInFightBg = 0;
			SMOneBgAnnounced = 0;
			SMTwoBgAnnounced = 0;
			SMThreeBgAnnounced = 0;
			SMFightBgAnnounced = 0;
			end
			for spellname in string.gmatch(arg1, EYE30)do
			ShaderModTimerBg = GetTime();
			ShaderModInFightBg = 1;
			end
			for spellname in string.gmatch(arg1, EYESTART)do
			ShaderModInFightBg = 0;
			SMOneBgAnnounced = 0;
			SMTwoBgAnnounced = 0;
			SMThreeBgAnnounced = 0;
			SMFightBgAnnounced = 0;
			end
			if (event == "PLAYER_ENTERING_WORLD") then
				ShaderModInFightBg = 0;
				SMOneBgAnnounced = 0;
				SMTwoBgAnnounced = 0;
				SMThreeBgAnnounced = 0;
				SMFightBgAnnounced = 0;
			end
		end
	end
end

function SMThreeBg()
	if (SMThreeBgAnnounced == 0) then
	SMDuelFrame:AddMessage("3",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	SMThreeBgAnnounced = 1;
		if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\three.wav");
		end
	end
end

function SMTwoBg()
	if (SMTwoBgAnnounced == 0) then
	SMDuelFrame:AddMessage("2",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	SMTwoBgAnnounced = 1;
		if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\two.wav");
		end
	end
end

function SMOneBg()
	if (SMOneBgAnnounced == 0) then
	SMDuelFrame:AddMessage("1",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	SMOneBgAnnounced = 1;
		if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\one.wav");
		end
	end
end

function SMFightBg()
	if (SMFightBgAnnounced == 0) then
	SMDuelFrame:AddMessage("FIGHT!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
	SMFightBgAnnounced = 1;
		if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\fight.wav");
		end
	end
end

function SMFlags()
	if (event == "CHAT_MSG_BG_SYSTEM_ALLIANCE") then
		-- Warsong
		for spellname in string.gmatch(arg1, HORDEPICK)do
			if (UnitFactionGroup("player") == "Horde") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\TheEnemyHasYourFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("The Alliance has your Flag!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
				end
			elseif (UnitFactionGroup("player") == "Alliance") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\YourTeamHasTheEnemyFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("Your Team has the Enemy Flag!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
				end
			end
		end
		-- Eye of the Storm
		for spellname in string.gmatch(arg1, HORDEPICKEYE)do
			if (UnitFactionGroup("player") == "Horde") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\TheEnemyHasTheFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("The Alliance has the Flag!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
				end
			elseif (UnitFactionGroup("player") == "Alliance") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\YourTeamHasTheFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("Your Team has the Flag!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
				end
			end
		end
		-- Warsong
		for spellname in string.gmatch(arg1, ALLIANCECAPTURE)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
			PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\BlueScores.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Alliance Scores!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
			end
		end
		-- Eye of the Storm
		for spellname in string.gmatch(arg1, ALLIANCECAPTUREEYE)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\BlueScores.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Alliance Scores!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
			end
		end
		for spellname in string.gmatch(arg1, ALLIANCERETURN)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\BlueFlagReturned.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Alliance Flag Returned!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (event == "CHAT_MSG_BG_SYSTEM_HORDE") then
		-- Warsong
		for spellname in string.gmatch(arg1, ALLIANCEPICK)do
			if (UnitFactionGroup("player") == "Horde") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\YourTeamHasTheEnemyFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("Your Team has the enemy Flag!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				end
			elseif (UnitFactionGroup("player") == "Alliance") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\TheEnemyHasYourFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("The Horde has your Flag!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				end
			end
		end
		-- Eye of the Storm
		for spellname in string.gmatch(arg1, ALLIANCEPICKEYE)do
			if (UnitFactionGroup("player") == "Horde") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\YourTeamHasTheFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("Your Team has the Flag!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				end
			elseif (UnitFactionGroup("player") == "Alliance") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\TheEnemyHasTheFlag.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("The Horde has the flag!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				end
			end
		end
		-- Warsong
		for spellname in string.gmatch(arg1, HORDECAPTURE)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\RedScores.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Horde Scores!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
			end
		end
		-- Eye of the Storm
		for spellname in string.gmatch(arg1, HORDECAPTUREEYE)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\RedScores.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Horde Scores!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
			end
		end
		for spellname in string.gmatch(arg1, HORDERETURN)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\RedFlagReturned.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Horde Flag Returned!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
			end
		end
	end
	if (event == "CHAT_MSG_BG_SYSTEM_NEUTRAL") then
		for spellname in string.gmatch(arg1, HORDERETURN2)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\RedFlagReturned.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Horde Flag Returned!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
			end
		end
		for spellname in string.gmatch(arg1, ALLIANCERETURN2)do
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
				PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\BlueFlagReturned.wav");
			end
			if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
				SMDuelFrame:AddMessage("Alliance Flag Returned!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
			end
		end
		for spellname in string.gmatch(arg1, HORDEWINS)do
			if (UnitFactionGroup("player") == "Horde") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\youwin.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("Horde Wins!",FDISPLAY_RED, FDISPLAY_GREEN, FDISPLAY_BLUE, 1, 3);
				end
			end
		end
		for spellname in string.gmatch(arg1, ALLIANCEWINS)do
			if (UnitFactionGroup("player") == "Alliance") then
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Sound == true) then
					PlaySoundFile("Interface\\AddOns\\ShaderMod\\Sounds\\youwin.wav");
				end
				if (SMData[SMPlayerRealm][SMPlayerName].Bg_Text == true) then
					SMDuelFrame:AddMessage("Alliance Wins!",ADISPLAY_RED, ADISPLAY_GREEN, ADISPLAY_BLUE, 1, 3);
				end
			end
		end
	end
end
