Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local PetAlly = 1;
  2.  
  3. local PetEnemy = 2;
  4.  
  5. local activePetEnemy = C_PetBattles.GetActivePet(PetEnemy);
  6.  
  7. local typePetEnemy = C_PetBattles.GetPetType(PetEnemy, activePetEnemy);
  8.  
  9. local activePetAlly = C_PetBattles.GetActivePet(PetAlly);
  10.  
  11. local typePetAlly = C_PetBattles.GetPetType(PetAlly, activePetAlly);
  12.  
  13. if activePetAlly == 1 and not (C_PetBattles.GetHealth(PetEnemy, activePetEnemy) == C_PetBattles.GetMaxHealth(PetEnemy, activePetEnemy) ) then
  14.  
  15. for i = 1, NUM_BATTLE_PETS_IN_BATTLE do
  16.  
  17. if C_PetBattles.GetHealth(PetAlly, i) > 0 and not ( i == activePetAlly) then
  18.  
  19. C_PetBattles.ChangePet(i);
  20.  
  21. break;
  22.  
  23. end
  24.  
  25. end
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement