public Sequence this[IBot.IBot bot] { get { var seq = new Sequence( new Decorator(ret => bot.isRunning, new TreeSharp.Action(ret => RunStatus.Success)), //first we must have a valid target new Decorator(ret => Util.Targeting.HasValidTarget(bot.CurrentTarget), new TreeSharp.Action(ret => RunStatus.Success)), //if we are already busy, don't continue. new Decorator(ret => !bot.isInAction, new TreeSharp.Action(ret => RunStatus.Success)), //send the attack action. new TreeSharp.Action(ret => { bot.Attack(bot.CurrentTarget); }), //wait for the action to complete (or we time out). new Wait(1, ret => bot.isInAction, new TreeSharp.Action(ret => RunStatus.Success)) ); return(seq); } }
public Sequence this[IBot.IBot bot] { get { var seq = new Sequence( new Decorator(ret => bot.isRunning, new TreeSharp.Action(ret => RunStatus.Success)), new Decorator(ret => bot.CurrentTarget.Distance() > 50, new TreeSharp.Action(ret => RunStatus.Success)), new TreeSharp.Action(ret => { Util.MoveTo.MoveToPosWithNavMeshAsync(bot.CurrentTarget.ToSharpDXVector3()); }), new Wait(1, ret => bot.isInAction, new TreeSharp.Action(ret => RunStatus.Success)) ); return(seq); } }
public Sequence this[IBot.IBot bot] { get { var seq = new Sequence( new Decorator(ret => bot.isRunning, new TreeSharp.Action(ret => RunStatus.Success)), //first we must not already have a target. new Decorator(ret => !Util.Targeting.HasValidTarget(bot.CurrentTarget), new TreeSharp.Action(ret => RunStatus.Success)), //go grab a target new TreeSharp.Action(ret => { bot.CurrentTarget = Util.Targeting.GetTarget(); }) ); return(seq); } }