private static DiaObject HealthGlobes
{
get
{
return ZetaDia.Actors.GetActorsOfType<DiaItem>().Where(i => i.ActorSNO == 4267 &&
i.Distance <= 34f).OrderBy(i => i.Distance).FirstOrDefault();
}
}
public void OnPulse()
{
if (ZetaDia.IsInGame && ZetaDia.Me.IsValid)
{
if (ZetaDia.Me.HitpointsCurrentPct < 0.65 &&
HealthGlobes != null)
{/*
if (!BotMain.IsPaused)
{
SimpleValueRetriever<bool> shouldGetGlobe = ShouldGetGlobe;
BotMain.PauseWhile(shouldGetGlobe);
}*/
if (Zeta.CommonBot.PowerManager.CanCast(SNOPower.DemonHunter_Vault))
{
ZetaDia.Me.UsePower(SNOPower.DemonHunter_Vault, HealthGlobes.Position, ZetaDia.Me.WorldDynamicId);
}
else if (Zeta.CommonBot.PowerManager.CanCast(SNOPower.Wizard_Teleport))
{
ZetaDia.Me.UsePower(SNOPower.Wizard_Teleport, HealthGlobes.Position, ZetaDia.Me.WorldDynamicId);
}
else if (Zeta.CommonBot.PowerManager.CanCast(SNOPower.Barbarian_FuriousCharge) && false)
{
//something clever
}
else //people should suggest abilities to use with the run to the health globe
//like smokescreen, spirit walk, dashing strike or whatever
{
Movement.MoveTo(HealthGlobes.Position, 2.5f);
}
}
else
{
if (CombatTargeting.Instance.LastObjects.Count(u => IsDebuff((DiaUnit)u)) >= 1)
{
MoveAway();
}
if (ZetaDia.Actors.GetActorsOfType<DiaObject>(true, false).Count(u => IsDebuff((DiaObject)u)) >= 1)
{
MoveAway();
}
}
}
}