Exemple #1
0
        protected override Composite CreateBehavior()
        {
            return _root ?? (_root =
                new PrioritySelector(
                    new Decorator(
                        ret => wp.Distance(ObjectManager.Me.Location) > 5,
                                new Sequence(
                                    new Action(ret => TreeRoot.StatusText = "Moving to location"),
                                    new Action(ret => Navigator.MoveTo(wp)))),
                    new Decorator(
                        ret => !ObjectManager.Me.HasAura("Vault Cracking Toolset"),
                                new Sequence(
                                    new Action(ret => q14122bank[0].Interact()),
                                    new Action(ret => StyxWoW.SleepForLagDuration())
                                    )),
                        
                    new Decorator(
                        ret => !IsAttached,
                                new Sequence(
                                    new Action(ret => Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)),
                                    new Action(ret => IsAttached = true))),
                    new Decorator(
                        ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted,
                        new PrioritySelector(
                            new Decorator(
                                ret => IsAttached,
                                new Sequence(
                                    new Action(ret => Styx.Helpers.Logging.Write("Detaching")),
                                    new Action(ret => Lua.Events.DetachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)),
                                    new Action(ret => IsBehaviorDone = true)
                                    )))),
                    new Decorator(
                        ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted && ObjectManager.Me.HasAura("Vault Cracking Toolset"),
                        new Sequence(
                            new Action(ret => Lua.DoString("VehicleExit()"))
                            ))
                    ));

        }
Exemple #2
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(
                                     new Decorator(
                                         ret => wp.Distance(ObjectManager.Me.Location) > 5,
                                         new Sequence(
                                             new Action(ret => TreeRoot.StatusText = "Moving to location"),
                                             new Action(ret => Navigator.MoveTo(wp)))),
                                     new Decorator(
                                         ret => !ObjectManager.Me.HasAura("Vault Cracking Toolset"),
                                         new Sequence(
                                             new Action(ret => q14122bank[0].Interact()),
                                             new Action(ret => StyxWoW.SleepForLagDuration())
                                             )),

                                     new Decorator(
                                         ret => !IsAttached,
                                         new Sequence(
                                             new Action(ret => Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)),
                                             new Action(ret => IsAttached = true))),
                                     new Decorator(
                                         ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted,
                                         new PrioritySelector(
                                             new Decorator(
                                                 ret => IsAttached,
                                                 new Sequence(
                                                     new Action(ret => Styx.Helpers.Logging.Write("Detaching")),
                                                     new Action(ret => Lua.Events.DetachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122msg)),
                                                     new Action(ret => IsBehaviorDone = true)
                                                     )))),
                                     new Decorator(
                                         ret => StyxWoW.Me.QuestLog.GetQuestById(14122).IsCompleted&& ObjectManager.Me.HasAura("Vault Cracking Toolset"),
                                         new Sequence(
                                             new Action(ret => Lua.DoString("VehicleExit()"))
                                             ))
                                     )));
        }
 public Inverter(Composite child)
     : base(child)
 {
 }
Exemple #4
0
 public SwitchArgument(Composite branch, T requiredValue = default(T))
 {
     Branch        = branch;
     RequiredValue = requiredValue;
 }
Exemple #5
0
 public Switch(Func <T> statement, Composite defaultArgument, params SwitchArgument <T>[] args) : this(statement, args)
 {
     Default = defaultArgument;
 }
Exemple #6
0
 public DecoratorContinue(CanRunDecoratorDelegate func, Composite decorated)
     : base(func, decorated)
 {
 }
Exemple #7
0
 public DecoratorContinue(Composite child)
     : base(child)
 {
 }
 public UntilFailure(Composite child)
     : base(child)
 {
 }
 public ProbabilitySelection(Composite branch, double chanceToExecute)
 {
     Branch          = branch;
     ChanceToExecute = chanceToExecute;
 }
Exemple #10
0
 /// <summary>
 ///   Creates a new Wait decorator with the specified timeout, and child composite.
 /// </summary>
 /// <param name = "timeoutSeconds"></param>
 /// <param name = "child"></param>
 public Wait(int timeoutSeconds, Composite child)
     : base(child)
 {
     Timeout = new TimeSpan(0, 0, timeoutSeconds);
 }
Exemple #11
0
 /// <summary>
 ///   Creates a new Wait decorator with an 'infinite' timeout, the specified run delegate, and a child composite.
 /// </summary>
 /// <param name = "runFunc"></param>
 /// <param name = "child"></param>
 public Wait(CanRunDecoratorDelegate runFunc, Composite child) : this(int.MaxValue, runFunc, child)
 {
 }
Exemple #12
0
 /// <summary>
 ///   Creates a new Wait decorator using the specified timeout, run delegate, and child composite.
 /// </summary>
 /// <param name = "timeoutSeconds"></param>
 /// <param name = "runFunc"></param>
 /// <param name = "child"></param>
 public Wait(int timeoutSeconds, CanRunDecoratorDelegate runFunc, Composite child)
     : base(runFunc, child)
 {
     Timeout = new TimeSpan(0, 0, timeoutSeconds);
 }
Exemple #13
0
 public Decorator(Composite child)
     : base(child)
 {
 }
Exemple #14
0
 public Decorator(CanRunDecoratorDelegate runFunc, Composite child)
     : this(child)
 {
     Runner = runFunc;
 }