Thread: Pet info
View Single Post
09-17-10, 09:29 PM   #3
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
Originally Posted by Waky View Post
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
  Reply With Quote