mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
enhance immunity tracking with SPELL_GO cross-reference and improve combo point capture
Use SPELL_GO hit/miss data to skip redundant debuff scanning for CC/shared immunity verification. Add stale entry cleanup (>2s) for pending debuffs. Capture combo points at SPELL_CAST_EVENT (client-side, pre-server) for reliable finisher duration tracking. Add SPELL_GO reactive ability detection for yellow attack dodges replacing combat log text parsing.
This commit is contained in:
@@ -5533,6 +5533,8 @@ function CleveRoids.Frame:SPELL_CAST_EVENT()
|
||||
if event == "SPELL_CAST_EVENT" then
|
||||
local success = arg1
|
||||
local spellId = arg2
|
||||
local castType = arg3
|
||||
local targetGuid = arg4
|
||||
|
||||
-- BUGFIX: Update casting state on spell cast events (for [casting] conditional)
|
||||
if CleveRoids.UpdateCastingState then
|
||||
@@ -5542,6 +5544,8 @@ function CleveRoids.Frame:SPELL_CAST_EVENT()
|
||||
if success == 1 then
|
||||
CleveRoids.lastCastSpell = {
|
||||
spellId = spellId,
|
||||
castType = castType,
|
||||
targetGuid = targetGuid,
|
||||
timestamp = GetTime()
|
||||
}
|
||||
if SpellInfo then
|
||||
@@ -5550,6 +5554,38 @@ function CleveRoids.Frame:SPELL_CAST_EVENT()
|
||||
CleveRoids.lastCastSpell.spellName = name
|
||||
end
|
||||
end
|
||||
|
||||
-- Track pending cast for SPELL_GO correlation (reactive ability detection)
|
||||
-- Keyed by spellId so concurrent casts don't overwrite each other
|
||||
CleveRoids.pendingCasts = CleveRoids.pendingCasts or {}
|
||||
CleveRoids.pendingCasts[spellId] = {
|
||||
castType = castType,
|
||||
targetGuid = targetGuid,
|
||||
timestamp = GetTime(),
|
||||
comboPoints = nil,
|
||||
}
|
||||
|
||||
-- Capture combo points NOW (before server consumes them)
|
||||
-- SPELL_CAST_EVENT fires client-side, so CP are guaranteed available
|
||||
if (CleveRoids.IsComboScalingSpellID and CleveRoids.IsComboScalingSpellID(spellId)) or
|
||||
(CleveRoids.FerociousBiteSpellIDs and CleveRoids.FerociousBiteSpellIDs[spellId]) then
|
||||
local cp = CleveRoids.GetComboPoints and CleveRoids.GetComboPoints() or 0
|
||||
if cp > 0 then
|
||||
CleveRoids.pendingCasts[spellId].comboPoints = cp
|
||||
if CleveRoids.debug then
|
||||
local castSpellName = SpellInfo and SpellInfo(spellId) or "Unknown"
|
||||
DEFAULT_CHAT_FRAME:AddMessage(
|
||||
string.format("|cff00ff88[SPELL_CAST_EVENT]|r Captured %d CP for %s (ID:%d)",
|
||||
cp, castSpellName, spellId)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Cast failed - clear pending entry for this spell
|
||||
if CleveRoids.pendingCasts then
|
||||
CleveRoids.pendingCasts[spellId] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user