54 lines
2.7 KiB
Lua
54 lines
2.7 KiB
Lua
-- Magmadar (Octo BigWigs Raids/MC/Magmadar.lua), native server events.
|
|
-- boss_magmadar.cpp: Panic 19408, Frenzy 19451, Lava Bomb 19411/20474 (fire on the ground: Conflagration 19428).
|
|
local MAGMADAR = 11982
|
|
local L = {
|
|
bar_panicCd = "Fear CD", bar_panicSoon = "Fear Soon...", msg_panic = "Fear - Dispel!",
|
|
bar_frenzyCd = "Frenzy CD", bar_frenzyDur = "Frenzy!", msg_frenzy = "Frenzy - Tranq now!",
|
|
}
|
|
local timer = {panicFirstCd = 10, panicCd = 30, panicSoon = 5, frenzyCd = {15, 20}, frenzyDur = 8}
|
|
local icon = {panic = "Spell_Shadow_DeathScream", berserkerRage = "spell_nature_ancestralguardian", frenzy = "Ability_Druid_ChallangingRoar",
|
|
tranquil = "Spell_Nature_Drowsy", fireProtPot = "inv_potion_24"}
|
|
local color = {panicCd = "Cyan", panicSoon = "Blue", frenzyCd = "White", frenzyDur = "Red"}
|
|
|
|
local m = OctoBossMods:NewModule("Magmadar", {npcs = {MAGMADAR}, displayName = "Magmadar", zone = "Molten Core"})
|
|
local function class() local _, c = UnitClass("player") return c end
|
|
|
|
function m:OnEngage()
|
|
self:Bar(L.bar_panicCd, timer.panicFirstCd, icon.panic, true, color.panicCd)
|
|
if class() == "WARRIOR" then self:WarningSign(icon.berserkerRage, 0.7) end
|
|
self:IntervalBar(L.bar_frenzyCd, timer.frenzyCd[1], timer.frenzyCd[2], icon.frenzy, true, color.frenzyCd)
|
|
end
|
|
function m:Panic()
|
|
if not self:Throttle("panic", 5) then return end
|
|
self:RemoveBar(L.bar_panicSoon)
|
|
self:Bar(L.bar_panicCd, timer.panicCd, icon.panic, true, color.panicCd)
|
|
self:Message(L.msg_panic, "Urgent", false, "Info")
|
|
self:WarningSign(icon.panic, 0.7)
|
|
self:DelayedBar(timer.panicCd, L.bar_panicSoon, timer.panicSoon, icon.panic, true, color.panicSoon)
|
|
end
|
|
function m:Frenzy(_, _, dstGUID)
|
|
if OctoBossMods.NpcId(dstGUID) ~= MAGMADAR then return end
|
|
self:RemoveBar(L.bar_frenzyCd)
|
|
if class() == "HUNTER" then
|
|
self:Message(L.msg_frenzy, "Urgent", false, "Info")
|
|
self:WarningSign(icon.tranquil, 1)
|
|
end
|
|
self:Bar(L.bar_frenzyDur, timer.frenzyDur, icon.frenzy, true, color.frenzyDur)
|
|
self.frenzyStart = GetTime()
|
|
end
|
|
function m:FrenzyFade(_, _, dstGUID)
|
|
if OctoBossMods.NpcId(dstGUID) ~= MAGMADAR then return end
|
|
self:RemoveBar(L.bar_frenzyDur)
|
|
self:RemoveWarningSign(icon.tranquil)
|
|
local spent = GetTime() - (self.frenzyStart or GetTime())
|
|
self:IntervalBar(L.bar_frenzyCd, math.max(0.1, timer.frenzyCd[1] - spent), math.max(0.2, timer.frenzyCd[2] - spent), icon.frenzy, true, color.frenzyCd)
|
|
end
|
|
function m:ConflagYou(_, _, dstGUID)
|
|
if dstGUID == UnitGUID("player") and self:Throttle("conflag", 3) then self:WarningSign(icon.fireProtPot, 1) end
|
|
end
|
|
m.events = {
|
|
SPELL_CAST_SUCCESS = {[19408] = "Panic"},
|
|
SPELL_AURA_APPLIED = {[19451] = "Frenzy", [19428] = "ConflagYou"},
|
|
SPELL_AURA_REMOVED = {[19451] = "FrenzyFade"},
|
|
}
|