WoW:API UnitHealthMax: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
({{wowapi}}, update) |
||
| Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | |||
Returns the maximum health of the specified unit. Returns the exact hitpoints for friendly players and pets in your raid/party, percentages otherwise. | |||
Returns the | |||
local max_health = UnitHealthMax(unit); | local max_health = UnitHealthMax(unit); | ||
==Parameters== | |||
===Arguments=== | |||
:;unit : [[UnitId]] - the unit whose max health to query. | |||
: | ===Returns=== | ||
:;max_health : Integer - the maximum health of the specified unit | |||
:;max_health : the maximum health of the specified unit | |||
==Example== | |||
ChatFrame1:AddMessage('Player max health: ' .. UnitHealthMax("player") .. " HP"); | |||
ChatFrame1:AddMessage('Target max health: ' .. UnitHealthMax("target").. "%"); | |||
===Result=== | |||
Prints the maximum health of ''player'' and ''target'' units to the chat window. | |||
Revision as of 16:19, 23 December 2006
← WoW API < UnitHealthMax
Returns the maximum health of the specified unit. Returns the exact hitpoints for friendly players and pets in your raid/party, percentages otherwise.
local max_health = UnitHealthMax(unit);
Parameters
Arguments
- unit
- UnitId - the unit whose max health to query.
Returns
- max_health
- Integer - the maximum health of the specified unit
Example
ChatFrame1:AddMessage('Player max health: ' .. UnitHealthMax("player") .. " HP");
ChatFrame1:AddMessage('Target max health: ' .. UnitHealthMax("target").. "%");
Result
Prints the maximum health of player and target units to the chat window.