local Jan = DBM:NewBossMod("Janalai", DBM_JANALAI_NAME, DBM_JANALAI_DESCRIPTION, DBM_ZULAMAN, DBM_ZULAMAN_TAB, 3);

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

Jan:RegisterEvents(
	"CHAT_MSG_MONSTER_YELL",
	"SPELL_AURA_APPLIED",
	"CHAT_MSG_RAID_BOSS_EMOTE"
)

Jan:RegisterCombat("YELL", DBM_JANALAI_YELL_PULL)

Jan:AddBarOption("Enrage")
Jan:AddBarOption("Hatcher")
Jan:AddBarOption("Explosion")

function Jan:OnCombatStart()
	self:StartStatusBarTimer(300, "Soft Enrage", "Interface\\Icons\\Spell_Shadow_UnholyFrenzy")
	self:Announce(DBM_JANALAI_WARN_HATCHER_SOON, 1)
	self:StartStatusBarTimer(11, "Hatcher", "Interface\\Icons\\INV_Misc_Head_Troll_01")
end

function Jan:OnEvent(event, args)
	if event == "CHAT_MSG_RAID_BOSS_EMOTE" then
		if args == "%s goes into a frenzy!" then
			self:Announce(DBM_JANALAI_WARN_FRENZY, 2);
			self:EndStatusBarTimer("Soft Enrage");
		end
	elseif event == "CHAT_MSG_MONSTER_YELL" then
		if arg1 == DBM_JANALAI_YELL_EXPLOSION then
			self:Announce(DBM_JANALAI_WARN_EXPLOSION, 3)
			self:StartStatusBarTimer(11, "Explosion", "Interface\\Icons\\Spell_Shadow_MindBomb")
			self:ScheduleAnnounce(10, DBM_JANALAI_WARN_EXPLOSION_INC, 4)
		elseif arg1 == DBM_JANALAI_YELL_HATCHER then
			self:Announce(DBM_JANALAI_WARN_HATCHER, 2)
			self:ScheduleAnnounce(80, DBM_JANALAI_WARN_HATCHER_SOON, 1)
			self:StartStatusBarTimer(90, "Hatcher", "Interface\\Icons\\INV_Misc_Head_Troll_01")
		elseif arg1 == DBM_JANALAI_YELL_NUMBERS then
			self:EndStatusBarTimer("Hatcher");
		end	
	end
end
