WoW:API UnitHealthMax: Difference between revisions
Jump to navigation
Jump to search
UnitHealthMax -Documentation by danboo-
No edit summary |
(Clarified when a percentage is returned and when real health points are returned) |
||
| Line 38: | Line 38: | ||
;''Description'' | ;''Description'' | ||
: Returns the | : Returns the maximum health of the specified unit. The health is returned in real points only if the unit is in the player's party. Otherwise, a percentage is returned (which will always be 100 in this case). (Note, that the player, the player's pet, and any party member pets are considered to be in the party.) | ||
---- | ---- | ||
{{Template:WoW API}} | {{Template:WoW API}} | ||
Revision as of 18:46, 11 July 2005
Returns the maximal health of the specified unit, in percentage, for:
- target
- mouseover
Otherwise in points.
local max_health = UnitHealthMax(unit);
- Arguments
- (String unit)
- arg1
- the unit's max health to query
- Returns
- max_health
- max_health
- the maximum health of the specified unit
- Example
local max_health = UnitHealth("player");
local max_health2 = UnitHealth("target");
ChatFrame1:AddMessage('player max health: ' .. max_health);
ChatFrame1:AddMessage('target max health: ' .. max_health2 .. "%");
- Result
Prints the player's maximum health to the chat frame as 'player max health: 900' and 'taget max health: 100%'
- Description
- Returns the maximum health of the specified unit. The health is returned in real points only if the unit is in the player's party. Otherwise, a percentage is returned (which will always be 100 in this case). (Note, that the player, the player's pet, and any party member pets are considered to be in the party.)