public async Task Evade() { // Don't evade if we weren't told to if (!WindowSettings.EnableEvade) { return; } if (!GameManager.ControlledUnit.Position.IsInDanger()) { Logger.Debug("IsSafe: " + GameManager.ControlledUnit.Position); Evading.IsEvading = false; return; } List <Vector3> points = Evading.GetSafePoints(); if (points.Count > 0) { Vector3 closest = GameManager.ControlledUnit.Position.Closest(points); Logger.Debug("Found safe points..."); Logger.Debug("Evade to: " + closest); Evading.IsEvading = true; await CommonBehaviors.MoveTo(closest); } }
public static Composite CreateGetPowerGlobe() { return (new Decorator( ret => BelphegorSettings.Instance.GetPowerGlobe, new PrioritySelector(ctx => PowerGlobe, new Decorator(ctx => (((DiaItem)ctx)) != null, CommonBehaviors.MoveTo(ctx => ((DiaItem)ctx).Position, "Power Globe") )))); }
public static Composite CreateGetHealthGlobe() { return (new Decorator( ret => BelphegorSettings.Instance.GetHealthGlobe && ZetaDia.Me.HitpointsCurrentPct <= BelphegorSettings.Instance.HealthGlobeHP, new PrioritySelector(ctx => HealthGlobes, new Decorator(ctx => (((DiaItem)ctx)) != null, CommonBehaviors.MoveTo(ctx => ((DiaItem)ctx).Position, "Health Globe") )))); }
protected override Composite CreateBehavior() { return(new PrioritySelector( new Decorator(ret => Talk.DialogOpen, new Action(r => { Talk.Next(); }) ), new Decorator(ret => IsOpen, new Sequence( new Sleep(1, 2), new Action(r => { //Logging.Write("Accepting leve..."); AcceptLeve((uint)LeveId); }), new Sleep(1, 2), new Action(r => { leveopened = true; //Logging.Write("Closing GuildLeve window..."); Close(); }), new Sleep(1, 2) ) ), new Decorator(ret => SelectYesno.IsOpen, new Action(r => { SelectYesno.ClickYes(); }) ), new Decorator(ret => SelectString.IsOpen, new Action(r => { if (!leveopened) { SelectString.ClickLineContains(LeveType); } else { SelectString.ClickSlot(4); } }) ), new Decorator(ret => JournalResult.IsOpen, new Action(r => { JournalResult.Complete(); }) ), new Decorator(ret => interacted && !Core.Player.HasTarget, new Action(r => { _done = true; }) ), new Decorator(ret => Vector3.Distance(Core.Player.Location, XYZ) > 3, CommonBehaviors.MoveTo(r => XYZ, "Moving to PickupLeve location") ), new Decorator(ret => Vector3.Distance(Core.Player.Location, XYZ) <= 3 && MovementManager.IsMoving, ff14bot.Behavior.CommonBehaviors.MoveStop() ), new Decorator(ret => Vector3.Distance(Core.Player.Location, XYZ) <= 3 && !MovementManager.IsMoving && !interacted, new Action(r => { GameObjectManager.GetObjectByNPCId((uint)NpcId).Interact(); interacted = true; }) ), new ActionAlwaysSucceed() )); }
/// <summary> /// Move into given range for combat /// </summary> /// <param name="range">range for combat</param> /// <returns></returns> public static Composite CreateMoveToRange(int range) { return(new Decorator(ret => Variables.MainTarget.Distance > range, CommonBehaviors.MoveTo(ret => Variables.MainTarget.Position, ret => "CreateMoveToRange"))); }
/// <summary> /// Move into LineofSight /// </summary> /// <returns></returns> public static Composite CreateMoveToLos() { return(new Decorator(ret => !LokiPoe.MeleeLineOfSight.CanSee(LokiPoe.Me.Position, Variables.MainTarget.Position), CommonBehaviors.MoveTo(ret => Variables.MainTarget.Position, ret => "CreateMoveToLos"))); }