94 lines
5.2 KiB
Lua
94 lines
5.2 KiB
Lua
-- Upper Karazhan trash (Octo BigWigs Raids/KarazhanUpper/KaraTrash.lua), native server events.
|
|
-- Mana Buildup 57648 / Unstable Mana 57647 (bombs), Overflowing Arcana 57646 (Arcane Anomaly 61950), Self Destruction
|
|
-- Protocol 57652 (Crumbling Protector 61952), Astral Insight 52928/58022/58026 (stop casting), Manascale Drake 61940:
|
|
-- Frigid Mana Breath 52388/52389, Draconic Thrash 52387. Drake engage = its first fact in the feed (no target polling).
|
|
local L = {
|
|
bar_astral_insight = "Astral Insight (stop casting!)", msg_astral_insight = "Stop casting!",
|
|
bar_breath = "Drake Breath soon", bar_thrash = "Wing Buffet soon",
|
|
msg_buildup_removed = "Mana Buildup dispelled.", msg_buildup = "You are a bomb, get dispelled or get out of the raid!",
|
|
warn_buildup = "Mana Buildup (bomb) on %s!", bar_buildup = "Mana Buildup (bomb)",
|
|
msg_unstable = "You are a bomb, get out of the raid!", warn_unstable = "Unstable Mana (bomb) on %s!", bar_unstable = "Unstable Mana (bomb)",
|
|
warn_arcana = "Flee from Arcane Anomaly!", warn_destruct = "Flee from Crumbling Protector!", bar_destruct = "Self Destruction Protocol",
|
|
}
|
|
local icon = {buildup = "Spell_Nature_Lightning", unstable = "Spell_Shadow_Teleport", arcana = "INV_Enchant_EssenceEternalLarge",
|
|
destruct = "Spell_Shadow_MindBomb", insight = "Spell_Arcane_MindMastery", breath = "Spell_Frost_FrostNova", thrash = "INV_Misc_MonsterScales_14"}
|
|
local DRAKE = 61940
|
|
local m = OctoBossMods:NewModule("Kara Trash", {npcs = {61940, 61948, 61949, 61950, 61952, 61954, 61955, 61956, 61957},
|
|
displayName = "Karazhan Trash", zone = "Karazhan", trash = true})
|
|
function m:OnEngage() self.drakes = {} end
|
|
function m:OnCombatLog(sub, srcGUID, _, dstGUID)
|
|
if sub == "UNIT_DIED" then
|
|
if OctoBossMods.NpcId(dstGUID) == 61950 then self:RemoveBar(L.warn_arcana) self:RemoveWarningSign(icon.arcana) end
|
|
return
|
|
end
|
|
for _, guid in ipairs({srcGUID, dstGUID}) do
|
|
if OctoBossMods.NpcId(guid) == DRAKE and not self.drakes[guid] then
|
|
self.drakes[guid] = true
|
|
self:IntervalBar(L.bar_breath, 14, 19, icon.breath, true, "Blue")
|
|
self:IntervalBar(L.bar_thrash, 12, 14, icon.thrash, true, "White")
|
|
end
|
|
end
|
|
end
|
|
function m:Breath() if self:Throttle("breath", 3) then self:IntervalBar(L.bar_breath, 14, 19, icon.breath, true, "Blue") end end
|
|
function m:Thrash() if self:Throttle("thrash", 3) then self:IntervalBar(L.bar_thrash, 12, 14, icon.thrash, true, "White") end end
|
|
function m:Buildup(_, _, dstGUID, dstName)
|
|
if not dstName then return end
|
|
if dstGUID == UnitGUID("player") then
|
|
self.buildupAt = GetTime()
|
|
self:Message(L.msg_buildup, "Personal", true, "Beware")
|
|
self:Bar(L.bar_buildup, 7, icon.buildup, true, "Yellow")
|
|
self:WarningSign(icon.buildup, 7)
|
|
else
|
|
self:Message(format(L.warn_buildup, dstName), "Attention", false, "Info")
|
|
end
|
|
end
|
|
function m:BuildupFade(_, _, dstGUID)
|
|
if dstGUID ~= UnitGUID("player") then return end
|
|
self:RemoveBar(L.bar_buildup)
|
|
self:RemoveWarningSign(icon.buildup)
|
|
if self.buildupAt and GetTime() - self.buildupAt < 6.5 then self:Message(L.msg_buildup_removed, "Positive") end
|
|
self.buildupAt = nil
|
|
end
|
|
function m:Unstable(_, _, dstGUID, dstName)
|
|
if not dstName then return end
|
|
if dstGUID == UnitGUID("player") then
|
|
self:Message(L.msg_unstable, "Personal", true, "RunAway")
|
|
self:Bar(L.bar_unstable, 10, icon.unstable, true, "Magenta")
|
|
self:WarningSign(icon.unstable, 10)
|
|
else
|
|
self:Message(format(L.warn_unstable, dstName), "Attention", false, "Info")
|
|
end
|
|
end
|
|
function m:UnstableFade(_, _, dstGUID)
|
|
if dstGUID == UnitGUID("player") then self:RemoveBar(L.bar_unstable) self:RemoveWarningSign(icon.unstable) end
|
|
end
|
|
function m:Arcana(_, _, dstGUID)
|
|
if dstGUID ~= UnitGUID("player") or not self:Throttle("arcana", 2) then return end
|
|
self:WarningSign(icon.arcana, 8, true, L.warn_arcana)
|
|
self:Bar(L.warn_arcana, 8, icon.arcana, true, "Magenta")
|
|
end
|
|
function m:ArcanaFade(_, _, dstGUID)
|
|
if dstGUID == UnitGUID("player") then self:RemoveBar(L.warn_arcana) self:RemoveWarningSign(icon.arcana) end
|
|
end
|
|
function m:Destruct()
|
|
if not self:Throttle("destruct", 2) then return end
|
|
self:Message(L.warn_destruct, "Important", false, "RunAway")
|
|
self:Bar(L.bar_destruct, 4, icon.destruct, true, "Red")
|
|
end
|
|
function m:Insight(_, _, dstGUID)
|
|
if dstGUID ~= UnitGUID("player") then return end
|
|
self:WarningSign(icon.insight, 7, true, L.msg_astral_insight)
|
|
self:Bar(L.bar_astral_insight, 7, icon.insight, true, "Blue")
|
|
end
|
|
function m:InsightFade(_, _, dstGUID)
|
|
if dstGUID == UnitGUID("player") then self:RemoveBar(L.bar_astral_insight) self:RemoveWarningSign(icon.insight) end
|
|
end
|
|
m.events = {
|
|
SPELL_CAST_START = {[57652] = "Destruct", [52388] = "Breath", [52389] = "Breath"},
|
|
SPELL_CAST_SUCCESS = {[52387] = "Thrash"},
|
|
SPELL_AURA_APPLIED = {[57648] = "Buildup", [57647] = "Unstable", [57646] = "Arcana", [52928] = "Insight", [58022] = "Insight", [58026] = "Insight"},
|
|
SPELL_AURA_APPLIED_DOSE = {[57646] = "Arcana"},
|
|
SPELL_AURA_REMOVED = {[57648] = "BuildupFade", [57647] = "UnstableFade", [57646] = "ArcanaFade", [52928] = "InsightFade",
|
|
[58022] = "InsightFade", [58026] = "InsightFade"},
|
|
}
|