Check if pet is dead or at full HP when using potions.
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
@@ -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)
|
||||||
{
|
{
|
||||||
|
@@ -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)
|
||||||
{
|
{
|
||||||
|
@@ -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)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user