local mod	= DBM:NewMod(2436, "DBM-Party-Shadowlands", 9, 1194)
local L		= mod:GetLocalizedStrings()

mod:SetRevision("20260210082755")
mod:SetCreatureID(175646)
mod:SetEncounterID(2424)
mod:SetHotfixNoticeRev(20220405000000)
mod:SetZone(2441)

mod:RegisterCombat("combat")

--Custom Sounds on cast/cooldown expiring
mod:AddCustomAlertSoundOption(346742, true, 2)--Fan Mail
mod:AddCustomAlertSoundOption(346286, true, 1)--Money Order
mod:AddCustomAlertSoundOption(346947, true, 1)--Unstable Goods
--Custom timer colors, countdowns, and disables
mod:AddCustomTimerOptions(346742, true, 2, 0)
mod:AddCustomTimerOptions(346962, true, 3, 0)--Money Order
mod:AddCustomTimerOptions(346286, true, 5, 0)
mod:AddCustomTimerOptions(346947, true, 5, 0)
--Midnight private aura replacements
--There are two other PAs but they are not useful since they are not player actionable PAs
mod:AddPrivateAuraSoundOption(346962, true, 346962, 1)

function mod:OnLimitedCombatStart()
	self:DisableSpecialWarningSounds()
	self:EnableAlertOptions(346742, 574, "aesoon", 2)
	self:EnableAlertOptions(346286, 576, "catchballs", 12)
	self:EnableAlertOptions(346947, 577, "specialsoon", 1)

	self:EnableTimelineOptions(346742, 574)
	self:EnableTimelineOptions(346962, 575)
	self:EnableTimelineOptions(346286, 576)
	self:EnableTimelineOptions(346947, 577)

	self:EnablePrivateAuraSound(346962, "gathershare", 2)
end

--[[
mod:RegisterEventsInCombat(
	"SPELL_CAST_START 346947 346286 346742 346293",
	"SPELL_CAST_SUCCESS 346962",
	"SPELL_AURA_APPLIED 346844 346329 346962 346403 356374 369133",
	"SPELL_AURA_REMOVED 346962"
)

local warnHazardousLiquids			= mod:NewSpellAnnounce(346286, 2)
local warnAlchemicalResidue			= mod:NewTargetNoFilterAnnounce(346844, 2, nil, false, 2)
local warnUnstableGoods				= mod:NewTargetNoFilterAnnounce(369133, 2)--Holding package

local specWarnUnstableGoods			= mod:NewSpecialWarningCount(346947, nil, nil, nil, 1, 2)
local specWarnFanMail				= mod:NewSpecialWarningCount(346293, nil, nil, nil, 2, 2)
local specWarnMoneyOrder			= mod:NewSpecialWarningMoveTo(346962, nil, nil, nil, 1, 2)
local yellMoneyOrder				= mod:NewYell(346962, nil, nil, nil, "YELL")
local yellMoneyOrderFades			= mod:NewShortFadesYell(346962, nil, nil, nil, "YELL")
local specWarnGTFO					= mod:NewSpecialWarningGTFO(346329, nil, nil, nil, 1, 8)

local timerUnstableGoodsCD			= mod:NewCDCountTimer(42.5, 346947, nil, nil, nil, 5)
local timerHazardousLiquidsCD		= mod:NewCDCountTimer(42.5, 346286, nil, nil, nil, 3)
local timerFanMailCD				= mod:NewCDCountTimer(42.5, 346293, nil, nil, nil, 2, nil, DBM_COMMON_L.HEALER_ICON)
local timerMoneyOrderCD				= mod:NewCDCountTimer(42.5, 346962, nil, nil, nil, 3)

mod.vb.goodsCount = 0
mod.vb.fanCount = 0
mod.vb.liquidsCount = 0
mod.vb.moCount = 0

function mod:OnCombatStart(delay)
	self.vb.goodsCount = 0
	self.vb.fanCount = 0
	self.vb.liquidsCount = 0
	self.vb.moCount = 0
	timerHazardousLiquidsCD:Start(5-delay, 1)
	timerFanMailCD:Start(15.4-delay, 1)
	timerMoneyOrderCD:Start(22.6-delay, 1)
	timerUnstableGoodsCD:Start(35.2-delay, 1)
end

function mod:SPELL_CAST_START(args)
	local spellId = args.spellId
	if spellId == 346947 then
		self.vb.goodsCount = self.vb.goodsCount + 1
		specWarnUnstableGoods:Show(self.vb.goodsCount)
		specWarnUnstableGoods:Play("specialsoon")
		--"Unstable Goods-346947-npc:175646-00000FBFBE = pull:35.2, 43.7, 43.8",
		timerUnstableGoodsCD:Start(nil, self.vb.goodsCount+1)
	elseif spellId == 346286 then
		self.vb.liquidsCount = self.vb.liquidsCount + 1
		warnHazardousLiquids:Show()
		--"Hazardous Liquids-346286-npc:175646-00000FBFBE = pull:6.1, 42.5, 43.7",
		timerHazardousLiquidsCD:Start(nil, self.vb.liquidsCount+1)
	elseif spellId == 346742 or spellId == 346293 then--Which one used? or maybe it's hard and non hard?
		self.vb.fanCount = self.vb.fanCount + 1
		specWarnFanMail:Show(self.vb.fanCount)
		specWarnFanMail:Play("aesoon")
		timerFanMailCD:Start(nil, self.vb.fanCount+1)
	end
end

function mod:SPELL_CAST_SUCCESS(args)
	local spellId = args.spellId
	if spellId == 346962 then
		--"Money Order-346962-npc:175646-00000FBFBE = pull:23.0, 42.5, 43.8",
		self.vb.moCount = self.vb.moCount + 1
		timerMoneyOrderCD:Start(nil, self.vb.moCount+1)
	end
end

function mod:SPELL_AURA_APPLIED(args)
	local spellId = args.spellId
	if spellId == 346844 then
		warnAlchemicalResidue:CombinedShow(1, args.destName)
	elseif spellId == 346329 and args:IsPlayer() and self:AntiSpam(3, 1) then
		specWarnGTFO:Show(args.spellName)
		specWarnGTFO:Play("watchfeet")
	elseif spellId == 346962 then
		if args:IsPlayer() then
			specWarnMoneyOrder:Show(DBM_COMMON_L.ALLIES)
			yellMoneyOrder:Yell()
			yellMoneyOrderFades:Countdown(spellId)
		else
			specWarnMoneyOrder:Show(args.destName)
		end
		specWarnMoneyOrder:Play("gathershare")
	elseif spellId == 369133 or spellId == 356374 or spellId == 346403 then--369133 confirmed, other 2 unknown
		warnUnstableGoods:Show(args.destName)
	end
end

function mod:SPELL_AURA_REMOVED(args)
	local spellId = args.spellId
	if spellId == 346962 then
		if args:IsPlayer() then
			yellMoneyOrderFades:Cancel()
		end
	end
end
--]]
