General Changes ad Improvements
- Added: Details:IsInMythicPlus() return true if the player is on a mythic dungeon run. - CombatObjects now have the key 'is_challenge' if the combat is a part of a challenge mode or mythic+ run. - Evoker extra bar tooltip's, now also show the uptime of Black Attunement and Prescience applications. - Breakdown Window now show Plater Npc Colors in the target box. - Added event: "COMBAT_MYTHICPLUS_OVERALL_READY", trigger when the overall segment for the mythic+ is ready. - Added event: "COMBAT_PLAYER_LEAVING", trigger at the beginning of the leave combat process. - Library updates: Details! Framework and Lib Open Raid.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
["COMBAT_ENCOUNTER_END"] = {},
|
||||
["COMBAT_PLAYER_ENTER"] = {},
|
||||
["COMBAT_PLAYER_LEAVE"] = {},
|
||||
["COMBAT_PLAYER_LEAVING"] = {},
|
||||
["COMBAT_PLAYER_TIMESTARTED"] = {},
|
||||
["COMBAT_BOSS_WIPE"] = {},
|
||||
["COMBAT_BOSS_DEFEATED"] = {},
|
||||
@@ -49,6 +50,7 @@
|
||||
["COMBAT_ARENA_END"] = {},
|
||||
["COMBAT_MYTHICDUNGEON_START"] = {},
|
||||
["COMBAT_MYTHICDUNGEON_END"] = {},
|
||||
["COMBAT_MYTHICPLUS_OVERALL_READY"] = {},
|
||||
|
||||
--area
|
||||
["ZONE_TYPE_CHANGED"] = {},
|
||||
@@ -100,6 +102,7 @@ local common_events = {
|
||||
["COMBAT_ENCOUNTER_END"] = true,
|
||||
["COMBAT_PLAYER_ENTER"] = true,
|
||||
["COMBAT_PLAYER_LEAVE"] = true,
|
||||
["COMBAT_PLAYER_LEAVING"] = true,
|
||||
["COMBAT_PLAYER_TIMESTARTED"] = true,
|
||||
["COMBAT_BOSS_WIPE"] = true,
|
||||
["COMBAT_BOSS_DEFEATED"] = true,
|
||||
@@ -113,6 +116,7 @@ local common_events = {
|
||||
["COMBAT_ARENA_END"] = true,
|
||||
["COMBAT_MYTHICDUNGEON_START"] = true,
|
||||
["COMBAT_MYTHICDUNGEON_END"] = true,
|
||||
["COMBAT_MYTHICPLUS_OVERALL_READY"] = true,
|
||||
["GROUP_ONENTER"] = true,
|
||||
["GROUP_ONLEAVE"] = true,
|
||||
["ZONE_TYPE_CHANGED"] = true,
|
||||
|
||||
@@ -64,6 +64,8 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() --~merge
|
||||
local newCombat = Details:GetCurrentCombat()
|
||||
local segmentsTable = Details:GetCombatSegments()
|
||||
|
||||
newCombat.is_challenge = true
|
||||
|
||||
local timeInCombat = 0
|
||||
local startDate, endDate = "", ""
|
||||
local lastSegment
|
||||
@@ -209,6 +211,8 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() --~merge
|
||||
instance:InstanceAlert ("Showing Mythic+ Run Segment", {[[Interface\AddOns\Details\images\icons]], 16, 16, false, 434/512, 466/512, 243/512, 273/512}, 6, func, true)
|
||||
end
|
||||
end
|
||||
|
||||
Details:SendEvent("COMBAT_MYTHICPLUS_OVERALL_READY")
|
||||
end
|
||||
|
||||
--after each boss fight, if enalbed on settings, create an extra segment with all trash segments from the boss just killed
|
||||
|
||||
+78
-29
@@ -1933,9 +1933,11 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0")
|
||||
if (openRaidLib) then
|
||||
if (not DetailsKeystoneInfoFrame) then
|
||||
---@type detailsframework
|
||||
local detailsFramework = DetailsFramework
|
||||
|
||||
local CONST_WINDOW_WIDTH = 614
|
||||
local CONST_WINDOW_HEIGHT = 700
|
||||
local CONST_WINDOW_HEIGHT = 720
|
||||
local CONST_SCROLL_LINE_HEIGHT = 20
|
||||
local CONST_SCROLL_LINE_AMOUNT = 30
|
||||
|
||||
@@ -1948,7 +1950,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
local backdrop_color_inguild = {.5, .8, .5, 0.2}
|
||||
local backdrop_color_on_enter_inguild = {.5, 1, .5, 0.4}
|
||||
|
||||
local f = DetailsFramework:CreateSimplePanel(UIParent, CONST_WINDOW_WIDTH, CONST_WINDOW_HEIGHT, "M+ Keystones (/key)", "DetailsKeystoneInfoFrame")
|
||||
local f = detailsFramework:CreateSimplePanel(UIParent, CONST_WINDOW_WIDTH, CONST_WINDOW_HEIGHT, "M+ Keystones (/key)", "DetailsKeystoneInfoFrame")
|
||||
f:SetPoint("center", UIParent, "center", 0, 0)
|
||||
|
||||
f:SetScript("OnMouseDown", nil) --disable framework native moving scripts
|
||||
@@ -1959,15 +1961,43 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
LibWindow.MakeDraggable(f)
|
||||
LibWindow.RestorePosition(f)
|
||||
|
||||
local scaleBar = DetailsFramework:CreateScaleBar(f, Details.keystone_frame)
|
||||
f:SetScript("OnEvent", function(self, event, ...)
|
||||
if (f:IsShown()) then
|
||||
if (event == "GUILD_ROSTER_UPDATE") then
|
||||
local bUpdateOkay = ...
|
||||
if (bUpdateOkay) then
|
||||
self:RefreshData()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local scaleBar = detailsFramework:CreateScaleBar(f, Details.keystone_frame)
|
||||
f:SetScale(Details.keystone_frame.scale)
|
||||
|
||||
local statusBar = DetailsFramework:CreateStatusBar(f)
|
||||
local statusBar = detailsFramework:CreateStatusBar(f)
|
||||
statusBar.text = statusBar:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
statusBar.text:SetPoint("left", statusBar, "left", 5, 0)
|
||||
statusBar.text:SetText("By Terciob | From Details! Damage Meter|Built with Details! Framework | Data from Open Raid Library")
|
||||
DetailsFramework:SetFontSize(statusBar.text, 11)
|
||||
DetailsFramework:SetFontColor(statusBar.text, "gray")
|
||||
statusBar.text:SetText("By Terciob | From Details! Damage Meter")
|
||||
detailsFramework:SetFontSize(statusBar.text, 12)
|
||||
detailsFramework:SetFontColor(statusBar.text, "gray")
|
||||
|
||||
local requestFromGuildButton = detailsFramework:CreateButton(f, function()
|
||||
local guildName = GetGuildInfo("player")
|
||||
if (guildName) then
|
||||
f:RegisterEvent("GUILD_ROSTER_UPDATE")
|
||||
C_Timer.After(30, function()
|
||||
f:UnregisterEvent("GUILD_ROSTER_UPDATE")
|
||||
end)
|
||||
C_GuildInfo.GuildRoster()
|
||||
openRaidLib.RequestKeystoneDataFromGuild()
|
||||
end
|
||||
end, 100, 20, "Request from Guild")
|
||||
requestFromGuildButton:SetPoint("bottomleft", statusBar, "topleft", 2, 2)
|
||||
requestFromGuildButton:SetTemplate(detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
|
||||
requestFromGuildButton:SetIcon("UI-RefreshButton", 20, 20, "overlay", {0, 1, 0, 1}, "lawngreen")
|
||||
requestFromGuildButton:SetFrameLevel(f:GetFrameLevel()+5)
|
||||
f.RequestFromGuildButton = requestFromGuildButton
|
||||
|
||||
--header
|
||||
local headerTable = {
|
||||
@@ -1995,8 +2025,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
header_click_callback = headerOnClickCallback,
|
||||
}
|
||||
|
||||
f.Header = DetailsFramework:CreateHeader(f, headerTable, headerOptions, "DetailsKeystoneInfoFrameHeader")
|
||||
f.Header:SetPoint("topleft", f, "topleft", 5, -25)
|
||||
f.Header = detailsFramework:CreateHeader(f, headerTable, headerOptions, "DetailsKeystoneInfoFrameHeader")
|
||||
f.Header:SetPoint("topleft", f, "topleft", 3, -25)
|
||||
|
||||
--scroll
|
||||
local refreshScrollLines = function(self, data, offset, totalLines)
|
||||
@@ -2033,13 +2063,13 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
line.icon:SetTexCoord(L+0.02, R-0.02, T+0.02, B-0.02)
|
||||
|
||||
--remove the realm name from the player name (if any)
|
||||
local unitNameNoRealm = DetailsFramework:RemoveRealmName(unitName)
|
||||
local unitNameNoRealm = detailsFramework:RemoveRealmName(unitName)
|
||||
line.playerNameText.text = unitNameNoRealm
|
||||
line.keystoneLevelText.text = level
|
||||
line.dungeonNameText.text = mapName
|
||||
DetailsFramework:TruncateText(line.dungeonNameText, 240)
|
||||
detailsFramework:TruncateText(line.dungeonNameText, 240)
|
||||
line.classicDungeonNameText.text = "" --mapNameChallenge
|
||||
DetailsFramework:TruncateText(line.classicDungeonNameText, 120)
|
||||
detailsFramework:TruncateText(line.classicDungeonNameText, 120)
|
||||
line.inMyParty = inMyParty > 0
|
||||
line.inMyGuild = isGuildMember
|
||||
|
||||
@@ -2083,8 +2113,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
end
|
||||
end
|
||||
|
||||
local scrollFrame = DetailsFramework:CreateScrollBox(f, "$parentScroll", refreshScrollLines, {}, CONST_WINDOW_WIDTH-10, CONST_WINDOW_HEIGHT-70, CONST_SCROLL_LINE_AMOUNT, CONST_SCROLL_LINE_HEIGHT)
|
||||
DetailsFramework:ReskinSlider(scrollFrame)
|
||||
local scrollFrame = detailsFramework:CreateScrollBox(f, "$parentScroll", refreshScrollLines, {}, CONST_WINDOW_WIDTH-10, CONST_WINDOW_HEIGHT-90, CONST_SCROLL_LINE_AMOUNT, CONST_SCROLL_LINE_HEIGHT)
|
||||
detailsFramework:ReskinSlider(scrollFrame)
|
||||
scrollFrame:SetPoint("topleft", f.Header, "bottomleft", -1, -1)
|
||||
scrollFrame:SetPoint("topright", f.Header, "bottomright", 0, -1)
|
||||
|
||||
@@ -2115,7 +2145,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
line:SetBackdropColor(unpack(backdrop_color))
|
||||
|
||||
DetailsFramework:Mixin(line, DetailsFramework.HeaderFunctions)
|
||||
detailsFramework:Mixin(line, detailsFramework.HeaderFunctions)
|
||||
|
||||
line:SetScript("OnEnter", lineOnEnter)
|
||||
line:SetScript("OnLeave", lineOnLeave)
|
||||
@@ -2125,19 +2155,19 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
icon:SetSize(CONST_SCROLL_LINE_HEIGHT - 2, CONST_SCROLL_LINE_HEIGHT - 2)
|
||||
|
||||
--player name
|
||||
local playerNameText = DetailsFramework:CreateLabel(line)
|
||||
local playerNameText = detailsFramework:CreateLabel(line, "")
|
||||
|
||||
--keystone level
|
||||
local keystoneLevelText = DetailsFramework:CreateLabel(line)
|
||||
local keystoneLevelText = detailsFramework:CreateLabel(line, "")
|
||||
|
||||
--dungeon name
|
||||
local dungeonNameText = DetailsFramework:CreateLabel(line)
|
||||
local dungeonNameText = detailsFramework:CreateLabel(line, "")
|
||||
|
||||
--classic dungeon name
|
||||
local classicDungeonNameText = DetailsFramework:CreateLabel(line)
|
||||
local classicDungeonNameText = detailsFramework:CreateLabel(line, "")
|
||||
|
||||
--player rating
|
||||
local ratingText = DetailsFramework:CreateLabel(line)
|
||||
local ratingText = detailsFramework:CreateLabel(line, "")
|
||||
|
||||
line.icon = icon
|
||||
line.playerNameText = playerNameText
|
||||
@@ -2170,6 +2200,16 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
local guildUsers = {}
|
||||
local totalMembers, onlineMembers, onlineAndMobileMembers = GetNumGuildMembers()
|
||||
|
||||
--[=[
|
||||
local unitsInMyGroup = {
|
||||
[Details:GetFullName("player")] = true,
|
||||
}
|
||||
for i = 1, GetNumGroupMembers() do
|
||||
local unitName = Details:GetFullName("party" .. i)
|
||||
unitsInMyGroup[unitName] = true
|
||||
end
|
||||
--]=]
|
||||
|
||||
--create a string to use into the gsub call when removing the realm name from the player name, by default all player names returned from GetGuildRosterInfo() has PlayerName-RealmName format
|
||||
local realmNameGsub = "%-.*"
|
||||
local guildName = GetGuildInfo("player")
|
||||
@@ -2258,18 +2298,23 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
--sort by player class
|
||||
if (columnIndex == 1) then
|
||||
sortByIndex = 5
|
||||
|
||||
--sort by player name
|
||||
elseif (columnIndex == 2) then
|
||||
sortByIndex = 1
|
||||
|
||||
--sort by keystone level
|
||||
elseif (columnIndex == 3) then
|
||||
sortByIndex = 2
|
||||
|
||||
--sort by dungeon name
|
||||
elseif (columnIndex == 4) then
|
||||
sortByIndex = 3
|
||||
|
||||
--sort by classic dungeon name
|
||||
--elseif (columnIndex == 5) then
|
||||
-- sortByIndex = 4
|
||||
|
||||
--sort by mythic+ ranting
|
||||
elseif (columnIndex == 5) then
|
||||
sortByIndex = 6
|
||||
@@ -2290,7 +2335,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
end
|
||||
end
|
||||
|
||||
newData.offlineGuildPlayers = DetailsFramework.table.reverse(newData.offlineGuildPlayers)
|
||||
newData.offlineGuildPlayers = detailsFramework.table.reverse(newData.offlineGuildPlayers)
|
||||
|
||||
--put players in the group at the top of the list
|
||||
if (IsInGroup() and not IsInRaid()) then
|
||||
@@ -2334,17 +2379,23 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
end)
|
||||
end
|
||||
|
||||
--call an update on the guild roster
|
||||
if (C_GuildInfo and C_GuildInfo.GuildRoster) then
|
||||
C_GuildInfo.GuildRoster()
|
||||
end
|
||||
|
||||
--show the frame
|
||||
DetailsKeystoneInfoFrame:Show()
|
||||
|
||||
openRaidLib.RegisterCallback(DetailsKeystoneInfoFrame, "KeystoneUpdate", "OnKeystoneUpdate")
|
||||
|
||||
openRaidLib.WipeKeystoneData()
|
||||
local guildName = GetGuildInfo("player")
|
||||
if (guildName) then
|
||||
--call an update on the guild roster
|
||||
if (C_GuildInfo and C_GuildInfo.GuildRoster) then
|
||||
C_GuildInfo.GuildRoster()
|
||||
end
|
||||
DetailsKeystoneInfoFrame.RequestFromGuildButton:Enable()
|
||||
else
|
||||
DetailsKeystoneInfoFrame.RequestFromGuildButton:Disable()
|
||||
end
|
||||
|
||||
--openRaidLib.WipeKeystoneData()
|
||||
|
||||
if (IsInRaid()) then
|
||||
openRaidLib.RequestKeystoneDataFromRaid()
|
||||
@@ -2352,8 +2403,6 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
openRaidLib.RequestKeystoneDataFromParty()
|
||||
end
|
||||
|
||||
openRaidLib.RequestKeystoneDataFromGuild()
|
||||
|
||||
DetailsKeystoneInfoFrame.RefreshData()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,6 +3,13 @@ local addonName, Details222 = ...
|
||||
local Details = Details
|
||||
local _
|
||||
|
||||
local CONST_SPELLID_EBONMIGHT = 395152
|
||||
local CONST_SPELLID_SS = 413984
|
||||
local CONST_SPELLID_PRESCIENCE = 410089
|
||||
local CONST_SPELLID_EONS_BREATH = 409560
|
||||
local CONST_SPELLID_TANK_SHIELD = 360827
|
||||
local CONST_SPELLID_INFERNOBLESS = 410263
|
||||
|
||||
local UnitExists = UnitExists
|
||||
local UnitIsUnit = UnitIsUnit
|
||||
|
||||
@@ -11,12 +18,240 @@ local augmentationCache = Details222.SpecHelpers[1473].augmentation_cache
|
||||
|
||||
local playerRealmName = GetRealmName()
|
||||
|
||||
local getAmountOfBuffsAppliedBySpellId = function(spellId)
|
||||
local amountBuffs = 0
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
|
||||
for i, unitId in ipairs(Details222.UnitIdCache.PartyIds) do
|
||||
if (UnitExists(unitId)) then
|
||||
for o = 1, 40 do
|
||||
local auraName = UnitBuff(unitId, o)
|
||||
if (auraName == spellName) then
|
||||
amountBuffs = amountBuffs + 1
|
||||
break
|
||||
elseif (not auraName) then
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
return amountBuffs
|
||||
end
|
||||
|
||||
local eventListener = Details:CreateEventListener()
|
||||
--eventListener:RegisterEvent("COMBAT_PLAYER_ENTER")
|
||||
eventListener:RegisterEvent("COMBAT_PLAYER_LEAVING", function(eventName, combatObject)
|
||||
--close the time on the current amount of prescience stacks the evoker have
|
||||
---@type combat
|
||||
local combat = Details:GetCurrentCombat()
|
||||
---@type actorcontainer
|
||||
local damageContainer = combat:GetContainer(DETAILS_ATTRIBUTE_MISC)
|
||||
--print(1, "COMBAT_PLAYER_LEAVING", next(augmentationCache.prescience_stacks))
|
||||
for actorName, stackInfo in pairs(augmentationCache.prescience_stacks) do
|
||||
local actorObject = damageContainer:GetActor(actorName)
|
||||
local currentAmountOfApplications = stackInfo.currentStacks
|
||||
if (currentAmountOfApplications >= 1 and currentAmountOfApplications <= 5) then
|
||||
--close the time the evoker had this amount of stacks
|
||||
local timeOfTheLastEvent = stackInfo.latestStackUpdateTime
|
||||
local timeNow = GetTime()
|
||||
local timeDiff = timeNow - timeOfTheLastEvent
|
||||
if (timeDiff > 0) then
|
||||
stackInfo.stackTime[currentAmountOfApplications] = stackInfo.stackTime[currentAmountOfApplications] + timeDiff
|
||||
end
|
||||
end
|
||||
|
||||
actorObject.prescience_stack_data_by_timeline = DetailsFramework.table.copy({}, stackInfo.stackTime)
|
||||
end
|
||||
end)
|
||||
|
||||
---@class details_evoker_presciencetimeline : table
|
||||
---@field currentStacks number amount of stacks the evoker has at the moment
|
||||
---@field stackTime table<number, number, number, number, number> amountof time the evoker had the amount of stacks, one stack if the first index, 5 stacks if the last index
|
||||
---@field latestStackUpdateTime number GetTime() of the latest stack amount update, this is used to calculate the time the evoker had each amount of stacks
|
||||
|
||||
local latestPrescienceEvent = 0
|
||||
local latestAuraInstanceId = 0
|
||||
function augmentationFunctions.OnAugmentationBuffUpdate(eventName, ...)
|
||||
---@combat
|
||||
local currentCombat = Details:GetCurrentCombat()
|
||||
|
||||
--test #1: calculate the amount of stack in real time
|
||||
if (eventName == "AURA_UPDATE" and Details.in_combat) then
|
||||
local targetGUID, auraInfo, eventType = ...
|
||||
local spellId = auraInfo.spellId
|
||||
|
||||
if (spellId == CONST_SPELLID_PRESCIENCE) then
|
||||
--[=[
|
||||
if (latestPrescienceEvent ~= GetTime()) then
|
||||
latestPrescienceEvent = GetTime()
|
||||
latestAuraInstanceId = auraInfo.instanceId
|
||||
else
|
||||
if (latestAuraInstanceId == auraInfo.instanceId) then
|
||||
return
|
||||
end
|
||||
latestPrescienceEvent = GetTime()
|
||||
latestAuraInstanceId = auraInfo.instanceId
|
||||
end
|
||||
|
||||
if ((currentCombat and currentCombat.is_challenge) or Details.debug) then
|
||||
local sourceUnitId = auraInfo.sourceUnit
|
||||
local sourceGUID = UnitGUID(sourceUnitId)
|
||||
local sourceName = Details:GetFullName(sourceUnitId)
|
||||
|
||||
local evokerUtilityObject = currentCombat:GetContainer(DETAILS_ATTRIBUTE_MISC):GetOrCreateActor(sourceGUID, sourceName, 0x514, true)
|
||||
|
||||
if (evokerUtilityObject) then
|
||||
local stackInfo = evokerUtilityObject.prescience_stack_data2
|
||||
if (not stackInfo) then
|
||||
stackInfo = {
|
||||
currentStacks = 0,
|
||||
stackTime = {0, 0, 0, 0, 0},
|
||||
latestStackUpdateTime = GetTime()
|
||||
}
|
||||
evokerUtilityObject.prescience_stack_data2 = stackInfo
|
||||
end
|
||||
|
||||
if (eventType == "BUFF_UPTIME_IN") then
|
||||
local currentAmountOfApplications = stackInfo.currentStacks
|
||||
--print("in", currentAmountOfApplications, GetTime())
|
||||
if (currentAmountOfApplications > 0) then
|
||||
--the the time the evoker had this amount of stacks
|
||||
local timeOfTheLastEvent = stackInfo.latestStackUpdateTime
|
||||
local timeNow = GetTime()
|
||||
local timeDiff = timeNow - timeOfTheLastEvent
|
||||
if (timeDiff > 0) then
|
||||
stackInfo.stackTime[currentAmountOfApplications] = stackInfo.stackTime[currentAmountOfApplications] + timeDiff
|
||||
end
|
||||
end
|
||||
|
||||
stackInfo.latestStackUpdateTime = GetTime()
|
||||
stackInfo.currentStacks = stackInfo.currentStacks + 1
|
||||
|
||||
elseif (eventType == "BUFF_UPTIME_OUT") then
|
||||
local currentAmountOfApplications = stackInfo.currentStacks
|
||||
--print("out", currentAmountOfApplications)
|
||||
if (currentAmountOfApplications > 0) then
|
||||
--the the time the evoker had this amount of stacks
|
||||
local timeOfTheLastEvent = stackInfo.latestStackUpdateTime
|
||||
local timeNow = GetTime()
|
||||
local timeDiff = timeNow - timeOfTheLastEvent
|
||||
if (timeDiff > 0) then
|
||||
stackInfo.stackTime[currentAmountOfApplications] = stackInfo.stackTime[currentAmountOfApplications] + timeDiff
|
||||
end
|
||||
end
|
||||
|
||||
stackInfo.latestStackUpdateTime = GetTime()
|
||||
stackInfo.currentStacks = stackInfo.currentStacks - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
--]=]
|
||||
end
|
||||
|
||||
--test #2: calculate the amount of stacks post combat using a list of events (timeline)
|
||||
--note to self: I'm not working with real time data, these are past events, GetTime() and time() will always return the same value
|
||||
elseif (eventName == "TIMELINE_READY") then --not in use
|
||||
--if true then return end
|
||||
--timelineTable is an indexed table with all the timeline events
|
||||
---@type details_auratimeline[]
|
||||
local timelineTable = ...
|
||||
|
||||
__details_debug.prescience_timeline = __details_debug.prescience_timeline or {}
|
||||
__details_debug.prescience_timeline[#__details_debug.prescience_timeline+1] = timelineTable
|
||||
|
||||
--amount of time the evoker had the amount of stacks
|
||||
--[evokerName] = details_evoker_presciencetimeline
|
||||
---@type table<string, details_evoker_presciencetimeline>
|
||||
local prescienceStacksByEvoker = {}
|
||||
|
||||
for i = 1, #timelineTable do
|
||||
---@type details_auratimeline
|
||||
local auraEvent = timelineTable[i]
|
||||
if (auraEvent.spellId == CONST_SPELLID_PRESCIENCE) then
|
||||
local evokerName = auraEvent.sourceName
|
||||
---@type details_evoker_presciencetimeline
|
||||
local evokerPrescienceStackInfo = prescienceStacksByEvoker[evokerName]
|
||||
|
||||
if (auraEvent.event == "BUFF_UPTIME_IN") then
|
||||
if (not evokerPrescienceStackInfo) then
|
||||
evokerPrescienceStackInfo = {
|
||||
currentStacks = 0,
|
||||
stackTime = {0, 0, 0, 0, 0},
|
||||
latestStackUpdateTime = 0
|
||||
}
|
||||
prescienceStacksByEvoker[evokerName] = evokerPrescienceStackInfo
|
||||
end
|
||||
|
||||
local currentAmountOfStacks = evokerPrescienceStackInfo.currentStacks
|
||||
|
||||
--the evoker gained a stack, so we need to add the time he had the previous amount of stacks
|
||||
if (currentAmountOfStacks > 0) then
|
||||
local timeWithThisAmountOfStacks = evokerPrescienceStackInfo.stackTime[currentAmountOfStacks]
|
||||
if (timeWithThisAmountOfStacks) then
|
||||
local appliedTime = auraEvent.appliedTime
|
||||
local timeDiff = appliedTime - evokerPrescienceStackInfo.latestStackUpdateTime
|
||||
if (timeDiff > 0) then
|
||||
evokerPrescienceStackInfo.stackTime[currentAmountOfStacks] = timeWithThisAmountOfStacks + timeDiff
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
evokerPrescienceStackInfo.latestStackUpdateTime = auraEvent.appliedTime
|
||||
evokerPrescienceStackInfo.currentStacks = currentAmountOfStacks + 1
|
||||
|
||||
elseif (auraEvent.event == "BUFF_UPTIME_OUT") then
|
||||
if (evokerPrescienceStackInfo) then
|
||||
--the evoker lost a stack, so we need to add the time he had the previous amount of stacks
|
||||
local currentAmountOfStacks = evokerPrescienceStackInfo.currentStacks
|
||||
local timeWithThisAmountOfStacks = evokerPrescienceStackInfo.stackTime[currentAmountOfStacks]
|
||||
|
||||
auraEvent.addTimeLineTable.closed = true
|
||||
|
||||
if (timeWithThisAmountOfStacks) then
|
||||
local timeNow = auraEvent.removedTime
|
||||
local timeDiff = timeNow - evokerPrescienceStackInfo.latestStackUpdateTime
|
||||
if (timeDiff > 0) then
|
||||
evokerPrescienceStackInfo.stackTime[currentAmountOfStacks] = timeWithThisAmountOfStacks + timeDiff
|
||||
end
|
||||
end
|
||||
|
||||
evokerPrescienceStackInfo.currentStacks = evokerPrescienceStackInfo.currentStacks - 1
|
||||
evokerPrescienceStackInfo.latestStackUpdateTime = auraEvent.removedTime
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--iterate again and print the tables with the key 'closed' that are not set to true
|
||||
local nonClosedTables = {}
|
||||
for i = 1, #timelineTable do
|
||||
---@type details_auratimeline
|
||||
local auraEvent = timelineTable[i]
|
||||
if (auraEvent.spellId == CONST_SPELLID_PRESCIENCE) then
|
||||
if (auraEvent.event == "BUFF_UPTIME_IN") then
|
||||
if (not auraEvent.closed) then
|
||||
nonClosedTables[#nonClosedTables+1] = auraEvent
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Details222.DebugMsg("|cFFFFFF00Non Closed Tables:", #nonClosedTables)
|
||||
|
||||
for evokerName, evokerPrescienceStackInfo in pairs(prescienceStacksByEvoker) do --table 'prescience_stack_data_by_timeline' not found, something wrong here
|
||||
local evokerUtilityObject = currentCombat:GetContainer(DETAILS_ATTRIBUTE_MISC):GetActor(evokerName)
|
||||
if (evokerUtilityObject) then
|
||||
evokerUtilityObject.prescience_stack_data_by_timeline = DetailsFramework.table.copy({}, evokerPrescienceStackInfo.stackTime)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, auraType, amount)
|
||||
if (not UnitAffectingCombat("player")) then --need documentation
|
||||
if (not Details.in_combat) then --when the player enter and leave combat, it tracks which players had buffs applied
|
||||
return
|
||||
end
|
||||
|
||||
@@ -43,10 +278,42 @@ function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sou
|
||||
end
|
||||
|
||||
elseif (spellId == 410089) then --prescience
|
||||
--added Prescience to a player (targetName)
|
||||
augmentationCache.prescience[targetSerial] = augmentationCache.prescience[targetSerial] or {}
|
||||
local evokerInfo = {sourceSerial, sourceName, sourceFlags, amount}
|
||||
table.insert(augmentationCache.prescience[targetSerial], evokerInfo)
|
||||
|
||||
---@combat
|
||||
local currentCombat = Details:GetCurrentCombat()
|
||||
local evokerUtilityObject = currentCombat:GetContainer(DETAILS_ATTRIBUTE_MISC):GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
|
||||
local stackInfo = evokerUtilityObject.cleu_prescience_time
|
||||
if (not stackInfo) then
|
||||
stackInfo = {
|
||||
currentStacks = 0,
|
||||
stackTime = {0, 0, 0, 0, 0},
|
||||
latestStackUpdateTime = GetTime()
|
||||
}
|
||||
evokerUtilityObject.cleu_prescience_time = stackInfo
|
||||
end
|
||||
|
||||
local prescienceApplied = getAmountOfBuffsAppliedBySpellId(CONST_SPELLID_PRESCIENCE)
|
||||
|
||||
if (prescienceApplied > 0) then
|
||||
local currentAmountOfApplications = stackInfo.currentStacks
|
||||
if (currentAmountOfApplications >= 1 and currentAmountOfApplications <= 5) then
|
||||
--the the time the evoker had this amount of stacks
|
||||
local timeOfTheLastEvent = stackInfo.latestStackUpdateTime
|
||||
local timeNow = GetTime()
|
||||
local timeDiff = timeNow - timeOfTheLastEvent
|
||||
if (timeDiff > 0) then
|
||||
stackInfo.stackTime[currentAmountOfApplications] = stackInfo.stackTime[currentAmountOfApplications] + timeDiff
|
||||
end
|
||||
end
|
||||
|
||||
stackInfo.latestStackUpdateTime = GetTime()
|
||||
stackInfo.currentStacks = prescienceApplied
|
||||
end
|
||||
|
||||
elseif (spellId == 409560) then --eons breath
|
||||
local unitIDAffected = Details:FindUnitIDByUnitSerial(targetSerial)
|
||||
if (unitIDAffected) then
|
||||
@@ -76,6 +343,8 @@ function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sou
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function augmentationFunctions.BuffRefresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, tipo, amount)
|
||||
if (spellId == 395152) then
|
||||
local bFound = false
|
||||
@@ -146,7 +415,11 @@ end
|
||||
|
||||
|
||||
function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellSchool, tipo, amount)
|
||||
if (spellId == 395152) then
|
||||
if (not Details.in_combat) then --when the player enter and leave combat, it tracks which players had buffs applied
|
||||
return
|
||||
end
|
||||
|
||||
if (spellId == 395152) then --ebon might
|
||||
if (augmentationCache.ebon_might[targetSerial]) then
|
||||
--print("tinha buff", targetName, targetSerial)
|
||||
for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do
|
||||
@@ -159,7 +432,7 @@ function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, so
|
||||
end
|
||||
end
|
||||
|
||||
elseif (spellId == 413984) then
|
||||
elseif (spellId == 413984) then --ss
|
||||
if (augmentationCache.ss[targetSerial]) then
|
||||
for index, evokerInfo in ipairs(augmentationCache.ss[targetSerial]) do
|
||||
if (evokerInfo[1] == sourceSerial) then
|
||||
@@ -169,7 +442,7 @@ function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, so
|
||||
end
|
||||
end
|
||||
|
||||
elseif (spellId == 410089) then
|
||||
elseif (spellId == 410089) then --prescience
|
||||
if (augmentationCache.prescience[targetSerial]) then
|
||||
for index, evokerInfo in ipairs(augmentationCache.prescience[targetSerial]) do
|
||||
if (evokerInfo[1] == sourceSerial) then
|
||||
@@ -177,6 +450,30 @@ function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, so
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
---@combat
|
||||
local currentCombat = Details:GetCurrentCombat()
|
||||
local evokerUtilityObject = currentCombat:GetContainer(DETAILS_ATTRIBUTE_MISC):GetOrCreateActor(sourceSerial, sourceName, sourceFlags, true)
|
||||
local stackInfo = evokerUtilityObject.cleu_prescience_time
|
||||
|
||||
if (stackInfo) then
|
||||
local prescienceApplied = getAmountOfBuffsAppliedBySpellId(CONST_SPELLID_PRESCIENCE)
|
||||
if (prescienceApplied >= 0) then
|
||||
local currentAmountOfApplications = stackInfo.currentStacks
|
||||
if (currentAmountOfApplications >= 1 and currentAmountOfApplications <= 5) then
|
||||
--the the time the evoker had this amount of stacks
|
||||
local timeOfTheLastEvent = stackInfo.latestStackUpdateTime
|
||||
local timeNow = GetTime()
|
||||
local timeDiff = timeNow - timeOfTheLastEvent
|
||||
if (timeDiff > 0) then
|
||||
stackInfo.stackTime[currentAmountOfApplications] = stackInfo.stackTime[currentAmountOfApplications] + timeDiff
|
||||
end
|
||||
end
|
||||
|
||||
stackInfo.latestStackUpdateTime = GetTime()
|
||||
stackInfo.currentStacks = prescienceApplied
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
elseif (spellId == 360827) then
|
||||
|
||||
@@ -4074,7 +4074,7 @@ local SplitLoadFunc = function(self, deltaTime)
|
||||
|
||||
if (not container) then
|
||||
if (Details.debug) then
|
||||
Details:Msg("(debug) finished index spells.")
|
||||
--Details:Msg("(debug) finished index spells.")
|
||||
end
|
||||
SplitLoadFrame:SetScript("OnUpdate", nil)
|
||||
return
|
||||
@@ -4096,7 +4096,7 @@ local SplitLoadFunc = function(self, deltaTime)
|
||||
if (SplitLoadFrame.NextActorContainer == 5) then
|
||||
SplitLoadFrame:SetScript("OnUpdate", nil)
|
||||
if (Details.debug) then
|
||||
Details:Msg("(debug) finished index spells.")
|
||||
--Details:Msg("(debug) finished index spells.")
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -4187,7 +4187,7 @@ end
|
||||
|
||||
function Details.StoreSpells()
|
||||
if (Details.debug) then
|
||||
Details:Msg("(debug) started to index spells.")
|
||||
--Details:Msg("(debug) started to index spells.")
|
||||
end
|
||||
SplitLoadFrame:SetScript("OnUpdate", SplitLoadFunc)
|
||||
SplitLoadFrame.NextActorContainer = 1
|
||||
|
||||
Reference in New Issue
Block a user