By looking at PetBattleQuality I had the idea to do sth like the Street Fighter "FIGHT" thing.
Concept:
When a pet battle starts you can extract the pet names + quality.
You could display that data on screen.
Lua Code:
local pet_quality = {
[1] = "|cff999999", --gray, poor
[2] = "|cffffffff", --white, common
[3] = "|cff009900", --green, uncommon
[4] = "|cff0099ff", --blue, rare
[5] = "|cffcc33cc", --purple, epic
[6] = "|cffff6600", --orange, legendary
}
local function getPetString(ownerId)
local string
for i = 1, C_PetBattles.GetNumPets(ownerId) do
local pet, quality
pet = C_PetBattles.GetName(ownerId, i)
quality = pet_quality[C_PetBattles.GetBreedQuality(ownerId, i)]
if i > 1 then
string = string.." + "
end
if pet and quality then
string = string..quality..pet.."|r"
else
string = string.."ErrorFindingPet"
end
end
return string
end
local function init()
local playerPetString = getPetString(1)
local enemyPetString = getPetString(2)
print("READY, SET, FIGHT!!!")
print(playerPetString.." VS. "..enemyPetString)
end
local frame = CreateFrame("Frame")
frame:Hide()
frame:SetScript("OnEvent", init)
frame:RegisterEvent("PET_BATTLE_OPENING_START")
Maybe we can even extract the pet ID and use it to display a number of portraits + school of magic.
Pet quality is already in.
Ok there is sth like:
Lua Code:
local speciesID, customName, level, xp, maxXp, displayID, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable = C_PetJournal.GetPetInfoByPetID(petID)
Plus there is GetDisplayID(). Not tested but this may return the DisplayID() that could be used in a 3D portrait. Which would be good since that is enough to display: portrait, name, quality.
Lua Code:
C_PetBattles.GetDisplayID(ownerId, i) -- This function is not yet documented
C_PetBattles.GetHealth(ownerId, i) -- This function is not yet documented
C_PetBattles.GetIcon(ownerId, i) -- This function is not yet documented
C_PetBattles.GetLevel(ownerId, i) -- This function is not yet documented
http://wowprogramming.com/docs/api
I'm thinking of sth like this:
http://images-mediawiki-sites.theful...2942977455.gif
Under the portrait would be the petname in petquality.