Download
(30Kb)
Download
Updated: 01-11-20 06:35 AM
Compatibility:
Classic Patch (1.13.3)
Updated:01-11-20 06:35 AM
Created:05-19-19 08:09 PM
Downloads:495,278
Favorites:261
MD5:

Real Mob Health  Popular! (More than 5000 hits)

Version: 2.18
by: SDPhantom [More]

Notice:
On February 18th, 2020, Blizzard released a hotfix that enables mob health to be displayed in the Default UI.
RealMobHealth has run its course and is now obsolete. I thank everyone for their support during the lifetime of this addon.


For existing users running the Default UI, here's a list of addons that'll provide an alternative to the UITweaks module.

2.18 (2020-01-11)
-Modified death detection to hold onto data a little longer to prevent mobs with reincarnation mechanics from spamming messages
-Internal timers now use C_Timer instead of OnUpdate to try to combat "No player named <Player> is currently playing." spam after being minimized

2.17 (2019-12-13)
-Added usage of INSTANCE_CHAT as a fallback for BATTLEGROUND. (Reports are saying BATTLEGROUND is defunct)

2.16 (2019-12-12)
-Added usage of BATTLEGROUND addon channel
-RAID/PARTY addon channels now check specifically for the home group category instead of all

2.15 (2019-12-11)
-Implemented an anti-spam measure to help mitigate Blizzard's throttle bug of the YELL channel
-TextStatusBar_UpdateTextString() code moved to a secure hook to mitigate Blizzard taint bug

2.14 (2019-12-10)
-The YELL addon channel has been added to the list of broadcast channels
-Some internal functions are now metatable-aware (opens possibilities for future features?)

2.13 (2019-09-25)
-Removed lingering debug message that was hiding in the aura scanner

2.12 (2019-09-23)
-Now detects health from a Hunter's Beast Lore
-Added ruRU localization (courtesy of vAlshebnik)

2.11 (2019-09-15)
-Localization.lua now uncludes Unicode BOM for easier UTF-8 editing
-Revised deDE localization (courtesy of Dathwada)
-Added esES localization (courtesy of Lynk_One)

2.10 (2019-09-11)
-Added koKR localization (courtesy of chkid)

2.9 (2019-09-10)
-Added deDE localization (courtesy of Figlmueller)
-Fixed zhCN, zhTW, and koKR numeric abbreviations

2.8 (2019-09-09)
-Added zhCN and zhTW localizations (courtesy of EKE00372 and HopeASD)

2.7 (2019-09-08)
-Fixed Localization loader not loading the default locale for some people

2.6 (2019-09-08)
-Added frFR localization (courtesy of Pgmbru)

2.5 (2019-09-06)
-GameTooltip health text is now offloaded to the same on-use generation code that TargetFrame uses

2.4 (2019-09-05) APIVersion: 3.2
-Fixed TargetFrame text not checking options on creation
-Added health text to the GameTooltip's StatusBar
-"Show Tooltip Info" in options has been renamed "Show Tooltip Feedback" to avoid ambiguity with the new health text
-Added API version info to API
Note: APIVersion is noted in this log for continuity, however it's only available starting now
-Added RealMobHealth.OverrideOption() and RealMobHealth.UITweaksSetEnabled() to API (See APIDoc.txt)

2.3 (2019-08-11) APIVersion: 3.1
-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) APIVersion: 3.0
-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) APIVersion: 2.0
-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) APIVersion: 1.0
-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 09-02-19, 06:31 AM  
Sojiro84
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Re: Re: always show health numbers

Thanks for your suggestion! I got it working now for all. Thanks a ton!
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 08-31-19, 09:54 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2326
File comments: 132
Uploads: 38
Re: always show health numbers

Originally Posted by wafflehatjoe
hey could we add something to always show estimated hp numbers inside the health bar of the target frame? instead of only on mouseover? I understand some people may not like this so it would be handy if it was a toggleable feature inside the options menu for the addon. great work though, fixed my main gripe.
It's showing up fine on my end. Could be a conflict with another addon.
__________________
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-31-19, 08:11 PM  
wafflehatjoe
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
always show health numbers

