Commit Graph
8 Commits
Author SHA1 Message Date
Claude 7abb78c54e Fix combo point tracking - use name-based tracking as fallback
Prevent macro conditional evaluations from overwriting good CP data:

Problem: Macros like "[combo:>0 nodebuff]Rip /cast [combo:>0]Rip"
evaluate multiple times, calling TrackComboPointCast repeatedly:
1. Check [combo:>0 nodebuff] → TrackComboPointCast(0 CP)
2. Claw lands → player gains 1 CP
3. Check [combo:>0] → TrackComboPointCast(1 CP)
4. Spell casts → pfUI AddEffect fires → uses tracking data

If the 0 CP call happens after the 1 CP call, pfUI gets wrong data.

Solution: Only update tracking if:
- No existing data exists, OR
- Existing data is stale (>0.5s), OR
- New CP value >= existing CP value

This ensures we keep the highest (best) combo point count during
rapid macro evaluations, so pfUI always gets the correct duration.

Debug: Shows "Ignoring X with Y CP (have Z CP)" when preventing
overwrites of better data.
2025-11-16 18:49:12 +00:00
Claude e7152e3683 Fix combo point tracking - use name-based tracking as fallback
The issue: UNIT_CASTEVENT fires AFTER combo points are consumed, so
GetComboPoints() returns 0. The lastComboPoints fallback wasn't always
set in time.

Solution: When TrackComboPointCastByID sees 0 combo points, it now:
1. First tries lastComboPoints (OnUpdate tracking)
2. If still 0, checks name-based tracking data from extension hooks
   (which captured the CP count BEFORE the spell was cast)
3. Uses the CP count if the cast was within the last 0.5 seconds

This ensures we always get the correct combo point count for duration
calculation, regardless of timing.
2025-11-16 18:04:20 +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 e07afa32d0 Fix combo point tracking - capture CPs before they're consumed
CRITICAL FIX: Combo points were showing as 0 because UNIT_CASTEVENT fires
AFTER the finisher consumes them.

Solution:
- Added CleveRoids.lastComboPoints to store the last known CP count
- UpdateComboPoints() continuously monitors and stores CP when > 0
- OnUpdate handler keeps lastComboPoints up-to-date every frame
- Also update on PLAYER_TARGET_CHANGED, UNIT_AURA, PLAYER_COMBO_POINTS
- TrackComboPointCastByID() uses stored value if current is 0
- Resets stored value after use to prevent reuse

Now correctly tracks: Rip at 5 CP = 28s, Rupture at 5 CP = 16s, etc.
2025-11-16 16:41:19 +00:00
Claude 3704ae0c23 Add debug output to diagnose ShowComboTracking loading issue
Added debug messages to confirm:
1. Whether ShowComboTracking is defined after being created
2. Whether it's successfully exported to global
3. Whether RegisterExtension exists when file loads

This will help identify why ShowComboTracking is nil at runtime.
2025-11-16 16:25:55 +00:00
Claude a14fe4ac74 Fix ShowComboTracking not being defined - restructure file loading
CRITICAL FIX: Moved all essential functions BEFORE Extension registration to
ensure they're always available even if Extension system fails.

Changes:
- Moved ShowComboTracking() definition to line 240 (before Extension)
- Moved slash command registration to before Extension
- Export CleveRoids to global BEFORE Extension.RegisterExtension()
- Added safety check: return early if RegisterExtension doesn't exist
- Removed duplicate function definitions at end of file
- Added helpful message when no combo data tracked yet

This ensures /cleveroid combotrack works even if Extension system fails.
2025-11-16 15:53:45 +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
Jrc13245 665b6c52e7 initial combo point duration checker 2025-11-10 17:35:33 -05:00