Quantcast
Download
(22 Kb)
Download
Updated: 08-11-19 07:00 AM
Compatibility:
WoW Classic (1.13.2)
Updated:08-11-19 07:00 AM
Created:05-19-19 08:09 PM
Downloads:28,386
Favorites:100
MD5:

Real Mob Health  Popular! (More than 5000 hits)

Version: 2.3
by: SDPhantom [More]

RealMobHealth records damage taken by a mob. This is used to estimate its max health when in combat and stores it for better accuracy in the future. RealMobHealth also broadcasts discovered health to others using the addon and can query them for unknown mobs.

See APIDoc.txt if you wish to add support to your addon or UI.



Commands:

/RMHDel [UnitID]
Removes selected UnitID from stored health values. This defaults to target if not specified. (Does not effect received peer data)

/RMHWipe
Clears all recorded health data. (Does not effect received peer data)



Known issues:

  • Drunkenness lowers the perceived level of a mob, this will confuse the addon if used while your character is drunk.
  • Recorded damage may not clear if an untargeted mob in CombatLog range resets and is re-engaged.
  • Due to the impreciseness of UnitHealth(), damage recording only starts once a hit brings a mob down to 99% or below.
    To mitigate this, there are a few seconds between when damage recording starts and when reset detection is allowed to run.
  • Race conditions exist in the CombatLog which may cause the addon to occasionally miss damage events at the beginning or end of a fight.
    Examples: CombatLog events firing after a UNIT_DEATH occurs and UnitHealth() not updating in time when a fight starts.
  • Mobs killed by NPCs like faction guards sometimes don't send overkill data in the CombatLog. This causes unusually high health to be recorded.

2.3 (2019-08-11)
-Improved UITweaks' integration with layout addons
-Tooltip lines have been added to the localization table
-Tooltip now shows if a creature's health is overridden
-Added RealMobHealth.HasHealthOverride() to API (See APIDoc.txt)

2.2 (2019-08-09)
-Fixed newly created nameplates not checking options

2.1 (2019-08-08)
-Implemented GetNormalizedRealmName() fallback if UnitFullName("player") fails to return realm name
-Fixed stack overflow in UITweaks

2.0 (2019-07-14)
-Complete restructure
-Supporting code is split into different modules
-Peer system broadcasts discovered health values and makes queries through the AddOn comm channels
-Health recording can now happen when targeting a corpse after witnessing a fight
-New cache timeout system purges damage data from mobs that have not been seen in a while
-Cache timeout varies based on what data exists for the mob and if the addon is aware the mob is dead
-BlizzardUI Tweaks is reintegrated to streamline the new options system
-Lots of API additions/tweaks/changes (See APIDoc.txt)
-Callbacks are now handled by the new event system
-RealMobHealth.GetUnitHealth() speculative mode is now force-enabled. The argument to control it has been removed.

1.1 (2019-06-05)
-Streamlined the core code
-Fixed issue with Shaman totems getting recorded
-World/Raid bosses are now supported
-Damage reflection is now properly tallied
-More API functions (See APIDoc.txt)
-RealMobHealth.GetHealth() had been renamed RealMobHealth.GetUnitHealth()
-RealMobHealth.GetUnitHealth() now falls back to native values if not enough data present
-GameTooltip hook now only runs if the unit is attackable

1.0 (2019-05-19)
-Classic release
-Records damage taken of nearby mobs from the CombatLog
-Obtains mob level using mouseover/target/partytarget/raidtarget and if enabled, nameplates
-TargetFrame and Nameplates show text values for health, TargetFrame also shows mana/rage/energy
-Gametooltip shows which mobs have had their health recorded
Post A Reply Comment Options
Unread Yesterday, 10:58 AM  
tyrone77
A Kobold Labourer

