Check if pet is dead or at full HP when using potions.

This commit is contained in:
MobiusDevelopment
2022-10-22 00:05:43 +00:00
parent 563e0cf320
commit 800c42fd4e
4 changed files with 76 additions and 60 deletions

View File

@@ -167,7 +167,10 @@ public class AutoUseTaskManager implements Runnable
if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone) if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone)
{ {
final Pet pet = player.getPet(); final Pet pet = player.getPet();
if ((pet != null) && (pet.getCurrentHpPercent() <= player.getAutoPlaySettings().getAutoPetPotionPercent())) if ((pet != null) && !pet.isDead())
{
final int percent = pet.getCurrentHpPercent();
if ((percent < 100) && (percent <= player.getAutoPlaySettings().getAutoPetPotionPercent()))
{ {
POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems()) POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems())
{ {
@@ -191,6 +194,7 @@ public class AutoUseTaskManager implements Runnable
} }
} }
} }
}
if (Config.ENABLE_AUTO_SKILL) if (Config.ENABLE_AUTO_SKILL)
{ {

View File

@@ -167,7 +167,10 @@ public class AutoUseTaskManager implements Runnable
if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone) if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone)
{ {
final Pet pet = player.getPet(); final Pet pet = player.getPet();
if ((pet != null) && (pet.getCurrentHpPercent() <= player.getAutoPlaySettings().getAutoPetPotionPercent())) if ((pet != null) && !pet.isDead())
{
final int percent = pet.getCurrentHpPercent();
if ((percent < 100) && (percent <= player.getAutoPlaySettings().getAutoPetPotionPercent()))
{ {
POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems()) POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems())
{ {
@@ -191,6 +194,7 @@ public class AutoUseTaskManager implements Runnable
} }
} }
} }
}
if (Config.ENABLE_AUTO_SKILL) if (Config.ENABLE_AUTO_SKILL)
{ {

View File

@@ -167,7 +167,10 @@ public class AutoUseTaskManager implements Runnable
if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone) if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone)
{ {
final Pet pet = player.getPet(); final Pet pet = player.getPet();
if ((pet != null) && (pet.getCurrentHpPercent() <= player.getAutoPlaySettings().getAutoPetPotionPercent())) if ((pet != null) && !pet.isDead())
{
final int percent = pet.getCurrentHpPercent();
if ((percent < 100) && (percent <= player.getAutoPlaySettings().getAutoPetPotionPercent()))
{ {
POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems()) POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems())
{ {
@@ -191,6 +194,7 @@ public class AutoUseTaskManager implements Runnable
} }
} }
} }
}
if (Config.ENABLE_AUTO_SKILL) if (Config.ENABLE_AUTO_SKILL)
{ {

View File

@@ -167,7 +167,10 @@ public class AutoUseTaskManager implements Runnable
if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone) if (Config.ENABLE_AUTO_PET_POTION && !isInPeaceZone)
{ {
final Pet pet = player.getPet(); final Pet pet = player.getPet();
if ((pet != null) && (pet.getCurrentHpPercent() <= player.getAutoPlaySettings().getAutoPetPotionPercent())) if ((pet != null) && !pet.isDead())
{
final int percent = pet.getCurrentHpPercent();
if ((percent < 100) && (percent <= player.getAutoPlaySettings().getAutoPetPotionPercent()))
{ {
POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems()) POTIONS: for (Integer itemId : player.getAutoUseSettings().getAutoPetPotionItems())
{ {
@@ -191,6 +194,7 @@ public class AutoUseTaskManager implements Runnable
} }
} }
} }
}
if (Config.ENABLE_AUTO_SKILL) if (Config.ENABLE_AUTO_SKILL)
{ {