Release Candidate 1

This commit is contained in:
Tercio Jose
2024-01-20 14:28:25 -03:00
parent 4eff7b223e
commit b7c2b6c7a1
9 changed files with 599 additions and 374 deletions
+36 -36
View File
@@ -802,50 +802,52 @@ do
--make new namespace
openRaidLib.AuraTracker = {}
function openRaidLib.AuraTracker.ScanCallback(aura)
local unitId = openRaidLib.AuraTracker.CurrentUnitId
local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId]
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID(unitId, aura.auraInstanceID)
if (auraInfo) then
local spellId = auraInfo.spellId
if (spellId) then
thisUnitAuras[spellId] = true
openRaidLib.AuraTracker.AurasFoundOnScan[spellId] = true
do if (false) then --do not load this section as it isn't in use
function openRaidLib.AuraTracker.ScanCallback(auraInfo)
if (auraInfo) then
local spellId = auraInfo.spellId
if (spellId) then
local unitId = openRaidLib.AuraTracker.CurrentUnitId
local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId]
thisUnitAuras[spellId] = true
openRaidLib.AuraTracker.AurasFoundOnScan[spellId] = true
end
end
end
end
function openRaidLib.AuraTracker.ScanUnitAuras(unitId)
local batchCount = nil
local usePackedAura = true
openRaidLib.AuraTracker.CurrentUnitId = unitId
function openRaidLib.AuraTracker.ScanUnitAuras(unitId)
local maxCount = nil
local bUsePackedAura = true
openRaidLib.AuraTracker.CurrentUnitId = unitId
openRaidLib.AuraTracker.AurasFoundOnScan = {}
AuraUtil.ForEachAura(unitId, "HELPFUL", batchCount, openRaidLib.AuraTracker.ScanCallback, usePackedAura)
openRaidLib.AuraTracker.AurasFoundOnScan = {}
local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId]
for spellId in pairs(thisUnitAuras) do
if (not openRaidLib.AuraTracker.AurasFoundOnScan[spellId]) then
--aura removed
openRaidLib.internalCallback.TriggerEvent("unitAuraRemoved", unitId, spellId)
--code of 'ForEachAura' has been updated to use the latest API available
AuraUtil.ForEachAura(unitId, "HELPFUL", maxCount, openRaidLib.AuraTracker.ScanCallback, bUsePackedAura)
local thisUnitAuras = openRaidLib.AuraTracker.CurrentAuras[unitId]
for spellId in pairs(thisUnitAuras) do
if (not openRaidLib.AuraTracker.AurasFoundOnScan[spellId]) then
--aura removed
openRaidLib.internalCallback.TriggerEvent("unitAuraRemoved", unitId, spellId)
end
end
end
end
--run when the open raid lib loads
function openRaidLib.AuraTracker.StartScanUnitAuras(unitId)
openRaidLib.AuraTracker.CurrentAuras = {
[unitId] = {}
}
--run when the open raid lib loads
function openRaidLib.AuraTracker.StartScanUnitAuras(unitId) --this function isn't getting called (was called from Entering World event)
openRaidLib.AuraTracker.CurrentAuras = {
[unitId] = {} --storing using the unitId as key, won't work for any other unit other than the "player"
}
local auraFrameEvent = CreateFrame("frame")
auraFrameEvent:RegisterUnitEvent("UNIT_AURA", unitId)
local auraFrameEvent = CreateFrame("frame")
auraFrameEvent:RegisterUnitEvent("UNIT_AURA", unitId)
auraFrameEvent:SetScript("OnEvent", function()
openRaidLib.AuraTracker.ScanUnitAuras(unitId)
end)
end
auraFrameEvent:SetScript("OnEvent", function()
openRaidLib.AuraTracker.ScanUnitAuras(unitId)
end)
end
end end
--test case:
local debugModule = {}
@@ -854,7 +856,6 @@ do
--print("aura removed:", unitId, spellId, spellName)
end
openRaidLib.internalCallback.RegisterCallback("unitAuraRemoved", debugModule.AuraRemoved)
end
@@ -899,7 +900,6 @@ do
local casterName = Ambiguate(casterString, "none")
return openRaidLib.AuraTracker.FindBuffDuration(targetName, casterName, spellId)
end
end
+32 -20
View File
@@ -43,7 +43,8 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
end
local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 122
local CONST_LIB_VERSION = 124
if (LIB_OPEN_RAID_MAX_VERSION) then
if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then
@@ -132,6 +133,9 @@ end
local CONST_USE_DEFAULT_SCHEDULE_TIME = true
-- Real throttle is 10 messages per 1 second, but we want to be safe due to fact we dont know when it actually resets
local CONST_COMM_BURST_BUFFER_COUNT = 9
local GetContainerNumSlots = GetContainerNumSlots or C_Container.GetContainerNumSlots
local GetContainerItemID = GetContainerItemID or C_Container.GetContainerItemID
local GetContainerItemLink = GetContainerItemLink or C_Container.GetContainerItemLink
@@ -485,25 +489,33 @@ end
---@field channel string
---@type {}[]
local commScheduler = {}
local commScheduler = {};
local commBurstBufferCount = CONST_COMM_BURST_BUFFER_COUNT;
local commServerTimeLastThrottleUpdate = GetServerTime();
do
--if there's an old version that already registered the comm ticker, cancel it
if (LIB_OPEN_RAID_COMM_SCHEDULER) then
LIB_OPEN_RAID_COMM_SCHEDULER:Cancel()
LIB_OPEN_RAID_COMM_SCHEDULER:Cancel();
end
--make the lib throttle the comms to one per second
local newTickerHandle = C_Timer.NewTicker(1, function()
for i = #commScheduler, 1, -1 do
local commData = commScheduler[i]
if (commData) then
sendData(commData.data, commData.channel)
table.remove(commScheduler, i)
return
end
local newTickerHandle = C_Timer.NewTicker(0.05, function()
local serverTime = GetServerTime();
-- Replenish the counter if last server time is not the same as the last throttle update
-- Clamp it to CONST_COMM_BURST_BUFFER_COUNT
commBurstBufferCount = math.min((serverTime ~= commServerTimeLastThrottleUpdate) and commBurstBufferCount + 1 or commBurstBufferCount, CONST_COMM_BURST_BUFFER_COUNT);
commServerTimeLastThrottleUpdate = serverTime;
-- while (anything in queue) and (throttle allows it)
while(#commScheduler > 0 and commBurstBufferCount > 0) do
-- FIFO queue
local commData = table.remove(commScheduler, 1);
sendData(commData.data, commData.channel);
commBurstBufferCount = commBurstBufferCount - 1;
end
end)
end);
LIB_OPEN_RAID_COMM_SCHEDULER = newTickerHandle
end
@@ -531,8 +543,8 @@ end
if (bit.band(flags, CONST_COMM_SENDTO_GUILD)) then --send to guild
if (IsInGuild()) then
local commData = {data = dataEncoded, channel = "GUILD"}
table.insert(commScheduler, commData)
--Guild has no 10 msg restriction so send it directly
sendData(dataEncoded, "GUILD");
end
end
else
@@ -588,9 +600,9 @@ end
end
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
if (not result) then
sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack)
end
--if (not result) then
-- sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack)
--end
return result
end
@@ -601,7 +613,7 @@ end
local newTimer = C_Timer.NewTimer(time, triggerScheduledTick)
newTimer.payload = payload
newTimer.callback = callback
newTimer.stack = debugstack()
--newTimer.stack = debugstack()
return newTimer
end
@@ -621,7 +633,7 @@ end
local newTimer = openRaidLib.Schedules.NewTimer(time, callback, ...)
newTimer.namespace = namespace
newTimer.scheduleName = scheduleName
newTimer.stack = debugstack()
--newTimer.stack = debugstack()
newTimer.isUnique = true
local registeredUniqueTimers = openRaidLib.Schedules.registeredUniqueTimers
+68 -2
View File
@@ -3481,6 +3481,7 @@ function damageClass.PredictedAugSpellsOnEnter(self)
local CONST_SPELLID_EBONMIGHT = 395152
local CONST_SPELLID_PRESCIENCE = 410089
local CONST_SPELLID_BLACKATTUNEMENT = 403264
local CONST_SPELLID_BLISTERING_SCALES = 360827
---@type actor[]
local augmentationEvokers = {}
@@ -3565,7 +3566,7 @@ function damageClass.PredictedAugSpellsOnEnter(self)
GameCooltip:AddLine("", "")
GameCooltip:AddIcon("", nil, nil, 1, 1)
for i = 1, #augmentationEvokers do
for i = 1, #augmentationEvokers do --black attunement
local actorObject = augmentationEvokers[i]
if (actorObject:Name() == actorName) then
local buffUptimeSpellContainer = actorObject:GetSpellContainer("buff")
@@ -3589,6 +3590,26 @@ function damageClass.PredictedAugSpellsOnEnter(self)
GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
end
end
local spellTable = buffUptimeSpellContainer:GetSpell(CONST_SPELLID_BLISTERING_SCALES)
if (spellTable) then
local uptime = spellTable.uptime
local spellName, _, spellIcon = _GetSpellInfo(CONST_SPELLID_BLISTERING_SCALES)
local uptimePercent = uptime / combatTime * 100
if (uptime <= combatTime) then
local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (minutes > 0) then
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen")
else
GameCooltip:AddLine(spellName, seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen")
end
GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
end
end
end
end
end
@@ -3645,7 +3666,7 @@ function damageClass.PredictedAugSpellsOnEnter(self)
if (evokerObject) then
GameCooltip:AddLine("Prescience Uptime by Amount of Applications")
local prescienceData = evokerObject.cleu_prescience_time --real time
local prescienceData = evokerObject.cleu_prescience_time
if (prescienceData) then
prescienceData = prescienceData.stackTime
@@ -3667,6 +3688,51 @@ function damageClass.PredictedAugSpellsOnEnter(self)
end
end
end
--iterate among all the actors and find which one are healers, then get the amount of mana the evoker restored for that healer
---@type actorcontainer
local resourcesContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_ENERGY)
local manaRestoredToHealers = {}
for index, actorObject in resourcesContainer:ListActors() do
if (actorObject.spec == 1473) then --this is an aug evoker
local spellContainer = actorObject:GetSpellContainer("spell")
--local spellContainer = actorObject.spells
if (spellContainer) then
local sourceOfMagic = spellContainer:GetSpell(372571)
if (sourceOfMagic) then
for targetName, restoredAmount in pairs(sourceOfMagic.targets) do
manaRestoredToHealers[#manaRestoredToHealers+1] = {targetName, restoredAmount}
end
end
end
end
end
if (#manaRestoredToHealers > 0) then
GameCooltip:AddLine(" ")
GameCooltip:AddIcon(" ", 1, 1, 10, 10)
GameCooltip:AddLine("Mana Restored to Healers:")
table.sort(manaRestoredToHealers, Details.Sort2)
for i = 1, math.min(10, #manaRestoredToHealers) do
local targetName, restoredAmount = unpack(manaRestoredToHealers[i])
local targetActorObject = combatObject(DETAILS_ATTRIBUTE_ENERGY, targetName)
if (targetActorObject) then
local targetClass = targetActorObject:GetActorClass()
local targetName = detailsFramework:AddClassColorToText(targetName, targetClass)
targetName = detailsFramework:AddClassIconToText(targetName, targetName, targetClass)
GameCooltip:AddLine(targetName, Details:Format(restoredAmount))
local spellIcon = GetSpellTexture(372571)
GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Details:AddTooltipBackgroundStatusbar(false, 100, true, "dodgerblue")
end
end
end
end
GameCooltip:AddLine("feature under test, can't disable atm")
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -1535,8 +1535,9 @@ function _detalhes:CatchRaidBuffUptime(sOperationType)
if (auraName) then
if (UnitExists(unitCaster)) then
local bBuffIsPlacedOnTarget = Details.CreditBuffToTarget[spellId]
if (UnitIsUnit(unitCaster, unitId) or bBuffIsPlacedOnTarget) then
if (bBuffIsPlacedOnTarget and not UnitIsUnit(unitCaster, unitId)) then
local bUnitIsTheCaster = UnitIsUnit(unitCaster, unitId)
if (bUnitIsTheCaster or bBuffIsPlacedOnTarget) then
if (bBuffIsPlacedOnTarget and not bUnitIsTheCaster) then
--could be prescince, ebom might or power infusion; casted on a target instead of the caster
local sourceSerial = UnitGUID(unitCaster)
local sourceName = Details:GetFullName(unitCaster)
@@ -1546,9 +1547,9 @@ function _detalhes:CatchRaidBuffUptime(sOperationType)
local targetFlags = 0x514
local targetFlags2 = 0x0
local spellName = auraName
--print(targetName, "already had", spellName, "at first of a combat")
Details.parser:buff("SPELL_AURA_APPLIED", time(), sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, 0x4, "BUFF", 0)
else
elseif (bUnitIsTheCaster) then
local playerGUID = UnitGUID(unitId)
if (playerGUID) then
local playerName = Details:GetFullName(unitId)
+3
View File
@@ -297,6 +297,7 @@
Details:Msg("(debug) |cFFFFFF00started a new combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "")
--local from = debugstack(2, 1, 0)
--print("from:", from)
DetailsParserDebugFrame:Show()
end
local segmentsTable = Details:GetCombatSegments()
@@ -474,6 +475,8 @@
function Details:SairDoCombate(bossKilled, bIsFromEncounterEnd)
if (Details.debug) then
Details:Msg("(debug) |cFFFFFF00ended a combat|r|cFFFF7700", Details.encounter_table and Details.encounter_table.name or "")
else
DetailsParserDebugFrame:Hide()
end
---@type combat
+50 -11
View File
@@ -1300,13 +1300,13 @@
--~roskash - augmentation evoker damage buff
if (augmentation_cache.ebon_might[sourceSerial] or (ownerActor and augmentation_cache.ebon_might[ownerActor.serial])) then
--get the serial number of the player who did the damage, in case of a pet or minion use the owner serial
local thisSourceSerial = augmentation_cache.ebon_might[sourceSerial] and sourceSerial or ownerActor.serial
local thisSourceSerial = (augmentation_cache.ebon_might[sourceSerial] and sourceSerial) or ownerActor.serial
---actor buffed with ebonmight -> list of evokers whose buffed
---@type table<serial, evokerinfo[]>
local currentlyBuffedWithEbonMight = augmentation_cache.ebon_might[thisSourceSerial]
local evokersWhoBuffedThisPlayer = augmentation_cache.ebon_might[thisSourceSerial]
for i, evokerInfo in ipairs(currentlyBuffedWithEbonMight) do
for i, evokerInfo in ipairs(evokersWhoBuffedThisPlayer) do
---@cast evokerInfo evokerinfo
---@type serial, actorname, controlflags
local evokerSourceSerial, evokerSourceName, evokerSourceFlags, attributedGained = unpack(evokerInfo)
@@ -1331,7 +1331,7 @@
local tierPieceMultiplier = 1 --bHasFourPieces and 1.08 or 1
local evokerItemLevel = gearCache[evokerSourceSerial] and gearCache[evokerSourceSerial].ilevel or 400
evokerItemLevel = max(evokerItemLevel, 400)
local itemLevelMultiplier = 1 + ((evokerItemLevel - 400) * 0.006)
local itemLevelMultiplier = 1 -- + ((evokerItemLevel - 400) * 0.006)
local predictedAmount = 0
if (Details.zone_type == "raid") then --0x410b
@@ -1346,7 +1346,10 @@
augmentedSpell.total = augmentedSpell.total + predictedAmount
augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 1)
if (Details.debug) then
DetailsParserDebugFrame:BlinkIcon(extraSpellId, 1)
DetailsParserDebugFrame.AllTexts[1]:SetText("Evokers Buffed: " .. #evokersWhoBuffedThisPlayer .. " (" .. floor(predictedAmount / amount * 100) .. "%)")
end
end
end
end
@@ -1386,7 +1389,9 @@
augmentedSpell.total = augmentedSpell.total + predictedAmount
augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + predictedAmount
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 2)
if (Details.debug) then
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 2)
end
end
end
end
@@ -1423,7 +1428,9 @@
augmentedSpell.total = augmentedSpell.total + damageSplitted
augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + damageSplitted
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 3)
if (Details.debug) then
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 3)
end
end
end
end
@@ -1460,7 +1467,9 @@
augmentedSpell.total = augmentedSpell.total + fateMirror_plus_Prescience
augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + fateMirror_plus_Prescience
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 4)
if (Details.debug) then
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 4)
end
end
end
end
@@ -1495,7 +1504,9 @@
augmentedSpell.total = augmentedSpell.total + amount
augmentedSpell.targets[sourceName] = (augmentedSpell.targets[sourceName] or 0) + amount
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 5)
if (Details.debug) then
--DetailsParserDebugFrame:BlinkIcon(extraSpellId, 5)
end
end
end
end
@@ -5406,6 +5417,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
Details:SendEvent("COMBAT_ENCOUNTER_START", nil, ...)
Details222.CacheKeystoneForAllGroupMembers()
end
--ENCOUNRTER_END
@@ -5763,6 +5776,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
local keystoneLevels = {}
Details.KeystoneLevels = keystoneLevels
--save the keystone level for each of the 5 party members
local saveGroupMembersKeystoneLevel = function()
wipe(keystoneLevels)
local libOpenRaid = LibStub("LibOpenRaid-1.0", true)
@@ -5788,6 +5802,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
function Details222.CacheKeystoneForAllGroupMembers()
local _, instanceType, difficultyID = GetInstanceInfo()
if (instanceType == "party") then
saveGroupMembersKeystoneLevel()
end
end
function Details.parser_functions:CHALLENGE_MODE_COMPLETED(...) --~complete ~finish ~mythic ~m+
Details222.MythicPlus.WorldStateTimerEndAt = time()
@@ -7309,34 +7330,46 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
--[=[
--[=
local detailsParserDebugFrame = CreateFrame("frame", "DetailsParserDebugFrame", UIParent)
detailsParserDebugFrame:SetSize(100, 200)
DetailsFramework:ApplyStandardBackdrop(detailsParserDebugFrame)
detailsParserDebugFrame:SetPoint("left", UIParent, "left", 2, 350)
detailsParserDebugFrame.AllIcons = {}
--detailsParserDebugFrame:Hide()
detailsParserDebugFrame.AllTexts = {}
local iconSize = 40
detailsParserDebugFrame:Hide()
local spellIcon1 = detailsParserDebugFrame:CreateTexture(nil, "overlay")
spellIcon1:SetSize(iconSize, iconSize)
spellIcon1:SetPoint("topleft", detailsParserDebugFrame, "topleft", 2, -5)
local text1 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal")
text1:SetPoint("left", spellIcon1, "right", 2, 0)
local spellIcon2 = detailsParserDebugFrame:CreateTexture(nil, "overlay")
spellIcon2:SetSize(iconSize, iconSize)
spellIcon2:SetPoint("topleft", spellIcon1, "bottomleft", 0, -2)
local text2 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal")
text2:SetPoint("left", spellIcon2, "right", 2, 0)
local spellIcon3 = detailsParserDebugFrame:CreateTexture(nil, "overlay")
spellIcon3:SetSize(iconSize, iconSize)
spellIcon3:SetPoint("topleft", spellIcon2, "bottomleft", 0, -2)
local text3 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal")
text3:SetPoint("left", spellIcon3, "right", 2, 0)
local spellIcon4 = detailsParserDebugFrame:CreateTexture(nil, "overlay")
spellIcon4:SetSize(iconSize, iconSize)
spellIcon4:SetPoint("topleft", spellIcon3, "bottomleft", 0, -2)
local text4 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal")
text4:SetPoint("left", spellIcon4, "right", 2, 0)
local spellIcon5 = detailsParserDebugFrame:CreateTexture(nil, "overlay")
spellIcon5:SetSize(iconSize, iconSize)
spellIcon5:SetPoint("topleft", spellIcon4, "bottomleft", 0, -2)
local text5 = detailsParserDebugFrame:CreateFontString(nil, "overlay", "GameFontNormal")
text5:SetPoint("left", spellIcon5, "right", 2, 0)
tinsert(detailsParserDebugFrame.AllIcons, spellIcon1)
tinsert(detailsParserDebugFrame.AllIcons, spellIcon2)
@@ -7344,6 +7377,12 @@ tinsert(detailsParserDebugFrame.AllIcons, spellIcon3)
tinsert(detailsParserDebugFrame.AllIcons, spellIcon4)
tinsert(detailsParserDebugFrame.AllIcons, spellIcon5)
tinsert(detailsParserDebugFrame.AllTexts, text1)
tinsert(detailsParserDebugFrame.AllTexts, text2)
tinsert(detailsParserDebugFrame.AllTexts, text3)
tinsert(detailsParserDebugFrame.AllTexts, text4)
tinsert(detailsParserDebugFrame.AllTexts, text5)
function detailsParserDebugFrame:BlinkIcon(spellId, iconId)
local spellName, _, spellIcon = GetSpellInfo(spellId)
local icon = self.AllIcons[iconId]
+15 -9
View File
@@ -525,26 +525,32 @@ local updateKeysStoneLevel = function()
local unitKeystoneInfo = libOpenRaid.GetKeystoneInfo(unitId)
--print("Unit Exists:", unitBanner.unitName, unitId, "updating keystone level", unitKeystoneInfo)
if (unitKeystoneInfo) then
if (instanceInfo) then
---@type details_instanceinfo
local thisInstanceInfo = Details:GetInstanceInfo(unitKeystoneInfo.mapID)
unitBanner.DungeonTexture:SetTexture(thisInstanceInfo.iconLore)
end
--if (instanceInfo) then
-- ---@type details_instanceinfo
-- local thisInstanceInfo = Details:GetInstanceInfo(unitKeystoneInfo.mapID)
-- unitBanner.DungeonTexture:SetTexture(thisInstanceInfo.iconLore)
--end
--unitBanner.LevelFontString:SetText(unitKeystoneInfo.level)
--print("setting player", unitBanner.unitName, "keystone level to", unitKeystoneInfo.level)
local oldKeystoneLevel = Details.KeystoneLevels[Details:GetFullName(unitId)]
if (oldKeystoneLevel and oldKeystoneLevel >= 2) then
if (unitKeystoneInfo.level > oldKeystoneLevel) then
--unitBanner.LevelUpFrame.Text:SetText("")
--unitBanner.LevelUpFrame:SetAlpha(1)
--unitBanner.LevelUpFrame.Anim:Play()
C_Timer.After(0.5, function()
unitBanner.LevelUpTextFrame.PlayAnimations(unitKeystoneInfo.level)
end)
---@type details_instanceinfo
local instanceInfo = Details:GetInstanceInfo(unitKeystoneInfo.mapID)
if (instanceInfo) then
unitBanner.DungeonTexture:SetTexture(instanceInfo.iconLore)
else
unitBanner.DungeonTexture:SetTexture([[Interface\ICONS\INV_Misc_QuestionMark]])
end
--this character had its keystone upgraded
--unitBanner.flashTexture:Flash()
--print("keystone upgraded for", Details:GetFullName(unitId), unitKeystoneInfo.level, "old was:", oldKeystoneLevel)
+116 -18
View File
@@ -47,6 +47,91 @@ eventListener:RegisterEvent("COMBAT_PLAYER_LEAVING", function(eventName, combatO
--close the time on the current amount of prescience stacks the evoker have
---@type combat
local combat = Details:GetCurrentCombat()
local amountOfAugEvokers = 0
---@type actorcontainer
local damageContainer = combat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
---@type actor[]
local players = {}
---@type actor
local augEvokerObject
for index, actorObject in damageContainer:ListActors() do
--check the specId to know if the actor has the augmentation specId
if (actorObject.spec == 1473) then
amountOfAugEvokers = amountOfAugEvokers + 1
players[#players+1] = actorObject
augEvokerObject = actorObject
elseif (actorObject:IsPlayer()) then
players[#players+1] = actorObject
end
end
--print("players", #players, "amountOfAugEvokers:", amountOfAugEvokers, augEvokerObject and augEvokerObject:Name() or "nil")
if (amountOfAugEvokers == 1 and augEvokerObject) then
local breathOfEonsDamage = 0
local infernoBlessingDamage = 0
local fateMirrorDamage = 0
local blisteringScalesDamage = 0
for i = 1, #players do
---@actor
local playerObject = players[i]
local spellContainer = playerObject:GetSpellContainer("spell")
local breathOfEons = spellContainer:GetSpell(CONST_SPELLID_EONS_BREATH)
local infornoBlessing = spellContainer:GetSpell(CONST_SPELLID_INFERNOBLESS)
local blisteringScales = spellContainer:GetSpell(CONST_SPELLID_TANK_SHIELD)
local fateMirror = spellContainer:GetSpell(CONST_SPELLID_SS)
if (breathOfEons and breathOfEons.total >= 1) then
breathOfEonsDamage = breathOfEonsDamage + breathOfEons.total
end
if (infornoBlessing and infornoBlessing.total >= 1) then
infernoBlessingDamage = infernoBlessingDamage + infornoBlessing.total
end
if (blisteringScales and blisteringScales.total >= 1) then
blisteringScalesDamage = blisteringScalesDamage + blisteringScales.total
end
if (fateMirror and fateMirror.total >= 1) then
fateMirrorDamage = fateMirrorDamage + fateMirror.total
end
end
local augmentedSpellContainer = augEvokerObject.augmentedSpellsContainer
if (breathOfEonsDamage > 0) then
local bCanCreateSpellIfMissing = true
local breathOfEonsSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_EONS_BREATH, bCanCreateSpellIfMissing, "SPELL_DAMAGE")
breathOfEonsSpell.total = breathOfEonsDamage
end
if (infernoBlessingDamage > 0) then
local bCanCreateSpellIfMissing = true
local infernoBlessingSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_INFERNOBLESS, bCanCreateSpellIfMissing, "SPELL_DAMAGE")
infernoBlessingSpell.total = infernoBlessingDamage
end
if (blisteringScalesDamage > 0) then
local bCanCreateSpellIfMissing = true
local blisteringScalesSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_TANK_SHIELD, bCanCreateSpellIfMissing, "SPELL_DAMAGE")
blisteringScalesSpell.total = blisteringScalesDamage
end
if (fateMirrorDamage > 0) then
local bCanCreateSpellIfMissing = true
local fateMirrorSpell = augmentedSpellContainer:GetOrCreateSpell(CONST_SPELLID_SS, bCanCreateSpellIfMissing, "SPELL_DAMAGE")
fateMirrorSpell.total = fateMirrorDamage
end
end
--[=[
---@type actorcontainer
local damageContainer = combat:GetContainer(DETAILS_ATTRIBUTE_MISC)
--print(1, "COMBAT_PLAYER_LEAVING", next(augmentationCache.prescience_stacks))
@@ -65,6 +150,7 @@ eventListener:RegisterEvent("COMBAT_PLAYER_LEAVING", function(eventName, combatO
actorObject.prescience_stack_data_by_timeline = DetailsFramework.table.copy({}, stackInfo.stackTime)
end
--]=]
end)
---@class details_evoker_presciencetimeline : table
@@ -156,6 +242,7 @@ function augmentationFunctions.OnAugmentationBuffUpdate(eventName, ...)
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 = ...
@@ -247,6 +334,7 @@ function augmentationFunctions.OnAugmentationBuffUpdate(eventName, ...)
evokerUtilityObject.prescience_stack_data_by_timeline = DetailsFramework.table.copy({}, evokerPrescienceStackInfo.stackTime)
end
end
--]=]
end
end
@@ -256,14 +344,23 @@ function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sou
end
if (spellId == 395152) then --ebom might on third parties
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, _, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local attributeGained = v2
--unit already have the buff from this evoker
if (type(attributeGained) == "number") then
if (augmentationCache.ebon_might[targetSerial]) then
for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do
if (evokerInfo[1] == sourceSerial) then
evokerInfo[4] = attributeGained
return
end
end
end
augmentationCache.ebon_might[targetSerial] = augmentationCache.ebon_might[targetSerial] or {}
local evokerInfo = {sourceSerial, sourceName, sourceFlags, attributeGained}
table.insert(augmentationCache.ebon_might[targetSerial], evokerInfo)
--print("ebom might added, cache:", Details.augmentation_cache, #augmentationCache.ebon_might[targetSerial])
end
elseif (spellId == 413984) then --ss
@@ -347,26 +444,30 @@ 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
augmentationCache.ebon_might[targetSerial] = augmentationCache.ebon_might[targetSerial] or {}
if (augmentationCache.ebon_might[targetSerial]) then
for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do
if (evokerInfo[1] == sourceSerial) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local attributeGained = v2
for index, evokerInfo in ipairs(augmentationCache.ebon_might[targetSerial]) do
if (evokerInfo[1] == sourceSerial) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local attributeGained = v2
if (type(attributeGained) == "number") then
evokerInfo[4] = attributeGained
bFound = true
break
if (type(attributeGained) == "number") then
evokerInfo[4] = attributeGained
return
end
end
end
end
if (not bFound) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local attributeGained = v2
if (type(attributeGained) == "number") then
Details222.DebugMsg("Ebon Might Refreshed!, but the evoker was not found in the cache (1), adding:", sourceName, sourceSerial, targetName, targetSerial)
table.insert(augmentationCache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, attributeGained})
end
else
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, auraSpellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local attributeGained = v2
if (type(attributeGained) == "number") then
Details222.DebugMsg("Ebon Might Refreshed!, but the evoker was not found in the cache (2), adding:", sourceName, sourceSerial, targetName, targetSerial)
table.insert(augmentationCache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, attributeGained})
end
end
@@ -421,12 +522,9 @@ function augmentationFunctions.BuffOut(token, time, sourceSerial, sourceName, so
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
if (evokerInfo[1] == sourceSerial) then
--print("ebom might finished, removing from cache:", Details.augmentation_cache, #augmentationCache.ebon_might[targetSerial])
table.remove(augmentationCache.ebon_might[targetSerial], index)
--print("ebom might finished, removing from cache:", Details.augmentation_cache, #augmentationCache.ebon_might[targetSerial])
break
end
end