Improve combo point duration tracking system

Major enhancements to the combo point finisher tracking system:

**ComboPointTracker.lua:**
- Added spell ID-based tracking (ComboScalingSpellsByID table)
- All Rupture ranks (1943, 8639, 8640, 11273, 11274, 11275): 8s + 2s per CP
- Kidney Shot ranks (408, 8643): Rank 1: 1s + 1s per CP, Rank 2: 2s + 1s per CP
- Druid Rip ranks (1079, 9492, 9493, 9752, 9894, 9896): 12s + 4s per CP (corrected from 10s + 2s)
- New TrackComboPointCastByID() function for UNIT_CASTEVENT integration
- Initialize spell_tracking table to prevent nil errors
- Consistent debug output using CleveRoids.debug flag

**Utility.lua (libdebuff integration):**
- UNIT_CASTEVENT handler now checks combo scaling spells first
- Calls TrackComboPointCastByID() before normal duration lookup
- Learning system skips combo spells (they're dynamically calculated)
- Improved debug messages distinguish combo spells from regular spells

**Core.lua (console commands):**
- Added /cleveroid combotrack - Display recent combo finisher casts
- Added /cleveroid comboclear - Clear combo tracking data
- Updated help text with combo point tracking section

**README.md:**
- New "Combo Point Scaling" section with examples
- Updated settings documentation with new commands
- Added /cleveroid debug to settings list
- Example macros showing combo point-aware debuff conditionals

This system ensures accurate duration tracking for:
- Rogue: Rupture (8-16s), Kidney Shot (1-6s)
- Druid: Rip (12-28s)

All durations are now calculated based on actual combo points used at cast time.
This commit is contained in:
Claude
2025-11-16 15:31:38 +00:00
parent 4d288cd482
commit 4cf8e07a17
4 changed files with 184 additions and 57 deletions
+32 -9
View File
@@ -836,9 +836,18 @@ ev:SetScript("OnEvent", function()
local _, playerGUID = UnitExists("player")
if casterGUID == playerGUID and targetGUID then
local duration = lib:GetDuration(spellID, casterGUID)
-- Check if this is a combo point scaling spell first
local duration = nil
if CleveRoids.TrackComboPointCastByID then
duration = CleveRoids.TrackComboPointCastByID(spellID, targetGUID)
end
if duration > 0 then
-- If not a combo scaling spell, use normal duration lookup
if not duration then
duration = lib:GetDuration(spellID, casterGUID)
end
if duration and duration > 0 then
local targetName = lib.guidToName[targetGUID]
if not targetName then
local _, currentTargetGUID = UnitExists("target")
@@ -905,14 +914,28 @@ evLearn:SetScript("OnEvent", function()
local casterGUID = lib.learnCastTimers[targetGUID][spellID].caster
local actualDuration = timestamp - castTime
CleveRoids_LearnedDurations[spellID] = CleveRoids_LearnedDurations[spellID] or {}
CleveRoids_LearnedDurations[spellID][casterGUID] = floor(actualDuration + 0.5)
-- Check if this is a combo point spell - if so, learn it with combo point context
local isComboSpell = false
if CleveRoids.IsComboScalingSpellID and CleveRoids.IsComboScalingSpellID(spellID) then
isComboSpell = true
if CleveRoids.debug then
local comboData = CleveRoids.ComboPointTracking.byID and CleveRoids.ComboPointTracking.byID[spellID]
local cpUsed = comboData and comboData.combo_points or "?"
DEFAULT_CHAT_FRAME:AddMessage(
"|cff4b7dccCleveRoids:|r Learned combo spell " .. spellName ..
" (ID:" .. spellID .. ") with " .. cpUsed .. " CP = " .. floor(actualDuration + 0.5) .. "s"
)
end
else
CleveRoids_LearnedDurations[spellID] = CleveRoids_LearnedDurations[spellID] or {}
CleveRoids_LearnedDurations[spellID][casterGUID] = floor(actualDuration + 0.5)
if CleveRoids.debug then
DEFAULT_CHAT_FRAME:AddMessage(
"|cff4b7dccCleveRoids:|r Learned " .. spellName ..
" (ID:" .. spellID .. ") = " .. floor(actualDuration + 0.5) .. "s"
)
if CleveRoids.debug then
DEFAULT_CHAT_FRAME:AddMessage(
"|cff4b7dccCleveRoids:|r Learned " .. spellName ..
" (ID:" .. spellID .. ") = " .. floor(actualDuration + 0.5) .. "s"
)
end
end
lib.learnCastTimers[targetGUID][spellID] = nil