Hi,
How explain I have added possibility to use lua script.
Use this script for change pet when health is smaller at 30 % (you can change this value):
local minHealthPercent = 30;
local PetAlly = 1;
local PetEnemy = 2;
local activePetEnemy = C_PetBattles.GetActivePet(PetEnemy);
local typePetEnemy = C_PetBattles.GetPetType(PetEnemy, activePetEnemy);
local activePetAlly = C_PetBattles.GetActivePet(PetAlly);
local typePetAlly = C_PetBattles.GetPetType(PetAlly, activePetAlly);
if C_PetBattles.GetHealth(PetAlly, activePetAlly) * 100 / C_PetBattles.GetMaxHealth(PetAlly, activePetAlly) <= minHealthPercent then
for i = 1, NUM_BATTLE_PETS_IN_BATTLE do
if C_PetBattles.GetHealth(PetAlly, i) * 100 / C_PetBattles.GetMaxHealth(PetAlly, i) > minHealthPercent and not (i == activePetAlly) then
C_PetBattles.ChangePet(i);
break;
end
end
end