Originally Posted by Waky
I'm trying to write an addon that relates to a hunter's pet but I can't figure out how to do two things:
- How to figure out the pet's owner (hunter's name)
- If the pet is in our party (hunter's in the party)
Does anyone know how to do this? I can't find a "GetPetInfo()" type of API.
Thanks!
|
i am not sure if there is a way to get the hunters name, however if you have the pet targeted you can iterate over your partymembers pets and check, via UnitIsUnit(), if the pet belogs to one of your party members
Code:
for i=1,4 do
if UnitIsUnit("target", "partypet"..i) then
print(UnitName("target").." belongs to "..UnitName("party"..i))
end
end