// Since EC has a cooldown, we can just cast it when mobs are in range to keep our endurance charges refreshed.
if (_abyssalCrySlot != -1)
{
// See if we can use the skill.
var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_abyssalCrySlot);
if (skill.CanUse())
{
if (EnduranceChargesTimeLeft.TotalSeconds < 5 && Utility.NumberOfMobsNear(LokiPoe.Me, 30) > 0)
{
var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_abyssalCrySlot, true);
if (err1 == LokiPoe.InGameState.UseError.None)
{
await Coroutine.Sleep(Utility.LatencySafeValue(500));
await Coroutines.FinishCurrentAction(false);
return true;
}
Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
}
}