Example #1
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(

                                     new Decorator(ret => !_waitTimer.IsFinished,
                                                   new Sequence(
                                                       new Action(ret => AntiAfk()),
                                                       new Action(ret => TreeRoot.StatusText = "Waiting for the story to end"),
                                                       new ActionAlwaysSucceed())
                                                   ),

                                     new Decorator(ret => HighWarlordDarion != null && HighWarlordDarion.CanGossip,
                                                   new PrioritySelector(
                                                       new Decorator(ret => !HighWarlordDarion.WithinInteractRange,
                                                                     new Sequence(
                                                                         new Action(ret => TreeRoot.StatusText = "Moving to High Warlord Darion"),
                                                                         new Action(ret => Navigator.MoveTo(HighWarlordDarion.Location)))),

                                                       new Sequence(
                                                           new Action(ret => TreeRoot.StatusText = "Talking to High Warlord Darion"),
                                                           new DecoratorContinue(ret => Me.IsMoving,
                                                                                 new Sequence(
                                                                                     new Action(ret => WoWMovement.MoveStop()),
                                                                                     new Action(ret => StyxWoW.SleepForLagDuration())
                                                                                     )),

                                                           new Action(ret => HighWarlordDarion.Interact()),
                                                           new WaitContinue(5, ret => GossipFrame.Instance.IsVisible,
                                                                            new Sequence(
                                                                                new DecoratorContinue(ret => GossipFrame.Instance.GossipOptionEntries == null,
                                                                                                      new Action(ret => _waitTimer.Reset())
                                                                                                      ),

                                                                                new DecoratorContinue(ret => GossipFrame.Instance.GossipOptionEntries != null,
                                                                                                      new Sequence(
                                                                                                          new Action(ret => GossipFrame.Instance.SelectGossipOption(0)),
                                                                                                          new Action(ret => StyxWoW.SleepForLagDuration())
                                                                                                          )))
                                                                            )))),

                                     new Action(ret => _waitTimer.Reset())
                                     )));
        }
Example #2
0
        public override void OnStart()
        {
            // This reports problems, and stops BT processing if there was a problem with attributes...
            // We had to defer this action, as the 'profile line number' is not available during the element's
            // constructor call.
            OnStart_HandleAttributeProblem();

            // If the quest is complete, this behavior is already done...
            // So we don't want to falsely inform the user of things that will be skipped.
            if (!IsDone)
            {
                int waitDuration = WaitTime + (new Random(Environment.TickCount + WaitTime + VariantTime)).Next(VariantTime);

                _timer            = new Timer(new TimeSpan(0, 0, 0, 0, waitDuration));
                _waitTimeAsString = UtilBuildTimeAsString(_timer.WaitTime);

                _timer.Reset();
            }
        }
Example #3
0
        public override void OnStart()
        {
            // This reports problems, and stops BT processing if there was a problem with attributes...
            // We had to defer this action, as the 'profile line number' is not available during the element's
            // constructor call.
            OnStart_HandleAttributeProblem();

            // If the quest is complete, this behavior is already done...
            // So we don't want to falsely inform the user of things that will be skipped.
            if (!IsDone)
            {
                int     waitDuration = WaitTime + (new Random(Environment.TickCount + WaitTime + VariantTime)).Next(VariantTime);

                _timer = new Timer(new TimeSpan(0, 0, 0, 0, waitDuration));
                _waitTimeAsString = UtilBuildTimeAsString(_timer.WaitTime);

                _timer.Reset();
            }
        }