87 lines
4.6 KiB
Lua
87 lines
4.6 KiB
Lua
-- Keeper Gnarlmoon (Octo BigWigs Raids/KarazhanUpper/KeeperGnarlmoon.lua), Turtle Upper Karazhan, native server events.
|
|
-- Lunar Shift 51085/51086, Flock of Ravens 51083, Worgen Dimension 51096 (owl phase), Red Moon 50064/51079/51081,
|
|
-- Blue Moon 50063/51078/51080, Blood Boil 51082. Owl phases at 66% and 33% (warnings at 71/38% from raid targets).
|
|
-- Octo's owl HP frame is not ported.
|
|
local BOSS = 61939
|
|
local L = {
|
|
bar_lunarShiftCast = "Lunar Shift Casting!", bar_lunarShiftCD = "Next Lunar Shift", msg_lunarShift = "Lunar Shift casting!",
|
|
msg_ravensSoon = "12 ravens incoming", bar_ravens = "Flock of Ravens",
|
|
msg_midHp = "Keeper Gnarlmoon < 71% - Owls Soon (@ 66%)!", msg_lowHp = "Keeper Gnarlmoon < 38% - Owls Soon (@ 33%)!",
|
|
msg_owlPhaseStart = "Owl Phase begins - kill the owls at the same time within 1 min!", msg_owlPhaseEnd = "Owl Phase ended!",
|
|
bar_owlEnrage = "Owls Enrage", msg_owlEnrage = "Owls will enrage in 10 seconds!", msg_owlsEnraged = "Owls Enraged!",
|
|
msg_redMoon = "You have RED MOON!", msg_blueMoon = "You have BLUE MOON!", bar_bloodBoil = "Next Blood Boil",
|
|
}
|
|
local icon = {lunarShift = "Spell_Nature_StarFall", owlEnrage = "Spell_Shadow_UnholyFrenzy", redMoon = "inv_misc_orb_05",
|
|
blueMoon = "inv_ore_arcanite_01", bloodBoil = "Spell_Shadow_BloodBoil", ravens = "Spell_Shadow_Carrion"}
|
|
local RED = {[50064] = true, [51079] = true, [51081] = true}
|
|
local BLUE = {[50063] = true, [51078] = true, [51080] = true}
|
|
local m = OctoBossMods:NewModule("Keeper Gnarlmoon", {npcs = {BOSS}, displayName = "Keeper Gnarlmoon", zone = "Karazhan"})
|
|
function m:OnEngage()
|
|
self.midWarned, self.lowWarned = false, false
|
|
self:Bar(L.bar_lunarShiftCD, 30, icon.lunarShift, true, "Blue")
|
|
self:Bar(L.bar_ravens, 15, icon.ravens, true, "Black")
|
|
self:DelayedMessage(10, L.msg_ravensSoon, "Important")
|
|
self:ScheduleRepeatingEvent("health", function() self:HealthCheck() end, 1)
|
|
end
|
|
function m:HealthCheck()
|
|
if self.lowWarned then return end
|
|
for _, unit in ipairs({"target", "focus", "mouseover", "targettarget"}) do
|
|
if OctoBossMods.NpcId(UnitGUID(unit)) == BOSS then
|
|
local ok, hp = pcall(function() return UnitHealth(unit) * 100 / UnitHealthMax(unit) end)
|
|
if ok and hp then
|
|
if not self.midWarned and hp <= 71 and hp > 66 then self.midWarned = true self:Message(L.msg_midHp, "Urgent", true) end
|
|
if hp <= 38 and hp > 33 then self.lowWarned = true self:Message(L.msg_lowHp, "Urgent", true) end
|
|
end
|
|
return
|
|
end
|
|
end
|
|
end
|
|
function m:Ravens()
|
|
if not self:Throttle("ravens", 5) then return end
|
|
self:CancelDelayedMessage(L.msg_ravensSoon)
|
|
self:Bar(L.bar_ravens, 35, icon.ravens, true, "Black")
|
|
self:DelayedMessage(30, L.msg_ravensSoon, "Important")
|
|
end
|
|
function m:LunarShift()
|
|
if not self:Throttle("shift", 5) then return end
|
|
self:RemoveBar(L.bar_lunarShiftCD)
|
|
self:Message(L.msg_lunarShift, "Important")
|
|
self:Bar(L.bar_lunarShiftCast, 5, icon.lunarShift, true, "Blue")
|
|
self:DelayedBar(5, L.bar_lunarShiftCD, 25, icon.lunarShift, true, "Blue")
|
|
end
|
|
function m:OwlStart(_, _, dstGUID)
|
|
if OctoBossMods.NpcId(dstGUID) ~= BOSS then return end
|
|
self:Message(L.msg_owlPhaseStart, "Attention", false, "Alarm")
|
|
self:Bar(L.bar_owlEnrage, 60, icon.owlEnrage, true, "Red")
|
|
self:DelayedMessage(50, L.msg_owlEnrage, "Urgent")
|
|
self:DelayedMessage(60, L.msg_owlsEnraged, "Important")
|
|
end
|
|
function m:OwlEnd(_, _, dstGUID)
|
|
if OctoBossMods.NpcId(dstGUID) ~= BOSS then return end
|
|
self:RemoveBar(L.bar_owlEnrage)
|
|
self:CancelDelayedMessage(L.msg_owlEnrage)
|
|
self:CancelDelayedMessage(L.msg_owlsEnraged)
|
|
self:Message(L.msg_owlPhaseEnd, "Positive")
|
|
end
|
|
function m:Moon(_, _, dstGUID, _, spellId)
|
|
if dstGUID ~= UnitGUID("player") or not self:Throttle("moon", 3) then return end
|
|
if RED[spellId] then
|
|
self:Message(L.msg_redMoon, "Important", true, "Alarm")
|
|
self:WarningSign(icon.redMoon, 5, true, "RED")
|
|
elseif BLUE[spellId] then
|
|
self:Message(L.msg_blueMoon, "Important", true, "Alert")
|
|
self:WarningSign(icon.blueMoon, 5, true, "BLUE")
|
|
end
|
|
end
|
|
function m:BloodBoil() if self:Throttle("boil", 3) then self:Bar(L.bar_bloodBoil, 11, icon.bloodBoil, true, "Red") end end
|
|
local applied = {[51096] = "OwlStart"}
|
|
for id in pairs(RED) do applied[id] = "Moon" end
|
|
for id in pairs(BLUE) do applied[id] = "Moon" end
|
|
m.events = {
|
|
SPELL_CAST_START = {[51085] = "LunarShift", [51086] = "LunarShift"},
|
|
SPELL_CAST_SUCCESS = {[51083] = "Ravens", [51082] = "BloodBoil"},
|
|
SPELL_DAMAGE = {[51082] = "BloodBoil"},
|
|
SPELL_AURA_APPLIED = applied,
|
|
SPELL_AURA_REMOVED = {[51096] = "OwlEnd"},
|
|
}
|