Files
2026-11-23 03:28:32 +02:00

47 lines
2.7 KiB
Lua

-- Echo of Medivh (Octo BigWigs Raids/KarazhanUpper/EchoOfMedivh.lua), Turtle Upper Karazhan, native server events.
-- Corruption of Medivh 52674 (spread out, mark, yell), Doom of Medivh 40004-40006 stacks on you. Octo's automatic
-- restoration-potion cancel uses a protected call and is not ported.
local L = {
msg_corruptionYou = "YOU have Corruption! Get away from others!", msg_corruptionOther = "%s has Corruption! Get away from others!",
bar_corruption = "Corruption of Medivh", bar_doom = "Doom of Medivh (%d)", warning = "CORRUPTED, GET AWAY",
yell_corruption = "I am corrupted! STAY AWAY!",
}
local icon = {corruption = "INV_Misc_ShadowEgg", doom = "Spell_Nature_Drowsy"}
local MARKS = {1, 2, 3, 4, 5, 6}
local m = OctoBossMods:NewModule("Echo of Medivh", {npcs = {61329, 61958}, displayName = "Echo of Medivh", zone = "Karazhan"})
function m:OnEngage() self.marked, self.nextMark, self.doomBar = {}, 1, nil end
function m:Corruption(_, _, dstGUID, dstName)
if not dstName then return end
if dstGUID == UnitGUID("player") then
self:Message(L.msg_corruptionYou, "Important", true, "Alarm")
self:WarningSign(icon.corruption, 5, true, L.warning)
self:Bar(L.bar_corruption, 12, icon.corruption, true, "Black")
SendChatMessage(L.yell_corruption, "YELL")
else
self:Message(format(L.msg_corruptionOther, dstName), "Important")
end
self.marked[dstName] = true
self:SetRaidTargetForPlayer(dstName, MARKS[self.nextMark])
self.nextMark = self.nextMark % #MARKS + 1
end
function m:CorruptionFade(_, _, dstGUID, dstName)
if not dstName then return end
if dstGUID == UnitGUID("player") then self:RemoveBar(L.bar_corruption) self:RemoveWarningSign(icon.corruption) end
if self.marked[dstName] then self.marked[dstName] = nil self:RestorePreviousRaidTargetForPlayer(dstName) end
end
function m:Doom(_, _, dstGUID, _, _, _, _, _, stacks)
if dstGUID ~= UnitGUID("player") then return end
stacks = tonumber(stacks) or 1
if self.doomBar then self:RemoveBar(self.doomBar) end
self.doomBar = format(L.bar_doom, stacks)
self:IntervalBar(self.doomBar, 14, 24, icon.doom, true, stacks >= 4 and "Red" or stacks >= 3 and "Yellow" or "White")
end
function m:DoomFade(_, _, dstGUID)
if dstGUID == UnitGUID("player") and self.doomBar then self:RemoveBar(self.doomBar) self.doomBar = nil end
end
m.events = {
SPELL_AURA_APPLIED = {[52674] = "Corruption", [40004] = "Doom", [40005] = "Doom", [40006] = "Doom"},
SPELL_AURA_APPLIED_DOSE = {[40004] = "Doom", [40005] = "Doom", [40006] = "Doom"},
SPELL_AURA_REMOVED = {[52674] = "CorruptionFade", [40004] = "DoomFade", [40005] = "DoomFade", [40006] = "DoomFade"},
}