Skip to content

Commit

Permalink
More fixes for patch 10.2 combatlog changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Oct 29, 2023
1 parent f870036 commit 557f54d
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 51 deletions.
2 changes: 1 addition & 1 deletion core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,7 @@
end

if (override_aura_spellid[spellId] and UnitIsUnit(sourceName, "player")) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(sourceName, spellId, sourceName)
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(sourceName, spellId, sourceName)
if (auraName) then
local overrideTable = override_aura_spellid[spellId]
if (overrideTable.CanOverride(auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5)) then
Expand Down
103 changes: 75 additions & 28 deletions core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,96 @@
local UnitAffectingCombat = UnitAffectingCombat --wow api local
local _InCombatLockdown = InCombatLockdown --wow api local

local gump = Details.gump --details local
local playerRealmName = GetRealmName()

local gump = Details.gump --details local

local predicateFunc = function(spellIdToFind, casterName, _, name, icon, applications, dispelName, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, applications)
--print(name, texture, count, debuffType, duration, expirationTime, spellID)
if (spellIdToFind == spellId and UnitExists(sourceUnit)) then
local spellname = GetSpellInfo(spellId)
if (casterName == GetUnitName(sourceUnit, true)) then
if (casterName == Details:GetFullName(sourceUnit)) then
return true
end
end
end

---find the duration of a debuff by passing the spellId and the caster name
---@param unitId unit
---@param spellId spellid
---@param casterName actorname
---@return auraduration|nil auraDuration
---@return number|nil expirationTime
function Details:FindDebuffDuration(unitId, spellId, casterName)
local name, texture, count, debuffType, duration, expirationTime = AuraUtil.FindAura(predicateFunc, unitId, "HARMFUL", spellId, casterName)
if (name) then
return duration, expirationTime
do
function Details:FindDebuffDurationByUnitName(targetString, spellId, casterString)
local targetName, targetRealm = strsplit("-", targetString)
if (playerRealmName ~= targetRealm) then
targetName = targetString
end

local casterName, casterRealm = strsplit("-", casterString)
if (playerRealmName ~= casterRealm) then
casterName = casterString
end

return Details:FindDebuffDuration(targetName, spellId, casterName)
end

---find the duration of a debuff by passing the spellId and the caster name
---@param unitId unit
---@param spellId spellid
---@param casterName actorname
---@return auraduration|nil auraDuration
---@return number|nil expirationTime
function Details:FindDebuffDuration(unitId, spellId, casterName)
local name, texture, count, debuffType, duration, expirationTime = AuraUtil.FindAura(predicateFunc, unitId, "HARMFUL", spellId, casterName)
if (name) then
return duration, expirationTime
end
end
end

---find the duration of a buff by passing the spellId and the caster name
---@param unitId unit
---@param spellId spellid
---@param casterName actorname
---@return auraduration|nil auraDuration
---@return number|nil expirationTime
function Details:FindBuffDuration(unitId, spellId, casterName)
local name, texture, count, debuffType, duration, expirationTime = AuraUtil.FindAura(predicateFunc, unitId, "HELPFUL", spellId, casterName)
if (name) then
return duration, expirationTime
do
function Details:FindBuffDurationByUnitName(targetString, spellId, casterString)
local targetName, targetRealm = strsplit("-", targetString)
if (playerRealmName ~= targetRealm) then
targetName = targetString
end

local casterName, casterRealm = strsplit("-", casterString)
if (playerRealmName ~= casterRealm) then
casterName = casterString
end

return Details:FindBuffDuration(targetName, spellId, casterName)
end

---find the duration of a buff by passing the spellId and the caster name
---@param unitId unit
---@param spellId spellid
---@param casterName actorname
---@return auraduration|nil auraDuration
---@return number|nil expirationTime
function Details:FindBuffDuration(unitId, spellId, casterName)
local name, texture, count, debuffType, duration, expirationTime = AuraUtil.FindAura(predicateFunc, unitId, "HELPFUL", spellId, casterName)
if (name) then
return duration, expirationTime
end
end
end

function Details:FindBuffCastedBy(unitId, buffSpellId, casterName)
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = AuraUtil.FindAura(predicateFunc, unitId, "HELPFUL", buffSpellId, casterName)
if (auraName) then
return auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5
do
function Details:FindBuffCastedByUnitName(targetString, buffSpellId, casterString)
local targetName, targetRealm = strsplit("-", targetString)
if (playerRealmName ~= targetRealm) then
targetName = targetString
end

local casterName, casterRealm = strsplit("-", casterString)
if (playerRealmName ~= casterRealm) then
casterName = casterString
end

return Details:FindBuffCastedBy(targetName, buffSpellId, casterName)
end

function Details:FindBuffCastedBy(unitId, buffSpellId, casterName)
local auraName, texture, count, auraType, duration, expTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, playerOrPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = AuraUtil.FindAura(predicateFunc, unitId, "HELPFUL", buffSpellId, casterName)
if (auraName) then
return auraName, texture, count, auraType, duration, expTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, playerOrPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5
end
end
end

Expand Down
28 changes: 6 additions & 22 deletions functions/spec_augmentation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ local augmentationFunctions = Details222.SpecHelpers[1473]
local augmentationCache = Details222.SpecHelpers[1473].augmentation_cache

function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, spellId, spellName, spellschool, auraType, amount)
if (spellId == 395152) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellId, sourceName)
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 attributeGained = v2

if (type(attributeGained) == "number") then
Expand All @@ -20,25 +20,9 @@ function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sou
table.insert(augmentationCache.ebon_might[targetSerial], evokerInfo)
end

















elseif (spellId == 413984) then --ss
if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellId, sourceName)
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 versaGained = v1
if (type(versaGained) == "number") then
augmentationCache.ss[targetSerial] = augmentationCache.ss[targetSerial] or {}
Expand Down Expand Up @@ -88,7 +72,7 @@ function augmentationFunctions.BuffRefresh(token, time, sourceSerial, sourceName

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:FindBuffCastedBy(targetName, spellId, sourceName)
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
Expand All @@ -100,7 +84,7 @@ function augmentationFunctions.BuffRefresh(token, time, sourceSerial, sourceName
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:FindBuffCastedBy(targetName, spellId, sourceName)
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
table.insert(augmentationCache.ebon_might[targetSerial], {sourceSerial, sourceName, sourceFlags, attributeGained})
Expand All @@ -109,7 +93,7 @@ function augmentationFunctions.BuffRefresh(token, time, sourceSerial, sourceName

elseif (spellId == 413984) then --ss
if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedBy(targetName, spellId, sourceName)
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 versaGained = v1

if (type(versaGained) == "number") then
Expand Down

0 comments on commit 557f54d

Please sign in to comment.