View Single Post
05-28-11, 10:16 AM   #12
hankthetank
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 64
Sourceflag, GUID - comes to the same thing.

Now that you say it, searching by hp could be done.

Code:
Combatlog damage event->
    Get sourceGUID & destGuid ->
        Do a raid/party/etc[N].."target" scan ->
            sGUID == GUID(raid[N]) && dGuid == GUID(raid[N].."target") ->
                Save UnitHealth, UnitHealthMax and UnitName
    Iterate nameplates ->
        Compare hpBar:GetMax, hpBar:GetValue and name:GetText values ->
            Save GUID
The process would be much more economical if you maintain raidN<->targetGUID pairs you update on UNIT_TARGET instead of doing a group target scan every time. But the whole thing won't help you when you are not in some kind of group because you will need this intermediate step with the target scan. I would also record if all nameplates currently have GUID informations as reactions to combatlog events are costly. Also chances are not so bad that if a mage goes into a goup of mobs and AEs the crap out of them the hpbar values are not distinct, especially in the low level range.

Last edited by hankthetank : 05-28-11 at 10:35 AM.
  Reply With Quote