- Added lib:UnitBuff(unit, index, filterCaster) to query buff data by slot
- Added lib:FindPlayerBuff(unit, spellID) to find player-cast buffs by spell ID
- Both functions return duration, timeleft, and caster information
- Mirrors the debuff tracking API (UnitDebuff/FindPlayerDebuff)
- Enables tracking buff ownership and timeleft for future projects
Changes:
- Split lib.durations into lib.personalDebuffs and lib.sharedDebuffs
- Removed combo-scaling spells (Rupture, Rip, Kidney Shot) from static tables
since they are handled dynamically by ComboPointTracker
- Added lib:IsPersonalDebuff() helper to distinguish debuff types
- Updated ValidateUnitDebuff to auto-detect personal vs shared debuffs
- Personal debuffs (DoTs, poisons, most CC) now auto-filter to player by default
- Shared debuffs (Sunder, Faerie Fire, Hunter's Mark) remain unfiltered
- Maintained lib.durations for backwards compatibility
This prevents false positives when checking personal debuffs like Rupture
in multi-player scenarios while allowing shared debuffs like Sunder Armor
to work correctly.
- Modified lib:UnitDebuff() to accept optional filterCaster parameter
- Added lib:FindPlayerDebuff() to search for player debuffs by spell ID
- Ensures debuffs in buff slots can be properly identified by owner
- Prevents false positives from other players' debuffs with same spell ID
Applied the same overflow bug fixes to the combodurations branch to ensure
compatibility with combo point-scaled debuffs. This fixes three issues:
1. lib:UnitDebuff() (line 799): Fixed UnitBuff() return value capture from 4
values to 3 values (UnitBuff only returns texture, stacks, spellID). Also
changed overflow check from only checking static database to checking
lib:GetDuration() which includes combo durations, learned durations, and
static durations.
2. SeedUnit() debuff loop (line 837): Changed check from only lib.durations[]
to lib:GetDuration() so debuffs with learned or combo-scaled durations are
properly seeded into the tracking system.
3. SeedUnit() buff loop (line 867): Fixed UnitBuff() return value capture from
4 values to 3, and changed check from only lib.durations[] to
lib:GetDuration() to properly track overflow debuffs with combo-scaled or
learned durations.
These fixes ensure that:
- Overflow debuffs like Moonfire are properly detected by [nodebuff:] conditionals
- Duration tracking works for overflow debuffs with combo point scaling (Rip, Rupture)
- Duration tracking works for overflow debuffs with learned durations
- All existing combo point tracking functionality is preserved
After analyzing pfUI's cooldown module, we need to directly sync
combo durations to pfUI's libdebuff.objects storage:
- Added SyncComboDurationToPfUI function to force-update pfUI's
stored debuff duration after tracking combo spells
- Called from UNIT_CASTEVENT handler after AddEffect
- This ensures pfUI's cooldown display shows the correct combo
duration (e.g., 28s for 5 CP Rip) instead of base 12s
pfUI's cooldown module is just a display layer - it shows durations
from pfUI.api.libdebuff.objects. By directly updating this storage,
we ensure the correct duration is displayed regardless of timing.
Added debug output at all critical points in the duration tracking flow:
- UNIT_CASTEVENT handler: Shows calculated duration and CP count
- lib:GetDuration: Shows which source provided the duration (learned combo/caster/static)
- lib:AddEffect: Shows what duration was actually stored
- SeedUnit: Shows what duration is used when rescanning debuffs/buffs
This will help diagnose why combo durations aren't being applied correctly.
CRITICAL FIX: Debuff conditionals like [debuff:Rip<4] were using base
duration (12s) instead of actual combo duration (28s for 5 CP).
**Problem:**
- SeedUnit rescans debuffs on target change/UNIT_AURA events
- It called lib:GetDuration(spellID) without combo awareness
- This overwrote combo-aware durations with base durations
- pfUI cooldown module showed wrong max duration (12s vs 28s)
- Conditional [debuff:Rip<4] triggered at wrong times
**Solution:**
1. Updated lib:GetDuration to accept optional comboPoints parameter
2. Checks CleveRoids_ComboDurations[spellID][cp] FIRST before other sources
3. Priority: combo learned > caster learned > static database
4. SeedUnit now uses highest learned CP duration as fallback
5. When rescanning combo spells, assumes 5 CP if learned
**Benefits:**
- [debuff:Rip<4] now uses actual 28s max duration (5 CP)
- pfUI cooldown displays correct duration
- Conditionals trigger at correct times
- Prevents base duration from overwriting learned duration
**Example:**
Cast Rip with 5 CP (28s), macro refreshes at <4s remaining (24s used)
Previously: Would refresh at <4s of 12s base (8s used) - TOO EARLY!
Major enhancement: System now learns actual combo finisher durations and
saves them per combo point level (1-5 CP).
**New SavedVariable:**
- CleveRoids_ComboDurations[spellID][comboPoints] = duration
- Persists between sessions
- Uses learned durations before calculated formulas
**ComboPointTracker.lua:**
- Added GetLearnedComboDuration(spellID, cp) - fetch learned duration
- Updated CalculateComboScaledDurationByID to check learned first
- Falls back to formula if not learned yet
**Utility.lua (libdebuff):**
- UNIT_CASTEVENT handler stores combo points in learnCastTimers
- RAW_COMBATLOG fade handler learns combo durations when spells expire
- Stores learned duration keyed by [spellID][comboPoints]
- Debug message shows "Learned combo spell X at Y CP = Zs"
**Core.lua:**
- New command: /cleveroid combolearn - Show all learned combo durations
- Lists each spell with all learned CP levels (1-5)
- Shows which durations have been learned vs not yet
**Benefits:**
- Debuff conditionals like [debuff:Rip<4] now use ACTUAL max duration
- Accounts for talents that modify finisher durations
- Learns different durations per rank
- More accurate than formulas for edge cases
**Example:**
After casting Rip with 5 CP and letting it expire, system learns:
CleveRoids_ComboDurations[1079][5] = 28
Future casts use 28s instead of calculated 12+4*4
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.