Ignore World Auras like those weekly that cannot be cancelled

This commit is contained in:
Tercio Jose
2024-07-21 20:43:49 -03:00
committed by andrew6180
parent 60957c1c11
commit 1dec8b7540
5 changed files with 57 additions and 13 deletions
+2
View File
@@ -187,6 +187,8 @@
[1473] = {},
}
Details222.IgnoredWorldAuras = {}
Details222.Parser = {}
Details222.Actors = {}
+9 -12
View File
@@ -1361,15 +1361,13 @@ function atributo_misc:ToolTipDispell(instancia, numero, barra)
end
local UnitReaction = UnitReaction
local UnitDebuff = UnitDebuff
function Details:CloseEnemyDebuffsUptime()
local combat = Details.tabela_vigente
local misc_container = combat [4]._ActorTable
for _, actor in ipairs(misc_container) do
local combat = Details:GetCurrentCombat()
local utilityContainer = combat:GetContainer(DETAILS_ATTRIBUTE_MISC)
for _, actor in utilityContainer:ListActors() do
if (actor.boss_debuff) then
for target_name, target in ipairs(actor.debuff_uptime_targets) do
for targetName, target in ipairs(actor.debuff_uptime_targets) do
if (target.actived and target.actived_at) then
target.uptime = target.uptime + Details._tempo - target.actived_at
actor.debuff_uptime = actor.debuff_uptime + Details._tempo - target.actived_at
@@ -1379,11 +1377,9 @@ function Details:CloseEnemyDebuffsUptime()
end
end
end
return
end
function Details:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN"
function Details:CatchRaidDebuffUptime(sOperationType) -- "DEBUFF_UPTIME_IN" ~scan
if (sOperationType == "DEBUFF_UPTIME_OUT") then
local combatObject = Details:GetCurrentCombat()
local utilityContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_MISC)
@@ -1517,7 +1513,7 @@ local runeIds = {
}
--called from control on leave / enter combat
function Details:CatchRaidBuffUptime(sOperationType)
function Details:CatchRaidBuffUptime(sOperationType) -- ~scan
if (IsInRaid()) then
local potUsage = {}
local focusAugmentation = {}
@@ -1602,7 +1598,7 @@ function Details:CatchRaidBuffUptime(sOperationType)
elseif (bUnitIsTheCaster) then
local playerGUID = UnitGUID(unitId)
if (playerGUID) then
if (playerGUID and auraInfo.duration ~= 3600) then
local playerName = Details:GetFullName(unitId)
if (sOperationType == "BUFF_UPTIME_IN") then
if (Details.PotionList[spellId]) then
@@ -1634,6 +1630,7 @@ function Details:CatchRaidBuffUptime(sOperationType)
if (UnitIsUnit(unitCaster, unitId) or bBuffIsPlacedOnTarget) then
if (bBuffIsPlacedOnTarget and not UnitIsUnit(unitCaster, unitId)) then
--could be prescince, ebom might or power infusion; casted on a target instead of the caster
--possible bug: the sOperationType could be BUFF_UP_TIME_OUT and it is calling aura applied, which shoud call aura_removed
local sourceSerial = UnitGUID(unitCaster)
local sourceName = Details:GetFullName(unitCaster)
local sourceFlags = 0x514
@@ -1646,7 +1643,7 @@ function Details:CatchRaidBuffUptime(sOperationType)
else
local playerName = Details:GetFullName(unitId)
local playerGUID = UnitGUID(unitId)
if (playerGUID) then
if (playerGUID and auraInfo.duration ~= 3600) then
if (sOperationType == "BUFF_UPTIME_IN") then
if (Details.PotionList[spellId]) then
potUsage [playerName] = spellId
+18
View File
@@ -16,6 +16,24 @@ AuraScan.UnitAurasStorage = {}
AuraScan.AurasToTimeline = {} --which spells should be added to the timeline
AuraScan.AuraTimelineStorage = {} --store the timeline here
function AuraScan.FindAndIgnoreWorldAuras()
for buffIndex = 1, 41 do
---@type aurainfo
local auraName, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitAura("player", buffIndex, "HELPFUL")
if (auraName) then
if (auraName and unitCaster and UnitExists(unitCaster) and UnitIsUnit(unitCaster, "player")) then
if (duration == 0 and expirationTime) then --this aura is a world buff, probably a weekly buff
Details222.IgnoredWorldAuras[spellId] = true
end
end
else
break
end
end
end
function AuraScan.RegisterCallback(callback)
AuraScan.Callbacks[callback] = true
end
+26 -1
View File
@@ -181,6 +181,9 @@
[10060] = true, --power infusion
}
---@type table<spellid, boolean>
local ignoredWorldAuras = Details222.IgnoredWorldAuras
Details.CreditBuffToTarget = buffs_on_target
local empower_cache = {}
@@ -2328,6 +2331,10 @@
-----------------------------------------------------------------------------------------------------------------------------------------
function parser:buff(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, auraType, amount, arg1, arg2, arg3)
if (ignoredWorldAuras[spellId]) then
return
end
--not yet well know about unnamed buff casters
if (not targetName) then
targetName = "[*] Unknown shield target"
@@ -2516,6 +2523,10 @@
--~refresh
function parser:buff_refresh(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, tipo, amount)
if (ignoredWorldAuras[spellId]) then
return
end
if (not sourceName) then
sourceName = names_cache[spellName]
if (not sourceName) then
@@ -2594,6 +2605,10 @@
-- ~unbuff
function parser:unbuff(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellSchool, tipo, amount)
if (ignoredWorldAuras[spellId]) then
return
end
if (not sourceName) then
sourceName = names_cache[spellName]
if (not sourceName) then
@@ -2802,7 +2817,9 @@
-----------------------------------------------------------------------------------------------------------------------------------------
function parser:add_bad_debuff_uptime(token, time, sourceGuid, sourceName, sourceFlags, targetGuid, targetName, targetFlags, targetsFlags2, spellId, spellName, spellSchool, sInOrOut, stackSize)
if (not targetName) then
if (ignoredWorldAuras[spellId]) then
return
elseif (not targetName) then
--no target name, just quit
return
elseif (not sourceName) then
@@ -2981,6 +2998,10 @@
---@param sAuraInOrOut string
---@param bAddToTarget boolean|nil not in use on debuffs at the moment
function parser:add_debuff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, sAuraInOrOut, bAddToTarget)
if (ignoredWorldAuras[spellId]) then
return
end
_current_misc_container.need_refresh = true
local sourceActor = misc_cache[sourceName]
@@ -3023,6 +3044,10 @@
---@param bAddToTarget boolean? --special auras which has to be added to the caster and target
---@param bOverrideTime boolean?
function parser:add_buff_uptime(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, sAuraInOrOut, bAddToTarget, bOverrideTime)
if (ignoredWorldAuras[spellId]) then
return
end
_current_misc_container.need_refresh = true
local sourceActor = misc_cache[sourceName]
+2
View File
@@ -85,6 +85,8 @@ function Details222.StartUp.StartMeUp()
Details222.CreateAllDisplaysFrame()
Details222.AuraScan.FindAndIgnoreWorldAuras()
if (Details.ocd_tracker.show_options) then
Details:InitializeCDTrackerWindow()
else