• World of Warcraft Addons
Advertisement
  • World of Warcraft
  • Average Rating:

  • Your Rating

  • Share
  • Report Abuse

Instant Health

  Download the Curse Client

Project Updated:
Files Updated: Sat, Oct 18 2008
Category: Unit Frames, and Combat
Tags:

, and [Edit Tags]

Project Manager: Meloeth
Current Version: Instant Health 1.1b
Downloads Today: 273
Downloads Total: 58,703
Favorites: 328
Comments: 67
  • About Instant Health
  •  
This addon updates the health of player/party/raid members and pets much faster then normal by using the combat log rather then

waiting for the server to send updated health info. Normally the health of a unit doesn't update faster then at most 3 times per second and there is often a delay between someone taking damage and the health updating. With this addon the health is updated instantly and the health updates as many times per second as the unit is taking hits and heals.

New in version 1.1

  • Added the ability for other addons to register for faster health updates.
  • Added a option for the user to choose if faster updates should be done for all addons or just the addons that has registered for faster updates.
  • Included a optional module that registers and handles the updates for blizzards default frames.

One of the advantages with only speeding up the health updates for addons that has registered for them is better performance, most noticeably in fights where a lot is going on while having a damage meter running. Another is that the tainting of blizzards frames can be avoided so that the targetOfTarget frame works (see tainting for details).

One issue you might get from this version is that addons that have not registered for faster health updates and which saves a local variable of UnitHealth(unit) won't receive faster health updates. In this case you might be better off using version 1.0.6 of the addon.

(this version of the addon has been tested in the WotLK beta and appears to be working without any issues. As a bonus the health of ALL units are being updated faster in WotLK, including hostile mobs and players)

Tainting

In short all blizzard code starts off as 'secure' but becomes tainted if a 3rd party addon such as this messes with it. Tainted code is unable to do some things such as showing or hiding frames while in combat. In the case of blizzards targetOfTarget frame it stops working properly if it gets tainted since the blizzard code tries to show and hide it during combat.

This version of the addon comes with a option to enable and disable a filter. This filter when enabled will only update addons that have registered for the faster health updates. As long as this filter is enabled it will not mess with blizzards code and will NOT cause tainting issues. If this filter is disabled however the addon will attempt to speed up the health updates of any and all addons and in the process it will taint blizzards code causing issues with blizzards unit frames such as the targetOfTarget frame.

How to avoid taint
Be sure the filter is enabled when you log in, if it's disabled at any time while playing blizzards code will get tainted, the only way of removing the taint is enabling the filter and reloading the UI ( /script ReloadUI() ).

Slash commands

Type '/instantHealth list' to see a list of addons that has registered for faster health updates. If you enable the filter these will be the only addons receiving faster health updates. If some addons are not on the list that you wish should receive faster updates it might be better to have the filter disabled. Type '/instantHealth filter enable' to enable the filter. Type '/instantHealth filter disable' to disable the filter.

About the server

  • The server doesn't send health updates for a unit faster then once every 0.3 seconds, often it's slower.
  • Combat log messages are sent as soon as the event happens making damage and healing show at the client before the affected units health is updated.
  • There are strong indications that the server not just sends health updates a bit slow, but that it in fact calculates the health at intervals of roughly 0.3 seconds.
  • It is possible, sometimes, to get in a heal on someone with negative health if the heal lands almost exactly after the health drops to negative (the reaction time plus latency needs to be around 0.3 seconds or less).

Performance

This addon in itself uses very little system resources (up to around 100 kb of memory in 25 man raids), it does however make all addons listening for the UNIT_HEALTH event to do a lot more work (such as unit frames, damage meters and threat meters), depending on what other addons you have installed and the cpu of your computer you may notice anywhere from no performance impact at all to a fairly large performance impact from using this addon.


For addon authors

I have tried to do the API as simple as possible and documentation as clear as possible (still messy?), if you have comments on how I can change or improve either feel free to leave a comment/message here or send a e-mail to meloeth@hotmail.com.

