Quantcast
WoWInterface - View Single Post - Tracking debuffs on multiple units affected by AoE spells
View Single Post
03-11-20, 09:37 AM   #2
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 217
The IDs referenced in the CLEU are GUIDs. Any ID used for a unit frame is a Unit ID(or token) which normally refers to a frame that can be referenced, or created securely.

You can cache the GUIDs when nameplates are added/removed and use those to check applicable units in the CLEU so you can avoid multiplicative aura scans, especially if you'd be scanning nameplates and raid frames.

Performance tip: Cache the player GUID in the frame your using for the CLEU event and put the IF statements inside the player check.
Lua Code:
  1. frame.playerGUID = UnitGUID('player')
  2. frame.AuraList = { -- skip this if you're not planning on adding more de/buffs
  3.     106830 = true,
  4. }
  5.  
  6. -- CLEU code with assuming your function is passed the frame as self
  7. if sourceGUID == self.playerGUID then
  8.    if subevent == "SPELL_CAST_SUCCESS" and frame.AuraList[spellList] then
  9.        -- some more code
  10.    end
  11. end
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison
  Reply With Quote