Forum posts: 0
File comments: 4
Uploads: 0
Originally Posted by SDPhantom
Originally Posted by tyrone77
Hi, so I'm currently on a 1.13 sandbox to get all my addons ready before release. I keep getting this error with your addon, I'm not even sure if it will be applicable to the live servers later on but would love if you could tell me what went wrong here.
It's a bug with your sandbox. It doesn't provide a server name and throws nil.
In short, this works fine on the official game servers/client.
Great, that's what I suspected. Thanks for the reply!
Report comment to moderator  
Reply With Quote
Unread 08-20-19, 05:09 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1804
File comments: 104
Uploads: 23
Originally Posted by tyrone77
Hi, so I'm currently on a 1.13 sandbox to get all my addons ready before release. I keep getting this error with your addon, I'm not even sure if it will be applicable to the live servers later on but would love if you could tell me what went wrong here.
It's a bug with your sandbox. It doesn't provide a server name and throws nil.
In short, this works fine on the official game servers/client.
__________________
ESOUI AddOns | 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 : 08-20-19 at 05:17 PM.
Report comment to moderator  
Reply With Quote
Unread 08-20-19, 12:24 PM  
tyrone77
A Kobold Labourer

Forum posts: 0
File comments: 4
Uploads: 0
Hi, so I'm currently on a 1.13 sandbox to get all my addons ready before release. I keep getting this error with your addon, I'm not even sure if it will be applicable to the live servers later on but would love if you could tell me what went wrong here.

Message: Interface\AddOns\RealMobHealth\Core.lua:205: bad argument #3 to 'string_format' (string expected, got nil)
Time: Tue Aug 20 20:21:30 2019
Count: 1
Stack: Interface\AddOns\RealMobHealth\Core.lua:205: bad argument #3 to 'string_format' (string expected, got nil)
[C]: ?
Interface\AddOns\RealMobHealth\Core.lua:205: in function <Interface\AddOns\RealMobHealth\Core.lua:203>
(tail call): ?
[C]: ?
Interface\AddOns\RealMobHealth\Events.lua:49: in function <Interface\AddOns\RealMobHealth\Events.lua:47>
Interface\AddOns\RealMobHealth\Events.lua:62: in function <Interface\AddOns\RealMobHealth\Events.lua:53>
Interface\AddOns\RealMobHealth\Events.lua:165: in function <Interface\AddOns\RealMobHealth\Events.lua:162>

Locals: <none>
Last edited by tyrone77 : 08-20-19 at 12:27 PM.
Report comment to moderator  
Reply With Quote
Unread 08-18-19, 05:49 AM  
adl
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally Posted by SDPhantom
Originally Posted by adl
Hello, im wondering if its possible to let us change the HP font and shadow? Im currently using a nameplate addon and i would be really happy if i was able to make the HP font match my nameplate font.
In UITweaks.lua line 169, there should be a line like this.
Code:
health:SetFont("Fonts\\ArialN.ttf",10,"THICKOUTLINE");
Feel free to change that around as you wish. See FontString:SetFont() for reference.
Oh thanks a lot. I figured out how to make it look exactly as i wanted.
Last edited by adl : 08-18-19 at 07:40 AM.
Report comment to moderator  
Reply With Quote
Unread 08-17-19, 12:20 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1804
File comments: 104
Uploads: 23
Originally Posted by adl
Hello, im wondering if its possible to let us change the HP font and shadow? Im currently using a nameplate addon and i would be really happy if i was able to make the HP font match my nameplate font.
In UITweaks.lua line 169, there should be a line like this.
Code:
health:SetFont("Fonts\\ArialN.ttf",10,"THICKOUTLINE");
Feel free to change that around as you wish. See FontString:SetFont() for reference.
__________________
ESOUI AddOns | 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 : 08-17-19 at 12:20 PM.
Report comment to moderator  
Reply With Quote
Unread 08-17-19, 06:16 AM  
adl
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Hello, im wondering if its possible to let us change the HP font and shadow? Im currently using a nameplate addon and i would be really happy if i was able to make the HP font match my nameplate font.
Report comment to moderator  
Reply With Quote
Unread 08-15-19, 01:56 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1804
File comments: 104
Uploads: 23
Originally Posted by Duman
Just out of curiosity -- why doesn't your addon just override the UnitHealth() and UnitHealthMax() builtins? Are there certain things that will break/explode if you do this?
Changing a built-in function always runs the risk of breaking everything, either by imperfect replication of the function, future changes, or by taint. My concern is it's common and even suggested for addons to store local references to globals if they call them frequently. This means any addon that does this before we even load is immune to the change. It's just not a feasible solution.



