diff --git a/SpecialEvents.lua b/SpecialEvents.lua index 5a70f64..d899815 100644 --- a/SpecialEvents.lua +++ b/SpecialEvents.lua @@ -1,7 +1,29 @@ -local n, tbl = ... +local tbl +do + local _ + _, tbl = ... +end + tbl.specialEvents = { ["UNIT_SPELLCAST_SUCCEEDED"] = { --[[ Tomb of Sargeras ]]-- + [239423] = { -- Dread Shark + [115767] = function() -- Mistress Sassz'ine + tbl.data[1] = (tbl.data[1] or 1) + 1 + + local stage = tbl.data[1] + local _, _, diff = GetInstanceInfo() + if diff == 16 then -- Mythic + if stage == 3 then + return "Stage 2" + elseif stage == 5 then + return "Stage 3" + end + else + return "Stage ".. stage + end + end, + }, [235268] = { -- Lunar Ghost [118523] = "Stage 2", -- Huntress Kasparian (Sisters of the Moon) [118374] = "Stage 3", -- Captain Yathae Moonstrike (Sisters of the Moon) diff --git a/Transcriptor.lua b/Transcriptor.lua index 114038c..31c3c1d 100644 --- a/Transcriptor.lua +++ b/Transcriptor.lua @@ -8,11 +8,13 @@ end local playerSpellBlacklist local badSourcelessPlayerSpellList local specialEvents +local data = {} do local n, tbl = ... playerSpellBlacklist = tbl.blacklist specialEvents = tbl.specialEvents + tbl.data = data end local logName = nil @@ -37,7 +39,7 @@ local format, strjoin = string.format, string.join local tostring, tostringall = tostring, tostringall local type, select, next = type, select, next local date = date -local debugprofilestop = debugprofilestop +local debugprofilestop, wipe = debugprofilestop, wipe local print = print local C_Scenario = C_Scenario @@ -73,6 +75,10 @@ local function MobId(guid) end local function InsertSpecialEvent(name) + if type(name) == "function" then + name = name() + end + if not name then return end if compareSuccess then for id,tbl in next, compareSuccess do for npcId, list in next, tbl do @@ -864,6 +870,7 @@ end function sh.ENCOUNTER_START(...) compareStartTime = debugprofilestop() + wipe(data) return strjoin("#", "ENCOUNTER_START", ...) end @@ -1149,6 +1156,7 @@ do ldb.icon = "Interface\\AddOns\\Transcriptor\\icon_on" previousWorldState = nil shouldLogFlags = TranscriptIgnore.logFlags and true or false + wipe(data) compareStartTime = debugprofilestop() logStartTime = compareStartTime / 1000