61 lines
3.4 KiB
Lua
61 lines
3.4 KiB
Lua
-- Hazza'rah (Octo BigWigs Raids/ZG/Hazzarah.lua), native server events.
|
|
-- boss_hazzarah.cpp: Sleep 24664, Mana Burn 26046 (Octo "Chain Burn"), three Nightmare Illusions 15163 summoned on players.
|
|
local ILLUSION = 15163
|
|
local L = {
|
|
bar_adds = "Adds Spawn", msg_addsSpawn = "3 Nightmare Illusions - Ranged, Kill the Adds! ", msg_addsLeft = "Nightmare Illusions left: %d",
|
|
bar_sleepCd = "Sleep CD", bar_sleepAfflic = "Sleeping!", msg_sleep = "Sleep - Tremor Totem!",
|
|
bar_chainBurn = "AoE Mana Burn CD", msg_chainBurn = "AoE Mana Burn - Drain his Mana!",
|
|
}
|
|
local timer = {firstAdds = 21, adds = 24, firstSleepCd = 10, sleepCd = 18, sleepAfflic = 6, chainBurn = 60}
|
|
local icon = {adds = "spell_magic_lesserinvisibilty", sleep = "spell_nature_sleep", chainBurn = "spell_shadow_manaburn",
|
|
tremor = "spell_nature_tremortotem", viperSting = "ability_hunter_aimedshot", manaDrain = "spell_shadow_siphonmana"}
|
|
local m = OctoBossMods:NewModule("Hazza'rah", {npcs = {15083, ILLUSION}, killNpcs = {15083}, displayName = "Hazza'rah", zone = "Zul'Gurub"})
|
|
local function class() local _, c = UnitClass("player") return c end
|
|
function m:OnEngage()
|
|
self.illusions, self.seenIllusion = 0, {}
|
|
self:Bar(L.bar_sleepCd, timer.firstSleepCd, icon.sleep, true, "Blue")
|
|
self:Bar(L.bar_adds, timer.firstAdds, icon.adds, true, "Black")
|
|
self:ScheduleRepeatingEvent("illusions", function() self:ScanIllusions() end, 0.5)
|
|
end
|
|
-- The summon has no spell event: a wave is a Nightmare Illusion GUID this client has not seen before on any raid target.
|
|
function m:ScanIllusions()
|
|
local units = {"target", "focus", "mouseover", "targettarget"}
|
|
local n = IsInRaid() and GetNumGroupMembers() or 0
|
|
for i = 1, n do units[#units + 1] = "raid" .. i .. "target" end
|
|
for _, unit in ipairs(units) do
|
|
local guid = UnitGUID(unit)
|
|
if OctoBossMods.NpcId(guid) == ILLUSION and not self.seenIllusion[guid] then
|
|
self.seenIllusion[guid] = true
|
|
if self:Throttle("wave", 10) then
|
|
self.illusions = 3
|
|
self:Bar(L.bar_adds, timer.adds, icon.adds, true, "Black")
|
|
self:Message(L.msg_addsSpawn, "Urgent")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
function m:OnCombatLog(sub, _, _, dstGUID)
|
|
if sub == "UNIT_DIED" and OctoBossMods.NpcId(dstGUID) == ILLUSION then
|
|
self.illusions = math.max(0, (self.illusions or 0) - 1)
|
|
if self.illusions > 0 then self:Message(format(L.msg_addsLeft, self.illusions), "Positive") end
|
|
end
|
|
end
|
|
function m:Sleep()
|
|
if not self:Throttle("sleep", 5) then return end
|
|
self:RemoveBar(L.bar_sleepCd)
|
|
self:Bar(L.bar_sleepAfflic, timer.sleepAfflic, icon.sleep, true, "Blue")
|
|
self:Message(L.msg_sleep, "Attention")
|
|
if class() == "SHAMAN" then self:WarningSign(icon.tremor, 1) end
|
|
self:DelayedBar(timer.sleepAfflic, L.bar_sleepCd, timer.sleepCd, icon.sleep, true, "Blue")
|
|
end
|
|
function m:ChainBurn()
|
|
if not self:Throttle("burn", 10) then return end
|
|
self:Bar(L.bar_chainBurn, timer.chainBurn, icon.chainBurn, true, "Red")
|
|
self:Message(L.msg_chainBurn, "Attention")
|
|
local c = class()
|
|
if c == "HUNTER" then self:WarningSign(icon.viperSting, 1)
|
|
elseif c == "WARLOCK" then self:WarningSign(icon.manaDrain, 1)
|
|
elseif c == "PRIEST" then self:WarningSign(icon.chainBurn, 1) end
|
|
end
|
|
m.events = {SPELL_AURA_APPLIED = {[24664] = "Sleep"}, SPELL_CAST_SUCCESS = {[24664] = "Sleep", [26046] = "ChainBurn"}}
|