Originally Posted by NeroDrops
So technically I'd just use a custom function to call the RealMobHealth.GetUnitHealth()
with

Code:
local curHealth, maxHealth, curIsEstimate, maxIsEstimate = RealMobHealth.GetUnitHealth(unit)
and return the value as output?
Yep, though you can cut out the "IsEstimate" variables if you don't have a use for them. Lua will just discard those if you do.
__________________
ESOUI AddOns | 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 : 08-16-19 at 06:26 AM.
Report comment to moderator  
Reply With Quote
Unread 08-15-19, 12:34 PM  
Duman
A Murloc Raider

Forum posts: 9
File comments: 36
Uploads: 0
Hey SDPhantom,

Just out of curiosity -- why doesn't your addon just override the UnitHealth() and UnitHealthMax() builtins? Are there certain things that will break/explode if you do this?

I realize other addons can just create their own "UnitHealth"-esque functions that check for RealMobHealth and use that if it exists, but that seems like unnecessary checks that everyone needs to do, rather than just overriding the builtins. (And means I need to hack this into all the various addons I have that may try to display a mob's health )

Would love to understand why you chose not to override

Thanks!
Report comment to moderator  
Reply With Quote
Unread 08-15-19, 06:46 AM  
NeroDrops
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Thx for ur fast reply I really apreciate ur help.

So technically I'd just use a custom fuction to call the RealMobHealth.GetUnitHealth()
with

local curHealth, maxHealth, curIsEstimate, maxIsEstimate = RealMobHealth.GetUnitHealth(unit)

and return the value as output?

Greetings
Report comment to moderator  
Reply With Quote
Unread 08-14-19, 03:13 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1804
File comments: 104
Uploads: 23
Re: Calling the Real Mob Health Value in Weakauras 2

Originally Posted by NeroDrops
I'm working on creating individual unitframes for my UI via WeakAuras2
Every frame is working with Health values % and numeric for party frames and playerframe.
Im using simple progressbars which show the health value as text in the options (default)

Now comes the struggle:
On the target frame the health value is only Percentage because on default as we know in the Classic client thers no health value for target Mobs.

Is it possible to call the target health value from the Real Mob Health Addon via Weakauras 2 and display it as a a numeric value?
I haven't done anything with WeakAuras, so I wouldn't know how to set it up without spending some time with the addon. However, documentation on the RealMobHealth API is available in APIDoc.txt. RealMobHealth.GetUnitHealth() should be listed near the bottom in the Health Data section.
Code:
RealMobHealth.GetUnitHealth(unit)
	Gets current and max health for unit
	Extra returns are booleans that signal if current and max health respectively are estimates
	Note: Extra returns are both nil if not enough data present and reverting to UnitHealth() and UnitMaxHealth()
		This function ignores peer data if the EnablePeerCache option is set to false
Example:
Code:
local curHealth, maxHealth, curIsEstimate, maxIsEstimate = RealMobHealth.GetUnitHealth(unit)
__________________
ESOUI AddOns | 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)
Report comment to moderator  
Reply With Quote
Unread 08-14-19, 06:36 AM  
NeroDrops
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Calling the Real Mob Health Value in Weakauras 2

Hey SDPhantom,

I'm working on creating individual unitframes for my UI via WeakAuras2
Every frame is working with Health values % and numeric for party frames and playerframe.
Im using simple progressbars which show the health value as text in the options (default)

Now comes the struggle:
On the target frame the health value is only Percentage because on default as we know in the Classic client thers no health value for target Mobs.