hey could we add something to always show estimated hp numbers inside the health bar of the target frame? instead of only on mouseover? I understand some people may not like this so it would be handy if it was a toggleable feature inside the options menu for the addon. great work though, fixed my main gripe.
Report comment to moderator  
Reply With Quote
Unread 08-31-19, 10:32 AM  
Metriss
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Originally Posted by SDPhantom
Code:
local OLD_UnitHealth,OLD_UnitHealthMax=UnitHealth,UnitHealthMax;
function UnitHealth(unit)
	if not RealMobHealth then return OLD_UnitHealth(unit); end
	local cur,max=RealMobHealth.GetUnitHealth(unit); return cur;
end
function UnitHealthMax(unit)
	if not RealMobHealth then return OLD_UnitHealthMax(unit); end
	local cur,max=RealMobHealth.GetUnitHealth(unit); return max;
end
Edit: Fixed another load order issue
Thanks for making this, it's awesome. I was even able to my make own plugin for Elvui that adds a "[health:real]" tag so I don't have to edit anything every time I update.

Code:
ElvUF.Tags.Events['health:real'] = 'UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED'
ElvUF.Tags.Methods['health:real'] = function(unit)
	local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]

	if (status) then
		return status
	else
		local cur,max
		if not RealMobHealth then
			max = UnitHealthMax(unit)
			cur = UnitHealth(unit)
		else
			cur,max=RealMobHealth.GetUnitHealth(unit)
		end

		return E:GetFormattedText('CURRENT_PERCENT', cur, max)
	end
end
if anyone is interested. Seems to be working great so far.
Last edited by Metriss : 08-31-19 at 12:22 PM.
Report comment to moderator  
Reply With Quote
Unread 08-31-19, 08:13 AM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2326
File comments: 132
Uploads: 38
Originally Posted by Sojiro84
Hello!

Thanks for making this addon. I love it. I do have one question though.


How can I change the font in the unit frames? I made a little script myself before using your addon but that doest seem to work anymore.


I want to change my frame and the target frames font size to 11 and having no outline.


I looked in your addon and I only see 1 line regarding font and changing that doesn't seem to have worked.


The reason I want to change it is by default (blizzards default) the font size is too bug for the health bar and I want it smaller so it fits in nicely.


I hope you can give me a pointer to what I need to change.
The only custom font setting used is for the nameplates. The TargetFrame is inherited from TextStatusBarText just like the PlayerFrame text. If you call TextStatusBarText:SetFont(), this'll propagate down and apply to both the PlayerFrame and TargetFrame along with the XP and reputation bars at the bottom of the screen.

Alternatively, you can access the FontStrings individually like this:
Code:
TargetFrameHealthBar.TextString
TargetFrameHealthBar.LeftText
TargetFrameHealthBar.RightText
TargetFrameManaBar.TextString
TargetFrameManaBar.LeftText
TargetFrameManaBar.RightText
__________________
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-31-19, 03:25 AM  
Sojiro84
Guest

Join Date: Not Yet
Forum posts: 0
File comments: 0
Uploads: 0
Hello!

Thanks for making this addon. I love it. I do have one question though.


How can I change the font in the unit frames? I made a little script myself before using your addon but that doest seem to work anymore.


I want to change my frame and the target frames font size to 11 and having no outline.


I looked in your addon and I only see 1 line regarding font and changing that doesn't seem to have worked.


The reason I want to change it is by default (blizzards default) the font size is too bug for the health bar and I want it smaller so it fits in nicely.


I hope you can give me a pointer to what I need to change.
Report comment to moderator  
Edit/Delete Message Reply With Quote
Unread 08-30-19, 03:28 PM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2326
File comments: 132
Uploads: 38
Originally Posted by trickdaemon
Is there any way to remove the "no info obtained" or "info obtained" from teh tooltips? I can tell it's been obtained when the health values go from 100% to actual 120/120

