View Single Post
11-21-23, 12:38 PM   #5
wardz
A Deviate Faerie Dragon
 
wardz's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 17
Combat log event handling looks like this now:
lua Code:
  1. local function OnEvent(self, event)
  2.     if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  3.         local _, subEvent, _, srcGUID, srcName, _, _, dstGUID, destName, _, _, spellId = CombatLogGetCurrentEventInfo()
  4.  
  5.  
  6.         if subEvent == "SPELL_AURA_APPLIED" and spellId == 421972 then
  7.             UpdateRaidDebuffList()
  8.         elseif subEvent == "SPELL_AURA_REMOVED" and spellId == 421972 then
  9.             local icon = GetRaidTargetIndex(destName)
  10.             if icon then
  11.                 table.insert(raidTargetIcons, icon)
  12.                 ClearRaidTargetIcon(destName)
  13.                 print(destName .. "'s Controlled Burn debuff has been removed.")
  14.             end
  15.         end
  16.     end
  17. end

The spellId I were refering to earlier is the one inside your UpdateRaidDebuffList function, but not in the combat log event, that one is correct.
Is 'castSuccess' a special variable return thats required for Controlled Burn? If you don't need it, the script can be simplified a lot. (Arguments for table.remove also seems incorrect, its missing the index you want to remove) Let me know and I can post a full example later.


For future cases, you might also want to look into the UNIT_AURA event. This is generally the event you want for these kind of things unless you need to track units that are not in your group or not currently targetted.

Last edited by wardz : 11-22-23 at 07:04 AM.
  Reply With Quote