Is it possible to call the target health value from the Real Mob Health Addon via Weakauras 2 and display it as a a numeric value?

Could u help me out how I could do that on a progress bar just to show the Real Mob Health value of my current target when its a mob and already tracked with Real Mob Health?

Greetings,

NeroDrops
Last edited by NeroDrops : 08-14-19 at 06:39 AM.
Report comment to moderator  
Reply With Quote
Unread 08-14-19, 06:11 AM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1804
File comments: 104
Uploads: 23
Originally Posted by Xenomorph2004
Do you know, if it would be possible to do something similar to the Tags.lua File in the ElvUI/Modules/Nameplates/ folder? So that the nameplates also draw the correct info from Real Mob Health. I had a look, but that Tags.lua doesn't have a TAGS section included within it. Would be amazing if you had any quick ideas I could try?

EDIT: Would the same code as you posted before work possibly after the line --GLOBALS: Hex ?
I ran a search for usage of UnitHealth() in the entire addon and the file I specified is the only space where formatting is defined. Adding the code in Nameplates would overwrite the Blizzard API since it's not defined as a local there, so it would propagate to the global space instead of being contained in the file. In all, both files are configuring oUF without any concern for what kind of UnitFrames they apply to. I assume for now, the instructions I posted previously are adequate enough to apply to the entire UI as a whole. I won't have a chance to test it until launch.
__________________
ESOUI AddOns | 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)
Report comment to moderator  
Reply With Quote
Unread 08-14-19, 05:37 AM  
Xenomorph2004
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Code:
local RMH_GetUnitHealth=RealMobHealth.GetUnitHealth;
function UnitHealth(unit) local cur,max=RMH_GetUnitHealth(unit); return cur; end
function UnitHealthMax(unit) local cur,max=RMH_GetUnitHealth(unit); return max; end

This is genuinely amazing work. I tried myself to go through the ElvUI code to see how they had it, but didn't even consider changing the values via the Tags file. Stupid me.

Do you know, if it would be possible to do something similar to the Tags.lua File in the ElvUI/Modules/Nameplates/ folder? So that the nameplates also draw the correct info from Real Mob Health. I had a look, but that Tags.lua doesn't have a TAGS section included within it. Would be amazing if you had any quick ideas I could try?

Thanks again for your amazing work. A life saver!

EDIT: Would the same code as you posted before work possibly after the line --GLOBALS: Hex ?
Last edited by Xenomorph2004 : 08-14-19 at 05:53 AM.
Report comment to moderator  
Reply With Quote
Unread 08-12-19, 04:17 PM  
ryguy182
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Thanks so much for checking it out SDPhantom!

Unfortunately I'll probably to wait until launch now to give it a shot. Really didn't expect you to go digging in another addon for me.
Report comment to moderator  
Reply With Quote
Unread 08-12-19, 03:10 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1804
File comments: 104
Uploads: 23
Originally Posted by woowoowoo
Have never seen it working on the target frame even with no other addons.
What version were you running? 2.1 had a stack overflow in the TargetFrame code that I put out a fix for already. Otherwise, it seemed to be working fine when I ran the current version (now 2.3).



Originally Posted by ryguy182
Did anyone manage to get this working? I got basically all my addons the way I want barring some that needs stability/error updates, but unfortunately it just defaults to 100 hp for everything with ElvUI.
I dug around in their code and in ElvUI/Modules/UnitFrame/Tags.lua, around line 70, you'll find a comment header named Tags. Insert this right under it.
Code:
local RMH_GetUnitHealth=RealMobHealth.GetUnitHealth;
function UnitHealth(unit) local cur,max=RMH_GetUnitHealth(unit); return cur; end
function UnitHealthMax(unit) local cur,max=RMH_GetUnitHealth(unit); return max; end
This will replace the local references of these functions in that file with a function that pulls values from RealMobHealth.
__________________
ESOUI AddOns | 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)
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: