LibHealComm-3.0
Keeps track of healing spells cast by everyone in a group. Discussion and comments are welcome at
http://forums.wowace.com/showthread.php?t=10435.... Bug reports and requests should be posted as a ticket at
http://www.wowace.com/projects/libhea.../tickets/
Supported Healing Spells: Lesser Healing Wave, Healing Wave, Chain Heal (only first target), Flash of Light, Holy Light, Regrowth (only direct heal part), Healing Touch, Nourish, Lesser Heal, Heal, Greater Heal, Binding Heal, Greater Heal, Prayer of Healing (with range check).
Required externals when embedding this library: LibStub, CallbackHandler-1.0
Addons supporting LibHealComm-3.0
- Shadowed Unit Frames
- Grid / Grid2
- PitBull 3
- PitBull 4
- VisualHeal
- sRaidFrames
- BunchOfBars
- PerfectRaid
- oUF
- X-Perl UnitFrames
- ag_unitframes
- Chinon
- Stuf Unit Frames
- OzRaid
- IceHUD
- HealInc
- HealAssign
How to embed LibHealComm-3.0 into an addon
LibStub and CallbackHandler-1.0 are required dependencies, and must be included by the addon, before trying to get a reference to LibHealComm-3.0. The reference to LibHealComm-3.0 is obtained by the following code:
local HealComm = LibStub:GetLibrary("LibHealComm-3.0");
API Documentation (Events)
Callbacks are used to signal various events. To register an addon to be notified of a specific event, use the following code:
function MyAddon:OnEnable()
HealComm.RegisterCallback(self, "HealComm_DirectHealStart");
end
function MyAddon:HealComm_DirectHealStart(event, healerName, healSize, endTime, ...)
for i=1,select('#', ...) do
local targetName = select(i, ...);
DEFAULT_CHAT_FRAME:AddMessage(healerName .. " is healing " .. targetName .. " for " .. healSize);
end
end
The various events that can be registered are listed below.
HealComm_DirectHealStart(event, healerName, healSize, endTime, ...)
This callback is triggered when anyone in the raid/party starts casting a healing spell. Arguments:
- event - the name of the event ("HealComm_DirectHealStart").
- healerName - the fully qualified name of the healer casting the spell.
- healSize - the base size of the healing (buffs/debuffs not included).
- endTime - the absolute time where the heal will complete.
- ... - the fully qualified name(s) of the healing target(s). See example code above.
HealComm_DirectHealDelayed(event, healerName, healSize, endTime, ...)
This callback is triggered when anyone in the raid/party, who are casting a healing spell, are delayed. Arguments:
- event - the name of the event ("HealComm_DirectHealDelayed").
- healerName - the fully qualified name of the healer casting the spell.
- healSize - the base size of the healing (buffs/debuffs not included).
- endTime - the new absolute time where the heal will complete.
- ... - the fully qualified name(s) of the healing target(s). See example code above.
HealComm_DirectHealStop(event, healerName, healSize, succeeded, ...)
This callback is triggered when anyone in the raid/party completes the casting of a healing spell, or when casting is interrupted before it completes. Arguments:
- event - the name of the event ("HealComm_DirectHealStop").
- healerName - the fully qualified name of the healer casting the spell.
- healSize - the base size of the healing (buffs/debuffs not included).
- succeeded - true if the healing completed successfully, false otherwise.
- ... - the fully qualified name(s) of the healing target(s). See example code above.
HealComm_HealModifierUpdate(event, unit, targetName, healModifier)
This callback is triggered when anyone in the raid/party gains or looses a buff/debuff which changes the heal modifier. Arguments:
- event - the name of the event ("HealComm_HealModifierUpdate").
- unit - the UnitID of the player.
- targetName - the fully qualified name of the player.
- healModifier - A fractional number that is multiplied with the base heal size to yield the effective healing size. Will be 1.0 if no buffs/debuffs affect healing.
API Documentation (Methods)
The library exposes a number of methods, that provide the ability to retrieve information from the library. A method is invoked like this:
local modifier = HealComm:UnitHealModifierGet('raid10');
The available methods are listed below.
UnitIncomingHealGet(unit, time)
Retrieve information about the incoming heals to a specific unit.
Input:
- unit - The name or UnitID of the unit to retrieve information about. Examples: "Kaki", "Kaki-Emerald Dream", "party1", "player", "target".
- time - specifies an absolute boundary time. Examples: GetTime(), GetTime() + 3.
Return values:
- incomingHealBefore - The total size of the incoming heals before the boundary time.
- incomingHealAfter - The total size of the incoming heals after the boundary time.
- nextTime - the time left until the next incoming heal will land.
- nextSize - the size of the next incoming heal.
- nextName - the name of the healer casting the next incoming heal.
Note that nothing is returned if no healing is incoming to the specified unit. Also note that the returned information does not include healing cast by the player, only healing cast by remote clients.
UnitCastingHealGet(unit)
Retrieve information about the direct healing spell currently being cast by any unit.
Input:
- unit - The name or UnitID of the unit to retrieve information about. Examples: "Kaki", "Kaki-Emerald Dream", "party1", "player", "target".
Return values:
- healSize - Size of the healing being cast.
- endTime - The time when the healing completes.
- targetName - Name of the unit being targeted for heal. If the spell is targeting multiple units, this parameter will be a table containing the individual target names.
Note that nothing is returned if the specified unit is not casting a heal.
UnitHealModifierGet(unit)
Returns the modifier to healing (as a factor) caused by buffs and debuffs.
Input:
- unit - The name or UnitID of the unit to retrieve information about. Examples: "Kaki", "Kaki-Emerald Dream", "party1", "player", "target".
Return values:
- modifier - A fractional number that is multiplied with the base heal size to yield the effective healing size. Will be 1.0 if no buffs/debuffs affect healing.
This function call always returns a valid number.
GetRaidOrPartyVersions()
Returns a table containing the versions of LibHealComm-3.0 used by raid and/or party members.
Return values:
- table - A table containing key-value pairs, where the key is the name of the raid/party member and the value is the numeric value of the version used by that player.
This function call always returns a table containg at least one entry for the player.
GetGuildVersions()
Returns a table containing the versions of LibHealComm-3.0 used by online guild members.
Return values:
- table - A table containing key-value pairs, where the key is the name of the guild member and the value is the numeric value of the version used by that player.
This function call always returns a table containg at least one entry for the player.
GetUnitVersion(unit)
Returns the versions of LibHealComm-3.0 used by a specific unit.
Input:
- unit - The name or UnitID of the unit to retrieve information about. Examples: "Kaki", "Kaki-Emerald Dream", "party1", "player", "target".
Return values:
- version - The version used or false if LibHealComm-3.0 was not detected for the specified unit.
This function call always returns either a number or false.