LibPetBreedInfo

16.6k Downloads

New Maintainer

Hi, Elegant here, I'll be picking up where Nullberri left off with this library and will be maintaining it going forward =D

Description

LibPetBreedInfo is a library for computing breed information for pets.

Example Usage

local LibPetBreedInfo = LibStub("LibPetBreedInfo-1.0")
local breedIndex, confidence = LibPetBreedInfo:GetBreedByPetID(C_PetJournal.GetPetInfoByIndex(1))
local breedName = LibPetBreedInfo:GetBreedName(breedIndex)
print(breedName)

GetBreedByPetBattleSlot(petOwner,id)

local breedIndex, confidence = LibPetBreedInfo:GetBreedByPetBattleSlot(petOwner,id)

Gets the breed index for the given pet Returns breedIndex, confidence breedIndex can be used by GetBreedName to return the breeds name. confidence, a number. higher numbers are better. good predictions start at confidence > 2.5

Caveats: Returns nil if the pet does not have a base stats profile or if the petOwner and id are not valid Results are not valid if computed while round play back is happening

GetBreedByPetID(petID)

local breedIndex, confidence = LibPetBreedInfo:GetBreedByPetID(petID)

Gets the breed index for the given pet Returns breedIndex ,confidence breedIndex can be used by GetBreedName to return the breeds name. confidence, a number. higher numbers are better. good predictions start at confidence > 2.5

Caveats: Returns nil if the species cannot battle or does not have a base stats profile or if the petID is not valid

GetBreedByStats(speciesID,level,rarity,health,power,speed)

local breedIndex, confidence = LibPetBreedInfo:GetBreedByStats(speciesID,level,rarity,health,power,speed)

Gets the breed index for the given pet Returns breedIndex ,confidence breedIndex can be used by GetBreedName to return the breeds name. confidence, a number. higher numbers are better. good predictions start at confidence > 2.5

Caveats: Returns nil if the species cannot battle or does not have a base stats profile

GetPetPredictedStats(speciesID, breedID, rarity, level)

local health, power, speed = LibPetBreedInfo:GetPetPredictedStats(speciesID, breedID, rarity, level)

Gets the predicted stats for a species at a given level returns health,power,speed

Caveats: returns nil if the pet does not have a base stats profile, or if an invalid... breedID, rarity, or non numeric level is given.

IterateBreedNames()

for breedID,breedName in LibPetBreedInfo:IterateBreedNames() do

Gets an ipair iterator for all of the possible breed names

GetBreedName(breedID)

local breedName =  LibPetBreedInfo:GetBreedName(breedID)

Gets the string representation of a BreedID

Caveats: BreedIDs are from 3-12 Returns nil for invalid breedID's

GetAvailableBreeds(speciesID)

local breedName =  LibPetBreedInfo:GetAvailableBreeds(speciesID)

returns a list of possible breedID's for a given speciesID returns nil if no data is present or if a speciesID is invalid