IH_UnitHealth(unitID)
Get the current health of unitID.

args
unitID - any valid unitID

returns
health - integer. Current health of the unit, can be negative. Returns 0 if the unit doesn't exist.


IH_Register(key, method [, extra])
Registers a method to be called when a units health changes. The unitID of the unit which health changed will be passed as the first argument.

args
key - must be of type String, must be unique. This is what the user will see when they list addons that has registered for faster health updates. It's recommended that you use your addons name as key!
method - the function to be called
[extra] - type boolean. Set to false or ignore if the function should only be notified of the same unitIDs you would expect if you registered for UNIT_HEALTH events. Set to true if the function should be notified of ANY valid unitID such as 'targettarget', 'raid1pettarget' or even names such as 'Imatank' (if that was the name of someone in the raid/party). Notice that Instant_Health has no way of tracking these extra unitIDs by itself. To active a unitID it has to be passed to IH_UnitHealth(unitID) after which Instant_Health will remember it until the GUID targeted by the unitID changes. Then it needs to be passed again to trigger the unitID to be sent again. So it's up to you to call IH_UnitHealth(unitID) whenever the unitID starts referring to someone else (like when the ToT changes you need to pass 'targettarget' to IH_UnitHealth(unitID) if you want to make sure your addon is notified of the ToTs health changing).

Example
a easy way to modify a addon for faster health updates. Might not be this easy with every addon and might not be the most optimal way with some addons, but just to give you a idea of how you can do it. The addon in this example is modified so that if Instant_Health is not available it works like normal and if Instant_Health is available it registers for the faster health updates and makes the function that is registered for the updates simply call the original function that handles the updates.

-- create a local variable pointing to the function UnitHealth(unit)
local UnitHealth = UnitHealth 
 
-- the function that will be called by Instant_Health
function PixieUnitHealth(unitID)

   -- the function you already use for updating the health
   PF_event.UNIT_HEALTH(unitID) 
end

-- your function listening for ADDON_LOADED events
function PF_event.ADDON_LOADED(arg1)
  if arg1 == "PixieFrames" then
	
     ...
     ...
	
     -- first check if these functions exists!
     if IH_Register and IH_UnitHealth then
		
        -- register function to be called when a units health changes
        IH_Register("PixieCore", PixieUnitHealth)
			
        -- change the local variable to point to IH_UnitHealth(unitID)
        -- instead (be sure you have saved a local variable of UnitHealth
        -- and hat you are changing the local variable!)
        UnitHealth = IH_UnitHealth
			
        -- unregister the UNIT_HEALTH event so your function doesn't get
        -- called more often then needed
        PF_eventFrame:UnregisterEvent("UNIT_HEALTH")
     end
  end
end

IH_Unregister(key)
Unregister health change notifications.

args
key - type String. (the exact same key that was used to register)

returns
True if the function related to this key got unregistered, false otherwise.

IH_IterateRegister()
Returns a iterator over keys used to register.

Example

for key, method in IH_IterateRegister() do
	DEFAULT_CHAT_FRAME:AddMessage(key)
end
  • Downloads (8)
  •  
File Name Release Type Game Version Downloads Date
Addon Curse.com Beta 2.3.3 0 9/29/2008
  File Name Release Type Game Version Downloads Date  
  Instant Health 1.1b Release 3.0.2 9,791 10/18/2008
  Instant Health 1.1 Release 2.4.3 4,228 8/24/2008
  Instant Health 1.0.6 Release 2.4.3 24 7/5/2008
  Instant Health 1.0.5 Release 2.4.2 10 6/15/2008
  Instant Health 1.0.4 Release 2.4.2 5 6/13/2008
Advertisement
  • Comments

Add Comment

Add

You need to login or register to post.

Benefits of Registration

  • Interact with hundreds of thousands of other gamers on an open social network.
  • Post your stories, news, images, videos, and other content to share.
  • Create a network with your fellow gamers or join an existing one.
  • Gain reputation for everything you do.