local Kazrogal = DBM:NewBossMod("Kazrogal", DBM_KAZROGAL_NAME, DBM_KAZROGAL_DESCRIPTION, DBM_MOUNT_HYJAL, DBM_HYJAL_TAB, 3);

Kazrogal.Version	= "1.0";
Kazrogal.Author		= "Tandanu";

local counter = 0;

Kazrogal:RegisterCombat("COMBAT");

Kazrogal:RegisterEvents(
	"SPELL_AURA_APPLIED"
);

function Kazrogal:OnCombatStart(delay)
	counter = 0;
	self:StartStatusBarTimer(38, "First Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
end

function Kazrogal:OnCombatEnd()
	counter = 0;
end

function Kazrogal:OnEvent(event, args)
	if event == "SPELL_AURA_APPLIED" then
		if args.spellId == 31447 then
			self:SendSync("Debuff")
		end	
	end
end

function Kazrogal:OnSync(msg)
	if msg == "Debuff" then
		counter = counter + 1;
		self:Announce(DBM_KAZROGAL_WARN_MARK:format(counter), 2); 
	end
	if counter == 1 then
		self:StartStatusBarTimer(40, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	elseif counter == 2 then
		self:StartStatusBarTimer(35, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	elseif counter == 3 then
		self:StartStatusBarTimer(30, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	elseif counter == 4 then
		self:StartStatusBarTimer(25, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	elseif counter == 5 then
		self:StartStatusBarTimer(20, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	elseif counter == 6 then
		self:StartStatusBarTimer(15, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	elseif counter > 6 then
		self:StartStatusBarTimer(10, "Next Mark", "Interface\\Icons\\spell_shadow_soulleech_3");
	end

end