Thread Tools Display Modes
09-16-10, 08:49 PM   #1
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
Pet info

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!
  Reply With Quote
09-17-10, 07:02 PM   #2
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
Anyone got a clue?
  Reply With Quote
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
09-18-10, 09:50 AM   #4
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
I'll see if that works, thanks!
  Reply With Quote
09-18-10, 10:27 AM   #5
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
How about
UNIT_PET
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Pet info

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off