Thread Tools Display Modes
02-12-24, 03:45 AM   #1
Skad_
A Kobold Labourer
Join Date: Feb 2024
Posts: 1
Connecting XP gains from combat to dead mob

I'm working on a personal addon focused around XP gain from mobs (specifically, predicting XP gain from mobs).

As part of the development process of the addon, I'm looking to store data related to XP gains for future reference. My initial idea was to get the XP gain by watching the CHAT_MSG_COMBAT_XP_GAIN event for the XP gain, but I quickly ran into an issue. How do I connect the XP gain to the specific mob whose death prompted the XP gain?

For example, if the player is fighting 3 mobs all with the same name "Bear", and due to the level range of the mobs one is level 22, one is level 23, and one is level 24. At some point, an event CHAT_MSG_COMBAT_XP_GAIN occurs, so the addon records the name of the mob "Bear", and the XP gain "X" from the text of the event. All of that is fine so far, but the new datum is missing one important piece of information: the level of the killed mob. Now, if all of the mobs were of unique names, or if I meticulously controlled my actions to get the result I wanted, I could do something like store the names and levels of the recent unit tooltips and then reference the name of the killed mob against that to get the level, but otherwise I can't guarantee that the most recent tooltip of a mob with the name "Bear" is the one that just died.

Is there any other way to glean information about the source of XP gains from combat, or is it locked behind a black box which only spits out generic information?

Thanks,

Skad-DefiasPillager
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Connecting XP gains from combat to dead mob


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