コード例 #1
0
        protected override bool CanRun(object context)
        {
            if (!AutoAngler.Instance.MySettings.Poolfishing || (AutoAngler.FishAtHotspot && StyxWoW.Me.Location.Distance(AutoAngler.CurrentPoint) <= 3))
            {
                return(true);
            }
            WoWGameObject pool = ObjectManager.GetObjectsOfType <WoWGameObject>()
                                 .OrderBy(o => o.Distance)
                                 .FirstOrDefault(o => o.SubType == WoWGameObjectType.FishingHole && !Blacklist.Contains(o.Guid) &&
                                                 // Check if we're fishing from specific pools
                                                 ((AutoAngler.PoolsToFish.Count > 0 && AutoAngler.PoolsToFish.Contains(o.Entry)) ||
                                                  AutoAngler.PoolsToFish.Count == 0) &&
                                                 // chaeck if pool is in a blackspot
                                                 !IsInBlackspot(o) &&
                                                 // check if player is near pool
                                                 NinjaCheck(o));

            WoWGameObject poiObj = BotPoi.Current != null && BotPoi.Current.Type == PoiType.Harvest
                                       ? (WoWGameObject)BotPoi.Current.AsObject
                                       : null;

            if (pool != null)
            {
                if (poiObj == null || poiObj.Entry != pool.Entry)
                {
                    BotPoi.Current = new BotPoi(pool, PoiType.Harvest);
                    AutoAngler.CycleToNextIfBehind(pool);
                }
                return(true);
            }
            return(false);
        }
コード例 #2
0
        protected override RunStatus Run(object context)
        {
            if (LootAction.GetLoot())
            {
                return(RunStatus.Success);
            }
            //  dks can refresh water walking while flying around.
            if (AutoAngler.Instance.MySettings.UseWaterWalking &&
                StyxWoW.Me.Class == WoWClass.DeathKnight && !WaterWalking.IsActive)
            {
                WaterWalking.Cast();
            }
            if (AutoAngler.CurrentPoint == WoWPoint.Zero)
            {
                return(RunStatus.Failure);
            }
            if (AutoAngler.FishAtHotspot && StyxWoW.Me.Location.Distance(AutoAngler.CurrentPoint) <= 3)
            {
                return(RunStatus.Failure);
            }
            //float speed = StyxWoW.Me.MovementInfo.CurrentSpeed;
            //float modifier = _settings.Fly ? 5f : 2f;
            //float precision = speed > 7 ? (modifier*speed)/7f : modifier;
            float precision = StyxWoW.Me.IsFlying ? AutoAnglerSettings.Instance.PathPrecision : 3;

            if (StyxWoW.Me.Location.Distance(AutoAngler.CurrentPoint) <= precision)
            {
                AutoAngler.CycleToNextPoint();
            }
            if (_settings.Fly)
            {
                if (_me.IsSwimming)
                {
                    if (_me.GetMirrorTimerInfo(MirrorTimerType.Breath).CurrentTime > 0)
                    {
                        WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
                    }
                    else if (_me.MovementInfo.IsAscending || _me.MovementInfo.JumpingOrShortFalling)
                    {
                        WoWMovement.MoveStop(WoWMovement.MovementDirection.JumpAscend);
                    }
                }
                if (!StyxWoW.Me.Mounted)
                {
                    Flightor.MountHelper.MountUp();
                }
                Flightor.MoveTo(AutoAngler.CurrentPoint);
            }
            else
            {
                if (!StyxWoW.Me.Mounted && Mount.ShouldMount(AutoAngler.CurrentPoint) && Mount.CanMount())
                {
                    Mount.MountUp(() => AutoAngler.CurrentPoint);
                }
                Navigator.MoveTo(AutoAngler.CurrentPoint);
            }
            return(RunStatus.Success);
        }