Exemplo n.º 1
0
        protected override void DefaultRemoveTargetsFilter(List <WoWObject> units)
        {
            bool isHorde = StyxWoW.Me.IsHorde;

            for (int i = units.Count - 1; i >= 0; i--)
            {
                WoWObject o = units[i];
                if (!(o is WoWPlayer) && !(o is LocalPlayer))
                {
                    units.RemoveAt(i);
                    continue;
                }

                WoWPlayer p = o.ToPlayer();

                // Make sure we ignore dead/ghost players. If we need res logic, they need to be in the class-specific area.
                if (p.Dead || p.IsGhost)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // Check if they're hostile first. This should remove enemy players, but it's more of a sanity check than anything.
                if (p.IsHostile)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // If we're horde, and they're not, fuggin ignore them!
                if (p.IsHorde != isHorde)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // They're not in our party/raid. So ignore them. We can't heal them anyway.
                if (!p.IsInMyPartyOrRaid)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (p.HealthPercent >= SingularSettings.Instance.IgnoreHealTargetsAboveHealth)
                {
                    units.RemoveAt(i);
                    continue;
                }
            }

            // A little bit of a hack, but this ensures 'Me' is in the list.
            if (!units.Any(o => o.IsMe) && StyxWoW.Me.HealthPercent < SingularSettings.Instance.IgnoreHealTargetsAboveHealth)
            {
                units.Add(StyxWoW.Me);
            }
        }
Exemplo n.º 2
0
        protected override void DefaultRemoveTargetsFilter(List <WoWObject> units)
        {
            bool isHorde = StyxWoW.Me.IsHorde;
            var  mistweaver_settings_ignore_percent = MistweaverSettings.Instance.IgnorePercent;

            for (int i = units.Count - 1; i >= 0; i--)
            {
                WoWObject o = units[i];
                if (!(o is WoWPlayer))
                {
                    units.RemoveAt(i);
                    continue;
                }

                WoWPlayer p = o.ToPlayer();

                if (p.IsDead || p.IsGhost)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (p.IsHostile)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (!p.IsInMyPartyOrRaid)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (p.HealthPercent > mistweaver_settings_ignore_percent)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (p.DistanceSqr > 40 * 40)
                {
                    units.RemoveAt(i);
                    continue;
                }
            }

            if (!units.Any(o => o.IsMe) && StyxWoW.Me.HealthPercent < mistweaver_settings_ignore_percent)
            {
                units.Add(StyxWoW.Me);
            }
        }
Exemplo n.º 3
0
        public static string SafeName(this WoWObject obj)
        {
            if (obj.IsMe)
            {
                return("Me");
            }

            string name;

            if (obj is WoWPlayer)
            {
                if (!obj.ToPlayer().IsFriendly)
                {
                    name = "Enemy.";
                }
                else
                {
                    if (RaFHelper.Leader == obj)
                    {
                        name = "lead.";
                    }
                    else if (Group.Tanks.Any(t => t.Guid == obj.Guid))
                    {
                        name = "tank.";
                    }
                    else if (Group.Healers.Any(t => t.Guid == obj.Guid))
                    {
                        name = "healer.";
                    }
                    else
                    {
                        name = "dps.";
                    }
                }
                name += ShowPlayerNames ? ((WoWPlayer)obj).Name : ((WoWPlayer)obj).Class.ToString();
            }
            else if (obj is WoWUnit && obj.ToUnit().IsPet)
            {
                WoWUnit root = obj.ToUnit().OwnedByRoot;
                name = root == null ? "(unknown)" : root.SafeName() + ":Pet";
            }
            else
            {
                name = obj.Name;
            }

            return(name + "." + UnitID(obj.Guid));
        }
Exemplo n.º 4
0
        protected override void DefaultRemoveTargetsFilter(List <WoWObject> units)
        {
            bool isHorde = StyxWoW.Me.IsHorde;

            for (int i = units.Count - 1; i >= 0; i--)
            {
                WoWObject o = units[i];
                if (!(o is WoWPlayer))
                {
                    units.RemoveAt(i);
                    continue;
                }

                WoWPlayer p = o.ToPlayer();

                // Make sure we ignore dead/ghost players. If we need res logic, they need to be in the class-specific area.
                if (p.IsDead || p.IsGhost)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // Check if they're hostile first. This should remove enemy players, but it's more of a sanity check than anything.
                if (p.IsHostile)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // If we're horde, and they're not, fuggin ignore them!
                if (p.IsHorde != isHorde)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // They're not in our party/raid. So ignore them. We can't heal them anyway.
                if (!p.IsInMyPartyOrRaid)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (p.HealthPercent >= SingularSettings.Instance.IgnoreHealTargetsAboveHealth)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // If we have movement turned off, ignore people who aren't in range.
                // Almost all healing is 40 yards, so we'll use that. If in Battlegrounds use a slightly larger value to expane our
                // healing range, but not too large that we are running all over the bg zone
                // note: reordered following tests so only one floating point distance comparison done due to evalution of DisableAllMovement
                if ((SingularSettings.Instance.DisableAllMovement && p.DistanceSqr > 40 * 40) || p.DistanceSqr > SingularSettings.Instance.MaxHealTargetRange * SingularSettings.Instance.MaxHealTargetRange)
                {
                    units.RemoveAt(i);
                    continue;
                }
            }

            // A little bit of a hack, but this ensures 'Me' is in the list.
            if (!units.Any(o => o.IsMe) && StyxWoW.Me.HealthPercent < SingularSettings.Instance.IgnoreHealTargetsAboveHealth)
            {
                units.Add(StyxWoW.Me);
            }
        }
        protected override void DefaultRemoveTargetsFilter(List <WoWObject> units)
        {
            bool isHorde = StyxWoW.Me.IsHorde;

            for (int i = units.Count - 1; i >= 0; i--)
            {
                WoWObject o = units[i];
                if (!(o is WoWPlayer))
                {
                    units.RemoveAt(i);
                    continue;
                }

                WoWPlayer p = o.ToPlayer();

                // Make sure we ignore dead/ghost players. If we need res logic, they need to be in the class-specific area.
                if (p.Dead || p.IsGhost)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // Check if they're hostile first. This should remove enemy players, but it's more of a sanity check than anything.
                if (p.IsHostile)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // If we're horde, and they're not, fuggin ignore them!
                if (p.IsHorde != isHorde)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // They're not in our party/raid. So ignore them. We can't heal them anyway.
                if (!p.IsInMyPartyOrRaid)
                {
                    units.RemoveAt(i);
                    continue;
                }

                if (p.HealthPercent >= SingularSettings.Instance.IgnoreHealTargetsAboveHealth)
                {
                    units.RemoveAt(i);
                    continue;
                }

                // If we have movement turned off or we are inside battlegrounds, ignore people who aren't in range.
                // Almost all healing is 40 yards, so we'll use that.
                if (p.DistanceSqr > 40 * 40)
                {
                    if (SingularSettings.Instance.DisableAllMovement || SingularRoutine.CurrentWoWContext == WoWContext.Battlegrounds)
                    {
                        units.RemoveAt(i);
                        continue;
                    }
                }
            }

            // A little bit of a hack, but this ensures 'Me' is in the list.
            if (!units.Any(o => o.IsMe) && StyxWoW.Me.HealthPercent < SingularSettings.Instance.IgnoreHealTargetsAboveHealth)
            {
                units.Add(StyxWoW.Me);
            }
        }