Love the addon, thank you!
Originally Posted by SDPhantom
Interface Options > AddOns tab > RealMobHealth > Show Tooltip Info
Uncheck that
__________________
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-30-19, 12:34 PM  
trickdaemon
An Aku'mai Servant

Forum posts: 36
File comments: 40
Uploads: 0
Is there any way to remove the "no info obtained" or "info obtained" from teh tooltips? I can tell it's been obtained when the health values go from 100% to actual 120/120

Love the addon, thank you!
Last edited by trickdaemon : 08-30-19 at 12:35 PM.
Report comment to moderator  
Reply With Quote
Unread 08-30-19, 08:30 AM  
Motiv
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Originally Posted by Nevcairiel
I'll add native and proper support to ShadowedUnitFrames soon, but I have more crucial things to fix for now and only a finite amount of time, so be patient.
mine seems to be working on SuF without any file edits now, dunno if you've done whatever you were gunna do to fix it yet but thank you anyway you hero x
Last edited by Motiv : 08-30-19 at 08:31 AM.
Report comment to moderator  
Reply With Quote
Unread 08-29-19, 11:12 AM  
adl
A Kobold Labourer

Forum posts: 0
File comments: 13
Uploads: 0
Originally Posted by Nevcairiel
I'll add native and proper support to ShadowedUnitFrames soon, but I have more crucial things to fix for now and only a finite amount of time, so be patient.
thanks
Report comment to moderator  
Reply With Quote
Unread 08-29-19, 03:08 AM  
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 63
File comments: 105
Uploads: 5
I'll add native and proper support to ShadowedUnitFrames soon, but I have more crucial things to fix for now and only a finite amount of time, so be patient.
Last edited by Nevcairiel : 08-29-19 at 03:10 AM.
Report comment to moderator  
Reply With Quote
Unread 08-29-19, 01:15 AM  
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2326
File comments: 132
Uploads: 38
Originally Posted by ujellyx
Does anyone know how to fix "whoa ThickFrames" to show the real health instead of "100% 100"? I did find the custom status text format-function (inside whoaThickFrame.lua), but I don't know how to properly edit it.
WoahThickFrames seems to be working fine out of the box. RealMobHealth doesn't come preloaded with health values, you still have to discover them.



Originally Posted by Scoboose
If you would like this to work with Shadowed Unit Frames add the following to the top of modules\health.lua

Code:
function UnitHealth(unit) local cur,max=RealMobHealth.GetUnitHealth(unit); return cur; end
function UnitHealthMax(unit) local cur,max=RealMobHealth.GetUnitHealth(unit); return max; end
This patch code was made specifically for ElvUI because it stored local references to these functions and this overwrote them. Putting them in SUF overwrites the global functions and causes the entire UI to crash.

SUF has a weird way of defining their tag functions as strings in modules/tags.lua. These are loaded by ShadowUF:OnInitialize() in ShadowedUnitFrames.lua. What I ended up doing is create my own function environment for these tag functions and inject it when SUF loads them.

This code comes in two parts. First, we define our environment. Put this at the top of ShadowedUnitFrames.lua.
Code:
local OLD_UnitHealth,OLD_UnitHealthMax=UnitHealth,UnitHealthMax;
local TagEnv=setmetatable({
	UnitHealth=function(unit)
		if not RealMobHealth then return OLD_UnitHealth(unit); end
		local cur,max=RealMobHealth.GetUnitHealth(unit); return cur;
	end;
	UnitHealthMax=function(unit)
		if not RealMobHealth then return OLD_UnitHealthMax(unit); end
		local cur,max=RealMobHealth.GetUnitHealth(unit); return max;
	end;
},{__index=_G,__newindex=function(_,k,v) _G[k]=v; end});
Around line 60, you'll find this metatable. Insert the highlighted line.
Code:
-- Setup tag cache
self.tagFunc = setmetatable({}, {
	__index = function(tbl, index)
		if( not ShadowUF.Tags.defaultTags[index] and not ShadowUF.db.profile.tags[index] ) then
			tbl[index] = false
			return false
		end

		local func, msg = loadstring("return " .. (ShadowUF.Tags.defaultTags[index] or ShadowUF.db.profile.tags[index].func or ""))
		if( func ) then
			func = func()
		elseif( msg ) then
			error(msg, 3)
		end

		setfenv(func, TagEnv)
		tbl[index] = func
		return tbl[index]
end})


