Commit Graph

16 Commits

Author SHA1 Message Date
Claude c8546df52a Fix debuff overflow detection and duration tracking for combodurations branch
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
2025-11-16 23:28:03 +00:00
Claude d6b4ae3d97 Add direct pfUI duration synchronization for combo spells
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.
2025-11-16 18:18:41 +00:00
Claude e8e5f7d1f3 Add comprehensive debug tracing for combo duration system
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.
2025-11-16 17:46:30 +00:00
Claude 7b79b45130 Fix debuff conditionals using wrong max duration for combo spells
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!
2025-11-16 17:33:27 +00:00
Claude 1172e3377b Add learned combo duration system - saves actual durations per CP
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
2025-11-16 16:49:30 +00:00
Claude 4cf8e07a17 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.
2025-11-16 15:31:38 +00:00
Torio 4d288cd482 Merge pull request #23 from jrc13245/main
merge
2025-11-16 10:23:13 -05:00
Jrc13245 1610920dda immunity tracking system 2025-11-16 09:46:51 -05:00
Jrc13245 e088ae4029 new weapon imbue check conditionals 2025-11-10 18:02:59 -05:00
Jrc13245 665b6c52e7 initial combo point duration checker 2025-11-10 17:35:33 -05:00
Jrc13245 8fcd17ff53 added ability to track overflow debuffs that show in buff slots on bosses in raids 2025-10-28 19:56:00 -04:00
Jrc13245 6db708f40b fix castsequence reset functionality 2025-10-25 11:34:36 -04:00
Jrc13245 8542a05170 implement standalone debuff timer system 2025-10-21 22:18:10 -04:00
Jrc13245 35a81eb29b many fixes 2025-10-05 14:24:46 -04:00
Jrc13245 a3169a7523 fix debuff timers for non pfui users 2025-10-02 13:22:47 -04:00
Jrc13245 fb359993b2 Initial Commit 2025-08-18 16:15:25 -04:00