Files
2026-11-23 03:28:32 +02:00

81 lines
4.2 KiB
Lua

-- Shazzrah (Octo BigWigs Raids/MC/Shazzrah.lua), native server events.
-- boss_shazzrah.cpp: Shazzrah's Curse 19713, Deaden Magic 19714, Counterspell 19715, Gate of Shazzrah (blink) 23138/23139.
local SHAZZRAH = 12264
local L = {
bar_counterspellCd = "Counterspell CD", bar_counterspellSoon = "Counterspell Soon...",
msg_counterspellSoon = "Counterspell Soon - Stop Casting!", msg_counterspell = "Counterspell Done - Start Casting!",
bar_curseCd = "Shazzrah's Curse CD", msg_curse = "Shazzrah's Curse - Decurse!",
bar_deadenCd = "Deaden Magic CD", bar_deadenDur = "Deaden Magic is UP!", msg_deaden = "Deaden Magic - Dispel it!",
bar_blinkCd = "Blink CD", bar_blinkSoon = "Blink Soon...", msg_blink = "Blink - Aggro Drop!",
}
local timer = {counterspellFirstCd = 14, counterspellCd = 16, counterspellSoon = 3, curseFirstCd = 10, curseCd = 20,
deadenFirstCd = 4.5, deadenCd = {7, 14}, deadenDur = 30, blinkFirstCd = 25, blinkCd = 30, blinkSoon = 5}
local icon = {counterspell = "Spell_Frost_IceShock", curse = "Spell_Shadow_AntiShadow", deaden = "Spell_Holy_SealOfSalvation", blink = "Spell_Arcane_Blink"}
local color = {counterspellCd = "Orange", counterspellSoon = "Red", curseCd = "Magenta", deadenCd = "Cyan", deadenDur = "Blue",
blinkCd = "White", blinkSoon = "Black"}
local m = OctoBossMods:NewModule("Shazzrah", {npcs = {SHAZZRAH}, displayName = "Shazzrah", zone = "Molten Core"})
local function class() local _, c = UnitClass("player") return c end
local function counterspellTimers(self, seconds)
self:Bar(L.bar_counterspellCd, seconds, icon.counterspell, true, color.counterspellCd)
self:DelayedBar(seconds, L.bar_counterspellSoon, timer.counterspellSoon, icon.counterspell, true, color.counterspellSoon)
self:DelayedMessage(seconds - 1, L.msg_counterspellSoon, "Attention")
end
local function blinkTimers(self, seconds)
self:Bar(L.bar_blinkCd, seconds, icon.blink, true, color.blinkCd)
self:DelayedBar(seconds, L.bar_blinkSoon, timer.blinkSoon, icon.blink, true, color.blinkSoon)
end
function m:OnEngage()
counterspellTimers(self, timer.counterspellFirstCd)
self:Bar(L.bar_curseCd, timer.curseFirstCd, icon.curse, true, color.curseCd)
self:Bar(L.bar_deadenCd, timer.deadenFirstCd, icon.deaden, true, color.deadenCd)
blinkTimers(self, timer.blinkFirstCd)
end
function m:Counterspell()
if not self:Throttle("cs", 3) then return end
self:CancelDelayedBar(L.bar_counterspellSoon)
self:RemoveBar(L.bar_counterspellSoon)
self:Message(L.msg_counterspell, "Positive", false, "BikeHorn")
counterspellTimers(self, timer.counterspellCd)
end
function m:Curse()
if not self:Throttle("curse", 5) then return end
self:Bar(L.bar_curseCd, timer.curseCd, icon.curse, true, color.curseCd)
local c = class()
if c == "MAGE" or c == "DRUID" then
self:Message(L.msg_curse, "Important", false, "Info")
self:WarningSign(icon.curse, 0.7)
end
end
function m:Deaden(_, _, dstGUID)
if OctoBossMods.NpcId(dstGUID) ~= SHAZZRAH then return end
self:RemoveBar(L.bar_deadenCd)
self.deadenStart = GetTime()
self:Bar(L.bar_deadenDur, timer.deadenDur, icon.deaden, true, color.deadenDur)
local c = class()
if c == "PRIEST" or c == "SHAMAN" then
self:Message(L.msg_deaden, "Urgent", false, "Info")
self:WarningSign(icon.deaden, timer.deadenDur)
end
end
function m:DeadenFade(_, _, dstGUID)
if OctoBossMods.NpcId(dstGUID) ~= SHAZZRAH then return end
self:RemoveBar(L.bar_deadenDur)
self:RemoveWarningSign(icon.deaden)
local spent = GetTime() - (self.deadenStart or GetTime())
self:IntervalBar(L.bar_deadenCd, math.max(0.1, timer.deadenCd[1] - spent), math.max(0.2, timer.deadenCd[2] - spent), icon.deaden, true, color.deadenCd)
end
function m:Blink()
if not self:Throttle("blink", 5) then return end
self:CancelDelayedBar(L.bar_blinkSoon)
self:RemoveBar(L.bar_blinkSoon)
self:Message(L.msg_blink, "Important", false, "Alarm")
blinkTimers(self, timer.blinkCd)
end
m.events = {
SPELL_CAST_SUCCESS = {[19715] = "Counterspell", [19713] = "Curse", [23138] = "Blink", [23139] = "Blink"},
SPELL_AURA_APPLIED = {[19714] = "Deaden"},
SPELL_AURA_REMOVED = {[19714] = "DeadenFade"},
}