diff --git a/ComboPointTracker.lua b/ComboPointTracker.lua index 142aec4..b92b01b 100644 --- a/ComboPointTracker.lua +++ b/ComboPointTracker.lua @@ -489,7 +489,7 @@ function CleveRoids.TrackComboPointCastByID(spellID, targetGUID) end else -- Second, check if name-based tracking has recent data for this spell - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName then -- Remove rank info for comparison local baseName = CleveRoids.StripRank(spellName) @@ -683,7 +683,7 @@ if _G.UseAction then local spellName = nil if actionType == "SPELL" and actionID then - spellName = GetSpellRecField(actionID, "name") + spellName = C_Spell.GetSpellName(actionID) end if currentCP and currentCP > 0 then diff --git a/Compatibility/pfUI.lua b/Compatibility/pfUI.lua index 1d0d531..8d5e399 100644 --- a/Compatibility/pfUI.lua +++ b/Compatibility/pfUI.lua @@ -99,7 +99,7 @@ local function GetCarnageOverride(effect) end for spellID, override in pairs(CleveRoids.carnageDurationOverrides) do - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName then local baseName = CleveRoids.StripRank(spellName) if baseName == effect and override.timestamp and (GetTime() - override.timestamp) < 5 then @@ -209,7 +209,7 @@ function Extension.HookPfUILibdebuff() for spellID, rec in pairs(CleveRoids.libdebuff.objects[unitGUID]) do if rec and rec.start and rec.duration then -- Get spell name for this ID - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName then local baseName = CleveRoids.StripRank(spellName) if baseName == effect then @@ -380,7 +380,7 @@ function Extension.SyncComboDurationToPfUI(guid, spellID, duration) end -- Get spell name from spell ID - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if not spellName then if CleveRoids.debug then DEFAULT_CHAT_FRAME:AddMessage("|cffff0000[pfUI Sync]|r Could not find spell name for ID " .. spellID) diff --git a/Conditionals.lua b/Conditionals.lua index e640cb3..8980898 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -105,7 +105,7 @@ local function BuildSpellNameCache() if lib.personalDebuffs then for sid, _ in pairs(lib.personalDebuffs) do - local name = GetSpellRecField(sid, "name") + local name = C_Spell.GetSpellName(sid) if name then name = CleveRoids.StripRank(name) if not _spellNameToIDs[name] then @@ -118,7 +118,7 @@ local function BuildSpellNameCache() if lib.sharedDebuffs then for sid, _ in pairs(lib.sharedDebuffs) do - local name = GetSpellRecField(sid, "name") + local name = C_Spell.GetSpellName(sid) if name then name = CleveRoids.StripRank(name) if not _spellNameToIDs[name] then @@ -163,7 +163,7 @@ local function GetSpellIDForRank(baseName, rankNum) if not matchIDs then return nil end local targetRank = "Rank " .. rankNum for _, sid in ipairs(matchIDs) do - local rank = GetSpellRecField and GetSpellRecField(sid, "rank") + local rank = C_Spell.GetSpellSubtext(sid) if rank and rank == targetRank then return sid end @@ -916,7 +916,7 @@ function CleveRoids.GetAllCasterAuraTimeRemaining(targetGuid, spellId) local targetData, isPfUI = CleveRoids.GetAuraTrackingData(targetGuid) if not targetData then return nil end - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if not spellName then return nil end local casters = targetData[spellName] @@ -960,7 +960,7 @@ function CleveRoids.FindAllCasterAuraByName(targetGuid, searchName) -- Resolve spell ID to name for direct lookup local searchID = tonumber(searchName) if searchID then - local resolvedName = GetSpellRecField and GetSpellRecField(searchID, "name") + local resolvedName = C_Spell.GetSpellName(searchID) if not resolvedName then return nil, nil end searchName = resolvedName end @@ -1081,7 +1081,7 @@ local function OnAutoAttackOther(attackerGuid, targetGuid, totalDamage, hitInfo, rec.start = GetTime() if CleveRoids.debug then - local spellName = GetSpellRecField and GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" local baseName = CleveRoids.StripRank(spellName) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00ffaa[Judgement Refresh]|r Refreshed %s (ID:%d) on melee hit - new duration: %ds", @@ -1091,7 +1091,7 @@ local function OnAutoAttackOther(attackerGuid, targetGuid, totalDamage, hitInfo, -- Sync to pfUI if loaded (pre-7.6 only) if not CleveRoids.hasPfUI76 and pfUI and pfUI.api and pfUI.api.libdebuff then - local spellName = GetSpellRecField and GetSpellRecField(spellID, "name") or nil + local spellName = C_Spell.GetSpellName(spellID) or nil local baseName = CleveRoids.StripRank(spellName) local targetName = (lib.guidToName and lib.guidToName[normalizedTarget]) or UnitName("target") local targetLevel = UnitLevel("target") or 0 @@ -1236,7 +1236,7 @@ local function OnAuraCastSelf(spellId, casterGuid, targetGuid, effect, effectAur -- Use the isBuffNotDebuff result determined above (avoids redundant slot scanning) local lib = CleveRoids.libdebuff if isBuffNotDebuff and spellId and durationMs and durationMs > 0 and lib and not lib.hasPfUIEnhanced then - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName then local playerGuid = CleveRoids.GetGUID("player") if playerGuid then @@ -1269,7 +1269,7 @@ local function OnAuraCastOther(spellId, casterGuid, targetGuid, effect, effectAu -- When pfUI enhanced is active, pfUI writes to pfUI.libdebuff_all_auras with -- full downrank protection — we read from that table via GetAuraTrackingData(). if spellId and durationMs and durationMs > 0 then - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName and not CleveRoids.hasPfUI76 then CleveRoids._allCasterAuraDirty = true if not CleveRoids.AllCasterAuraTracking[targetGuid] then @@ -1327,7 +1327,7 @@ local function OnAuraCastOther(spellId, casterGuid, targetGuid, effect, effectAu -- (AURA_CAST_ON_OTHER fires for both buffs and debuffs; BUFF_ADDED_OTHER confirms buff) local lib = CleveRoids.libdebuff if lib and not lib.hasPfUIEnhanced then - local spellNameForPending = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellNameForPending = C_Spell.GetSpellName(spellId) if spellNameForPending then local normTargetGuid = CleveRoids.NormalizeGUID(targetGuid) if normTargetGuid then @@ -1472,7 +1472,7 @@ autoAttackFrame:SetScript("OnEvent", function() if spellId and spellId > 0 and durationMs and durationMs > 0 then local playerGUID = CleveRoids.GetGUID("player") - local durSpellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local durSpellName = C_Spell.GetSpellName(spellId) if playerGUID and durSpellName and not CleveRoids.hasPfUI76 then CleveRoids._allCasterAuraDirty = true if not CleveRoids.AllCasterAuraTracking[playerGUID] then @@ -1524,7 +1524,7 @@ autoAttackFrame:SetScript("OnEvent", function() local state = arg7 if state == 2 then return end -- Stack change, not full removal if guid and spellId and CleveRoids.AllCasterAuraTracking[guid] then - local removedName = GetSpellRecField and GetSpellRecField(spellId, "name") + local removedName = C_Spell.GetSpellName(spellId) if removedName and CleveRoids.AllCasterAuraTracking[guid][removedName] then CleveRoids.AllCasterAuraTracking[guid][removedName] = nil if not next(CleveRoids.AllCasterAuraTracking[guid]) then @@ -1880,7 +1880,7 @@ local function IsPendingDebuffCast(spellName, targetUnit) if arr then for _, pending in pairs(arr) do if pending and pending.targetGUID == targetGuid and pending.spellID then - local pendingName = GetSpellRecField and GetSpellRecField(pending.spellID, "name") + local pendingName = C_Spell.GetSpellName(pending.spellID) if pendingName then local normalizedPending = NormalizeSpellNameForComparison(pendingName) if normalizedPending == normalizedCheck then @@ -2018,7 +2018,7 @@ function CleveRoids.CancelAura(auraName) if aura_ix == -1 then break end local bid = GetPlayerBuffID(aura_ix) bid = (bid < -1) and (bid + 65536) or bid - if string.lower(GetSpellRecField(bid, "name") or "") == auraName then + if string.lower(C_Spell.GetSpellName(bid) or "") == auraName then C_Spell.CancelSpellByID(bid) return true end @@ -2031,7 +2031,7 @@ function CleveRoids.CancelAura(auraName) for slot = 0, 31 do local spellId = _G.GetPlayerAuraDuration(slot) if spellId and spellId > 0 then - local name = GetSpellRecField(spellId, "name") + local name = C_Spell.GetSpellName(spellId) if name and string.lower(name) == auraName then C_Spell.CancelSpellByID(spellId) return true @@ -2047,7 +2047,7 @@ function CleveRoids.CancelAura(auraName) if entry.durationSec and entry.durationSec > 0 and elapsed > entry.durationSec then CleveRoids.OverflowBuffs[spellId] = nil else - local name = GetSpellRecField(spellId, "name") + local name = C_Spell.GetSpellName(spellId) if name and string.lower(name) == auraName then C_Spell.CancelSpellByID(spellId) CleveRoids.OverflowBuffs[spellId] = nil @@ -3530,7 +3530,7 @@ local function GetLowercaseSpellName(spellID) local cached = _spellNameCache[spellID] if cached then return cached end - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) if not name then return nil end -- Strip rank and lowercase @@ -3553,7 +3553,7 @@ local function GetSpellNames(spellID) return cached.base, cached.full end - local fullName = GetSpellRecField(spellID, "name") + local fullName = C_Spell.GetSpellName(spellID) if not fullName then return nil, nil end local baseName = _string_gsub(fullName, _RANK_PATTERN, "") @@ -4208,7 +4208,7 @@ function CleveRoids.ValidateUnitDebuff(unit, args) local fallbackNameLower = _string_lower(args.name) for sid, rec in pairs(lib.objects[guid]) do if rec and rec.caster == "player" then - local n = GetSpellRecField and GetSpellRecField(sid, "name") + local n = C_Spell.GetSpellName(sid) if n then n = CleveRoids.StripRank(n) if _string_lower(n) == fallbackNameLower then @@ -4295,7 +4295,7 @@ function CleveRoids.ValidateUnitDebuff(unit, args) local cleanupNameLower = _string_lower(args.name) for sid, rec in pairs(lib.objects[guid]) do if rec and rec.caster == "player" then - local n = GetSpellRecField and GetSpellRecField(sid, "name") + local n = C_Spell.GetSpellName(sid) if n then n = CleveRoids.StripRank(n) if _string_lower(n) == cleanupNameLower then @@ -5089,7 +5089,7 @@ function CleveRoids.CheckSpellCast(unit, spell) if not CleveRoids.spell_tracking[guid] then return false else - if spell == GetSpellRecField(CleveRoids.spell_tracking[guid].spell_id, "name") or (spell == "") then + if spell == C_Spell.GetSpellName(CleveRoids.spell_tracking[guid].spell_id) or (spell == "") then return true end return false diff --git a/Core.lua b/Core.lua index cf983b1..e19e60d 100644 --- a/Core.lua +++ b/Core.lua @@ -42,6 +42,9 @@ CleveRoids.spellIdCache = {} -- PERFORMANCE: Spell name construction cache CleveRoids.spellNameCache = {} +CleveRoids.playerGuid = UnitGUID('player') +CleveRoids.playerClass = UnitClassBase("player") + -- PERFORMANCE: Upvalues for frequently called global functions (avoid global lookups) local GetTime = GetTime local UnitExists = UnitExists @@ -4947,7 +4950,6 @@ function CleveRoids.Frame:PLAYER_LOGIN() if CleveRoids.disabled then return end _, CleveRoids.playerClass = UnitClass("player") - _, CleveRoids.playerGuid = UnitExists("player") CleveRoids.IndexSpells() CleveRoids.IndexPetSpells() CleveRoids.initializationTimer = GetTime() + 1.5 @@ -5036,7 +5038,7 @@ function CleveRoids.Frame:UNIT_CASTEVENT(caster,target,action,spell_id,cast_time -- Refresh the Judgement by updating the start time rec.start = GetTime() - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) local baseName = CleveRoids.StripRank(spellName) or "Unknown" if CleveRoids.debug then @@ -5072,7 +5074,7 @@ function CleveRoids.Frame:UNIT_CASTEVENT(caster,target,action,spell_id,cast_time -- Debug channel tracking if CleveRoids.ChannelTimeDebug then - local spellName = spell_id and GetSpellRecField and GetSpellRecField(spell_id, "name") or "Unknown" + local spellName = spell_id and C_Spell.GetSpellName(spell_id) or "Unknown" if string.find(spellName, "Arcane") then DEFAULT_CHAT_FRAME:AddMessage(string.format("|cff00ff00[UNIT_CASTEVENT]|r %s: %s (ID:%s) caster=%s player=%s", action, spellName, tostring(spell_id), tostring(caster), tostring(CleveRoids.playerGuid))) @@ -5145,8 +5147,8 @@ function CleveRoids.Frame:UNIT_CASTEVENT(caster,target,action,spell_id,cast_time if CleveRoids.currentSequence and caster == CleveRoids.playerGuid then local active = CleveRoids.GetCurrentSequenceAction(CleveRoids.currentSequence) - local name = GetSpellRecField(spell_id, "name") - local rank = GetSpellRecField(spell_id, "rank") + local name = C_Spell.GetSpellName(spell_id) + local rank = C_Spell.GetSpellSubtext(spell_id) local nameRank = (rank and rank ~= "") and (name .. "(" .. rank .. ")") or nil local isSeqSpell = active and active.action and ( active.action == name or @@ -5186,7 +5188,7 @@ function CleveRoids.Frame:SPELL_CAST_EVENT(success, spellId, castType, targetGui CleveRoids.CurrentSpell.type = "channeled" CleveRoids.CurrentSpell.castingSpellId = spellId - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName then CleveRoids.CurrentSpell.spellName = spellName end @@ -5212,8 +5214,8 @@ function CleveRoids.Frame:SPELL_CAST_EVENT(success, spellId, castType, targetGui if CleveRoids.currentSequence and success == 1 then local active = CleveRoids.GetCurrentSequenceAction(CleveRoids.currentSequence) if active and active.action then - local name = GetSpellRecField(spellId, "name") - local rank = GetSpellRecField(spellId, "rank") + local name = C_Spell.GetSpellName(spellId) + local rank = C_Spell.GetSpellSubtext(spellId) local nameRank = (rank and rank ~= "") and (name .. "(" .. rank .. ")") or nil local isSeqSpell = (active.action == name or (nameRank and active.action == nameRank)) @@ -5230,7 +5232,7 @@ function CleveRoids.Frame:SPELL_CAST_EVENT(success, spellId, castType, targetGui if CleveRoids.currentSequence and success == 0 then local active = CleveRoids.GetCurrentSequenceAction(CleveRoids.currentSequence) if active and active.action then - local name = GetSpellRecField(spellId, "name") + local name = C_Spell.GetSpellName(spellId) local isSeqSpell = (active.action == name) if isSeqSpell then CleveRoids.currentSequence.status = 1 -- Reset to retry @@ -5288,8 +5290,8 @@ function CleveRoids.Frame:SPELL_START_SELF(casterGuid, targetGuid, spellId, cast if CleveRoids.currentSequence and castTimeMs and castTimeMs > 0 then local active = CleveRoids.GetCurrentSequenceAction(CleveRoids.currentSequence) if active and active.action then - local name = GetSpellRecField(spellId, "name") - local rank = GetSpellRecField(spellId, "rank") + local name = C_Spell.GetSpellName(spellId) + local rank = C_Spell.GetSpellSubtext(spellId) local nameRank = (rank and rank ~= "") and (name .. "(" .. rank .. ")") or nil local isSeqSpell = (active.action == name or (nameRank and active.action == nameRank)) @@ -5326,7 +5328,7 @@ function CleveRoids.Frame:SPELL_FAILED_SELF(casterGuid, targetGuid, spellId, ... if CleveRoids.currentSequence then local active = CleveRoids.GetCurrentSequenceAction(CleveRoids.currentSequence) if active and active.action then - local name = GetSpellRecField(spellId, "name") + local name = C_Spell.GetSpellName(spellId) local isSeqSpell = name and (active.action == name) if isSeqSpell then CleveRoids.currentSequence.status = 1 -- Reset to retry @@ -5365,7 +5367,7 @@ function CleveRoids.Frame:SPELLCAST_CHANNEL_START() -- Update spell info if spellId then CleveRoids.CurrentSpell.castingSpellId = spellId - local spellName = GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName then CleveRoids.CurrentSpell.spellName = spellName end @@ -5445,7 +5447,7 @@ function CleveRoids.Frame:SPELLCAST_START() -- Update spell info if spellId then CleveRoids.CurrentSpell.castingSpellId = spellId - local spellName = GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName then CleveRoids.CurrentSpell.spellName = spellName end @@ -5896,7 +5898,7 @@ function CleveRoids.Frame:SPELL_QUEUE_EVENT() queueTime = GetTime() } if GetSpellRecField then - local name = GetSpellRecField(spellId, "name") + local name = C_Spell.GetSpellName(spellId) if name then CleveRoids.queuedSpell.spellName = name end @@ -5937,7 +5939,7 @@ function CleveRoids.Frame:SPELL_CAST_EVENT() timestamp = GetTime() } if GetSpellRecField then - local name = GetSpellRecField(spellId, "name") + local name = C_Spell.GetSpellName(spellId) if name then CleveRoids.lastCastSpell.spellName = name end @@ -5970,7 +5972,7 @@ function CleveRoids.Frame:SPELL_CAST_EVENT() if cp > 0 then CleveRoids.pendingCasts[spellId].comboPoints = cp if CleveRoids.debug then - local castSpellName = GetSpellRecField and GetSpellRecField(spellId, "name") or "Unknown" + local castSpellName = C_Spell.GetSpellName(spellId) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00ff88[SPELL_CAST_EVENT]|r Captured %d CP for %s (ID:%d)", cp, castSpellName, spellId) @@ -6234,7 +6236,7 @@ SlashCmdList["CLEVEROID"] = function(msg) CleveRoids_LearnedDurations = CleveRoids_LearnedDurations or {} CleveRoids_LearnedDurations[spellID] = CleveRoids_LearnedDurations[spellID] or {} CleveRoids_LearnedDurations[spellID][playerGUID] = duration - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" CleveRoids.Print("Set " .. spellName .. " (ID:" .. spellID .. ") duration to " .. duration .. "s") else CleveRoids.Print("Usage: /cleveroid learn - Manually set spell duration") @@ -6251,7 +6253,7 @@ SlashCmdList["CLEVEROID"] = function(msg) else local spellID = tonumber(val) if spellID and CleveRoids_LearnedDurations and CleveRoids_LearnedDurations[spellID] then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" CleveRoids_LearnedDurations[spellID] = nil CleveRoids.Print("Forgot " .. spellName .. " (ID:" .. spellID .. ") duration") elseif spellID then @@ -6437,7 +6439,7 @@ SlashCmdList["CLEVEROID"] = function(msg) CleveRoids.Print(schoolColor .. string.upper(school) .. "|r (" .. table.getn(spellIDs) .. " spells):") for _, spellID in ipairs(spellIDs) do - local spellName = GetSpellRecField and GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" CleveRoids.Print(" " .. spellName .. " (ID:" .. spellID .. ")") end end @@ -6480,7 +6482,7 @@ SlashCmdList["CLEVEROID"] = function(msg) CleveRoids.Print("No learned combo durations yet. Cast finishers and let them expire!") else for spellID, cpData in pairs(CleveRoids_ComboDurations) do - local spellName = GetSpellRecField(spellID, "name") or ("Spell " .. spellID) + local spellName = C_Spell.GetSpellName(spellID) or ("Spell " .. spellID) CleveRoids.Print(spellName .. " (ID:" .. spellID .. "):") for cp = 1, 5 do if cpData[cp] then @@ -6562,7 +6564,7 @@ SlashCmdList["CLEVEROID"] = function(msg) return end - local spellName = GetSpellRecField(spellID, "name") or ("Spell " .. spellID) + local spellName = C_Spell.GetSpellName(spellID) or ("Spell " .. spellID) local modifier = CleveRoids.talentModifiers and CleveRoids.talentModifiers[spellID] if not modifier then @@ -6638,7 +6640,7 @@ SlashCmdList["CLEVEROID"] = function(msg) for spellID, rec in pairs(lib.objects[guid]) do if rec and rec.start and rec.duration then local timeRemaining = rec.duration + rec.start - GetTime() - local spellName = GetSpellRecField and GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" local caster = rec.caster or "unknown" local stacks = rec.stacks or 0 if timeRemaining > 0 then @@ -6665,7 +6667,7 @@ SlashCmdList["CLEVEROID"] = function(msg) for i = 1, 16 do local texture, stacks, debuffType, spellID = UnitDebuff("target", i) if texture then - local spellName = GetSpellRecField and GetSpellRecField(spellID, "name") or "slot" .. i + local spellName = C_Spell.GetSpellName(spellID) or "slot" .. i CleveRoids.Print(string.format(" Slot %d: [%d] %s (stacks: %d)", i, spellID or 0, spellName, stacks or 0)) debuffCount = debuffCount + 1 @@ -6685,7 +6687,7 @@ SlashCmdList["CLEVEROID"] = function(msg) -- Check if this might be an overflow debuff by checking libdebuff durations local isDebuff = lib and lib.durations and lib.durations[spellID] if isDebuff then - local spellName = GetSpellRecField and GetSpellRecField(spellID, "name") or "slot" .. i + local spellName = C_Spell.GetSpellName(spellID) or "slot" .. i CleveRoids.Print(string.format(" Buff Slot %d (=Debuff %d): [%d] %s (stacks: %d) |cffff8800OVERFLOW|r", i, i + 16, spellID, spellName, stacks or 0)) overflowCount = overflowCount + 1 @@ -6726,7 +6728,7 @@ SlashCmdList["CLEVEROID"] = function(msg) -- Also check GetSpellRecField if GetSpellRecField then for id = 1, 30000 do - local name = GetSpellRecField(id, "name") + local name = C_Spell.GetSpellName(id) if name and string.lower(name) == string.lower(searchName) then local found = false for _, existingID in ipairs(foundIDs) do diff --git a/Extensions/CursiveCustomSpells.lua b/Extensions/CursiveCustomSpells.lua index bd9492a..bbc04fd 100644 --- a/Extensions/CursiveCustomSpells.lua +++ b/Extensions/CursiveCustomSpells.lua @@ -209,8 +209,8 @@ local function InjectCustomSpells() local count = 0 for spellID, data in pairs(CleveRoids.CustomCursiveSpells) do -- Get texture from GetSpellRecField + GetSpellIconTexture - local name = GetSpellRecField(spellID, "name") - local rank = GetSpellRecField(spellID, "rank") + local name = C_Spell.GetSpellName(spellID) + local rank = C_Spell.GetSpellSubtext(spellID) local texture = CleveRoids.libdebuff and CleveRoids.libdebuff:GetCachedIcon(spellID) if texture then -- Always update/add (in case Cursive reloaded and cleared them) @@ -524,8 +524,8 @@ CleveRoids.HandleConsoleCommand = function(msg) return end - local name = GetSpellRecField(spellID, "name") - local rank = GetSpellRecField(spellID, "rank") + local name = C_Spell.GetSpellName(spellID) + local rank = C_Spell.GetSpellSubtext(spellID) local texture = CleveRoids.libdebuff and CleveRoids.libdebuff:GetCachedIcon(spellID) if not name then DEFAULT_CHAT_FRAME:AddMessage("|cffff0000Error:|r Spell ID " .. spellID .. " not found.") diff --git a/Extensions/OverflowBuffFrame.lua b/Extensions/OverflowBuffFrame.lua index 709a71b..e97ac25 100644 --- a/Extensions/OverflowBuffFrame.lua +++ b/Extensions/OverflowBuffFrame.lua @@ -122,7 +122,7 @@ local function CreateIconButton(parent, index, iconTable) GameTooltip:SetOwner(btn, "ANCHOR_BOTTOMLEFT") local spellName if data.spellId then - spellName = GetSpellRecField and GetSpellRecField(data.spellId, "name") or ("Spell " .. data.spellId) + spellName = C_Spell.GetSpellName(data.spellId) or ("Spell " .. data.spellId) else spellName = data.displayName end @@ -649,7 +649,7 @@ local function InjectTestTargetData() for i = 1, table.getn(TEST_TARGET_SPELL_IDS) do local spellId = TEST_TARGET_SPELL_IDS[i] local dur = targetDurations[i] or 60 - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or ("TestSpell" .. spellId) + local spellName = C_Spell.GetSpellName(spellId) or ("TestSpell" .. spellId) if not CleveRoids.AllCasterAuraTracking[targetGuid][spellName] then CleveRoids.AllCasterAuraTracking[targetGuid][spellName] = {} end diff --git a/Extensions/Tooltip/Generic.lua b/Extensions/Tooltip/Generic.lua index 7b70f0e..abb6950 100644 --- a/Extensions/Tooltip/Generic.lua +++ b/Extensions/Tooltip/Generic.lua @@ -378,9 +378,9 @@ function CleveRoids.GetActionButtonInfo(slot) if not actionType then return end if actionType == "spell" and id then - local rank = GetSpellRecField(id, "rank") + local rank = C_Spell.GetSpellSubtext(id) if rank == "" then rank = nil end - return "SPELL", id, GetSpellRecField(id, "name"), rank + return "SPELL", id, C_Spell.GetSpellName(id), rank elseif actionType == "item" and id then local item = CleveRoids.GetItem(id) return "ITEM", id, (item and item.name) diff --git a/Utility.lua b/Utility.lua index eb08f7f..5c49224 100644 --- a/Utility.lua +++ b/Utility.lua @@ -248,7 +248,7 @@ function CleveRoids.GetChannelDurationFromTooltipByID(spellID) -- Fallback: resolve name and scan tooltip if not GetSpellRecField then return nil end - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if not spellName then return nil end return CleveRoids.GetSpellDurationFromTooltip(spellName) end @@ -2018,8 +2018,8 @@ end -- Returns rank number (1, 2, 3, etc.) or 0 if no rank found function lib:GetSpellRank(spellID) if not spellID then return 0 end - local name = GetSpellRecField(spellID, "name") - local rankStr = GetSpellRecField(spellID, "rank") + local name = C_Spell.GetSpellName(spellID) + local rankStr = C_Spell.GetSpellSubtext(spellID) if not rankStr or rankStr == "" then return 0 end -- Handle different rank formats @@ -2040,7 +2040,7 @@ end -- Helper function to get spell base name (without rank) function lib:GetSpellBaseName(spellID) if not spellID then return nil end - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) if not name then return nil end -- Remove rank suffix @@ -2179,7 +2179,7 @@ function lib:GetDuration(spellID, casterGUID, comboPoints) local comboDuration = CleveRoids_ComboDurations[spellID][comboPoints] if comboDuration and comboDuration > 0 then if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffccccff[DEBUG GetDuration]|r %s (ID:%d) CP:%d -> %ds (from learned combo)", spellName, spellID, comboPoints, comboDuration) @@ -2194,7 +2194,7 @@ function lib:GetDuration(spellID, casterGUID, comboPoints) local learned = CleveRoids_LearnedDurations[spellID][casterGUID] if learned and learned > 0 then if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffccccff[DEBUG GetDuration]|r %s (ID:%d) -> %ds (from learned caster)", spellName, spellID, learned) @@ -2207,7 +2207,7 @@ function lib:GetDuration(spellID, casterGUID, comboPoints) -- Fall back to static database local staticDur = self.durations[spellID] or 0 if CleveRoids.debug and staticDur > 0 then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffccccff[DEBUG GetDuration]|r %s (ID:%d) -> %ds (from static DB)", spellName, spellID, staticDur) @@ -2235,8 +2235,8 @@ function lib:AddEffect(guid, unitName, spellID, duration, stacks, caster) for trackedID, rec in pairs(lib.objects[guid]) do if lib.curseSpellIDs[trackedID] and trackedID ~= spellID then if CleveRoids.debug then - local oldName = GetSpellRecField(trackedID, "name") or "Unknown" - local newName = GetSpellRecField(spellID, "name") or "Unknown" + local oldName = C_Spell.GetSpellName(trackedID) or "Unknown" + local newName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffff8800[Curse Replace]|r %s replaced by %s on %s", oldName, newName, unitName or "target")) @@ -2260,9 +2260,9 @@ function lib:AddEffect(guid, unitName, spellID, duration, stacks, caster) -- SPELL_GO/AURA_CAST/DEBUFF_ADDED handlers. Without pfUI, we populate it here -- so lib.ownDebuffs has consistent data for downrank checks and debuff queries. if caster == "player" and not lib.hasPfUIEnhanced then - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName then - local spellRankStr = GetSpellRecField(spellID, "rank") + local spellRankStr = C_Spell.GetSpellSubtext(spellID) local rankNum = spellRankStr and tonumber((string.gsub(spellRankStr, "Rank ", ""))) or 0 lib.ownDebuffs[guid] = lib.ownDebuffs[guid] or {} @@ -2297,7 +2297,7 @@ function lib:AddEffect(guid, unitName, spellID, duration, stacks, caster) -- pfUI 7.6+ handles all duration tracking internally via GetUnitField if pfUI and pfUI.api and pfUI.api.libdebuff and unitName and not CleveRoids.hasPfUI76 then local pflib = pfUI.api.libdebuff - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName and pflib.AddEffect then -- Get target level for pfUI's tracking structure @@ -2326,7 +2326,7 @@ function lib:AddEffect(guid, unitName, spellID, duration, stacks, caster) end if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" CleveRoids.DebugChanged("addeffect_" .. spellID .. "_" .. tostring(guid), string.format("|cff00ffff[AddEffect]|r %s (ID:%d) %ds on %s, caster:%s", spellName, spellID, duration, unitName or "Unknown", caster or "nil")) @@ -2358,7 +2358,7 @@ function lib:UnitDebuff(unit, id, filterCaster) if not texture or not spellID then return nil end - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) local duration, timeleft, caster = nil, -1, nil local rec = lib.objects[guid] and lib.objects[guid][spellID] @@ -2401,7 +2401,7 @@ function lib:UnitBuff(unit, id, filterCaster) if not texture or not spellID then return nil end - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) local duration, timeleft, caster = nil, -1, nil local rec = lib.objects[guid] and lib.objects[guid][spellID] @@ -2477,7 +2477,7 @@ function lib:FindPlayerDebuff(unit, spellID) if not texture then return nil end - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) return name, nil, texture, stacks, nil, rec.duration, remaining, rec.caster end @@ -2515,7 +2515,7 @@ function lib:FindPlayerBuff(unit, spellID) if not texture then return nil end - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) return name, nil, texture, stacks, nil, rec.duration, remaining, rec.caster end @@ -2556,7 +2556,7 @@ local function SeedUnit(unit) -- PFUI INTEGRATION: Inject refreshed timer into pfUI (pre-7.6 only) if pfUI and pfUI.api and pfUI.api.libdebuff and unitName and not CleveRoids.hasPfUI76 then local pflib = pfUI.api.libdebuff - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName and pflib.AddEffect then local targetLevel = UnitLevel(unit) or 1 local baseName = CleveRoids.StripRank(spellName) @@ -2568,7 +2568,7 @@ local function SeedUnit(unit) end if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[DEBUG SeedUnit Debuff]|r %s (ID:%d) stack increased %d->%d, timer RESET to %ds (refresh detected)", spellName, spellID, oldStacks, stacks or 0, duration) @@ -2577,7 +2577,7 @@ local function SeedUnit(unit) else -- Stacks decreased (shouldn't happen normally) - just update stacks, preserve timer if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[DEBUG SeedUnit Debuff]|r %s (ID:%d) updated stacks to %d (timer preserved)", spellName, spellID, stacks or 0) @@ -2598,7 +2598,7 @@ local function SeedUnit(unit) if CleveRoids_ComboDurations[spellID][cp] then duration = CleveRoids_ComboDurations[spellID][cp] if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[DEBUG SeedUnit Debuff]|r %s (ID:%d) using learned %dCP duration:%ds", spellName, spellID, cp, duration) @@ -2645,7 +2645,7 @@ local function SeedUnit(unit) -- PFUI INTEGRATION: Inject refreshed timer into pfUI (pre-7.6 only) if pfUI and pfUI.api and pfUI.api.libdebuff and unitName and not CleveRoids.hasPfUI76 then local pflib = pfUI.api.libdebuff - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName and pflib.AddEffect then local targetLevel = UnitLevel(unit) or 1 local baseName = CleveRoids.StripRank(spellName) @@ -2657,7 +2657,7 @@ local function SeedUnit(unit) end if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[DEBUG SeedUnit Buff]|r %s (ID:%d) stack increased %d->%d, timer RESET to %ds (refresh detected)", spellName, spellID, oldStacks, stacks or 0, duration) @@ -2666,7 +2666,7 @@ local function SeedUnit(unit) else -- Stacks decreased (shouldn't happen normally) - just update stacks, preserve timer if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[DEBUG SeedUnit Buff]|r %s (ID:%d) updated stacks to %d (timer preserved)", spellName, spellID, stacks or 0) @@ -2684,7 +2684,7 @@ local function SeedUnit(unit) if CleveRoids_ComboDurations[spellID][cp] then duration = CleveRoids_ComboDurations[spellID][cp] if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[DEBUG SeedUnit Buff]|r %s (ID:%d) using learned %dCP duration:%ds", spellName, spellID, cp, duration) @@ -2917,7 +2917,7 @@ function lib.ApplyCarnageRefresh(targetGUID, targetName, biteSpellID) -- pfUI will pick up the new duration through our GetDuration/UnitDebuff hooks if not CleveRoids.hasPfUI76 and pfUI and pfUI.api and pfUI.api.libdebuff then local pflib = pfUI.api.libdebuff - local ripSpellName = GetSpellRecField(ripSpellID, "name") + local ripSpellName = C_Spell.GetSpellName(ripSpellID) local baseName = CleveRoids.StripRank(ripSpellName) or "Rip" if CleveRoids.debug then @@ -3030,7 +3030,7 @@ function lib.ApplyCarnageRefresh(targetGUID, targetName, biteSpellID) -- pfUI will pick up the new duration through our GetDuration/UnitDebuff hooks if not CleveRoids.hasPfUI76 and pfUI and pfUI.api and pfUI.api.libdebuff then local pflib = pfUI.api.libdebuff - local rakeSpellName = GetSpellRecField(rakeSpellID, "name") + local rakeSpellName = C_Spell.GetSpellName(rakeSpellID) local baseName = CleveRoids.StripRank(rakeSpellName) or "Rake" if CleveRoids.debug then @@ -3182,7 +3182,7 @@ local function HasImmunityGrantingBuff(unit) if not texture then break end if spellID and INVULNERABILITY_SPELL_IDS[spellID] then - local buffName = GetSpellRecField(spellID, "name") or ("SpellID:" .. spellID) + local buffName = C_Spell.GetSpellName(spellID) or ("SpellID:" .. spellID) return buffName end end @@ -3297,7 +3297,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() local _, _, _, debuffSpellID = _UnitDebuff("target", slot) if not debuffSpellID then break end - local debuffName = _GetSpellRecField(debuffSpellID, "name") + local debuffName = C_Spell.GetSpellName(debuffSpellID) -- Check if this is a judgement debuff (name starts with "Judgement") if debuffName and _string_find(debuffName, "^Judgement") then -- Found a judgement debuff! Store it for refresh tracking @@ -3372,7 +3372,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if pending.spellGoMissed then debuffVerified = false if debug then - local spellNameDbg = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDbg = C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffff6600[Personal Miss]|r %s (ID:%d) missed on %s - SPELL_GO confirmed miss", spellNameDbg, pending.spellID, pending.targetName or "Unknown") @@ -3382,7 +3382,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- DEBUG: Log verification attempt for bleed spells if debug and isBleedSpell and not pending.spellGoMissed then - local spellNameDbg = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDbg = C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00aaff[Bleed Verify Start]|r %s (ID:%d) on %s - hasSuperwow:%s, targetGUID:%s", spellNameDbg, pending.spellID, pending.targetName or "Unknown", @@ -3403,7 +3403,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if pending.verifiedByAffliction then -- We confirmed bleed landed via combat log before target died if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Bleed" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Bleed" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00ff00[Bleed Verified]|r %s on %s confirmed via 'afflicted by' (target now dead)", spellNameDebug, pending.targetName or "Unknown") @@ -3422,7 +3422,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- Set debuffVerified=false so we don't add to tracking or remove existing immunity debuffVerified = false if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Bleed" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Bleed" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaaa[Bleed Skip]|r %s on %s - target died too quickly (%.2fs), can't determine immunity", spellNameDebug, pending.targetName or "Unknown", timeSinceCast) @@ -3436,7 +3436,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- is not proof of immunity. SPELL_MISS_SELF handles true immunity detection. debuffVerified = false if debug then - local spellNameForImmunity = _GetSpellRecField(pending.spellID, "name") or "Bleed" + local spellNameForImmunity = C_Spell.GetSpellName(pending.spellID) or "Bleed" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaaa[Bleed Inconclusive]|r %s on %s - target died without 'afflicted by' (%.2fs), not recording immunity", spellNameForImmunity, pending.targetName or "Unknown", timeSinceCast) @@ -3449,7 +3449,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- This is similar to one-shot kills: inconclusive result, don't record immunity debuffVerified = false if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Bleed" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Bleed" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaaa[Bleed Skip]|r %s on %s - target no longer exists (despawned), can't determine immunity", spellNameDebug, pending.targetName or "Unknown") @@ -3502,7 +3502,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- Record as BLEED immunity directly (bypass split damage override in RecordImmunity) -- RecordImmunity would record Rake/Pounce as "physical" (initial school), -- but we specifically detected the BLEED debuff didn't land - local spellNameForImmunity = _GetSpellRecField(pending.spellID, "name") or "Bleed" + local spellNameForImmunity = C_Spell.GetSpellName(pending.spellID) or "Bleed" if not CleveRoids_ImmunityData["bleed"] then CleveRoids_ImmunityData["bleed"] = {} @@ -3516,7 +3516,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() else CleveRoids.DebugChanged("bleed_cap_" .. _tostring(pending.targetName) .. "_" .. pending.spellID, _string_format("|cffff6600[Debuff Cap]|r %s not found on %s - likely pushed off (%d debuffs on target)", - _GetSpellRecField(pending.spellID, "name") or "Bleed", pending.targetName or "Unknown", totalDebuffs)) + C_Spell.GetSpellName(pending.spellID) or "Bleed", pending.targetName or "Unknown", totalDebuffs)) end end end @@ -3533,11 +3533,11 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- with time remaining, the lower rank DoT didn't apply local downrankBlocked = false if lib.ownDebuffs and pending.targetGUID then - local spellName = _GetSpellRecField(pending.spellID, "name") + local spellName = C_Spell.GetSpellName(pending.spellID) if spellName then local existing = lib.ownDebuffs[pending.targetGUID] and lib.ownDebuffs[pending.targetGUID][spellName] if existing and existing.rank and existing.spellId and existing.spellId ~= pending.spellID then - local pendingRankStr = _GetSpellRecField(pending.spellID, "rank") + local pendingRankStr = C_Spell.GetSpellSubtext(pending.spellID) local pendingRank = pendingRankStr and tonumber((string.gsub(pendingRankStr, "Rank ", ""))) or 0 if pendingRank > 0 and existing.rank > pendingRank then local existingTimeleft = (existing.startTime + existing.duration) - GetTime() @@ -3587,7 +3587,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if _IsUnitDead(nonBleedVerifyUnit) then -- Target died - can't verify, assume landed if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Debuff" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Debuff" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaaa[NonBleed Skip]|r %s on %s - target dead, assuming landed", spellNameDebug, pending.targetName or "Unknown") @@ -3597,7 +3597,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- Target despawned - inconclusive, don't add to tracking debuffVerified = false if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Debuff" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Debuff" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaaa[NonBleed Skip]|r %s on %s - target despawned, can't verify", spellNameDebug, pending.targetName or "Unknown") @@ -3647,12 +3647,12 @@ delayedTrackingFrame:SetScript("OnUpdate", function() CleveRoids.RecordImmunity(pending.targetName, nil, nil, pending.spellID) CleveRoids.DebugChanged("nonbleed_immune_" .. _tostring(pending.targetName) .. "_" .. pending.spellID, _string_format("|cffff6600[NonBleed Immunity]|r %s is immune to %s - only %d debuffs on target", - pending.targetName, _GetSpellRecField(pending.spellID, "name") or "Debuff", totalDebuffs)) + pending.targetName, C_Spell.GetSpellName(pending.spellID) or "Debuff", totalDebuffs)) end else CleveRoids.DebugChanged("nonbleed_cap_" .. _tostring(pending.targetName) .. "_" .. pending.spellID, _string_format("|cffff6600[NonBleed Debuff Cap]|r %s not found on %s - likely pushed off (%d debuffs)", - _GetSpellRecField(pending.spellID, "name") or "Debuff", pending.targetName or "Unknown", totalDebuffs)) + C_Spell.GetSpellName(pending.spellID) or "Debuff", pending.targetName or "Unknown", totalDebuffs)) end end end @@ -3664,7 +3664,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if debuffVerified then -- Debug: Show what we're about to add to tracking if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Unknown" local guidStr = _string_sub(_tostring(pending.targetGUID or "nil"), 1, 20) DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff88ff88[Pending Process]|r Adding %s (ID:%d, %ds) GUID:%s", @@ -3696,7 +3696,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() end if debug then - local spellName = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00ff00[Delayed Track]|r Applied %s (ID:%d) to tracking on %s", spellName, pending.spellID, pending.targetName or "Unknown") @@ -3802,7 +3802,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() totalDebuffs = totalDebuffs + 1 -- Debug: Show each debuff found during CC verification if debug then - local debuffName = _GetSpellRecField(debuffSpellID, "name") or "Unknown" + local debuffName = C_Spell.GetSpellName(debuffSpellID) or "Unknown" local mechanic = CleveRoids.GetSpellMechanic and CleveRoids.GetSpellMechanic(debuffSpellID) or 0 DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaaa[CC Scan]|r Slot %d: %s (ID:%d, Mech:%d) - Looking for %s (ID:%d)", @@ -3910,7 +3910,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() local isSplitCCSpell = SPLIT_CC_SPELLS[pending.spellID] or pending.spellGoHit if isSplitCCSpell then if debug then - local spellNameDebug = pending.spellName or (_GetSpellRecField(pending.spellID, "name") or "Unknown") + local spellNameDebug = pending.spellName or (C_Spell.GetSpellName(pending.spellID) or "Unknown") DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00aaff[Split CC Skip]|r %s CC resisted on %s - skipping CC immunity recording", spellNameDebug, resolvedTargetName or "Unknown") @@ -4018,7 +4018,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() local elapsed = currentTime - pending.timestamp if debug then - local spellName = pending.spellID and _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellName = pending.spellID and C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00aaff[Shared Check]|r %s elapsed:%.2fs (need 0.2s)", spellName, elapsed) ) @@ -4027,7 +4027,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- Drop stale entries (>2s) without recording immunity - inconclusive due to severe lag if elapsed > 2.0 then if debug then - local spellNameDebug = pending.spellID and _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = pending.spellID and C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffff6600[Shared Stale]|r Dropping stale shared entry for %s on %s (%.1fs old)", spellNameDebug, pending.targetName or "Unknown", elapsed) @@ -4042,7 +4042,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if pending.spellGoHit then debuffVerified = true if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Shared Debuff" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Shared Debuff" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00ff00[Shared Verified via SPELL_GO]|r %s landed on %s - skipping debuff scan", spellNameDebug, pending.targetName or "Unknown") @@ -4054,7 +4054,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if pending.spellGoMissed then -- Leave debuffVerified=false → falls through to immunity recording if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Shared Debuff" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Shared Debuff" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffff6600[Shared Miss]|r %s missed on %s - SPELL_GO confirmed miss", spellNameDebug, pending.targetName or "Unknown") @@ -4071,7 +4071,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() -- Target died - can't verify immunity, assume debuff landed debuffVerified = true if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Shared Debuff" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Shared Debuff" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffff6600[Shared Verify Skip]|r Target %s is dead - skipping immunity check for %s", pending.targetName or "Unknown", spellNameDebug) @@ -4101,7 +4101,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() if debuffVerified then -- Debuff landed - add to tracking if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff88ff88[Shared Verified]|r %s (ID:%d) verified on %s", spellNameDebug, pending.spellID, pending.targetName or "Unknown") @@ -4143,7 +4143,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() end elseif isSplitCCSpell then if debug then - local spellNameDebug = _GetSpellRecField(pending.castSpellID or pending.spellID, "name") or "Unknown" + local spellNameDebug = C_Spell.GetSpellName(pending.castSpellID or pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cff00aaff[Split CC Skip]|r %s CC resisted on %s - skipping immunity recording (physical damage landed)", spellNameDebug, pending.targetName or "Unknown") @@ -4172,7 +4172,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() CleveRoids_ImmunityData[recordSchool][pending.targetName] = true if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffff6600[Shared Immunity]|r %s is immune to %s (%s) - only %d debuffs on target", pending.targetName, recordSchool, spellNameDebug, totalDebuffs) @@ -4182,7 +4182,7 @@ delayedTrackingFrame:SetScript("OnUpdate", function() else -- Many debuffs = likely pushed off at debuff cap if debug then - local spellNameDebug = _GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffff6600[Shared Debuff Cap]|r %s not found on %s - likely pushed off (%d debuffs)", spellNameDebug, pending.targetName or "Unknown", totalDebuffs) @@ -4354,7 +4354,7 @@ ev:SetScript("OnEvent", function() if currentCP and currentCP > 0 then CleveRoids.lastComboPoints = currentCP if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaaaff[UNIT_CASTEVENT START]|r Captured %d CP before casting %s (ID:%d)", currentCP, spellName, spellID) @@ -4489,7 +4489,7 @@ ev:SetScript("OnEvent", function() -- Debug: Show what GetSpellCCType returns for this spell if CleveRoids.debug then - local spellNameDebug = GetSpellRecField(spellID, "name") or "Unknown" + local spellNameDebug = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaaaaa[CC Check]|r %s (ID:%d) → ccType: %s", spellNameDebug, spellID, ccType or "nil") @@ -4507,7 +4507,7 @@ ev:SetScript("OnEvent", function() if not isHiddenCC and _G.IsAuraHidden then isHiddenCC = (_G.IsAuraHidden(spellID) == 1) end - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) -- Get target name from cache or current target local ccTargetName = lib.guidToName[targetGUID] if not ccTargetName then @@ -4561,7 +4561,7 @@ ev:SetScript("OnEvent", function() -- DEBUG: Show what duration we calculated if CleveRoids.debug and duration then - local spellName = GetSpellRecField(trackingSpellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(trackingSpellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffff00ff[DEBUG CAST]|r %s (ID:%d) CP:%s duration:%ds", spellName, trackingSpellID, tostring(comboPoints or "nil"), duration) @@ -4591,7 +4591,7 @@ ev:SetScript("OnEvent", function() -- For combo spells, populate name-based tracking for pfUI compatibility if comboPoints and comboPoints > 0 then - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName and CleveRoids.ComboPointTracking then -- Remove rank from spell name to match pfUI's format local baseName = CleveRoids.StripRank(spellName) @@ -4646,7 +4646,7 @@ ev:SetScript("OnEvent", function() -- Check by ID (known judgement debuffs) OR by name (Turtle WoW custom cast spell IDs) local isJudgementCast = lib.judgementSpells[spellID] if not isJudgementCast and CleveRoids.playerClass == "PALADIN" then - local castName = _GetSpellRecField(spellID, "name") + local castName = C_Spell.GetSpellName(spellID) isJudgementCast = castName and _string_find(castName, "^Judgement") end if CleveRoids.playerClass == "PALADIN" and isJudgementCast then @@ -4659,7 +4659,7 @@ ev:SetScript("OnEvent", function() end if CleveRoids.debug then - local spellName = GetSpellRecField(trackingSpellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(trackingSpellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[Pending Track]|r Scheduled %s (ID:%d) for tracking on %s (will apply if hit)", spellName, trackingSpellID, targetName or "Unknown") @@ -4678,7 +4678,7 @@ ev:SetScript("OnEvent", function() }) if CleveRoids.debug then - local spellName = GetSpellRecField(rankCheck.preserve, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(rankCheck.preserve) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[Pending Track]|r Scheduled rank preserve for %s (ID:%d, %.1fs remaining) on %s", spellName, rankCheck.preserve, rankCheck.timeRemaining, targetName or "Unknown") @@ -4732,7 +4732,7 @@ ev:SetScript("OnEvent", function() -- Determine spell school for immunity tracking -- GetSpellSchool is defined later in file, use CleveRoids wrapper if available local spellSchool = nil - local spellNameForSchool = GetSpellRecField(spellID, "name") + local spellNameForSchool = C_Spell.GetSpellName(spellID) if CleveRoids.GetSpellSchool then spellSchool = CleveRoids.GetSpellSchool(spellNameForSchool, spellID) end @@ -4762,7 +4762,7 @@ ev:SetScript("OnEvent", function() lib:AddEffect(targetGUID, targetName, trackingSpellID, trackingDuration, newStacks, "player") if CleveRoids.debug then - local spellName = GetSpellRecField(trackingSpellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(trackingSpellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00ff00[Shared Refresh]|r %s (ID:%d) on %s - timer reset to %ds (stacks:%d)", spellName, trackingSpellID, targetName or "Unknown", trackingDuration, newStacks) @@ -4783,7 +4783,7 @@ ev:SetScript("OnEvent", function() }) if CleveRoids.debug then - local spellName = GetSpellRecField(trackingSpellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(trackingSpellID) or "Unknown" local queueLen = table.getn(lib.pendingSharedDebuffs) local firstItem = lib.pendingSharedDebuffs[1] DEFAULT_CHAT_FRAME:AddMessage( @@ -4955,7 +4955,7 @@ ev:SetScript("OnEvent", function() lib:AddEffect(targetGUID, targetName, spellID, duration, newStacks, casterGUID) if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" local casterName = lib.guidToName[casterGUID] or "Other Player" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00aaff[Other Cast]|r %s cast %s (ID:%d) on %s - timer reset to %ds", @@ -5000,7 +5000,7 @@ ev:SetScript("OnEvent", function() if currentCP and currentCP > 0 then CleveRoids.lastComboPoints = currentCP if CleveRoids.debug then - local spellName = _GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( _string_format("|cffaaaaff[SPELL_START_SELF]|r Captured %d CP before casting %s (ID:%d)", currentCP, spellName, spellID) @@ -5044,7 +5044,7 @@ ev:SetScript("OnEvent", function() if not casterGuid or not spellId then return end - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) local icon = lib:GetCachedIcon(spellId) local now = GetTime() @@ -5126,7 +5126,7 @@ ev:SetScript("OnEvent", function() if not spellId or not targetGuid then return end targetGuid = CleveRoids.NormalizeGUID(targetGuid) - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if not spellName then return end local playerGUID = CleveRoids.GetGUID("player") @@ -5467,7 +5467,7 @@ ev:SetScript("OnEvent", function() -- Judgement scan for Paladins local isJudgementCast = lib.judgementSpells[spellId] if not isJudgementCast and CleveRoids.playerClass == "PALADIN" then - local castName = GetSpellRecField(spellId, "name") + local castName = C_Spell.GetSpellName(spellId) isJudgementCast = castName and string.find(castName, "^Judgement") end if CleveRoids.playerClass == "PALADIN" and isJudgementCast then @@ -5480,7 +5480,7 @@ ev:SetScript("OnEvent", function() end if CleveRoids.debug then - local trackingName = GetSpellRecField(trackingSpellID, "name") or "Unknown" + local trackingName = C_Spell.GetSpellName(trackingSpellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[SPELL_GO Pending]|r Scheduled %s (ID:%d) for tracking on %s (confirmed hit)", trackingName, trackingSpellID, targetName) @@ -5499,7 +5499,7 @@ ev:SetScript("OnEvent", function() }) if CleveRoids.debug then - local preserveName = GetSpellRecField(rankCheck.preserve, "name") or "Unknown" + local preserveName = C_Spell.GetSpellName(rankCheck.preserve) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffaaff00[SPELL_GO Pending]|r Scheduled rank preserve for %s (ID:%d, %.1fs remaining) on %s", preserveName, rankCheck.preserve, rankCheck.timeRemaining, targetName) @@ -5585,8 +5585,8 @@ ev:SetScript("OnEvent", function() if not spellId or not targetGuid then return end targetGuid = CleveRoids.NormalizeGUID(targetGuid) - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") - local spellRankStr = GetSpellRecField and GetSpellRecField(spellId, "rank") + local spellName = C_Spell.GetSpellName(spellId) + local spellRankStr = C_Spell.GetSpellSubtext(spellId) local texture = lib:GetCachedIcon(spellId) if not spellName then return end @@ -5726,7 +5726,7 @@ ev:SetScript("OnEvent", function() if not guid or not slot or not spellId then return end guid = CleveRoids.NormalizeGUID(guid) - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if not spellName then return end local playerGUID = CleveRoids.GetGUID("player") @@ -5795,7 +5795,7 @@ ev:SetScript("OnEvent", function() if not guid or not slot then return end guid = CleveRoids.NormalizeGUID(guid) - local spellName = spellId and GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = spellId and C_Spell.GetSpellName(spellId) -- v2.32+: state == 2 means stack decrease - update stacks, don't remove if state == 2 and stacks and stacks > 0 then @@ -5854,7 +5854,7 @@ ev:SetScript("OnEvent", function() -- Consume pending AURA_CAST data for this buff local pending = lib.pendingBuffCasts[guid] and lib.pendingBuffCasts[guid][spellId] if pending then - local spellName = pending.spellName or (GetSpellRecField and GetSpellRecField(spellId, "name")) + local spellName = pending.spellName or (C_Spell.GetSpellName(spellId)) if spellName then local casterGuid = pending.casterGuid local duration = pending.duration @@ -5893,7 +5893,7 @@ ev:SetScript("OnEvent", function() if not spellId then return end if state == 2 then return end -- Stack decrease only, not full removal - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) local playerGuid = CleveRoids.GetGUID("player") if spellName and playerGuid then @@ -5934,7 +5934,7 @@ ev:SetScript("OnEvent", function() if not guid or not spellId then return end if state == 2 then return end -- Stack decrease only, not full removal - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName then if lib.allBuffAuras[guid] then lib.allBuffAuras[guid][spellName] = nil @@ -6106,7 +6106,7 @@ evLearn:SetScript("OnEvent", function() local isFerociousBite = false if CleveRoids.FerociousBiteSpellIDs then for biteSpellID, _ in pairs(CleveRoids.FerociousBiteSpellIDs) do - local biteName = GetSpellRecField(biteSpellID, "name") + local biteName = C_Spell.GetSpellName(biteSpellID) if biteName then biteName = CleveRoids.StripRank(biteName) local messageSpellName = CleveRoids.StripRank(spellName) @@ -6142,8 +6142,8 @@ evLearn:SetScript("OnEvent", function() for i, pending in ipairs(lib.pendingPersonalDebuffs) do -- Check both the triggered spell name AND the original cast spell name -- (e.g., "Pounce Bleed" is triggered by "Pounce", but combat log says "Pounce was dodged") - local pendingSpellName = GetSpellRecField(pending.spellID, "name") - local castSpellName = pending.castSpellID and GetSpellRecField(pending.castSpellID, "name") + local pendingSpellName = C_Spell.GetSpellName(pending.spellID) + local castSpellName = pending.castSpellID and C_Spell.GetSpellName(pending.castSpellID) local matchesTriggered = false local matchesCast = false @@ -6191,7 +6191,7 @@ evLearn:SetScript("OnEvent", function() local toRemove = {} for i, pending in ipairs(lib.pendingCCDebuffs) do - local pendingSpellName = GetSpellRecField(pending.spellID, "name") + local pendingSpellName = C_Spell.GetSpellName(pending.spellID) if pendingSpellName then pendingSpellName = CleveRoids.StripRank(pendingSpellName) if lower(pendingSpellName) == lower(messageSpellName) then @@ -6225,8 +6225,8 @@ evLearn:SetScript("OnEvent", function() for i, pending in ipairs(lib.pendingSharedDebuffs) do -- Check both the tracking spell name AND the original cast spell name - local pendingSpellName = GetSpellRecField(pending.spellID, "name") - local castSpellName = pending.castSpellID and GetSpellRecField(pending.castSpellID, "name") + local pendingSpellName = C_Spell.GetSpellName(pending.spellID) + local castSpellName = pending.castSpellID and C_Spell.GetSpellName(pending.castSpellID) local matchesTracking = false local matchesCast = false @@ -6273,7 +6273,7 @@ evLearn:SetScript("OnEvent", function() local castSpellID = lib.lastPlayerCast.spellID -- Get the spell name from the cast (strip rank) - local castSpellName = GetSpellRecField(castSpellID, "name") + local castSpellName = C_Spell.GetSpellName(castSpellID) if castSpellName then castSpellName = CleveRoids.StripRank(castSpellName) @@ -6299,7 +6299,7 @@ evLearn:SetScript("OnEvent", function() local matchingSpellIDs = {} if lib.personalDebuffs then for sid, _ in pairs(lib.personalDebuffs) do - local name = GetSpellRecField(sid, "name") + local name = C_Spell.GetSpellName(sid) if name then name = CleveRoids.StripRank(name) if name == castSpellName then @@ -6310,7 +6310,7 @@ evLearn:SetScript("OnEvent", function() end if lib.sharedDebuffs then for sid, _ in pairs(lib.sharedDebuffs) do - local name = GetSpellRecField(sid, "name") + local name = C_Spell.GetSpellName(sid) if name then name = CleveRoids.StripRank(name) if name == castSpellName then @@ -6386,7 +6386,7 @@ evLearn:SetScript("OnEvent", function() local targetName = lib.guidToName[targetGUID] if not CleveRoids.hasPfUI76 and pfUI and pfUI.api and pfUI.api.libdebuff and targetName then local pflib = pfUI.api.libdebuff - local spellName = GetSpellRecField(flameShockID, "name") + local spellName = C_Spell.GetSpellName(flameShockID) if spellName and pflib.AddEffect then local baseName = CleveRoids.StripRank(spellName) local targetLevel = UnitLevel(targetGUID) or UnitLevel("target") or 1 @@ -6553,7 +6553,7 @@ evJudgement:SetScript("OnEvent", function() rec.start = GetTime() if CleveRoids.debug then - local spellName = GetSpellRecField(spellID, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00ffaa[Judgement Refresh]|r Refreshed %s (ID:%d) on melee hit - new duration: %ds", spellName, spellID, rec.duration) @@ -6564,7 +6564,7 @@ evJudgement:SetScript("OnEvent", function() if not CleveRoids.hasPfUI76 and pfUI and pfUI.api and pfUI.api.libdebuff then local targetName = lib.guidToName[targetGUID] or UnitName("target") local targetLevel = UnitLevel("target") or 0 - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if spellName and targetName then local effectName = CleveRoids.StripRank(spellName) @@ -6726,7 +6726,7 @@ function CleveRoids.ApplyTalentModifier(spellID, baseDuration) local talentName = modifier.talent or ("Tab " .. modifier.tab .. " ID " .. modifier.id) DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffff00ff[Talent Modifier]|r %s (ID:%d): %ds -> %ds (talent: %s rank %d, %s)", - GetSpellRecField(spellID, "name") or "Unknown", spellID, baseDuration, modifiedDuration, + C_Spell.GetSpellName(spellID) or "Unknown", spellID, baseDuration, modifiedDuration, talentName, talentRank, lookupMethod) ) end @@ -6757,7 +6757,7 @@ function CleveRoids.DiagnoseTalentModifier(spellID, baseDuration) DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00=== Talent Modifier Diagnostic ===|r") -- Check if spellID is valid - local spellName = GetSpellRecField(spellID, "name") + local spellName = C_Spell.GetSpellName(spellID) if not spellName then DEFAULT_CHAT_FRAME:AddMessage("|cffff0000ERROR: Invalid spell ID " .. tostring(spellID) .. "|r") return @@ -6922,7 +6922,7 @@ function CleveRoids.ApplyEquipmentModifier(spellID, baseDuration) DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffff00ff[Equipment Modifier]|r %s (ID:%d): %ds -> %ds (item: %s [%d])", - GetSpellRecField(spellID, "name") or "Unknown", spellID, baseDuration, modifiedDuration, + C_Spell.GetSpellName(spellID) or "Unknown", spellID, baseDuration, modifiedDuration, itemName, itemID) ) end @@ -6981,7 +6981,7 @@ function CleveRoids.ApplyNampowerDurationModifier(spellID, baseDuration) if CleveRoids.debug then DEFAULT_CHAT_FRAME:AddMessage( string.format("|cffff00ff[Nampower Duration Modifier]|r %s (ID:%d): %ds -> %ds (flat: %+d, percent: %d%%)", - GetSpellRecField(spellID, "name") or "Unknown", spellID, baseDuration, modified, + C_Spell.GetSpellName(spellID) or "Unknown", spellID, baseDuration, modified, flat or 0, percent or 0) ) end @@ -7137,7 +7137,7 @@ function CleveRoids.ApplySetBonusModifier(spellID, baseDuration) if modifiedDuration ~= baseDuration and CleveRoids.debug then local spellName = "Unknown" if GetSpellRecField then - spellName = GetSpellRecField(spellID, "name") or spellName + spellName = C_Spell.GetSpellName(spellID) or spellName end DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00ffff[Set Bonus Modifier]|r %s (ID:%d): %.1fs -> %.1fs (%d/%d pieces)", @@ -7473,7 +7473,7 @@ local function OnSpellDamageEvent() -- Check if this is a known bleed spell by name (fallback) - only if physical if schoolName == "physical" then - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") + local spellName = C_Spell.GetSpellName(spellId) if spellName then local baseName = string.gsub(spellName, "%s*%(.-%)%s*$", "") local lower = string.lower(baseName) @@ -7495,7 +7495,7 @@ local function OnSpellDamageEvent() CleveRoids.spellSchoolMapping[spellId] = schoolName if CleveRoids.debug then - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or "Unknown" + local spellName = C_Spell.GetSpellName(spellId) or "Unknown" CleveRoids.Print(string.format("|cff88ff88[School Learned]|r %s (ID:%d) = %s (raw:%d)", spellName, spellId, schoolName, spellSchool)) end @@ -7536,7 +7536,7 @@ local function GetSpellSchool(spellName, spellID) if spellName then baseName = string.gsub(spellName, "%s*%(.-%)%s*$", "") elseif spellID and GetSpellRecField then - local fullName = GetSpellRecField(spellID, "name") + local fullName = C_Spell.GetSpellName(spellID) if fullName then baseName = string.gsub(fullName, "%s*%(.-%)%s*$", "") end @@ -7588,7 +7588,7 @@ local function GetSpellSchool(spellName, spellID) -- If we only have spellID but no name, try to get name from GetSpellRecField if spellID and not spellName and GetSpellRecField then - spellName = GetSpellRecField(spellID, "name") + spellName = C_Spell.GetSpellName(spellID) end if not spellName then return nil end @@ -7746,7 +7746,7 @@ local function GetUnitBuffs(unit) if not texture then break end if spellID then - local buffName = GetSpellRecField(spellID, "name") + local buffName = C_Spell.GetSpellName(spellID) if buffName then buffs[buffName] = true end @@ -8146,7 +8146,7 @@ local function CancelPendingVerification(targetName, spellName) local matches = false if pending.targetName and string.lower(pending.targetName) == lowerTarget then if lowerSpell then - local pendingSpellName = pending.spellID and GetSpellRecField(pending.spellID, "name") + local pendingSpellName = pending.spellID and C_Spell.GetSpellName(pending.spellID) pendingSpellName = pendingSpellName and string.lower(string.gsub(pendingSpellName, "%s*%(.-%)%s*$", "")) if pendingSpellName and pendingSpellName == lowerSpell then matches = true @@ -8157,7 +8157,7 @@ local function CancelPendingVerification(targetName, spellName) end if matches then if debug then - local spellNameDebug = pending.spellID and GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = pending.spellID and C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00aaff[Combat Log Immune]|r Cancelled pending shared debuff verification for %s on %s - combat log confirmed immunity", spellNameDebug, targetName) @@ -8178,9 +8178,9 @@ local function CancelPendingVerification(targetName, spellName) local matches = false if pending.targetName and string.lower(pending.targetName) == lowerTarget then if lowerSpell then - local pendingSpellName = pending.spellID and GetSpellRecField(pending.spellID, "name") + local pendingSpellName = pending.spellID and C_Spell.GetSpellName(pending.spellID) pendingSpellName = pendingSpellName and string.lower(string.gsub(pendingSpellName, "%s*%(.-%)%s*$", "")) - local castSpellName = pending.castSpellID and GetSpellRecField(pending.castSpellID, "name") + local castSpellName = pending.castSpellID and C_Spell.GetSpellName(pending.castSpellID) castSpellName = castSpellName and string.lower(string.gsub(castSpellName, "%s*%(.-%)%s*$", "")) if (pendingSpellName and pendingSpellName == lowerSpell) or (castSpellName and castSpellName == lowerSpell) then @@ -8192,7 +8192,7 @@ local function CancelPendingVerification(targetName, spellName) end if matches then if debug then - local spellNameDebug = pending.spellID and GetSpellRecField(pending.spellID, "name") or "Unknown" + local spellNameDebug = pending.spellID and C_Spell.GetSpellName(pending.spellID) or "Unknown" DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00aaff[Combat Log Immune]|r Cancelled pending personal debuff verification for %s on %s - combat log confirmed immunity", spellNameDebug, targetName) @@ -8564,7 +8564,7 @@ local function ParseAfflictedCombatLog() for _, pending in ipairs(lib.pendingPersonalDebuffs) do if pending.targetName == targetName and not pending.verifiedByAffliction then -- Check if this pending entry matches the affliction spell - local pendingSpellName = pending.spellID and GetSpellRecField(pending.spellID, "name") + local pendingSpellName = pending.spellID and C_Spell.GetSpellName(pending.spellID) if pendingSpellName then -- Strip rank info for comparison pendingSpellName = string.gsub(pendingSpellName, "%s*%(.-%)%s*$", "") @@ -8715,7 +8715,7 @@ function CleveRoids.CheckImmunity(unitId, spellOrSchool) local texture, stacks, spellID = UnitBuff(unitId, i) if not texture then break end if spellID then - local buffName = GetSpellRecField(spellID, "name") + local buffName = C_Spell.GetSpellName(spellID) if buffName and buffName == initialImmunityData.buff then initialImmune = true break @@ -8739,7 +8739,7 @@ function CleveRoids.CheckImmunity(unitId, spellOrSchool) local texture, stacks, spellID = UnitBuff(unitId, i) if not texture then break end if spellID then - local buffName = GetSpellRecField(spellID, "name") + local buffName = C_Spell.GetSpellName(spellID) if buffName and buffName == debuffImmunityData.buff then debuffImmune = true break @@ -8806,7 +8806,7 @@ function CleveRoids.CheckImmunity(unitId, spellOrSchool) if not texture then break end if spellID then - local buffName = GetSpellRecField(spellID, "name") + local buffName = C_Spell.GetSpellName(spellID) if buffName and buffName == requiredBuff then return true end @@ -9473,7 +9473,7 @@ local function ProcessSpellMissSelf(spellId, targetGuid, missInfo) end -- Resolve spell name - local spellName = GetSpellRecField and type(spellId) == "number" and spellId > 0 and GetSpellRecField(spellId, "name") + local spellName = type(spellId) == "number" and spellId > 0 and C_Spell.GetSpellName(spellId) local baseName = spellName and string.gsub(spellName, "%s*%(.-%)%s*$", "") or nil -- ======================================================================== @@ -9977,7 +9977,7 @@ reactiveFrame:SetScript("OnEvent", function() end if CleveRoids.debug then - local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or tostring(spellId) + local spellName = C_Spell.GetSpellName(spellId) or tostring(spellId) DEFAULT_CHAT_FRAME:AddMessage( string.format("|cff00ff00[SPELL_GO]|r Yellow miss detected - %s (hit=%d, miss=%d, castType=%s) - deferring to combat log for type", spellName, numHit, numMissed, tostring(pending.castType)) @@ -10151,7 +10151,7 @@ local function HandleDebuffFade() local timestamp = GetTime() for spellID in pairs(lib.objects[targetGUID]) do - local name = GetSpellRecField(spellID, "name") + local name = C_Spell.GetSpellName(spellID) if name then name = CleveRoids.StripRank(name) if name == spellName then