From d426977c1c363d97f26c79a301ce02ea22b9601b Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Thu, 19 Mar 2026 08:41:37 -0700 Subject: [PATCH] fix melee bleed logic --- curses.lua | 47 +++++++++++++++++++++++++++------------------- spells/druid.lua | 14 +++++++------- spells/rogue.lua | 24 +++++++++++------------ spells/warrior.lua | 14 +++++++------- 4 files changed, 54 insertions(+), 45 deletions(-) diff --git a/curses.lua b/curses.lua index 823e64d..e8600a3 100644 --- a/curses.lua +++ b/curses.lua @@ -291,6 +291,26 @@ local function StopChanneling() curses.isChanneling = false end +local function VerifyMeleeBleedApplied(targetGuid, spellID) + local curseData = curses.trackedCurseIds[spellID] + if not curseData or not curseData.meleeBleed then + return + end + + if not curses.guids[targetGuid] or not curses.guids[targetGuid][curseData.name] then + return + end + + local auras = GetUnitField(targetGuid, "aura") or {} + for i, auraSpellID in pairs(auras) do + if auraSpellID == spellID then + return + end + end + + curses:RemoveCurse(targetGuid, curseData.name) +end + Cursive:RegisterEvent("SPELLCAST_CHANNEL_START", function() curses.isChanneling = true end); @@ -300,13 +320,11 @@ Cursive:RegisterEvent("SPELLCAST_INTERRUPTED", StopChanneling); -- player spell completions Cursive:RegisterEvent("SPELL_GO_SELF", function(itemId, spellID, casterGuid, targetGuid, castFlags, numTargetsHit, numTargetsMissed) - if numTargetsMissed > 0 then - curses.pendingCast = {} - elseif numTargetsHit > 0 or curses.travelTimeSpellIds[spellID] then - curses.pendingCast = { - spellID = spellID, - targetGuid = targetGuid, - } + if curses.travelTimeSpellIds[spellID] and numTargetsMissed == 0 then + curses.pendingCast = { + spellID = spellID, + targetGuid = targetGuid, + } end if curses.isDruid then @@ -339,6 +357,9 @@ Cursive:RegisterEvent("SPELL_GO_SELF", function(itemId, spellID, casterGuid, tar lastGuid = targetGuid local duration = curses:GetCurseDuration(spellID) curses:ApplyCurse(spellID, targetGuid, GetTime(), duration) + if curses.trackedCurseIds[spellID].meleeBleed and not curses.mobsThatBleed[targetGuid] then + Cursive:ScheduleEvent(VerifyMeleeBleedApplied, 0.05, targetGuid, spellID) + end elseif curses.conflagrateSpellIds[spellID] then curses:UpdateCurse(spellID, targetGuid, GetTime()) end @@ -351,7 +372,6 @@ Cursive:RegisterEvent("SPELL_START_SELF", function(itemId, spellID, casterGuid, curses.pendingCast = { spellID = spellID, targetGuid = targetGuid, - castDuration = castTime / 1000 } end end) @@ -609,17 +629,6 @@ function curses:ApplyCurse(spellID, targetGuid, startTime, duration) local name = curses.trackedCurseIds[spellID].name local rank = curses.trackedCurseIds[spellID].rank - if curses.isDruid and name == L["rake"] then - -- check if mob is in bleed whitelist first - -- these bosses are most likely to hit 48 client debuff cap - if not curses.mobsThatBleed[targetGuid] then - if not curses:ScanGuidForCurse(targetGuid, spellID) then - -- rake not found on target, do not apply - return - end - end - end - if not curses.guids[targetGuid] then curses.guids[targetGuid] = {} end diff --git a/spells/druid.lua b/spells/druid.lua index 6353137..ec64a64 100644 --- a/spells/druid.lua +++ b/spells/druid.lua @@ -59,10 +59,10 @@ function getDruidSpells() [9834] = { name = L["moonfire"], rank = 9, duration = 18, variableDuration = true }, [9835] = { name = L["moonfire"], rank = 10, duration = 18, variableDuration = true }, - [1822] = { name = L["rake"], rank = 1, duration = 9, variableDuration = true }, - [1823] = { name = L["rake"], rank = 2, duration = 9, variableDuration = true }, - [1824] = { name = L["rake"], rank = 3, duration = 9, variableDuration = true }, - [9904] = { name = L["rake"], rank = 4, duration = 9, variableDuration = true }, + [1822] = { name = L["rake"], rank = 1, duration = 9, variableDuration = true, meleeBleed=true }, + [1823] = { name = L["rake"], rank = 2, duration = 9, variableDuration = true, meleeBleed=true }, + [1824] = { name = L["rake"], rank = 3, duration = 9, variableDuration = true, meleeBleed=true }, + [9904] = { name = L["rake"], rank = 4, duration = 9, variableDuration = true, meleeBleed=true }, [1079] = { name = L["rip"], rank = 1, duration = 8, calculateDuration = getRipDuration }, [9492] = { name = L["rip"], rank = 2, duration = 8, calculateDuration = getRipDuration }, @@ -87,8 +87,8 @@ function getDruidSpells() [5209] = { name = L["challenging roar"], rank = 1, duration = 6 }, - [9005] = { name = L["pounce bleed"], rank = 1, duration = 18 }, - [9823] = { name = L["pounce bleed"], rank = 2, duration = 18 }, - [9827] = { name = L["pounce bleed"], rank = 3, duration = 18 }, + [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 }, } end diff --git a/spells/rogue.lua b/spells/rogue.lua index 135e82c..8a4d1bf 100644 --- a/spells/rogue.lua +++ b/spells/rogue.lua @@ -38,12 +38,12 @@ function getRogueSpells() [11285] = { name = L["gouge"], rank = 4, duration = 4, calculateDuration = getGougeDuration }, [11286] = { name = L["gouge"], rank = 5, duration = 4, calculateDuration = getGougeDuration }, - [1943] = { name = L["rupture"], rank = 1, duration = 6, calculateDuration = getRuptureDuration }, - [8639] = { name = L["rupture"], rank = 2, duration = 6, calculateDuration = getRuptureDuration }, - [8640] = { name = L["rupture"], rank = 3, duration = 6, calculateDuration = getRuptureDuration }, - [11273] = { name = L["rupture"], rank = 4, duration = 6, calculateDuration = getRuptureDuration }, - [11274] = { name = L["rupture"], rank = 5, duration = 6, calculateDuration = getRuptureDuration }, - [11275] = { name = L["rupture"], rank = 6, duration = 6, calculateDuration = getRuptureDuration }, + [1943] = { name = L["rupture"], rank = 1, duration = 6, calculateDuration = getRuptureDuration, meleeBleed=true }, + [8639] = { name = L["rupture"], rank = 2, duration = 6, calculateDuration = getRuptureDuration, meleeBleed=true }, + [8640] = { name = L["rupture"], rank = 3, duration = 6, calculateDuration = getRuptureDuration, meleeBleed=true }, + [11273] = { name = L["rupture"], rank = 4, duration = 6, calculateDuration = getRuptureDuration, meleeBleed=true }, + [11274] = { name = L["rupture"], rank = 5, duration = 6, calculateDuration = getRuptureDuration, meleeBleed=true }, + [11275] = { name = L["rupture"], rank = 6, duration = 6, calculateDuration = getRuptureDuration, meleeBleed=true }, [408] = { name = L["kidney shot"], rank = 1, duration = 1, calculateDuration = getKidneyShotDuration }, [8643] = { name = L["kidney shot"], rank = 2, duration = 1, calculateDuration = getKidneyShotDuration }, @@ -54,12 +54,12 @@ function getRogueSpells() [11197] = { name = L["expose armor"], rank = 4, duration = 30 }, [11198] = { name = L["expose armor"], rank = 5, duration = 30 }, - [703] = { name = L["garrote"], rank = 1, duration = 18 }, - [8631] = { name = L["garrote"], rank = 2, duration = 18 }, - [8632] = { name = L["garrote"], rank = 3, duration = 18 }, - [8633] = { name = L["garrote"], rank = 4, duration = 18 }, - [11289] = { name = L["garrote"], rank = 5, duration = 18 }, - [11290] = { name = L["garrote"], rank = 6, duration = 18 }, + [703] = { name = L["garrote"], rank = 1, duration = 18, meleeBleed=true }, + [8631] = { name = L["garrote"], rank = 2, duration = 18, meleeBleed=true }, + [8632] = { name = L["garrote"], rank = 3, duration = 18, meleeBleed=true }, + [8633] = { name = L["garrote"], rank = 4, duration = 18, meleeBleed=true }, + [11289] = { name = L["garrote"], rank = 5, duration = 18, meleeBleed=true }, + [11290] = { name = L["garrote"], rank = 6, duration = 18, meleeBleed=true }, [2818] = { name = L["deadly poison"], rank = 1, duration = 12 }, [2819] = { name = L["deadly poison ii"], rank = 2, duration = 12 }, diff --git a/spells/warrior.lua b/spells/warrior.lua index c6ba70a..af0ab78 100644 --- a/spells/warrior.lua +++ b/spells/warrior.lua @@ -1,12 +1,12 @@ local L = AceLibrary("AceLocale-2.2"):new("Cursive") function getWarriorSpells() return { - [772] = { name = L["rend"], rank = 1, duration = 9 }, - [6546] = { name = L["rend"], rank = 2, duration = 12 }, - [6547] = { name = L["rend"], rank = 3, duration = 15 }, - [6548] = { name = L["rend"], rank = 4, duration = 18 }, - [11572] = { name = L["rend"], rank = 5, duration = 21 }, - [11573] = { name = L["rend"], rank = 6, duration = 21 }, - [11574] = { name = L["rend"], rank = 7, duration = 21 }, + [772] = { name = L["rend"], rank = 1, duration = 9, meleeBleed=true }, + [6546] = { name = L["rend"], rank = 2, duration = 12, meleeBleed=true }, + [6547] = { name = L["rend"], rank = 3, duration = 15, meleeBleed=true }, + [6548] = { name = L["rend"], rank = 4, duration = 18, meleeBleed=true }, + [11572] = { name = L["rend"], rank = 5, duration = 21, meleeBleed=true }, + [11573] = { name = L["rend"], rank = 6, duration = 21, meleeBleed=true }, + [11574] = { name = L["rend"], rank = 7, duration = 21, meleeBleed=true }, } end