------------------------------
--      Are you local?      --
------------------------------

local boss = AceLibrary("Babble-Boss-2.0")("High Priestess Jeklik")
local L = AceLibrary("AceLocale-2.0"):new("BigWigs"..boss)

----------------------------
--      Localization      --
----------------------------

L:RegisterTranslations("enUS", function() return {
	cmd = "Jeklik",

	heal_cmd = "heal",
	heal_name = "Heal Alert",
	heal_desc = "Warn for healing",

	bomb_cmd = "bomb",
	bomb_name = "Bomb Bat Alert",
	bomb_desc = "Warn for Bomb Bats",

	swarm_cmd = "swarm",
	swarm_name = "Bat Swarm Alert",
	swarm_desc = "Warn for the Bat swarms",

	swarm_trigger = "emits a deafening shriek",
	bomb_trigger = "I command you to rain fire down upon these invaders!$",
	heal_trigger = "begins to cast a Greater Heal!$",

	swarm_message = "Incoming bat swarm!",
	bomb_message = "Incoming bomb bats!",
	heal_message = "Casting heal!",
	
} end )

L:RegisterTranslations("frFR", function() return {
	bomb_trigger =  "Qu'une pluie de feu s'abatte sur les envahisseurs !",
	heal_trigger = "commence \195\160 lancer un sort de Soins exceptionnels !",
	bomb_message = "Chauve-souris en approche !",
	heal_message = "Commence \195\160 se soigner",
} end )

L:RegisterTranslations("deDE", function() return {
	heal_name = "Heilung",
	heal_desc = "Warnung, wenn Jeklik versucht sich zu heilen.",

	bomb_name = "Fledermaus Bomben",
	bomb_desc = "Warnung, wenn Fledermaus Bomben im Anflug sind.",

	bomb_trigger =  "Ich befehle Euch Feuer \195\188ber diese Eindringlinge regnen zu lassen!",
	heal_trigger = "beginnt Gro\195\159es Heilen zu wirken!",
	bomb_message = "Fledermaus Bomben im Anflug!",
	heal_message = "Jeklik versucht sich zu heilen!",
} end )

L:RegisterTranslations("zhCN", function() return {
	heal_name = "治疗警报",
	heal_desc = "高阶祭司耶克里克使用治疗时发出警报",

	bomb_name = "炸弹蝙蝠警报",
	bomb_desc = "炸弹蝙蝠出现时发出警报",

	bomb_trigger = "我命令你把这些入侵者烧成灰烬！$",
	heal_trigger = "开始释放强效治疗术！$",
	bomb_message = "炸弹蝙蝠来了！",
	heal_message = "高阶祭司耶克里克正在施放治疗，赶快打断它！",
} end )

L:RegisterTranslations("koKR", function() return {

	heal_name = "치유 경고",
	heal_desc = "치유에 대한 경고",

	bomb_name = "폭탄 박쥐 경고",
	bomb_desc = "폭탄 박쥐에 대한 경고",

	swarm_name = "박쥐 떼 경고",
	swarm_desc = "박쥐 떼에 대한 경고",

	swarm_trigger = "emits a deafening shriek", -- CHECK
	bomb_trigger = "침략자들에게 뜨거운 맛을 보여줘라!$",
	heal_trigger = "상급 치유를 시전하기 시작합니다!$",

	swarm_message = "박쥐 떼 소환!",
	bomb_message = "폭탄 박쥐 소환!",
	heal_message = "치유 시전 - 시전 방해해주세요!",
} end )

----------------------------------
--      Module Declaration      --
----------------------------------

BigWigsJeklik = BigWigs:NewModule(boss)
BigWigsJeklik.zonename = AceLibrary("Babble-Zone-2.0")("Zul'Gurub")
BigWigsJeklik.enabletrigger = boss
BigWigsJeklik.toggleoptions = {"swarm", "heal", "bomb", "bosskill"}
BigWigsJeklik.revision = tonumber(string.sub("$Revision: 12206 $", 12, -3))

------------------------------
--      Initialization      --
------------------------------

function BigWigsJeklik:OnEnable()
	self:RegisterEvent("CHAT_MSG_MONSTER_YELL")
	self:RegisterEvent("CHAT_MSG_MONSTER_EMOTE")
	self:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH", "GenericBossDeath")
end

------------------------------
--      Events              --
------------------------------

function BigWigsJeklik:CHAT_MSG_MONSTER_YELL(msg)
	if self.db.profile.bomb and string.find(msg, L["bomb_trigger"]) then
		self:TriggerEvent("BigWigs_Message", L["bomb_message"], "Yellow")
	end
end

function BigWigsJeklik:CHAT_MSG_MONSTER_EMOTE(msg)
	if self.db.profile.heal and string.find(msg, L["heal_trigger"]) then
		self:TriggerEvent("BigWigs_Message", L["heal_message"], "Orange")
	elseif self.db.profile.swarm and string.find(msg, L["swarm_trigger"]) then
		self:TriggerEvent("BigWigs_Message", L["swarm_message"], "Orange")
	end
end

