You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

local mod = DBM:NewMod(558, "DBM-Party-BC", 14, 257)
local L = mod:GetLocalizedStrings()
mod.statTypes = "normal,heroic,timewalker"
mod:SetRevision("20210922153837")
mod:SetCreatureID(17976)
mod:SetEncounterID(1925)
mod:RegisterCombat("combat")
local warnReinforcementsNow = mod:NewSpellAnnounce(34803, 1)
local warnReinforcementsSoon = mod:NewSoonAnnounce(34803, 3)
local timerReinforcements = mod:NewCDTimer(60, 34803, nil, nil, nil, 2)
function mod:OnCombatStart(delay)
if self:IsNormal() then
self:RegisterShortTermEvents("UNIT_HEALTH")
else
self:RegisterShortTermEvents("UNIT_SPELLCAST_SUCCEEDED")
timerReinforcements:Start(60 - delay)
warnReinforcementsSoon:Schedule(55 - delay)
end
end
function mod:OnCombatEnd()
self:UnregisterShortTermEvents()
end
do
local UnitHealth, UnitHealthMax = UnitHealth, UnitHealthMax
function mod:UNIT_HEALTH(uId)
if self:GetUnitCreatureId(uId) == 17976 and UnitHealth(uId) / UnitHealthMax(uId) <= 0.60 then
warnReinforcementsSoon:Show()
self:UnregisterShortTermEvents()
end
end
end
function mod:UNIT_SPELLCAST_SUCCEEDED(_, _, spellId)
if spellId == 34803 and self:AntiSpam(3, 1) then
timerReinforcements:Start(60 )
warnReinforcementsSoon:Schedule(55)
warnReinforcementsNow:Show()
end
end