Lore archive · Warcraft Wiki, 2023 dump
API GetPetHappiness
Last wiki revision 2022-08-01
Returns the pet's happiness, damage percentage, and loyalty gain rate. happiness, damagePercentage, loyaltyRate = GetPetHappiness
- happiness: - the numerical happiness value of the pet (1 = unhappy, 2 = content, 3 = happy)
- damagePercentage: - damage modifier, happiness affects this (unhappy = 75%, content = 100%, happy = 125%)
- loyaltyRate: - the rate at which your pet is currently gaining loyalty (< 0, losing loyalty, > 0, gaining loyalty)
local happiness, damagePercentage, loyaltyRate = GetPetHappiness if not happiness then print("No Pet") else local happy = ({"Unhappy", "Content", "Happy"})[happiness] local loyalty = loyaltyRate > 0 and "gaining" or "losing" print("Pet is "..happy) print("Pet is doing "..damagePercentage.."% damage") print("Pet is "..loyalty.." loyalty") end
Source
https://warcraft.wiki.gg/wiki/API_GetPetHappiness · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.