LibMobHealth-4.0

From WowAce Wiki
Jump to: navigation, search


API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate. number boolean

:GetMaxHP("name" , level , "kind" [, difficulty] [, known])

Arguments

"name"
string - name of the unit in question in the form of "Someguy", "Someguy-Some Realm"
level
number - level of the unit in question
"kind"
string - kind of unit, can be "npc", "pc", "pet"
difficulty
number - difficulty of the unit, only applies to "npc". see http://wowwiki.com/API_GetInstanceDifficulty for details. Can be 1, 2, or 3. 1 by default.
known
boolean - whether not to guess at the mob's health based on other levels of said mob.

Returns

number or nil - the maximum health of the unit or nil if unknown

Example

local hp = LibStub("LibMobHealth-4.0"):GetMaxHP("Young Wolf", 2)

:GetUnitCurrentHP("unit")

Arguments

"unit"
string - a unit ID

Returns

number, boolean - the current health of the unit, whether the health is known or not

Example

local curhp, found = LibStub("LibMobHealth-4.0"):GetUnitCurrentHP("target")

:GetUnitHealth("unit")

Arguments

"unit"
string - a unit ID

Returns

number, number, boolean - the current health of the unit, the maximum health of the unit, whether the health is known or not

Example

local curhp, maxhp, found = LibStub("LibMobHealth-4.0"):GetUnitHealth("target")

:GetUnitMaxHP("unit")

Arguments

"unit"
string - a unit ID

Returns

number, boolean - the maximum health of the unit, whether the health is known or not

Example

local maxhp, found = LibStub("LibMobHealth-4.0"):GetUnitMaxHP("target")