diff --git a/Cursive.toc b/Cursive.toc index e56f08b..25c88ae 100644 --- a/Cursive.toc +++ b/Cursive.toc @@ -1,6 +1,6 @@ ## Interface: 11200 -## Title: Cursive 3.0.6 -## Title-zhCN: Cursive 3.0.6 +## Title: Cursive 3.0.7 +## Title-zhCN: Cursive 3.0.7 ## Author: Pepopo ## Notes: Uses GUIDs to show units in combat and track curses ## Notes-zhCN: 使用的GUID功能来显示战斗中的单位并监视诅咒等 diff --git a/curses.lua b/curses.lua index cf54dca..ee97236 100644 --- a/curses.lua +++ b/curses.lua @@ -249,24 +249,10 @@ function curses:GetCurseDuration(curseSpellID) end function curses:ScanGuidForCurse(guid, curseSpellID) - for i = 1, 64 do - local _, _, _, spellID = UnitDebuff(guid, i) - if spellID then - if spellID == curseSpellID then - return true - end - else - break - end - end - for i = 1, 64 do - local _, _, spellID = UnitBuff(guid, i) - if spellID then - if spellID == curseSpellID then - return true - end - else - break + local auras = GetUnitField(guid, "aura") or {} + for i, spellID in pairs(auras) do + if spellID == curseSpellID then + return true end end @@ -293,6 +279,15 @@ local function StopChanneling() curses.isChanneling = false end +local function GetAppliedCurseSpellID(spellID) + local curseData = curses.trackedCurseIds[spellID] + if curseData and curseData.debuffSpellId then + return curseData.debuffSpellId + end + + return spellID +end + local function VerifyMeleeBleedApplied(targetGuid, spellID) local curseData = curses.trackedCurseIds[spellID] if not curseData or not curseData.meleeBleed then @@ -308,25 +303,17 @@ local function VerifyMeleeBleedApplied(targetGuid, spellID) end local hasFullBuffsAndDebuffs = true + local appliedSpellID = GetAppliedCurseSpellID(spellID) local auras = GetUnitField(targetGuid, "aura") or {} for i, auraSpellID in pairs(auras) do - if auraSpellID == spellID then + if auraSpellID == appliedSpellID then return elseif auraSpellID <= 0 then hasFullBuffsAndDebuffs = false end end - local isPounceBleed = false - if spellID == 9005 or - spellID == 9823 or - spellID == 9827 then - isPounceBleed = true - end - - -- pounce bleed can fail due to stun immunity as well - -- skip marking the mob as bleed immune for it - if not hasFullBuffsAndDebuffs and not isPounceBleed then + if not hasFullBuffsAndDebuffs then local mobName = UnitName(targetGuid) if mobName then curses.bleedImmuneMobs[mobName] = true @@ -455,7 +442,7 @@ Cursive:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER", function(message) for curseName, curseData in pairs(data) do if curseName == spellName then -- see if target still has that curse - if not curses:ScanGuidForCurse(guid, curseData.spellID) then + if not curses:ScanGuidForCurse(guid, curseData.appliedSpellID or curseData.spellID) then -- remove curse curses:RemoveCurse(guid, curseName) end @@ -678,6 +665,7 @@ function curses:ApplyCurse(spellID, targetGuid, startTime, duration) duration = duration, start = startTime, spellID = spellID, + appliedSpellID = GetAppliedCurseSpellID(spellID), targetGuid = targetGuid, currentPlayer = true, } diff --git a/spells/druid.lua b/spells/druid.lua index ec64a64..89fae6c 100644 --- a/spells/druid.lua +++ b/spells/druid.lua @@ -87,8 +87,8 @@ function getDruidSpells() [5209] = { name = L["challenging roar"], rank = 1, duration = 6 }, - [9005] = { name = L["pounce bleed"], rank = 1, duration = 18, meleeBleed=true }, - [9823] = { name = L["pounce bleed"], rank = 2, duration = 18, meleeBleed=true }, - [9827] = { name = L["pounce bleed"], rank = 3, duration = 18, meleeBleed=true }, + [9005] = { name = L["pounce bleed"], rank = 1, duration = 18, meleeBleed=true, debuffSpellId=9007 }, + [9823] = { name = L["pounce bleed"], rank = 2, duration = 18, meleeBleed=true, debuffSpellId=9824 }, + [9827] = { name = L["pounce bleed"], rank = 3, duration = 18, meleeBleed=true, debuffSpellId=9826 } } end