LVBM.AddOns.Flamegor = {
	["Name"] = LVBM_FLAMEGOR_NAME,
	["Version"] = "1.0",
	["Author"] = "La Vendetta|Tandanu",
	["Description"] = LVBM_FLAMEGOR_DESCRIPTION,
	["Instance"] = LVBM_BWL,
	["GUITab"] = LVBMGUI_TAB_BWL,
	["Sort"] = 6,
	["Options"] = {
		["Enabled"] = true,
		["Announce"] = false,
		["Frenzy"] = true,
	},
	["DropdownMenu"] = {
		[1] = {
			["variable"] = "LVBM.AddOns.Flamegor.Options.Frenzy",
			["text"] = LVBM_FLAMEGOR_ANNOUNCE_FRENZY,
			["func"] = function() LVBM.AddOns.Flamegor.Options.Frenzy = not LVBM.AddOns.Flamegor.Options.Frenzy; end,
		},
	},
	["Events"] = {
		["CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE"] = true,
		["CHAT_MSG_MONSTER_EMOTE"] = true,
	},
	["OnEvent"] = function(event, arg1)
		if event == "PLAYER_REGEN_DISABLED" and GetRealZoneText() == LVBM_BWL then
			if LVBM.UnitExists(LVBM_FLAMEGOR_FLAMEGOR) then
				LVBM.Schedule(10, "LVBM.AddOns.Flamegor.OnEvent", "ConfirmCombat");
			end
		elseif event == "ConfirmCombat" then			
			if LVBM.DetectCombat(LVBM_FLAMEGOR_FLAMEGOR) then
				LVBM.StartStatusBarTimer(21, "Wing Buffet");
				LVBM.Schedule(18, "LVBM.AddOns.Flamegor.OnEvent", "WingBuffetWarning", 3);
			end
		elseif event == "CHAT_MSG_SPELL_CREATURE_VS_CREATURE_DAMAGE" then
			if arg1 == LVBM_FLAMEGOR_WING_BUFFET then
				LVBM.Announce(string.format(LVBM_WING_BUFFET_WARNING, 1))
				LVBM.StartStatusBarTimer(1, "Wing Buffet Cast");
				LVBM.Schedule(29, "LVBM.AddOns.Flamegor.OnEvent", "WingBuffetWarning", 3);
				LVBM.Schedule(1, "LVBM.AddOns.Flamegor.OnEvent", "WingBuffetWarning", 31);
			elseif arg1 == LVBM_FLAMEGOR_SHADOW_FLAME then
				LVBM.Announce(LVBM_SHADOW_FLAME_WARNING);
				LVBM.StartStatusBarTimer(2, "Shadow Flame Cast");
			end
		elseif event == "WingBuffetWarning" then
			if arg1 == 3 then
				LVBM.Announce(string.format(LVBM_WING_BUFFET_WARNING, 3));
			elseif arg1 == 31 then
				LVBM.EndStatusBarTimer("Wing Buffet");
				LVBM.StartStatusBarTimer(31, "Wing Buffet");
			end
		elseif event == "CHAT_MSG_MONSTER_EMOTE" then
			if arg1 == LVBM_FLAMEGOR_FRENZY and arg2 == LVBM_FLAMEGOR_FLAMEGOR then
				LVBM.EndStatusBarTimer("Frenzy")
				LVBM.StartStatusBarTimer(9, "Frenzy");
				if LVBM.AddOns.Flamegor.Options.Frenzy then
					LVBM.Announce("*** Frenzy ***");
				end
			end
		end
	end,
};
