Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API GetPetHappiness
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} Returns the pet's happiness, damage percentage, and loyalty gain rate. happiness, damagePercentage, loyaltyRate = GetPetHappiness() == Parameters == === Arguments === :none === Returns === :happiness, damagePercentage, loyaltyRate :;happiness : Number - the numerical happiness value of the pet (1 = unhappy, 2 = content, 3 = happy) :;damagePercentage : Number - damage modifier, happiness affects this (unhappy = 75%, content = 100%, happy = 125%) :;loyaltyRate : Number - the rate at which your pet is currently gaining loyalty (< 0, losing loyalty, > 0, gaining loyalty) == Example == happiness, damagePercentage, loyaltyRate = GetPetHappiness() if not happiness then DEFAULT_CHAT_FRAME:AddMessage("No Pet") else local happy = ({"Unhappy", "Content", "Happy"})[happiness] local loyalty = loyaltyRate > 0 and "gaining" or "losing" DEFAULT_CHAT_FRAME:AddMessage("Pet is " .. happy) DEFAULT_CHAT_FRAME:AddMessage("Pet is doing " .. damagePercentage .. "% damage") DEFAULT_CHAT_FRAME:AddMessage("Pet is " .. loyalty .. " loyalty") end
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)