53 lines
2.9 KiB
Lua
53 lines
2.9 KiB
Lua
-- Majordomo Executus (Octo BigWigs Raids/MC/Majordomo.lua), native server events.
|
|
-- boss_majordomo_executus.cpp: Magic Reflection 20619, Damage Shield 21075 (cast on the adds and himself).
|
|
-- Adds: Flamewaker Elite 11664, Flamewaker Healer 11663. The encounter ends on his submission yell.
|
|
-- Octo's lava "fire pit" warning comes from environmental damage text, which has no server spell event; not ported.
|
|
local ELITE, HEALER = 11664, 11663
|
|
local L = {
|
|
bar_reflectCd = "Reflection CD", bar_magicReflect = "Magic Reflection", msg_magicReflect = "Magic Reflection - Stop Casting!",
|
|
bar_physicalReflect = "Physical Reflection", msg_physicalReflect = "Physical Reflection - Stop Attacking!",
|
|
msg_eliteDead = "/4 Flamewaker Elite Dead", msg_healerDead = "/4 Flamewaker Healer Dead",
|
|
trigger_engage = "Reckless mortals, none may challenge the sons of the living flame!",
|
|
trigger_submit = "Impossible! Stay your attack, mortals... I submit! I submit!",
|
|
}
|
|
local timer = {reflectFirstCd = 30, reflectCd = 20, reflectDur = 10}
|
|
local icon = {noReflect = "Spell_Shadow_DetectLesserInvisibility", magicReflect = "Spell_Frost_FrostShock", physicalReflect = "Spell_Shadow_AntiShadow"}
|
|
|
|
local m = OctoBossMods:NewModule("Majordomo Executus", {npcs = {12018, ELITE, HEALER}, killNpcs = {12018},
|
|
displayName = "Majordomo Executus", zone = "Molten Core", engageYells = {L.trigger_engage}})
|
|
|
|
function m:OnEngage()
|
|
self.elites, self.healers = 0, 0
|
|
self:Bar(L.bar_reflectCd, timer.reflectFirstCd, icon.noReflect, true, "Black")
|
|
end
|
|
local function reflect(self, key, bar, msg, ic, col, warn)
|
|
if not self:Throttle(key, 5) then return end
|
|
self:RemoveBar(L.bar_reflectCd)
|
|
self:Bar(bar, timer.reflectDur, ic, true, col)
|
|
if warn then
|
|
self:Message(msg, "Attention", false, "Beware")
|
|
self:WarningSign(ic, 1)
|
|
end
|
|
self:ScheduleEvent("reflectCd", function()
|
|
self:RemoveWarningSign(ic)
|
|
self:Bar(L.bar_reflectCd, timer.reflectCd, icon.noReflect, true, "Black")
|
|
end, timer.reflectDur)
|
|
end
|
|
local function melee() local _, c = UnitClass("player") return c == "WARRIOR" or c == "ROGUE" end
|
|
function m:MagicReflect() reflect(self, "magic", L.bar_magicReflect, L.msg_magicReflect, icon.magicReflect, "Blue", not melee()) end
|
|
function m:PhysicalReflect() reflect(self, "physical", L.bar_physicalReflect, L.msg_physicalReflect, icon.physicalReflect, "Red", true) end
|
|
function m:OnCombatLog(sub, _, _, dstGUID)
|
|
if sub ~= "UNIT_DIED" then return end
|
|
local id = OctoBossMods.NpcId(dstGUID)
|
|
if id == ELITE then
|
|
self.elites = (self.elites or 0) + 1
|
|
self:Message(self.elites .. L.msg_eliteDead, "Positive")
|
|
elseif id == HEALER then
|
|
self.healers = (self.healers or 0) + 1
|
|
self:Message(self.healers .. L.msg_healerDead, "Positive")
|
|
end
|
|
end
|
|
function m:Submit() OctoBossMods:Victory(self) end
|
|
m.yells = {{L.trigger_submit, "Submit"}}
|
|
m.events = {SPELL_AURA_APPLIED = {[20619] = "MagicReflect", [21075] = "PhysicalReflect"}}
|