-- returns the petID of the special slot or nil if none
-- petID can be 0 (leveling), "ignored" or "random:x"
functionrematch:GetSpecialSlot(slot)
returnspecialSlots[slot]
end
-- returns "leveling" or "ignored" or "random" depending on the petID
functionrematch:GetSpecialPetIDType(petID)
ifpetID==0then
return"leveling"
elseifpetID=="ignored"then
return"ignored"
elseiftype(petID)~="string"then
returnfalse
elseifpetID:match("^random")then
return"random"
end
end
functionrematch:GetSpecialTooltip(petID)
ifpetID==0then
returnL["Leveling Slot"],L["This slot is controlled by the leveling queue.\n\nTeams saved with leveling slots will load leveling pets from the queue into these slots."]
elseifpetID=="ignored"then
returnL["Ignored Slot"],L["Teams saved with ignored slots will not load anything into these slots."]
returnpetType==0andL["Random Pet"]orformat(L["Random %s Pet"],_G["BATTLE_PET_NAME_"..petType]or""),L["Teams saved with random slots will load a random high level pet into these slots."]
end
end
functionrematch:SpecialFootnoteOnClick()
rematch:SetMenuSubject(self:GetParent():GetID())
rematch:ShowMenu("LoadoutMenu","cursor")
end
-- this takes a random petID ("random:10") and returns a random petID of an owned pet
-- if noPetID1 and/or noPetID2 defined, the random pet will not be one of those
-- the random group is prioritized by level, rarity, whether in a team, and health
-- pets not in a team are preferred, and full-health pets are preferred over injured pets,
-- which are preferred over dead pets. if evenInTeams is true, then whether the pet is
if(petType==0orpetInfo.petType==petType)andpetInfo.canBattleandnotpetInfo.isDeadandpetInfo.speciesID~=1426then-- petType==0 is "any type", speciesID 1426 is Elekk Plushie
-- calculating weights from lowest to highest
-- health is lowest: max health=2, injured=1, dead=0