Thread Tools Display Modes
06-13-24, 01:09 PM   #1
MinguasBeef
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 55
Get Unit Class for source/destination from combat log event

Is it possible to retrieve the UnitClass from a combat log event unfiltered for the source and destination?

I tried UnitClass with the name as well as the guid, but both returned nil.

The only thing I can think of is comparing the GUID of every nameplate and then grabbing the unit class from the nameplate unit id, but I wanted to see if there was a better option because this just sounded inefficient.
  Reply With Quote
06-13-24, 01:22 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,931
UnitTokenFromGUID

Would probably do it faster than you could.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
06-13-24, 05:17 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,336
I was going to suggest GetPlayerInfoByGUID() as a more direct option.
Not everyone that shows up in your combat log is going to have a valid UnitID, even with NamePlates on. Objects not on screen, exceeding a render count threshold, or are too far away won't have a nameplate.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 06-13-24 at 05:24 PM.
  Reply With Quote
06-14-24, 07:03 AM   #4
MinguasBeef
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 55
Originally Posted by Fizzlemizz View Post
UnitTokenFromGUID

Would probably do it faster than you could.
Thank you! I forgot to mention this is classic though and it looks like that function isn't available.

Originally Posted by SDPhantom View Post
I was going to suggest GetPlayerInfoByGUID() as a more direct option.
Not everyone that shows up in your combat log is going to have a valid UnitID, even with NamePlates on. Objects not on screen, exceeding a render count threshold, or are too far away won't have a nameplate.
Perfect! This is available in the classic client and also achieves the same goal.

Thanks both of you for your help!
  Reply With Quote
06-14-24, 09:34 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,974
Originally Posted by MinguasBeef View Post
Thank you! I forgot to mention this is classic though and it looks like that function isn't available.



Perfect! This is available in the classic client and also achieves the same goal.

Thanks both of you for your help!

Have you tried the function ?
Depending on which version of Classic you are doing it for ( Era, Cata ) there is a chance that it is one of the 10.0 *features* that were added to the Classic version.
But seeing as the other option works fine enough for you .. all good.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
06-14-24, 11:25 AM   #6
MinguasBeef
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 55
Originally Posted by Xrystal View Post
Have you tried the function ?
Depending on which version of Classic you are doing it for ( Era, Cata ) there is a chance that it is one of the 10.0 *features* that were added to the Classic version.
But seeing as the other option works fine enough for you .. all good.
Yes, on the classic cata client UnitTokenFromGUID is nil.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Get Unit Class for source/destination from combat log event

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off