PS: I ran into another loading issue with ElvUI and revised my patch code to compensate.
Code:
local OLD_UnitHealth,OLD_UnitHealthMax=UnitHealth,UnitHealthMax;
function UnitHealth(unit)
	if not RealMobHealth then return OLD_UnitHealth(unit); end
	local cur,max=RealMobHealth.GetUnitHealth(unit); return cur;
end
function UnitHealthMax(unit)
	if not RealMobHealth then return OLD_UnitHealthMax(unit); end
	local cur,max=RealMobHealth.GetUnitHealth(unit); return max;
end
In addition, the tooltip is still showing the old values. This can be fixed by inserting the highlighted line in ElvUI/Modules/Tooltip/Tooltip.lua line 460.
Code:
function TT:GameTooltipStatusBar_OnValueChanged(tt, value)
	if tt:IsForbidden() then return end
	if not value or not self.db.healthBar.text or not tt.text then return end
	local unit = select(2, tt:GetParent():GetUnit())
	if(not unit) then
		local GMF = GetMouseFocus()
		if(GMF and GMF.GetAttribute and GMF:GetAttribute("unit")) then
			unit = GMF:GetAttribute("unit")
		end
	end

	local _, max = tt:GetMinMaxValues()
	if(value > 0 and max == 1) then
		tt.text:SetFormattedText("%d%%", floor(value * 100))
		tt:SetStatusBarColor(TAPPED_COLOR.r, TAPPED_COLOR.g, TAPPED_COLOR.b) --most effeciant?
	elseif(value == 0 or (unit and UnitIsDeadOrGhost(unit))) then
		tt.text:SetText(_G.DEAD)
	else
		if unit and RealMobHealth then value,max=RealMobHealth.GetUnitHealth(unit); end
		tt.text:SetText(E:ShortValue(value).." / "..E:ShortValue(max))
	end
end
__________________
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-29-19 at 02:13 AM.
Report comment to moderator  
Reply With Quote
Unread 08-28-19, 10:28 PM  
ujellyx
A Murloc Raider

Forum posts: 4
File comments: 4
Uploads: 0
Does anyone know how to fix "whoa ThickFrames" to show the real health instead of "100% 100"? I did find the custom status text format-function (inside whoaThickFrame.lua), but I don't know how to properly edit it.

Thanks in advance!
Report comment to moderator  
Reply With Quote
Unread 08-28-19, 10:15 PM  
Motiv
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Originally Posted by Scoboose
If you would like this to work with Shadowed Unit Frames add the following to the top of modules\health.lua

Code:
function UnitHealth(unit) local cur,max=RealMobHealth.GetUnitHealth(unit); return cur; end
function UnitHealthMax(unit) local cur,max=RealMobHealth.GetUnitHealth(unit); return max; end
This doesn't seem to be working for my SuF, just shows [afk][()perhp] or 89% on my target frame for some reason
(also takes away all of my edits on the target frame, level, name, widget edits etc.)
Last edited by Motiv : 08-28-19 at 10:18 PM.
Report comment to moderator  
Reply With Quote
Unread 08-28-19, 09:15 PM  
Scoboose
A Defias Bandit

Forum posts: 2
File comments: 1
Uploads: 0
If you would like this to work with Shadowed Unit Frames add the following to the top of modules\health.lua

Code:
function UnitHealth(unit) local cur,max=RealMobHealth.GetUnitHealth(unit); return cur; end
function UnitHealthMax(unit) local cur,max=RealMobHealth.GetUnitHealth(unit); return max; end
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: