private WoWUnit GetNearestTarget()
 {
     return(ObjectManager.GetObjectsOfType <WoWUnit>(false, false)
            .Where(u => _manditUnitIds.Contains(u.Entry) && u.IsAlive && !Blacklist.Contains(u, BlacklistFlags.Combat))
            .OrderBy(u => u.DistanceSqr)
            .FirstOrDefault());
 }
Ejemplo n.º 2
0
        public static WoWItem FindUnlockedBox()
        {
            // If your inventory is empty
            if (Character.Me.CarriedItems == null)
            {
                return(null);
            }

            var lockbox = Character.Me.CarriedItems.FirstOrDefault(b => b != null &&
                                                                   b.IsValid &&
                                                                   b.ItemInfo != null &&
                                                                   b.ItemInfo.ItemClass == WoWItemClass.Miscellaneous &&
                                                                   b.ItemInfo.ContainerClass == WoWItemContainerClass.Container &&
                                                                   b.IsOpenable &&
                                                                   b.Usable &&
                                                                   b.Cooldown <= 0 &&
                                                                   !Blacklist.Contains(b.Guid, BlacklistFlags.Node) &&
                                                                   LockBoxes.Contains(b.Entry));

            if (lockbox == null)
            {
                return(null);
            }

            // Otherwise, return carried items
            return(lockbox);
        }
Ejemplo n.º 3
0
 private bool Revive()
 {
     foreach (WoWPlayer p in GetResurrectTargets())
     {
         if (Blacklist.Contains(p.Guid, true))
         {
             continue;
         }
         else
         {
             if (p.Distance > 40 || !p.InLineOfSight)
             {
                 return(true);
             }
             else if (CC("Revive", p) && HazzDruidSettings.Instance.UseRevive)
             {
                 C("Revive", p);
                 Logging.Write("Revive " + p);
                 Blacklist.Add(p, new TimeSpan(0, 0, 15));
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns the closest object to the player matching any NpcId in the array.
 /// </summary>
 /// <param name="npcids">The NpcId array.</param>
 public static GameObject GetClosest(int[] npcids) => GameObjectManager.GameObjects.Where(
     o => npcids.Contains((int)o.NpcId) &&
     o.IsVisible &&
     o.IsTargetable &&
     !Blacklist.Contains(o.ObjectId))
 .OrderBy(o => o.Location.Distance3D(Core.Me.Location))
 .FirstOrDefault();
Ejemplo n.º 5
0
        internal static async Task BlacklistBadFates()
        {
            if (!WorldManager.CanFly)
            {
                var navRequest = FateManager.ActiveFates.Select(fate => new CanFullyNavigateTarget
                {
                    Id       = fate.Id,
                    Position = fate.Location
                }).ToList();
                var navTask    = Navigator.NavigationProvider.CanFullyNavigateTo(navRequest, Core.Player.Location, WorldManager.ZoneId);
                var navResults = await Coroutine.ExternalTask(navTask);

                foreach (var navResult in navResults.Where(result => result.CanNavigate == 0))
                {
                    var fate = FateManager.ActiveFates.FirstOrDefault(result => result.Id == navResult.Id);
                    if (fate == null || Blacklist.Contains(fate.Id))
                    {
                        continue;
                    }

                    Logger.SendDebugLog("'" + fate.Name + "' cannot be navigated to, blacklisting for its remaining duration.");
                    Blacklist.Add(fate.Id, BlacklistFlags.Node, fate.TimeLeft, "Cannot navigate to FATE.");
                }
            }
        }
Ejemplo n.º 6
0
        private WoWUnit FindTarget(Vector3 location)
        {
            WoWUnit target = null;

            if (_targetGuid.IsValid)
            {
                target = ObjectManager.GetObjectByGuid <WoWUnit>(_targetGuid);
            }

            if (target != null && target.IsAlive
                // if rescuing NPCs then we don't want to include those rescued by other players.
                && (DropPassengerButton == 0 || !IsRescuedByOtherPlayer(target)) &&
                !Blacklist.Contains(target, BlacklistFlags.Combat | BlacklistFlags.Interact))
            {
                return(target);
            }

            target = ObjectManager.GetObjectsOfType <WoWUnit>()
                     .Where(u => !u.IsDead && NpcList.Contains((int)u.Entry) &&
                            !Blacklist.Contains(u, BlacklistFlags.Combat | BlacklistFlags.Interact)
                            // if rescuing NPCs then we don't want to include those rescued by other players.
                            && (DropPassengerButton == 0 || !IsRescuedByOtherPlayer(target)) &&
                            u.Location.Distance2D(location) < NpcScanRange)
                     .OrderBy(u => location.Distance2DSquared(u.Location))
                     .FirstOrDefault();

            if (target != null)
            {
                _targetGuid = target.Guid;
            }

            return(target);
        }
Ejemplo n.º 7
0
        private bool Filter(GameObject obj)
        {
            if (obj.NpcId == 5042) //script object
            {
                return(false);
            }

            if (obj.Location == Vector3.Zero)
            {
                return(false);
            }


            if (Blacklist.Contains(obj) || Constants.TrapIds.Contains(obj.NpcId) || Constants.IgnoreEntity.Contains(obj.NpcId))
            {
                return(false);
            }


            if (obj.Type == GameObjectType.BattleNpc)
            {
                if (DeepDungeonManager.PortalActive)
                {
                    return(false);
                }

                var battleCharacter = (BattleCharacter)obj;
                return(!battleCharacter.IsDead);
            }

            return(obj.Type == GameObjectType.EventObject || obj.Type == GameObjectType.Treasure || obj.Type == GameObjectType.BattleNpc);
        }
Ejemplo n.º 8
0
 private bool Resurrecting()
 {
     foreach (WoWPlayer p in GetResurrectTargets())
     {
         slog(Color.DarkRed, "I need to ress {0}", privacyname(p));
         if (Blacklist.Contains(p.Guid, true))
         {
             continue;
         }
         else
         {
             if (p.Distance > 40 || !p.InLineOfSight)
             {
                 //MoveTo(p);
                 return(true);
             }
             else if (CanCast("Redemption", p) && castaress("Redemption", p, 30, "Buff", "Ressing"))
             {
                 Blacklist.Add(p, new TimeSpan(0, 0, 15));
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     return(false);
 }
        private WoWUnit FindDrowningWatchman()
        {
            // Blacklist any watchmen in troubling area...
            IEnumerable <WoWUnit> drowningWatchmenInNeedOfBlacklisting =
                from unit in FindUnitsFromIds(MobId_DrowningWatchman)
                where
                IgnoreDrowningWatchmenInTheseAreas.Any(b => b.Location.Distance(unit.Location) <= b.Radius) &&
                !Blacklist.Contains(unit.Guid, BlacklistFlags.Combat)
                select unit;

            foreach (var drowningWatchman in drowningWatchmenInNeedOfBlacklisting)
            {
                Blacklist.Add(drowningWatchman.Guid, BlacklistFlags.Combat, TimeSpan.FromMinutes(5));
            }

            // Choose the nearest viable watchman...
            return
                ((from unit in FindUnitsFromIds(MobId_DrowningWatchman)
                  where
                  IsViableDrowningWatchman(unit) &&
                  unit.HasAura(AuraId_Drowning)
                  orderby
                      (from path in Paths
                      let pathSegment = ExtractPathSegment(Me.Location, unit.Location, path)
                                        let pathCost = CalculatePathCost(Me.Location, unit.Location, pathSegment)
                                                       orderby pathCost
                                                       select pathCost)
                  .FirstOrDefault()
                  select unit)
                 .FirstOrDefault());
        }
Ejemplo n.º 10
0
        public override bool Filter(GameObject obj)
        {
            //Blacklists
            if (Blacklist.Contains(obj) || Constants.TrapIds.Contains(obj.NpcId) ||
                Constants.IgnoreEntity.Contains(obj.NpcId))
            {
                return(false);
            }

            if (obj.Location == Vector3.Zero)
            {
                return(false);
            }

            switch (obj.Type)
            {
            case GameObjectType.Treasure:
                return(!(HaveMainPomander() && DeepDungeonManager.PortalActive &&
                         FloorExit.location != Vector3.Zero));

            case GameObjectType.EventObject:
                return(true);

            case GameObjectType.BattleNpc:
                return(!((BattleCharacter)obj).IsDead);

            default:
                return(false);
            }
        }
Ejemplo n.º 11
0
        public static bool FilterKnown(GameObject obj)
        {
            if (obj.Location == Vector3.Zero)
            {
                return(false);
            }
            //Blacklists
            if (Blacklist.Contains(obj) || Constants.TrapIds.Contains(obj.NpcId) ||
                Constants.IgnoreEntity.Contains(obj.NpcId))
            {
                return(false);
            }

            switch (obj.Type)
            {
            case GameObjectType.Treasure:
                return(true);

            case GameObjectType.EventObject:
                return(true);

            case GameObjectType.BattleNpc:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 12
0
        public List <GameObject> StartList()
        {
            var result = new List <GameObject>();

            foreach (var obj in GameObjectManager.GameObjects)
            {
                if (obj.Location == Vector3.Zero)
                {
                    continue;
                }

                if (!obj.IsValid || !obj.IsVisible)
                {
                    continue;
                }

                if (Blacklist.Contains(obj) || Constants.TrapIds.Contains(obj.NpcId) ||
                    Constants.IgnoreEntity.Contains(obj.NpcId))
                {
                    continue;
                }

                switch (obj.Type)
                {
                case GameObjectType.Treasure:
                    if (obj.NpcId == EntityNames.BandedCoffer)
                    {
                        result.Add(obj);
                        break;
                    }

                    if (!(HaveMainPomander() && DeepDungeonManager.PortalActive && FloorExit.location != Vector3.Zero))
                    {
                        result.Add(obj);
                    }

                    break;

                case GameObjectType.EventObject:
                    result.Add(obj);
                    break;

                case GameObjectType.BattleNpc:
                    if (DeepDungeonManager.PortalActive && !((BattleCharacter)obj).InCombat && FloorExit.location != Vector3.Zero)
                    {
                        continue;
                    }
                    if (!((BattleCharacter)obj).IsDead)
                    {
                        result.Add(obj);
                    }
                    break;

                default:
                    continue;
                }
            }
            //Blacklists
            return(result);
        }
Ejemplo n.º 13
0
        public static bool ShouldAttack(WoWUnit unit)
        {
            if (unit == null)
            {
                return(false);
            }

            if (IsFocusTarget(unit) && unit.IsAlive)
            {
                return(true);
            }
            if (unit.Name == "Training Dummy" || unit.Name == "Raider's Training Dummy")
            {
                return(true);
            }
            return(unit.Attackable &&
                   unit.IsValid &&
                   !unit.IsFriendly &&
                   !IsCrowdControlled(unit) &&
                   unit.IsAlive &&
                   unit.Combat &&
                   (!unit.IsPlayer || unit.ToPlayer().IsHorde != Me.IsHorde) &&
                   !IsMeOrMyGroup(unit)
                   // && (IsTargetingMeOrMyGroup(unit) || unit.CreatureType == WoWCreatureType.Totem)
                   && !Blacklist.Contains(unit.Guid) &&
                   !IsIgnoreTarget(unit));
        }
Ejemplo n.º 14
0
 private bool Revive()
 {
     foreach (WoWPlayer p in GetResurrectTargets())
     {
         if (Blacklist.Contains(p.Guid, true))
         {
             continue;
         }
         else
         {
             if (p.Distance2D > 40 || !p.InLineOfSight)
             {
                 return(true);
             }
             else if (HazzDruidSettings.Instance.UseRevive && CC("Revive", p))
             {
                 Logging.Write("Revive " + p);
                 C("Revive", p);
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 15
0
        protected sealed override async Task Main()
        {
            if (!IsDone)
            {
                await CommonTasks.HandleLoading();

                await GoThere();

                if (Target != null && !Blacklist.Contains(Target.ObjectId))
                {
                    await CustomLogic();
                }
                else
                {
                    if (ItemTarget != 0)
                    {
                        await UseItem();
                    }

                    if (!Position.WithinHotSpot2D(Me.Location, 5f))
                    {
                        await MoveAndStop(Position, Distance, "Searching for a Target for " + QuestName);
                    }

                    if (Hotspots.Count != 0 && Position.WithinHotSpot2D(Me.Location, 5f))
                    {
                        Hotspots.Next();
                    }
                }

                await Coroutine.Yield();
            }
        }
 // 24Feb2013-08:11UTC chinajade
 private bool IsViable(WoWUnit wowUnit)
 {
     return
         ((wowUnit != null) &&
          wowUnit.IsValid &&
          wowUnit.IsAlive &&
          !Blacklist.Contains(wowUnit, BlacklistFlags.Combat));
 }
Ejemplo n.º 17
0
        public static bool ValidUnit(WoWUnit p)
        {
            if (StyxWoW.Me.IsInInstance && IgnoreMobs.Contains(p.Entry))
            {
                return(false);
            }

            // Ignore shit we can't select/attack
            if (!p.CanSelect || !p.Attackable)
            {
                return(false);
            }

            // Duh
            if (p.IsDead)
            {
                return(false);
            }

            // check for enemy players here as friendly only seems to work on npc's
            if (p.IsPlayer)
            {
                return(p.ToPlayer().IsHorde != StyxWoW.Me.IsHorde);
            }

            // Ignore friendlies!
            if (p.IsFriendly)
            {
                return(false);
            }

            // Dummies/bosses are valid by default. Period.
            if (p.IsTrainingDummy() || p.IsBoss())
            {
                return(true);
            }

            // If it is a pet/minion/totem, lets find the root of ownership chain
            WoWUnit pOwner = GetPlayerParent(p);

            // ignore if owner is player, alive, and not blacklisted then ignore (since killing owner kills it)
            if (pOwner != null && pOwner.IsAlive && !Blacklist.Contains(pOwner, BlacklistFlags.Combat))
            {
                return(false);
            }

            // And ignore critters (except for those ferocious ones) /non-combat pets
            if (p.IsNonCombatPet || (p.IsCritter && p.ThreatInfo.ThreatValue == 0 && !p.IsTargetingMyRaidMember))
            {
                return(false);
            }

/*
 *          if (p.CreatedByUnitGuid != 0 || p.SummonedByUnitGuid != 0)
 *              return false;
 */
            return(true);
        }
        /// <summary> Query if '@object' is valid obstacle. </summary>
        /// <param name="object"> The object. </param>
        /// <returns> true if valid obstacle, false if not. </returns>
        public bool IsValidObstacle(DiaObject @object)
        {
            int   actorId  = @object.ActorSNO;
            float distance = @object.Distance;

            if (Blacklist.Contains(@object))
            {
                return(false);
            }

            if (@object.ActorType == ActorType.ClientEffect)
            {
                return(false);
            }

            float baseRange = 5f;

            if (@object.ActorInfo.GizmoType == GizmoType.BreakableDoor)
            {
                baseRange = 10f;
            }

            // This is for destructibles that is rather big and can't go by the default 10 yrds rule.
            float range = baseRange + @object.CollisionSphere.Radius / 2;

            if (_longRangeDestructibles.ContainsKey(actorId))
            {
                range = _longRangeDestructibles[actorId];
            }

            if (_longRangeDoors.ContainsKey(actorId))
            {
                range = _longRangeDoors[actorId];
            }

            if (distance > range)
            {
                return(false);
            }

            var door = @object as GizmoDoor;

            if (door != null)
            {
                return(!_doorBlacklist.Contains(actorId));
            }

            // Destructible loot containers etc.
            var destructible = @object as GizmoDestructible;

            if (destructible != null)
            {
                return(!_obstacleBlacklist.Contains(actorId));
            }

            return(false);
        }
Ejemplo n.º 19
0
 private bool IsViableTarget(WoWUnit vehicle, WoWUnit wowUnit)
 {
     return
         ((wowUnit != null) &&
          wowUnit.IsValid &&
          wowUnit.IsAlive &&
          !Blacklist.Contains(wowUnit, BlacklistFlags.Combat) &&
          IsWithinArticulationLimits(vehicle, wowUnit));
 }
Ejemplo n.º 20
0
 // 24Feb2013-08:11UTC chinajade
 public bool IsViableForFighting(WoWUnit wowUnit)
 {
     return
         (IsViable(wowUnit) &&
          wowUnit.IsAlive &&
          !wowUnit.IsFriendly &&
          wowUnit.Attackable &&
          !Blacklist.Contains(wowUnit, BlacklistFlags.Combat));
 }
Ejemplo n.º 21
0
 public static IEnumerable <WoWAreaTrigger> FindFragments(float range)
 {
     range *= range;
     return(ObjectManager.GetObjectsOfType <WoWAreaTrigger>()
            .Where(
                o =>
                !Blacklist.Contains(o, BlacklistFlags.Loot) && o.Caster == Me && o.DistanceSqr <= range &&
                (o.Entry == 11266 || o.Entry == 10665 || o.Entry == 12929 || o.Entry == 8352)).OrderBy(o => o.DistanceSqr));
 }
Ejemplo n.º 22
0
 public static IEnumerable <WoWObject> FindSpheres(SphereType typ, float range)
 {
     range *= range;
     return(ObjectManager.ObjectList
            .Where(
                o =>
                o.Type == WoWObjectType.AreaTrigger && o.Entry == (uint)typ && o.DistanceSqr < range &&
                !Blacklist.Contains(o.Guid, BlacklistFlags.Combat))
            .OrderBy(o => o.DistanceSqr));
 }
Ejemplo n.º 23
0
        private bool Filter(bool inCombat, BattleCharacter battleCharacter)
        {
            if (!battleCharacter.IsValid || battleCharacter.IsDead || !battleCharacter.IsVisible || battleCharacter.CurrentHealthPercent <= 0f)
            {
                return(false);
            }

            if (!battleCharacter.CanAttack)
            {
                return(false);
            }

            if (this.IgnoreNpcIds.Contains(battleCharacter.NpcId))
            {
                return(false);
            }

            if (Blacklist.Contains(battleCharacter.ObjectId, BlacklistFlags.Combat))
            {
                return(false);
            }

            if (battleCharacter.IsFateGone)
            {
                return(false);
            }

            if (Core.Player.IsLevelSynced && IsOutOfRangeOfLevelSyncedFate(battleCharacter))
            {
                return(false);
            }

            if (this.attackers.Contains(battleCharacter))
            {
                return(true);
            }

            if (!battleCharacter.IsFate && ExFateBot.FateData != null)
            {
                return(false);
            }

            if (ExFateBot.FateData != null && battleCharacter.FateId != ExFateBot.FateData.Id)
            {
                return(false);
            }

            if ((ExFateBot.FateData == null || !ExFateBot.FateData.IsValid))
            {
                return(false);
            }

            return(!inCombat);
        }
Ejemplo n.º 24
0
        internal static bool GrindMobFilter(BattleCharacter battleCharacter)
        {
            if (!battleCharacter.IsValid || battleCharacter.IsDead || !battleCharacter.IsVisible || battleCharacter.CurrentHealthPercent <= 0f)
            {
                return(false);
            }

            if (battleCharacter.TappedByOther)
            {
                return(false);
            }

            if (OracleClassManager.GetTrueLevel() - WaitSettings.Instance.MobGrindMinLevelBelow > battleCharacter.ClassLevel)
            {
                return(false);
            }

            if (OracleClassManager.GetTrueLevel() + WaitSettings.Instance.MobGrindMaxLevelAbove < battleCharacter.ClassLevel)
            {
                return(false);
            }

            if (!battleCharacter.CanAttack)
            {
                return(false);
            }

            if (Blacklist.Contains(battleCharacter.ObjectId, BlacklistFlags.Combat))
            {
                return(false);
            }

            if (battleCharacter.IsFateGone)
            {
                return(false);
            }

            if (battleCharacter.IsFate)
            {
                return(false);
            }

            if (BlacklistSettings.Instance.BlacklistedMobs.Contains(battleCharacter.NpcId))
            {
                return(false);
            }

            if (GameObjectManager.Attackers.Contains(battleCharacter))
            {
                return(true);
            }

            return(true);
        }
Ejemplo n.º 25
0
 /// <summary>
 ///   Creates a behavior to resurrect dead players around. This behavior will res each player once in every 10 seconds.
 ///   Returns RunStatus.Success if successful, RunStatus.Failure otherwise.
 /// </summary>
 /// <remarks>
 ///   Created 16/12/2011.
 /// </remarks>
 /// <param name = "spellName">The name of resurrection spell.</param>
 /// <returns>.</returns>
 public static Composite Resurrect(string spellName)
 {
     return
         (new PrioritySelector(
              ctx => Unit.ResurrectablePlayers.FirstOrDefault(u => !Blacklist.Contains(u)),
              new Decorator(
                  ctx => ctx != null && SingularRoutine.CurrentWoWContext != WoWContext.Battlegrounds,
                  new Sequence(
                      Cast(spellName, ctx => (WoWPlayer)ctx),
                      new Action(ctx => Blacklist.Add((WoWPlayer)ctx, TimeSpan.FromSeconds(30)))))));
 }
Ejemplo n.º 26
0
        public static async Task <bool> KillDominus()
        {
            if (_dominusKilled)
            {
                return(false);
            }

            if (World.Act3.UpperSceptreOfGod.IsCurrentArea)
            {
                UpdateDominusFightObjects();

                if (_dominus2 != null)
                {
                    await Helpers.MoveAndWait(_dominus2.WalkablePosition());

                    return(true);
                }
                if (_dominus != null)
                {
                    if (await Helpers.StopBeforeBoss(Settings.BossNames.Dominus))
                    {
                        return(true);
                    }

                    if (!_dominus.IsTargetable && _anyActiveUniqueMob != null)
                    {
                        await Helpers.MoveAndWait(_anyActiveUniqueMob.WalkablePosition());

                        return(true);
                    }
                    if (_dominus.Health == 1)
                    {
                        var id = _dominus.Id;
                        if (!Blacklist.Contains(id))
                        {
                            Blacklist.Add(id, TimeSpan.FromDays(1), "Dominus first form waiting for death");
                        }
                    }
                    await Helpers.MoveAndWait(_dominus.WalkablePosition());

                    return(true);
                }
                if (_dominusRoomObj != null)
                {
                    await Helpers.MoveAndWait(_dominusRoomObj.WalkablePosition(), "Waiting for any Dominus fight object");

                    return(true);
                }
            }
            await Travel.To(World.Act4.Aqueduct);

            return(true);
        }
Ejemplo n.º 27
0
        public bool IsVendorNpcNear(out WowUnit unit)
        {
            unit = WowInterface.ObjectManager.WowObjects.OfType <WowUnit>()
                   .FirstOrDefault(e => e.GetType() != typeof(WowPlayer) &&
                                   !Blacklist.Contains(e.Guid) &&
                                   !e.IsDead &&
                                   e.IsVendor &&
                                   WowInterface.HookManager.GetUnitReaction(WowInterface.ObjectManager.Player, e) != WowUnitReaction.Hostile &&
                                   e.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < Config.RepairNpcSearchRadius);

            return(unit != null);
        }
Ejemplo n.º 28
0
        public static void Pulse()
        {
            string fnname = "CheckForChest.Pulse";

            MyTimer.Start(fnname);
            if (BotPoi.Current.Type == PoiType.Loot)
            {
                // Black list loot if it's taking too long
                FTWLogger.log(color, "LOOT CHESTS: Moving towards {0} ({1:X}) at {2} yards away", BotPoi.Current.Name, BotPoi.Current.Guid, BotPoi.Current.Location.Distance(StyxWoW.Me.Location));
                if (BotPoi.Current.Guid == lastguid && DateTime.Now > stoptime)
                {
                    FTWLogger.log(color, "LOOT CHESTS: Blacklisting {0} ({1:X}) - didn't get it after {2} seconds.", BotPoi.Current.Name, BotPoi.Current.Guid, blacklistMinutes);
                    Blacklist.Add(lastguid, BlacklistFlags.All, TimeSpan.FromMinutes(60));
                    Clear();
                }
            }
            else
            {
                // Look for new loot
                if (DateTime.Now < nexttime)
                {
                    MyTimer.Stop(fnname);
                    return;
                }
                // OMG DON'T run for a chest in a dungeon!
                // 'Tap tool' on beer keg in Stormstout causes you to pull multiple rooms of mobs.
                if (StyxWoW.Me.IsInInstance)
                {
                    return;
                }
                nexttime = DateTime.Now.AddSeconds(checkInterval);
                List <WoWGameObject> chests = (from c in ObjectManager.GetObjectsOfType <WoWGameObject>(false, false)
                                               where c.Distance < Styx.CommonBot.LootTargeting.LootRadius
                                               where c.Type != WoWObjectType.Corpse &&
                                               c.SubType == WoWGameObjectType.Chest &&
                                               !Blacklist.Contains(c.Guid, BlacklistFlags.All) &&
                                               c.CanLoot == true
                                               where c.IsHerb == false && c.IsMineral == false
                                               orderby c.Distance
                                               select c).ToList();
                if (chests.Count > 0)
                {
                    lastguid       = chests[0].Guid;
                    BotPoi.Current = new BotPoi(chests[0], PoiType.Loot);
                    FTWLogger.log(color, "LOOT CHESTS: Going after {0} ({1:X}) at {2} yards away", chests[0].Name, chests[0].Guid, chests[0].Distance);
                    stoptime = DateTime.Now.AddSeconds(pullSeconds);
                }
            }
            MyTimer.Stop(fnname);
        }
Ejemplo n.º 29
0
        private void Instance_IncludeTargetsFilter(List <WoWObject> incomingUnits, HashSet <WoWObject> outgoingUnits)
        {
            var isOutdoors = Me.IsOutdoors;

            foreach (var unit in incomingUnits.OfType <WoWUnit>())
            {
                if (!isOutdoors &&
                    (unit.Entry == EddyId || unit.Entry == JoogaId || unit.Entry == FizzyYellowSpiritId ||
                     unit.Entry == FizzyYellowAlementalId) &&
                    !Blacklist.Contains(unit, BlacklistFlags.Combat))
                {
                    outgoingUnits.Add(unit);
                }
            }
        }
Ejemplo n.º 30
0
        /// <summary> Query if 'unit' is valid unit. </summary>
        /// <remarks> Nesox, 2013-06-29. </remarks>
        private bool IsValidUnit(bool incombat, BattleCharacter unit)
        {
            if (!unit.IsValid || unit.IsDead || !unit.IsVisible || unit.CurrentHealthPercent <= 0)
            {
                return(false);
            }

            if (IgnoreNpcIds.Contains(unit.NpcId))
            {
                return(false);
            }

            // Ignore blacklisted mobs if they're in combat with us!
            if (Blacklist.Contains(unit.ObjectId, BlacklistFlags.Combat))
            {
                return(false);
            }

            var fategone = unit.IsFateGone;

            if (fategone)
            {
                return(false);
            }

            //Make sure we always return true for units inside our aggro list
            if (_aggroedBattleCharacters.Contains(unit))
            {
                return(true);
            }

            if (!unit.IsFate)
            {
                return(false);
            }

            if (!unit.CanAttack)
            {
                return(false);
            }

            if (Vector3.Distance(unit.Location, LLFate.Position) > 50)
            {
                return(false);
            }

            return(!incombat);
        }