local mod	= DBM:NewMod(967, "DBM-Party-WoD", 7, 476)
local L		= mod:GetLocalizedStrings()

mod.statTypes = "normal,heroic,mythic,challenge,timewalker"

mod:SetRevision("20240106080507")
mod:SetCreatureID(76143)
mod:SetEncounterID(1700)

mod:RegisterCombat("combat")

mod:RegisterEventsInCombat(
	"SPELL_AURA_REMOVED 159382",
	"SPELL_CAST_START 153810 153794 159382",
	"RAID_BOSS_WHISPER"
)

local warnSolarFlare			= mod:NewSpellAnnounce(153810, 3)

local specWarnPierceArmor		= mod:NewSpecialWarningDefensive(153794, nil, nil, nil, 1, 2)
local specWarnFixate			= mod:NewSpecialWarningYou(176544, nil, nil, nil, 1, 2)
local specWarnQuills			= mod:NewSpecialWarningMoveTo(159382, nil, nil, nil, 2, 13)
local specWarnQuillsEnd			= mod:NewSpecialWarningEnd(159382, nil, nil, nil, 1, 2)

local timerSolarFlareCD			= mod:NewCDTimer(17, 153810, nil, nil, nil, 3)
local timerQuills				= mod:NewBuffActiveTimer(17, 159382, nil, nil, nil, 2, nil, DBM_COMMON_L.HEALER_ICON)

local skyTrashMod = DBM:GetModByName("SkyreachTrash")

function mod:OnCombatStart(delay)
	timerSolarFlareCD:Start(11-delay)
--	if self:IsHard() then
		--timerQuillsCD:Start(33-delay)--Needs review
--	end
	if skyTrashMod.Options.RangeFrame and skyTrashMod.vb.debuffCount ~= 0 then--In case of bug where range frame gets stuck open from trash pulls before this boss.
		skyTrashMod.vb.debuffCount = 0--Fix variable
		DBM.RangeCheck:Hide()--Close range frame.
	end
end

function mod:SPELL_AURA_REMOVED(args)
	local spellId = args.spellId
	if spellId == 159382 then
		specWarnQuillsEnd:Show()
		specWarnQuillsEnd:Play("safenow")
	end
end

function mod:SPELL_CAST_START(args)
	local spellId = args.spellId
	if spellId == 153810 then
		warnSolarFlare:Show()
		timerSolarFlareCD:Start()
		warnSolarFlare:Play("mobsoon")
		if self:IsDps() then
			warnSolarFlare:ScheduleVoice(2, "mobkill")
		end
	elseif spellId == 153794 then
		if self:IsTanking("player", "boss1", nil, true) then
			specWarnPierceArmor:Show()
			specWarnPierceArmor:Play("defensive")
		end
	elseif spellId == 159382 then
		specWarnQuills:Show(DBM_COMMON_L.BREAK_LOS)
		specWarnQuills:Play("breaklos")
		timerQuills:Start()
	end
end

function mod:RAID_BOSS_WHISPER()
	specWarnFixate:Show()
	specWarnFixate:Play("targetyou")
end
