Exemplo n.º 1
0
        public static void ResetBot()
        {
            Logger.DBLog.InfoFormat("Preforming reset of bot data...");
            BlacklistCache.ClearBlacklistCollections();
            GoldInactivity.LastCoinageUpdate = DateTime.Now;

            PlayerMover.iTotalAntiStuckAttempts    = 1;
            PlayerMover.vSafeMovementLocation      = Vector3.Zero;
            PlayerMover.vOldPosition               = Vector3.Zero;
            PlayerMover.iTimesReachedStuckPoint    = 0;
            PlayerMover.timeLastRecordedPosition   = DateTime.Today;
            PlayerMover.timeStartedUnstuckMeasure  = DateTime.Today;
            PlayerMover.iTimesReachedMaxUnstucks   = 0;
            PlayerMover.iCancelUnstuckerForSeconds = 0;
            PlayerMover.timeCancelledUnstuckerFor  = DateTime.Today;

            //Reset all data with bot (Playerdata, Combat Data)
            Reset();

            PlayerClass.CreateBotClass();
            //Update character info!
            FunkyGame.Hero.Update();

            //OOC ID Flags
            Targeting.Cache.ShouldCheckItemLooted   = false;
            Targeting.Cache.CheckItemLootStackCount = 0;
            //ItemIdentifyBehavior.shouldPreformOOCItemIDing = false;

            //TP Behavior Reset
            TownPortalBehavior.ResetTPBehavior();

            //Sno Trim Timer Reset
            ObjectCache.cacheSnoCollection.ResetTrimTimer();
            //clear obstacles
            ObjectCache.Obstacles.Clear();
            ObjectCache.Objects.Clear();
            //EventHandlers.EventHandlers.DumpedDeathInfo = false;
        }
Exemplo n.º 2
0
        protected override Composite CreateBehavior()
        {
            return(new PrioritySelector
                   (
                       new Decorator(ret => FunkyGame.GameIsInvalid,
                                     new Action(ret =>
            {
                if (TownPortalBehavior.FunkyTPBehaviorFlag)
                {
                    TownPortalBehavior.ResetTPBehavior();
                }
                m_IsDone = true;
            })),



                       //Return To Town
                       new Decorator(ret => TownPortalBehavior.FunkyTPOverlord(null),
                                     new Action(ret => TownPortalBehavior.FunkyTPBehavior(null))),

                       //Setup our Vector and SNO
                       new Decorator(ret => !initalizedTownVars,
                                     new Action(ret => InitalizeTownVariables())),



                       new Decorator(ret => MovementVector == Vector3.Zero || ObjectSNO == -1,
                                     new Action(ret =>
            {
                if (TownPortalBehavior.FunkyTPBehaviorFlag)
                {
                    TownPortalBehavior.ResetTPBehavior();
                }
                m_IsDone = true;
            })),

                       //Movement
                       new Decorator(ret => !UpdateObject() || ZetaDia.Me.Position.Distance(MovementVector) > 10f || !Object.InLineOfSight,
                                     new Action(ret => Navigator.MoveTo(MovementVector))),

                       new Decorator(ret => !Interact,
                                     new Action(ret =>
            {
                if (TownPortalBehavior.FunkyTPBehaviorFlag)
                {
                    TownPortalBehavior.ResetTPBehavior();
                }
                m_IsDone = true;
            })),

                       //Interaction
                       new Decorator(ret => !DialogIsVisible(),
                                     new Action(ret => Object.Interact())),

                       new Decorator(ret => DialogIsVisible(),
                                     new Action(ret => {
                if (TownPortalBehavior.FunkyTPBehaviorFlag)
                {
                    TownPortalBehavior.ResetTPBehavior();
                }
                m_IsDone = true;
            }))
                   ));
        }