518 lines
30 KiB
Lua
518 lines
30 KiB
Lua
-- Offline harness for client_addons/OctoBossMods: a minimal stand-in for the 70334 client API.
|
|
-- Usage: lua5.1 tests/bossmods_harness.lua <addon dir>
|
|
local dir = assert(arg[1], "addon dir")
|
|
local now = 0
|
|
local frames, messages, sounds = {}, {}, {}
|
|
local cleu = {}
|
|
local combat = {player = false}
|
|
local guids = {player = "Player-70-00000001"}
|
|
|
|
local function newObject()
|
|
local o = {scripts = {}, events = {}, shown = true, points = {}}
|
|
local mt = {__index = function(t, k)
|
|
if type(k) ~= "string" or not k:match("^%u") then return nil end
|
|
return function(self, ...)
|
|
if k == "SetScript" then local name, fn = ...; self.scripts[name] = fn
|
|
elseif k == "RegisterEvent" then self.events[(...)] = true
|
|
elseif k == "Show" then self.shown = true
|
|
elseif k == "Hide" then self.shown = false
|
|
elseif k == "SetShown" then self.shown = (...) and true or false
|
|
elseif k == "IsShown" then return self.shown
|
|
elseif k == "SetMinMaxValues" then self.min, self.max = ...
|
|
elseif k == "SetValue" then self.value = ...
|
|
elseif k == "SetText" then self.text_value = ...
|
|
elseif k == "SetFormattedText" then self.text_value = string.format(...)
|
|
elseif k == "GetPoint" then return "CENTER", nil, "CENTER", 0, 0
|
|
elseif k == "CreateFontString" or k == "CreateTexture" then return newObject()
|
|
end
|
|
end
|
|
end}
|
|
return setmetatable(o, mt)
|
|
end
|
|
|
|
CreateFrame = function() local f = newObject(); frames[#frames + 1] = f; return f end
|
|
UIParent = newObject()
|
|
RaidWarningFrame = newObject()
|
|
DEFAULT_CHAT_FRAME = {AddMessage = function(_, text) messages[#messages + 1] = {t = now, text = text, chat = true} end}
|
|
RaidNotice_AddMessage = function(_, text) messages[#messages + 1] = {t = now, text = text} end
|
|
PlaySoundFile = function(path) sounds[#sounds + 1] = {t = now, path = path} end
|
|
GetTime = function() return now end
|
|
-- 70334 has no addon combat log: scenarios are written as combat-log rows and delivered the way the
|
|
-- Backend delivers server facts, as local "OctoBM" addon messages.
|
|
local spellNames, fakeSpell, sentAddon, prefixes = {}, 900000, {}, {}
|
|
C_Spell = {GetSpellName = function(id) return spellNames[id] end}
|
|
C_ChatInfo = {
|
|
RegisterAddonMessagePrefix = function(p) prefixes[p] = true end,
|
|
SendAddonMessage = function(p, text, chan, to) sentAddon[#sentAddon + 1] = p .. "|" .. chan .. "|" .. to .. "|" .. text end,
|
|
}
|
|
Ambiguate = function(name) return (name:gsub("%-.*", "")) end
|
|
strsub, strmatch = string.sub, string.match
|
|
UnitAffectingCombat = function(unit) return combat[unit] or false end
|
|
UnitIsDeadOrGhost = function() return false end
|
|
local dead = {}
|
|
UnitIsDead = function(unit) return dead[unit] or false end
|
|
UnitExists = function(unit) return guids[unit] ~= nil end
|
|
UnitName = function(unit) return unit == "player" and "Tester" or "Firemaw" end
|
|
UnitClass = function() return "Hunter", "HUNTER" end
|
|
UnitIsGroupLeader = function() return true end
|
|
UnitIsGroupAssistant = function() return false end
|
|
local marks = {}
|
|
GetRaidTargetIndex = function(unit) return marks[unit] end
|
|
SetRaidTarget = function(unit, i) marks[unit] = i end
|
|
UnitGUID = function(unit) return guids[unit] end
|
|
UnitIsUnit = function(a, b) return a == b end
|
|
IsInRaid = function() return false end
|
|
UnitPowerType = function() return 0 end
|
|
GetNumSubgroupMembers = function() return 0 end
|
|
GetNumGroupMembers = function() return 0 end
|
|
GetSpellTexture = nil -- removed in 70334; only C_Spell.GetSpellTexture exists
|
|
strsplit = function(sep, s)
|
|
local out = {}
|
|
for piece in string.gmatch(s .. sep, "(.-)" .. sep:gsub("%p", "%%%0")) do out[#out + 1] = piece end
|
|
return unpack(out)
|
|
end
|
|
strfind, strlower, format, floor = string.find, string.lower, string.format, math.floor
|
|
strtrim = function(s) return (s:gsub("^%s+", ""):gsub("%s+$", "")) end
|
|
wipe = function(t) for k in pairs(t) do t[k] = nil end return t end
|
|
tinsert, tremove = table.insert, table.remove
|
|
SlashCmdList = {}
|
|
local said_chat = {}
|
|
SendChatMessage = function(text, chan) said_chat[#said_chat + 1] = chan .. ":" .. text end
|
|
|
|
local function load(path)
|
|
local chunk = assert(loadfile(dir .. "/" .. path))
|
|
chunk("OctoBossMods", {})
|
|
end
|
|
for line in io.lines(dir .. "/OctoBossMods.toc") do
|
|
if not line:match("^##") and line:match("%S") then load((line:gsub("\\", "/"):gsub("%s+$", ""))) end
|
|
end
|
|
|
|
local function fire(event, ...)
|
|
for _, f in ipairs(frames) do
|
|
if f.events[event] and f.scripts.OnEvent then f.scripts.OnEvent(f, event, ...) end
|
|
end
|
|
end
|
|
local function advance(to)
|
|
while now < to do
|
|
now = math.min(to, now + 0.1)
|
|
for _, f in ipairs(frames) do if f.shown and f.scripts.OnUpdate then f.scripts.OnUpdate(f, 0.1) end end
|
|
end
|
|
end
|
|
local function feedActor(guid, name)
|
|
if not guid or guid == "" then return "-" end
|
|
local entry, low = guid:match("^Creature%-.-%-(%d+)%-(%x+)$")
|
|
if entry then return "C" .. entry .. ":" .. tonumber(low, 16) end
|
|
if guid == guids.player then return "PTester" end -- The Backend names a player by the real name.
|
|
return "P" .. name
|
|
end
|
|
local function fireCleu()
|
|
local sub, src, srcName, dst, dstName, id, name = cleu[2], cleu[4], cleu[5], cleu[8], cleu[9], cleu[12], cleu[13]
|
|
local extra, amount = "", 0
|
|
if sub:sub(1, 6) == "SWING_" then
|
|
if sub ~= "SWING_MISSED" then return end -- Only own parried swings are fed.
|
|
extra, id = tostring(id), 0
|
|
else
|
|
if type(id) ~= "number" and type(name) == "string" and name ~= "" then
|
|
fakeSpell = fakeSpell + 1 id = fakeSpell
|
|
end
|
|
if id and name then spellNames[id] = name end
|
|
for i = 15, 17 do if type(cleu[i]) == "number" then amount = cleu[i] end end
|
|
end
|
|
if sub == "UNIT_DIED" then src = nil end
|
|
local text = table.concat({sub, tostring(id or 0), feedActor(src, srcName), feedActor(dst, dstName), tostring(amount or 0), extra}, ";")
|
|
fire("CHAT_MSG_ADDON", "OctoBM", text, "WHISPER", "Tester-Realm")
|
|
end
|
|
local FIREMAW = "Creature-0-70-469-0-11983-000001"
|
|
local function log(sub, src, dst, spellId, spellName, ...)
|
|
cleu = {now, sub, false, src, "Firemaw", 0, 0, dst, "Raider", 0, 0, spellId, spellName, 0, ...}
|
|
fireCleu()
|
|
end
|
|
|
|
local failures = 0
|
|
local function checkFeedSubscription()
|
|
fire("PLAYER_ENTERING_WORLD", true, false)
|
|
if #sentAddon > 0 then return false end -- Never inside the post-login spell-locator barrier.
|
|
advance(now + 45.2)
|
|
local joined = table.concat(sentAddon, "\n")
|
|
return prefixes.OctoBM and joined:find("OctoBM|WHISPER|Tester|R", 1, true) and joined:find(" 23339", 1, true)
|
|
end
|
|
local function check(ok, text) if not ok then failures = failures + 1 print("FAIL: " .. text) end end
|
|
local function bar(text) return OctoBossMods.Bars.active[text] end
|
|
local function said(text, from)
|
|
for _, m in ipairs(messages) do if not m.chat and m.t >= (from or 0) and m.text:find(text, 1, true) then return m end end
|
|
end
|
|
|
|
fire("ADDON_LOADED", "OctoBossMods")
|
|
-- Pull: player enters combat with Firemaw targeted.
|
|
guids.target = FIREMAW
|
|
combat.player = true
|
|
fire("PLAYER_REGEN_DISABLED")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Firemaw", "engage on pull")
|
|
check(bar("Wing Buffet CD") and bar("Wing Buffet CD").ends == 30, "first Wing Buffet bar 30 s")
|
|
check(bar("Shadow Flame CD") and bar("Shadow Flame CD").ends == 14, "first Shadow Flame bar 14 s")
|
|
-- Shadow Flame: cast start at 14 s, the raid-wide hit 2 s later lands on many players.
|
|
advance(14)
|
|
log("SPELL_CAST_START", FIREMAW, "", 22539, "Shadow Flame")
|
|
check(bar("Casting Shadow Flame!") and not bar("Shadow Flame CD"), "Shadow Flame cast bar replaces CD")
|
|
check(said("Casting Shadow Flame!", 14), "Shadow Flame cast warning")
|
|
advance(16)
|
|
for i = 1, 40 do log("SPELL_DAMAGE", FIREMAW, "Player-70-0000" .. i, 22539, "Shadow Flame", 32, 3319) end
|
|
check(bar("Shadow Flame CD") and math.abs(bar("Shadow Flame CD").ends - 30) < 1e-6, "Shadow Flame CD restarts once from the hit")
|
|
local zone = 0
|
|
for _, m in ipairs(messages) do if not m.chat and m.text == "Look for new Floor Zones!" then zone = zone + 1 end end
|
|
check(zone == 1, "40 hits give exactly one zone warning (got " .. zone .. ")")
|
|
check(bar("find new Zone(s)"), "zone find bar")
|
|
advance(20.05)
|
|
check(bar("soak Floor Zone(s)") and not bar("find new Zone(s)"), "soak bar follows find bar")
|
|
-- Explosions: first Beware, then Alarm.
|
|
log("SPELL_DAMAGE", "Creature-0-70-469-0-29476-000002", guids.player, nil, "Shadowflame Explosion", 4, 601)
|
|
advance(22)
|
|
log("SPELL_DAMAGE", "Creature-0-70-469-0-29476-000003", guids.player, nil, "Shadowflame Explosion", 4, 601)
|
|
check(#sounds >= 2 and sounds[#sounds - 1].path:find("Beware") and sounds[#sounds].path:find("Alarm"), "explosion sounds Beware then Alarm")
|
|
-- Wing Buffet soon warning 2 s before 30 s, cast at 30 s, next CD after the 1 s cast.
|
|
advance(28.05)
|
|
check(said("Wing Buffet in 2 seconds", 27.9), "Wing Buffet soon warning at 28 s")
|
|
advance(30)
|
|
log("SPELL_CAST_START", FIREMAW, "", 23339, "Wing Buffet")
|
|
check(bar("Casting Wing Buffet!") and not bar("Wing Buffet CD"), "Wing Buffet cast bar")
|
|
advance(31.05)
|
|
check(bar("Wing Buffet CD") and math.abs(bar("Wing Buffet CD").ends - 60) < 0.11, "Wing Buffet CD 29 s after the cast")
|
|
-- Flame Buffet stacks: 8+ stacks on a non-tank warns.
|
|
guids.targettarget = nil
|
|
guids.target = nil
|
|
log("SPELL_AURA_APPLIED_DOSE", FIREMAW, guids.player, 23341, "Flame Buffet", 4, "DEBUFF", 7)
|
|
check(not said("7 Flame Buffet Stacks"), "7 stacks: no warning")
|
|
log("SPELL_AURA_APPLIED_DOSE", FIREMAW, guids.player, 23341, "Flame Buffet", 4, "DEBUFF", 8)
|
|
check(said("8 Flame Buffet Stacks"), "8 stacks warn")
|
|
-- Kill.
|
|
log("UNIT_DIED", "", FIREMAW, nil, nil)
|
|
check(not OctoBossMods.active and said("Firemaw has been defeated"), "kill resets and announces")
|
|
check(not next(OctoBossMods.Bars.active), "bars cleared on kill")
|
|
-- Kill seen only through the unit (no UNIT_DIED in the combat log).
|
|
guids.target = FIREMAW
|
|
fire("PLAYER_REGEN_DISABLED")
|
|
check(OctoBossMods.active, "engage for unit-death kill")
|
|
dead.target = true
|
|
fire("UNIT_HEALTH", "target")
|
|
check(not OctoBossMods.active, "unit reads dead: kill")
|
|
dead.target = nil
|
|
-- Second pull then wipe.
|
|
fire("PLAYER_REGEN_DISABLED")
|
|
guids.target = FIREMAW
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
check(OctoBossMods.active, "re-engage")
|
|
combat.player = false
|
|
fire("PLAYER_REGEN_ENABLED")
|
|
advance(now + 2.2)
|
|
check(not OctoBossMods.active and not next(OctoBossMods.Bars.active), "wipe resets after 2 s out of combat")
|
|
|
|
-- Ebonroc: Shadow of Ebonroc on the tank, then fades.
|
|
local EBONROC = "Creature-0-70-469-0-14601-000004"
|
|
combat.player = true
|
|
guids.target = EBONROC
|
|
fire("PLAYER_REGEN_DISABLED")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Ebonroc", "Ebonroc engage")
|
|
check(bar("Wing Buffet CD") and bar("Shadow of Ebonroc CD") and bar("Sparks (1)"), "Ebonroc opening bars")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, EBONROC, "Ebonroc", 0, 0, "Player-70-00000009", "Tank", 0, 0, 23340, "Shadow of Ebonroc", 32, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Tank Shadow of Ebonroc") and said("Tank has Shadow of Ebonroc - Taunt!"), "Shadow of Ebonroc bar and warning")
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, EBONROC, "Ebonroc", 0, 0, "Player-70-00000009", "Tank", 0, 0, 23340, "Shadow of Ebonroc", 32, "DEBUFF"}
|
|
fireCleu()
|
|
check(not bar("Tank Shadow of Ebonroc"), "fade removes bar")
|
|
local t0 = now
|
|
advance(now + 16.05)
|
|
check(said("Sparks (1)!", t0) and bar("Sparks (2)"), "sparks wave timer")
|
|
cleu = {now, "SWING_DAMAGE", false, "Creature-0-70-469-0-99999-1", "Shadowflame Spark", 0, 0, guids.player, "Tester", 0, 0, 120}
|
|
fireCleu()
|
|
OctoBossMods:Reset()
|
|
-- Flamegor: frenzy, fade, Overbearing Rage marking.
|
|
local FLAMEGOR = "Creature-0-70-469-0-11981-000005"
|
|
guids.target = FLAMEGOR
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Flamegor", "Flamegor engage")
|
|
advance(now + 4)
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, FLAMEGOR, "Flamegor", 0, 0, FLAMEGOR, "Flamegor", 0, 0, 23342, "Frenzy", 1, "BUFF"}
|
|
fireCleu()
|
|
check(bar("Frenzy!") and said("Frenzy - Tranq now!", now), "frenzy warning for hunter")
|
|
advance(now + 3)
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, FLAMEGOR, "Flamegor", 0, 0, FLAMEGOR, "Flamegor", 0, 0, 23342, "Frenzy", 1, "BUFF"}
|
|
fireCleu()
|
|
check(not bar("Frenzy!") and bar("Frenzy CD") and math.abs(bar("Frenzy CD").ends - (now + 7)) < 0.11, "frenzy CD resumes with the remainder")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, FLAMEGOR, "Flamegor", 0, 0, guids.player, "Tester", 0, 0, 52756, "Overbearing Rage", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(said("Tester raging out!") and marks.player == 3, "Overbearing Rage warning + diamond")
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, FLAMEGOR, "Flamegor", 0, 0, guids.player, "Tester", 0, 0, 52756, "Overbearing Rage", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(marks.player == 0, "previous mark restored")
|
|
-- Unrelated combat log traffic with no encounter must be ignored.
|
|
OctoBossMods:Reset()
|
|
guids.target = nil
|
|
cleu = {now, "SPELL_DAMAGE", false, "Creature-0-70-0-0-123-1", "Boar", 0, 0, guids.player, "Tester", 0, 0, 1, "Bite"}
|
|
fireCleu()
|
|
check(not OctoBossMods.active, "unrelated mob ignored")
|
|
|
|
check(OctoBossModsDB.lastEncounters and OctoBossModsDB.lastEncounters[1] and OctoBossModsDB.lastEncounters[1].events["SPELL_AURA_APPLIED:52756"] == 1, "encounter evidence recorded")
|
|
-- Razorgore: orb control named by Mind Exhaustion, eggs counted on Destroy Egg GO, orb release.
|
|
OctoBossMods:Reset()
|
|
local RAZOR = "Creature-0-70-469-0-12435-000007"
|
|
combat.player = true
|
|
fire("CHAT_MSG_MONSTER_YELL", "Intruders have breached the hatchery!", "Razorgore the Untamed")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Razorgore the Untamed" and bar("Mobs Spawn"), "Razorgore engage yell")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, "", "", 0, 0, "Player-70-0000000A", "Orbguy", 0, 0, 23958, "Mind Exhaustion", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Orbguy Orb Control") and said("Orbguy is Controlling Razorgore", now), "orb controller from Mind Exhaustion")
|
|
cleu = {now, "SPELL_CAST_SUCCESS", false, RAZOR, "Razorgore", 0, 0, "", "", 0, 0, 19873, "Destroy Egg"}
|
|
fireCleu() fireCleu()
|
|
check(said("2/20 Eggs Destroyed", now) and bar("Destroy Egg CD"), "egg counter")
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, "", "", 0, 0, RAZOR, "Razorgore", 0, 0, 23014, "Possess", 1, "BUFF"}
|
|
fireCleu()
|
|
check(not bar("Orbguy Orb Control") and said("Razorgore is loose!", now), "orb release")
|
|
fire("CHAT_MSG_MONSTER_EMOTE", "Razorgore the Untamed's troops flee as the power of the controlling power of the orb is drained.", "Razorgore the Untamed")
|
|
check(bar("Fireball Volley CD") and bar("War Stomp CD"), "Razorgore phase 3")
|
|
-- Chromaggus: breaths learned in turn, vulnerability from his own aura.
|
|
OctoBossMods:Reset()
|
|
local CHROMA = "Creature-0-70-469-0-14020-000008"
|
|
guids.target = CHROMA
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Chromaggus" and bar("??? CD"), "Chromaggus engage, unknown breath")
|
|
cleu = {now, "SPELL_CAST_START", false, CHROMA, "Chromaggus", 0, 0, "", "", 0, 0, 23313, "Corrosive Acid"}
|
|
fireCleu()
|
|
check(bar("Casting Corrosive Acid") and said("Casting Corrosive Acid", now), "first breath named")
|
|
advance(now + 2.1)
|
|
check(bar("??? CD"), "second breath still unknown")
|
|
advance(now + 28)
|
|
cleu = {now, "SPELL_CAST_START", false, CHROMA, "Chromaggus", 0, 0, "", "", 0, 0, 23187, "Frost Burn"}
|
|
fireCleu()
|
|
advance(now + 2.1)
|
|
check(bar("Corrosive Acid CD") and not bar("??? CD"), "breaths alternate once both are known")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, CHROMA, "Chromaggus", 0, 0, CHROMA, "Chromaggus", 0, 0, 22279, "Shadow Vulnerability", 32, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Shadow Vulnerability") and said("Current Vulnerability - Shadow", now), "vulnerability from aura")
|
|
-- Nefarian: drakonid deaths counted per death, landing, class call (spell then same yell = one call), parry.
|
|
OctoBossMods:Reset()
|
|
local NEF = "Creature-0-70-469-0-11583-000009"
|
|
combat.player = true
|
|
fire("CHAT_MSG_MONSTER_YELL", "Let the games begin!", "Lord Victor Nefarius")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Nefarian", "Nefarian engage yell")
|
|
for i = 1, 36 do
|
|
cleu = {now, "UNIT_DIED", false, "", "", 0, 0, "Creature-0-70-469-0-14264-" .. string.format("%06X", 100 + i), "Red Drakonid", 0, 0}
|
|
fireCleu()
|
|
end
|
|
check(said("Red Drakonids", 0) and said("36/44 Drakonids dead", 0) and said("Landing Party", 0), "drakonid count + landing party")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Nefarian", "drakonid deaths do not end Nefarian")
|
|
fire("CHAT_MSG_MONSTER_YELL", "BURN! You wretches! BURN!", "Nefarian")
|
|
check(bar("Shadow Flame CD") and bar("Fear CD") and bar("First Class Call"), "landing timers")
|
|
cleu = {now, "SPELL_CAST_SUCCESS", false, NEF, "Nefarian", 0, 0, "", "", 0, 0, 23436, "Hunter Class Call"}
|
|
fireCleu()
|
|
fire("CHAT_MSG_MONSTER_YELL", "Hunters, why rely on your weapons so much?", "Nefarian")
|
|
check(bar("Hunter Class Call") and not bar("First Class Call"), "class call by spell")
|
|
local calls = 0
|
|
for _, msg in ipairs(messages) do if msg.text:find("Hunter Call", 1, true) and not msg.chat then calls = calls + 1 end end
|
|
check(calls == 1, "spell + yell are one class call")
|
|
check(marks.player == nil or marks.player == 0, "no stray marks")
|
|
cleu = {now, "SWING_MISSED", false, guids.player, "Tester", 0, 0, NEF, "Nefarian", 0, 0, "PARRY"}
|
|
fireCleu()
|
|
check(said("Nefarian Parried your attack", now), "parry warning")
|
|
-- Ezzel: Ton'Raka's charge emote names the target.
|
|
OctoBossMods:Reset()
|
|
guids.target = "Creature-0-70-469-0-65148-00000A"
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
fire("CHAT_MSG_RAID_BOSS_EMOTE", "Ton'Raka begins charging Tester!", "Ton'Raka")
|
|
check(bar("Charge on Tester") and bar("Damage Reduction active") and said_chat[#said_chat] == "SAY:Charge On Me!" and marks.player == 4, "Ezzel charge on you")
|
|
-- Baron Geddon: Living Bomb on you, Inferno channel bar, Lucifron protector deaths.
|
|
OctoBossMods:Reset()
|
|
local GEDDON = "Creature-0-70-409-0-12056-000003"
|
|
guids.target = GEDDON
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Baron Geddon" and bar("Inferno CD"), "Geddon engage")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, GEDDON, "Baron Geddon", 0, 0, guids.player, "Tester", 0, 0, 20475, "Living Bomb", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Tester Bomb!") and said("Tester is the Bomb!", now) and marks.player == 8, "Geddon bomb on you")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, GEDDON, "Baron Geddon", 0, 0, GEDDON, "Baron Geddon", 0, 0, 19695, "Inferno", 1, "BUFF"}
|
|
fireCleu()
|
|
check(bar("Inferno!") and not bar("Inferno CD"), "Geddon inferno channel")
|
|
OctoBossMods:Reset()
|
|
guids.target = "Creature-0-70-409-0-12118-000004"
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
cleu = {now, "UNIT_DIED", false, "", "", 0, 0, "Creature-0-70-409-0-12119-000005", "Flamewaker Protector", 0, 0}
|
|
fireCleu()
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Lucifron" and said("1/2 Flamewaker Protectors Dead", now), "Lucifron add death")
|
|
-- Majordomo: engage yell, add death does not end it, submission yell does.
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "Reckless mortals, none may challenge the sons of the living flame!", "Majordomo Executus")
|
|
cleu = {now, "UNIT_DIED", false, "", "", 0, 0, "Creature-0-70-409-0-11664-000009", "Flamewaker Elite", 0, 0}
|
|
fireCleu()
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Majordomo Executus" and said("1/4 Flamewaker Elite Dead", now), "Majordomo add death keeps encounter")
|
|
fire("CHAT_MSG_MONSTER_YELL", "Impossible! Stay your attack, mortals... I submit! I submit! Brashly, you have come", "Majordomo Executus")
|
|
check(not OctoBossMods.active and said("Majordomo Executus has been defeated", now), "Majordomo submission ends")
|
|
-- Ragnaros: Domo speech bar pre-pull, knockback cycle on Wrath, submerge/emerge.
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "Imprudent whelps! You've rushed headlong to your own deaths! See now, the master stirs!", "Majordomo Executus")
|
|
check(not OctoBossMods.active and bar("Ragnaros Engage"), "Ragnaros RP bar")
|
|
fire("CHAT_MSG_MONSTER_YELL", "NOW FOR YOU, INSECTS! BOLDLY, YOU SOUGHT THE POWER OF RAGNAROS. NOW YOU SHALL SEE IT FIRSTHAND!", "Ragnaros")
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "Ragnaros" and bar("Knockback CD") and not bar("Ragnaros Engage"), "Ragnaros engage")
|
|
local RAG = "Creature-0-70-409-0-11502-000010"
|
|
cleu = {now, "SPELL_CAST_SUCCESS", false, RAG, "Ragnaros", 0, 0, "", "", 0, 0, 20566, "Wrath of Ragnaros"}
|
|
fireCleu()
|
|
check(said("Knockback - Melee In!", now) and bar("Knockback CD"), "Ragnaros knockback")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, RAG, "Ragnaros", 0, 0, RAG, "Ragnaros", 0, 0, 21107, "Submerge", 1, "BUFF"}
|
|
fireCleu()
|
|
check(bar("Emerge") and not bar("Knockback CD"), "Ragnaros submerge")
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, RAG, "Ragnaros", 0, 0, RAG, "Ragnaros", 0, 0, 21107, "Submerge", 1, "BUFF"}
|
|
fireCleu()
|
|
check(said("Ragnaros Emerged!", now) and not bar("Emerge") and bar("Knockback CD"), "Ragnaros emerge")
|
|
-- Trash: Flame Imp death starts a respawn bar that outlives the reset, and no "defeated" message.
|
|
OctoBossMods:Reset()
|
|
guids.target = "Creature-0-70-409-0-11669-000011"
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
cleu = {now, "UNIT_DIED", false, "", "", 0, 0, "Creature-0-70-409-0-11669-000011", "Flame Imp", 0, 0}
|
|
fireCleu()
|
|
check(bar("Imp Pack 1 Respawn") and not said("Flame Imp has been defeated", now), "imp respawn bar, no victory")
|
|
OctoBossMods:Reset()
|
|
check(bar("Imp Pack 1 Respawn"), "respawn bar survives reset")
|
|
-- Thaurissan: Detonation on you while standing in the Rune of Power zone.
|
|
OctoBossMods:Reset()
|
|
local THANE = "Creature-0-70-409-0-57642-000012"
|
|
guids.target = THANE
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, THANE, "Thane", 0, 0, guids.player, "Tester", 0, 0, 52724, "Rune of Power", 1, "BUFF"}
|
|
fireCleu()
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, THANE, "Thane", 0, 0, guids.player, "Tester", 0, 0, 52725, "Rune of Detonation", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Detonation (move out)") and said("Get/Stay out of the Zone", now), "Thaurissan detonation on you")
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, THANE, "Thane", 0, 0, guids.player, "Tester", 0, 0, 52724, "Rune of Power", 1, "BUFF"}
|
|
fireCleu()
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, THANE, "Thane", 0, 0, guids.player, "Tester", 0, 0, 52724, "Rune of Power", 1, "BUFF"}
|
|
fireCleu()
|
|
check(said("Get back out of the Zone!!!", now), "Thaurissan back in zone with detonation")
|
|
-- Renataki: losing him from every target means vanish; Ambush brings him back.
|
|
OctoBossMods:Reset()
|
|
local RENA = "Creature-0-70-309-0-15084-000013"
|
|
guids.target = RENA
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
advance(now + 0.6)
|
|
guids.target = nil
|
|
advance(now + 0.6)
|
|
check(said("Renataki has Vanished!", now - 1) and bar("Return"), "Renataki vanish from target loss")
|
|
cleu = {now, "SPELL_CAST_SUCCESS", false, RENA, "Renataki", 0, 0, guids.player, "Tester", 0, 0, 24337, "Ambush"}
|
|
fireCleu()
|
|
check(said("Renataki Appears!", now) and bar("Vanish"), "Renataki ambush return")
|
|
-- Mar'li: Spider Form aura starts the spider phase; Jin'do curse removed early reads as decursed.
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "Draw me to your web mistress Shadra. Unleash your venom!", "High Priestess Mar'li")
|
|
local MARLI = "Creature-0-70-309-0-14510-000014"
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, MARLI, "Mar'li", 0, 0, MARLI, "Mar'li", 0, 0, 24084, "Spider Form", 1, "BUFF"}
|
|
fireCleu()
|
|
check(bar("Next Troll Phase") and bar("Enveloping Webs CD") and not bar("Poison Volley CD"), "Mar'li spider phase")
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "Welcome to the great show, friends. Step right up to die!", "Jin'do the Hexxer")
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, "", "", 0, 0, guids.player, "Tester", 0, 0, 24306, "Delusions of Jin'do", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Tester Cursed") and said("You are cursed! Kill the Shades!", now), "Jin'do curse on you")
|
|
advance(now + 3)
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, "", "", 0, 0, guids.player, "Tester", 0, 0, 24306, "Delusions of Jin'do", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(said("Delusions of Jin'do was decursed!", now) and not bar("Tester Cursed"), "Jin'do early removal = decursed")
|
|
-- Mandokir: Watch aura names the gazed player; Jeklik phase 2 on Bat Form removal.
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "I'll feed your souls to Hakkar himself!", "Bloodlord Mandokir")
|
|
local MANDO = "Creature-0-70-309-0-11382-000015"
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, MANDO, "Mandokir", 0, 0, guids.player, "Tester", 0, 0, 24314, "Threatening Gaze", 1, "DEBUFF"}
|
|
fireCleu()
|
|
check(bar("Tester Gaze!") and said("Threatening Gaze - Stop all Actions Tester", now), "Mandokir gaze on you")
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "Lord Hir'eek, grant me wings of vengance!", "High Priestess Jeklik")
|
|
local JEK = "Creature-0-70-309-0-14517-000016"
|
|
cleu = {now, "SPELL_AURA_REMOVED", false, JEK, "Jeklik", 0, 0, JEK, "Jeklik", 0, 0, 23966, "Jeklik Transform", 1, "BUFF"}
|
|
fireCleu()
|
|
check(said("Phase 2", now) and not bar("Bat Swarm"), "Jeklik phase 2 on bat form removal")
|
|
-- Hakkar: siphon tells an unprotected player.
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "PRIDE HERALDS THE END OF YOUR WORLD. COME, MORTALS! FACE THE WRATH OF THE SOULFLAYER!", "Hakkar")
|
|
local HAK = "Creature-0-70-309-0-14834-000017"
|
|
cleu = {now, "SPELL_AURA_APPLIED", false, "", "", 0, 0, "Player-70-0000000B", "Other", 0, 0, 24321, "Poisonous Blood", 1, "DEBUFF"}
|
|
fireCleu()
|
|
cleu = {now, "SPELL_CAST_SUCCESS", false, HAK, "Hakkar", 0, 0, "", "", 0, 0, 24324, "Blood Siphon"}
|
|
fireCleu()
|
|
check(bar("Blood Siphon!") and said("Poisonous Blood: 1 players protected", now) and said("You are NOT protected", now), "Hakkar siphon protection count")
|
|
-- Thekal: the trio down starts the tiger-phase bar; a fake death is not a kill; the final yell is.
|
|
OctoBossMods:Reset()
|
|
guids.target = "Creature-0-70-309-0-14509-000018"
|
|
combat.player = true
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
for _, id in ipairs({14509, 11348, 11347}) do
|
|
cleu = {now, "UNIT_DIED", false, "", "", 0, 0, "Creature-0-70-309-0-" .. id .. "-000019", "x", 0, 0}
|
|
fireCleu()
|
|
end
|
|
check(OctoBossMods.active and OctoBossMods.active.name == "High Priest Thekal" and bar("Tiger Phase"), "Thekal trio down, no victory")
|
|
fire("CHAT_MSG_MONSTER_YELL", "Shirvallah, fill me with your RAGE!", "High Priest Thekal")
|
|
check(bar("Force Punch CD") and not bar("Tiger Phase"), "Thekal phase 2")
|
|
fire("CHAT_MSG_MONSTER_YELL", "Hakkar binds me no more! Peace at last!", "High Priest Thekal")
|
|
check(not OctoBossMods.active and said("High Priest Thekal has been defeated", now), "Thekal final yell is the kill")
|
|
-- Onyxia: Fireball bar names the server's cast target; deep breath emote.
|
|
OctoBossMods:Reset()
|
|
fire("CHAT_MSG_MONSTER_YELL", "How fortuitous. Usually, I must leave my lair to feed.", "Onyxia")
|
|
local ONY = "Creature-0-70-249-0-10184-000020"
|
|
cleu = {now, "SPELL_CAST_START", false, ONY, "Onyxia", 0, 0, guids.player, "Tester", 0, 0, 18392, "Fireball"}
|
|
fireCleu()
|
|
check(bar("Fireball on Tester") and marks.player == 8, "Onyxia fireball target")
|
|
fire("CHAT_MSG_RAID_BOSS_EMOTE", "Onyxia takes in a deep breath...", "Onyxia")
|
|
check(bar("Deep Breath") and said("Deep Breath incoming!", now), "Onyxia deep breath")
|
|
-- Smoke: every module engages, takes each registered trigger, runs its timers out and dies without a Lua error.
|
|
for name, mod in pairs(OctoBossMods.modules) do
|
|
OctoBossMods:Reset()
|
|
local boss = "Creature-0-70-469-0-" .. mod.npcs[1] .. "-0000AA"
|
|
guids.target = boss
|
|
combat.player = true
|
|
local ok, err = pcall(function()
|
|
fire("PLAYER_TARGET_CHANGED")
|
|
if not OctoBossMods.active then OctoBossMods:Engage(mod) end
|
|
for sub, handlers in pairs(mod.events) do
|
|
for k in pairs(handlers) do
|
|
local id, spellName = type(k) == "number" and k or nil, type(k) == "string" and k or "Spell"
|
|
cleu = {now, sub, false, boss, name, 0, 0, guids.player, "Tester", 0, 0, id, spellName, 1, "DEBUFF", 9}
|
|
fireCleu()
|
|
cleu = {now, sub, false, "Player-70-00000002", "Other", 0, 0, boss, name, 0, 0, id, spellName, 1, "BUFF", 9}
|
|
fireCleu()
|
|
end
|
|
end
|
|
for _, y in ipairs(mod.yells) do fire("CHAT_MSG_MONSTER_YELL", y[1], name) end
|
|
for _, y in ipairs(mod.emotes) do fire("CHAT_MSG_RAID_BOSS_EMOTE", y[1], name) end
|
|
advance(now + 120)
|
|
for _, id in ipairs(mod.killNpcs or {mod.npcs[1]}) do
|
|
cleu = {now, "UNIT_DIED", false, "", "", 0, 0, "Creature-0-70-469-0-" .. id .. "-0000AB", name, 0, 0}
|
|
fireCleu()
|
|
end
|
|
end)
|
|
check(ok, name .. " smoke: " .. tostring(err))
|
|
if mod.manualKill then
|
|
check(said((mod.displayName or name) .. " has been defeated"), name .. " smoke: manual kill announced")
|
|
OctoBossMods:Reset()
|
|
elseif mod.trash then
|
|
check(not said((mod.displayName or name) .. " has been defeated"), name .. " smoke: trash kill is silent")
|
|
OctoBossMods:Reset()
|
|
else
|
|
check(not OctoBossMods.active, name .. " smoke: kill resets")
|
|
end
|
|
end
|
|
for _, line in ipairs(messages) do if line.chat and line.text:find("Boss Mods|r: ", 1, true) then check(false, "scheduled error: " .. line.text) end end
|
|
|
|
check(checkFeedSubscription(), "feed subscription names the encounter spells")
|
|
-- Live 2026-11-22: a secret target GUID reached strsplit ("string conversion on a secret string value").
|
|
do
|
|
local secretGuid = setmetatable({}, {__tostring = function() error("secret string conversion") end})
|
|
issecretvalue = function(v) return v == secretGuid end
|
|
check(OctoBossMods.NpcId(secretGuid) == nil, "secret GUID ignored")
|
|
issecretvalue = nil
|
|
end
|
|
-- /obm test uses a numeric file data icon: live 2026-11-22 it hit the removed global GetSpellTexture.
|
|
check(pcall(function() OctoBossMods.Bars:Start("Icon test", 5, 136116, {1, 1, 1}) OctoBossMods.Bars:Stop("Icon test") end), "numeric icon bar")
|
|
if failures > 0 then print(failures .. " failure(s)") os.exit(1) end
|
|
print("bossmods harness OK")
|