コード例 #1
0
ファイル: Helper.cs プロジェクト: joyhck/OKTW-EB
        public static List <Obj_AI_Minion> GetMinions(Vector3 from, float range, MinionTypes type = MinionTypes.All, MinionTeam team = MinionTeam.Enemy, MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = from minion in ObjectManager.Get <Obj_AI_Minion>()
                         where minion.IsValidTarget(range, false, @from)
                         let minionTeam = minion.Team
                                          where
                                          (team == MinionTeam.Neutral && minionTeam == GameObjectTeam.Neutral) ||
                                          (team == MinionTeam.Ally &&
                                           minionTeam
                                           == (myHero.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order)) ||
                                          (team == MinionTeam.Enemy &&
                                           minionTeam
                                           == (myHero.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos)) ||
                                          (team == MinionTeam.NotAlly && minionTeam != myHero.Team) ||
                                          (team == MinionTeam.NotAllyForEnemy &&
                                           (minionTeam == myHero.Team || minionTeam == GameObjectTeam.Neutral)) ||
                                          team == MinionTeam.All
                                          where
                                          (minion.IsMelee() && type == MinionTypes.Melee) ||
                                          (!minion.IsMelee() && type == MinionTypes.Ranged) || type == MinionTypes.All
                                          where MinionManager.IsMinion(minion) || minionTeam == GameObjectTeam.Neutral || IsPet(minion)
                                          select minion;

            switch (order)
            {
            case MinionOrderTypes.Health:
                result = result.OrderBy(i => i.Health);
                break;

            case MinionOrderTypes.MaxHealth:
                result = result.OrderBy(i => i.MaxHealth).Reverse();
                break;
            }
            return(result.ToList());
        }
コード例 #2
0
ファイル: Utils.cs プロジェクト: uio25371555/LeagueSharp2
            public static Obj_AI_Minion GetOneMinionObject(float range, MinionTypes mobTypes = MinionTypes.All,
                                                           int minMobCount = 1)
            {
                Obj_AI_Minion      oneMinion = null;
                List <Obj_AI_Base> minionsQ  = LeagueSharp.Common.MinionManager.GetMinions(Player.Self.ServerPosition,
                                                                                           range, LeagueSharp.Common.MinionTypes.All, MinionTeam.Enemy);

                if (mobTypes == MinionTypes.Siege)
                {
                    Obj_AI_Base oMob = (from fMobs in minionsQ
                                        from fBigBoys in
                                        new[]
                    {
                        "SRU_ChaosMinionSiege", "SRU_ChaosMinionSuper"
                    }
                                        where fBigBoys == fMobs.SkinName && fMobs.Health > Player.Self.TotalAttackDamage()
                                        select fMobs).FirstOrDefault();

                    if (oMob != null)
                    {
                        if (oMob.IsValidTarget(range))
                        {
                            oneMinion = (Obj_AI_Minion)oMob;
                        }
                    }
                }
                else if (minionsQ.Count > 0)
                {
                    oneMinion = (Obj_AI_Minion)minionsQ[0];
                }

                return(oneMinion);
            }
コード例 #3
0
ファイル: Helper.cs プロジェクト: Xelamats/PortAIO
 public static List<Obj_AI_Minion> GetMinions(Vector3 from, float range, MinionTypes type = MinionTypes.All,
     MinionTeam team = MinionTeam.Enemy, MinionOrderTypes order = MinionOrderTypes.Health)
 {
     var result = from minion in ObjectManager.Get<Obj_AI_Minion>()
         where minion.IsValidTarget(range, false, @from)
         let minionTeam = minion.Team
         where
             (team == MinionTeam.Neutral && minionTeam == GameObjectTeam.Neutral)
             || (team == MinionTeam.Ally
                 && minionTeam
                 == (myHero.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order))
             || (team == MinionTeam.Enemy
                 && minionTeam
                 == (myHero.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos))
             || (team == MinionTeam.NotAlly && minionTeam != myHero.Team)
             || (team == MinionTeam.NotAllyForEnemy
                 && (minionTeam == myHero.Team || minionTeam == GameObjectTeam.Neutral))
             || team == MinionTeam.All
         where
             (minion.IsMelee() && type == MinionTypes.Melee)
             || (!minion.IsMelee() && type == MinionTypes.Ranged) || type == MinionTypes.All
         where MinionManager.IsMinion(minion) || minionTeam == GameObjectTeam.Neutral || IsPet(minion)
         select minion;
     switch (order)
     {
         case MinionOrderTypes.Health:
             result = result.OrderBy(i => i.Health);
             break;
         case MinionOrderTypes.MaxHealth:
             result = result.OrderBy(i => i.MaxHealth).Reverse();
             break;
     }
     return result.ToList();
 }
コード例 #4
0
    public void SpawnMinion(MinionTypes minionType)
    {
        switch (minionType)
        {
        case MinionTypes.TURTLE_1:
            Instantiate(MinionPrefabs[0], transform.position, Quaternion.identity);
            break;

        case MinionTypes.TURTLE_2:
            Instantiate(MinionPrefabs[1], transform.position, Quaternion.identity);
            break;

        case MinionTypes.TURTLE_3:
            Instantiate(MinionPrefabs[2], transform.position, Quaternion.identity);
            break;

        case MinionTypes.TURTLE_4:
            Instantiate(MinionPrefabs[3], transform.position, Quaternion.identity);
            break;

        case MinionTypes.TURTLE_5:
            Instantiate(MinionPrefabs[4], transform.position, Quaternion.identity);
            break;

        default:
            break;
        }
    }
コード例 #5
0
        public void Cast_onMinion_nearEnemy(Spell spell,
                                            float range,
                                            TargetSelector.DamageType damageType = TargetSelector.DamageType.Physical,
                                            MinionTypes minionTypes = MinionTypes.All,
                                            MinionTeam minionTeam   = MinionTeam.All)
        {
            if (!spell.IsReady() || !ManaManagerAllowCast(spell))
            {
                return;
            }
            var target = TargetSelector.GetTarget(spell.Range + range, damageType);

            Obj_AI_Base[] nearstMinion = { null };
            var           allminions   = MinionManager.GetMinions(target.Position, range, minionTypes, minionTeam);

            foreach (var minion in
                     allminions.Where(
                         minion => minion.Distance(ObjectManager.Player) <= spell.Range && minion.Distance(target) <= range)
                     .Where(
                         minion => nearstMinion[0] == null || nearstMinion[0].Distance(target) >= minion.Distance(target))
                     )
            {
                nearstMinion[0] = minion;
            }

            if (nearstMinion[0] != null)
            {
                spell.CastOnUnit(nearstMinion[0], Packets());
            }
        }
コード例 #6
0
ファイル: Helper.cs プロジェクト: fgpmaia123/KaiserSharp
        public static Tuple<bool, Obj_AI_Base> IsCanLastHit(Vector3 from, float range, MinionTypes _MinionType, MinionTeam _MinionTeam, MinionOrderTypes _MinionOrderType, bool _IsRanged)
        {
            bool result = false;
            Obj_AI_Base target = null;

            if (HasTargonItem && !player.IsDead && player.Buffs.Any(x => x.Count > 0 && x.Name == "talentreaperdisplay") && IsAllyInRange(1500))
            {
                var minions = MinionManager.GetMinions(from, range, _MinionType, _MinionTeam, _MinionOrderType);
                var itemNum = player.InventoryItems.Any(x => x.Id == ItemId.Face_of_the_Mountain || x.Id == ItemId.Relic_Shield || x.Id == ItemId.Targons_Brace);

                foreach(var minion in minions)
                {
                    var a = player.Buffs.Any(x => x.DisplayName.Contains("ThreshPassiveSoulsGain")) ? player.Buffs.Find(x => x.DisplayName.Contains("ThreshPassiveSoulsGain")).Count : 0;
                    var dmg = _IsRanged ? player.GetAutoAttackDamage(minion) + a : GetItemDmg();

                    if (minion.Health < dmg && player.CanAttack && Orbwalking.InAutoAttackRange(minion))
                    {
                        result = true;
                        target = minion;
                    }
                }
            }

            return new Tuple<bool, Obj_AI_Base>(result, target);
        }
コード例 #7
0
ファイル: MinionManager.cs プロジェクト: lolscripts/Aka-s
 public static List<Obj_AI_Base> GetMinions(float range,
     MinionTypes type = MinionTypes.All,
     MinionTeam team = MinionTeam.Enemy,
     MinionOrderTypes order = MinionOrderTypes.Health)
 {
     return GetMinions(ObjectManager.Player.ServerPosition, range, type, team, order);
 }
コード例 #8
0
 public static List <Obj_AI_Base> GetMinions(float range,
                                             MinionTypes type       = MinionTypes.All,
                                             MinionTeam team        = MinionTeam.Enemy,
                                             MinionOrderTypes order = MinionOrderTypes.Health)
 {
     return(GetMinions(ObjectManager.Player.ServerPosition, range, type, team, order));
 }
コード例 #9
0
 /// <summary>
 /// Gets the minions.
 /// </summary>
 /// <param name="range">The range.</param>
 /// <param name="type">The type.</param>
 /// <param name="team">The team.</param>
 /// <param name="order">The order.</param>
 /// <returns>List&lt;AIBaseClient&gt;.</returns>
 public static List <AIBaseClient> GetMinions(
     float range,
     MinionTypes type       = MinionTypes.All,
     MinionTeam team        = MinionTeam.Enemy,
     MinionOrderTypes order = MinionOrderTypes.Health)
 {
     return(GetMinions(ObjectManager.Player.PreviousPosition, range, type, team, order));
 }
コード例 #10
0
ファイル: Minion.cs プロジェクト: Joey115/Softwaredev
    public void Start()
    {
        MinionTypes thisMinion = MinionTypes.GoblinArchers;

        filePath = "URI=file:" + Application.dataPath + "Minions.s3db";
        _name    = thisMinion.ToString();
        LoadMinions();
        //instantiate children
    }
コード例 #11
0
        /// <summary>
        ///     Returns the minions in range from From.
        /// </summary>
        public static List <Obj_AI_Base> GetMinions(Vector3 from,
                                                    float range,
                                                    MinionTypes type       = MinionTypes.All,
                                                    MinionTeam team        = MinionTeam.Enemy,
                                                    MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result =
                ObjectHandler.GetFast <Obj_AI_Minion>()
                .Where(minion => minion.IsValidTarget(range, false, @from))
                .Select(minion => new { minion, minionTeam = minion.Team })
                .Where(
                    @t =>
                    team == MinionTeam.Neutral && @t.minionTeam == GameObjectTeam.Neutral ||
                    team == MinionTeam.Ally &&
                    @t.minionTeam ==
                    (ObjectManager.Player.Team == GameObjectTeam.Chaos
                                ? GameObjectTeam.Chaos
                                : GameObjectTeam.Order) ||
                    team == MinionTeam.Enemy &&
                    @t.minionTeam ==
                    (ObjectManager.Player.Team == GameObjectTeam.Chaos
                                ? GameObjectTeam.Order
                                : GameObjectTeam.Chaos) ||
                    team == MinionTeam.NotAlly && @t.minionTeam != ObjectManager.Player.Team ||
                    team == MinionTeam.NotAllyForEnemy &&
                    (@t.minionTeam == ObjectManager.Player.Team || @t.minionTeam == GameObjectTeam.Neutral) ||
                    team == MinionTeam.All)
                .Where(
                    @t =>
                    @t.minion.CombatType == GameObjectCombatType.Melee && type == MinionTypes.Melee ||
                    @t.minion.CombatType != GameObjectCombatType.Melee && type == MinionTypes.Ranged ||
                    type == MinionTypes.All)
                .Where(@t => IsMinion(@t.minion) || @t.minionTeam == GameObjectTeam.Neutral)
                .Select(@t => @t.minion)
                .Cast <Obj_AI_Base>()
                .ToList();

            switch (order)
            {
            case MinionOrderTypes.Health:
                result = result.OrderBy(o => o.Health).ToList();
                break;

            case MinionOrderTypes.MaxHealth:
                result = result.OrderBy(o => o.MaxHealth).Reverse().ToList();
                break;
            }

            return(result);
        }
コード例 #12
0
        /// <summary>
        /// Returns the minions in range from From.
        /// </summary>
        public static List <Obj_AI_Base> GetMinions(Vector3 from,
                                                    float range,
                                                    MinionTypes type       = MinionTypes.All,
                                                    MinionTeam team        = MinionTeam.Enemy,
                                                    MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = new List <Obj_AI_Base>();

            foreach (var minion in ObjectManager.Get <Obj_AI_Minion>())
            {
                if (minion.IsValidTarget(range, false, from))
                {
                    var minionTeam = minion.Team;
                    if (team == MinionTeam.Neutral && minionTeam == GameObjectTeam.Neutral ||
                        team == MinionTeam.Ally &&
                        minionTeam ==
                        (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order) ||
                        team == MinionTeam.Enemy &&
                        minionTeam ==
                        (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos) ||
                        team == MinionTeam.NotAlly && minionTeam != ObjectManager.Player.Team ||
                        team == MinionTeam.NotAllyForEnemy &&
                        (minionTeam == ObjectManager.Player.Team || minionTeam == GameObjectTeam.Neutral) ||
                        team == MinionTeam.All)
                    {
                        if (minion.IsMelee() && type == MinionTypes.Melee ||
                            !minion.IsMelee() && type == MinionTypes.Ranged || type == MinionTypes.All)
                        {
                            if (IsMinion(minion) || minionTeam == GameObjectTeam.Neutral)
                            {
                                result.Add(minion);
                            }
                        }
                    }
                }
            }

            if (order == MinionOrderTypes.Health)
            {
                result = result.OrderBy(o => o.Health).ToList();
            }
            else if (order == MinionOrderTypes.MaxHealth)
            {
                result = result.OrderBy(o => o.MaxHealth).Reverse().ToList();
            }

            return(result);
        }
コード例 #13
0
        public static List <Obj_AI_Base> GetMinions(Vector3 from, float range, MinionTypes type = MinionTypes.All, MinionTeam team = MinionTeam.Enemy, MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = (from minion in ObjectManager.Get <Obj_AI_Minion>() where minion.IsValidTarget(range, false, @from) let minionTeam = minion.Team where team == MinionTeam.Neutral && minionTeam == GameObjectTeam.Neutral || team == MinionTeam.Ally && minionTeam == (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order) || team == MinionTeam.Enemy && minionTeam == (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos) || team == MinionTeam.NotAlly && minionTeam != ObjectManager.Player.Team || team == MinionTeam.NotAllyForEnemy && (minionTeam == ObjectManager.Player.Team || minionTeam == GameObjectTeam.Neutral) || team == MinionTeam.All where minion.IsMelee() && type == MinionTypes.Melee || !minion.IsMelee() && type == MinionTypes.Ranged || type == MinionTypes.All where IsMinion(minion) || minionTeam == GameObjectTeam.Neutral select minion).Cast <Obj_AI_Base>().ToList();

            switch (order)
            {
            case MinionOrderTypes.Health:
                result = result.OrderBy(o => o.Health).ToList();
                break;

            case MinionOrderTypes.MaxHealth:
                result = result.OrderBy(o => o.MaxHealth).Reverse().ToList();
                break;
            }
            return(result);
        }
コード例 #14
0
        /// <summary>
        /// Returns the minions in range from From.
        /// </summary>
        public static List<Obj_AI_Base> GetMinions(Vector3 from,
            float range,
            MinionTypes type = MinionTypes.All,
            MinionTeam team = MinionTeam.Enemy,
            MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = new List<Obj_AI_Base>();

            foreach (var minion in ObjectManager.Get<Obj_AI_Minion>())
            {
                if (minion.IsValidTarget(range, false))
                {
                    if (team == MinionTeam.Neutral && minion.Team == GameObjectTeam.Neutral ||
                        team == MinionTeam.Ally &&
                        minion.Team ==
                        (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order) ||
                        team == MinionTeam.Enemy &&
                        minion.Team ==
                        (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos) ||
                        team == MinionTeam.NotAlly && minion.Team != ObjectManager.Player.Team ||
                        team == MinionTeam.NotAllyForEnemy &&
                        (minion.Team == ObjectManager.Player.Team || minion.Team == GameObjectTeam.Neutral) ||
                        team == MinionTeam.All)
                    {
                        if (minion.IsMelee() && type == MinionTypes.Melee ||
                            !minion.IsMelee() && type == MinionTypes.Ranged || type == MinionTypes.All)
                        {
                            result.Add(minion);
                        }
                    }
                }
            }

            if (order == MinionOrderTypes.Health)
            {
                result = result.OrderBy(o => o.Health).ToList();
            }
            else if (order == MinionOrderTypes.MaxHealth)
            {
                result = result.OrderBy(o => o.MaxHealth).Reverse().ToList();
            }

            return result;
        }
コード例 #15
0
 /// <summary>
 ///     Returns the best killable minion (if any)
 /// </summary>
 /// <param name="types"><see cref="MinionTypes" /> as filter</param>
 /// <param name="predictionType"><see cref="HealthPredictionType" /> to support both lane clear/last hit</param>
 /// <param name="adModifier">A modifier value for the lane freeze, passed as <see cref="float" /></param>
 /// <returns></returns>
 private Obj_AI_Base GetKillableMinion(MinionTypes types = MinionTypes.All,
                                       HealthPredictionType predictionType = HealthPredictionType.Default,
                                       double adModifier = 1.0)
 {
     return
         (MinionManager.GetMinions(
              ObjectHandler.Player.ServerPosition, ObjectHandler.Player.GetRealAutoAttackRange() + 65, types)
          .Where(CanGetOrbwalked)
          .Select(
              minion =>
              new
     {
         minion,
         predictedHealth =
             Health.GetPrediction(minion, (int)minion.GetTimeToHit(), 20, predictionType)
     })
          .Where(@t => @t.predictedHealth > 0 &&
                 @t.predictedHealth <= ObjectManager.Player.GetAutoAttackDamage(@t.minion) * adModifier)
          .Select(@t => @t.minion).FirstOrDefault());
 }
コード例 #16
0
        /// <summary>
        ///     Returns the minions in range from From.
        /// </summary>
        public static List<Obj_AI_Base> GetMinions(Vector3 from,
            float range,
            MinionTypes type = MinionTypes.All,
            MinionTeam team = MinionTeam.Enemy,
            MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = (from minion in GameObjects.Minions.Concat(GameObjects.Jungle)
                where minion.IsValidTarget(range, false, @from)
                let minionTeam = minion.Team
                where
                    team == MinionTeam.Neutral && minionTeam == GameObjectTeam.Neutral ||
                    team == MinionTeam.Ally &&
                    minionTeam ==
                    (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order) ||
                    team == MinionTeam.Enemy &&
                    minionTeam ==
                    (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos) ||
                    team == MinionTeam.NotAlly && minionTeam != ObjectManager.Player.Team ||
                    team == MinionTeam.NotAllyForEnemy &&
                    (minionTeam == ObjectManager.Player.Team || minionTeam == GameObjectTeam.Neutral) ||
                    team == MinionTeam.All
                where
                    minion.IsMelee() && type == MinionTypes.Melee || !minion.IsMelee() && type == MinionTypes.Ranged ||
                    type == MinionTypes.All
                where IsMinion(minion) || minionTeam == GameObjectTeam.Neutral
                select minion).Select(m => m as Obj_AI_Base).ToList();

            switch (order)
            {
                case MinionOrderTypes.Health:
                    result = result.OrderBy(o => o.Health).ToList();
                    break;
                case MinionOrderTypes.MaxHealth:
                    result = result.OrderBy(o => o.MaxHealth).Reverse().ToList();
                    break;
            }

            return result;
        }
コード例 #17
0
ファイル: Helper.cs プロジェクト: joyhck/OKTW-EB
 public static List <Obj_AI_Minion> GetMinions(float range, MinionTypes type = MinionTypes.All, MinionTeam team = MinionTeam.Enemy, MinionOrderTypes order = MinionOrderTypes.Health)
 {
     return(GetMinions(myHero.ServerPosition, range, type, team, order));
 }
コード例 #18
0
ファイル: Utils.cs プロジェクト: yashine59fr/PortAIO
            public static Obj_AI_Minion GetOneMinionObject(float range, MinionTypes mobTypes = MinionTypes.All,
                int minMobCount = 1)
            {
                Obj_AI_Minion oneMinion = null;
                var minionsQ = LeagueSharp.Common.MinionManager.GetMinions(Player.Self.ServerPosition,
                    range);

                if (mobTypes == MinionTypes.Siege)
                {
                    var oMob = (from fMobs in minionsQ
                        from fBigBoys in
                            new[]
                            {
                                "SRU_ChaosMinionSiege", "SRU_ChaosMinionSuper"
                            }
                        where fBigBoys == fMobs.BaseSkinName && fMobs.Health > Player.Self.TotalAttackDamage
                        select fMobs).FirstOrDefault();

                    if (oMob != null)
                    {
                        if (oMob.LSIsValidTarget(range))
                        {
                            oneMinion = (Obj_AI_Minion) oMob;
                        }
                    }
                }
                else if (minionsQ.Count > 0)
                {
                    oneMinion = (Obj_AI_Minion) minionsQ[0];
                }

                return oneMinion;
            }
コード例 #19
0
ファイル: Champion.cs プロジェクト: Imatation/LS-
		public void Cast_onMinion_nearEnemy(Spell spell, float range, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, MinionTypes minionTypes = MinionTypes.All, MinionTeam minionTeam = MinionTeam.All)
		{
			if(!spell.IsReady() || !ManaManagerAllowCast(spell))
				return;
			var target = SimpleTs.GetTarget(spell.Range + range, damageType);
			Obj_AI_Base[] nearstMinion = { null };
			var allminions = MinionManager.GetMinions(target.Position, range, minionTypes, minionTeam);
			foreach(var minion in allminions.Where(minion => minion.Distance(ObjectManager.Player) <= spell.Range && minion.Distance(target) <= range).Where(minion => nearstMinion[0] == null || nearstMinion[0].Distance(target) >= minion.Distance(target)))
				nearstMinion[0] = minion;

			if(nearstMinion[0] != null)
				spell.CastOnUnit(nearstMinion[0], Packets());
		}
コード例 #20
0
ファイル: Helper.cs プロジェクト: Xelamats/PortAIO
 public static List<Obj_AI_Minion> GetMinions(float range, MinionTypes type = MinionTypes.All,
     MinionTeam team = MinionTeam.Enemy, MinionOrderTypes order = MinionOrderTypes.Health)
 {
     return GetMinions(myHero.ServerPosition, range, type, team, order);
 }
コード例 #21
0
        public static Tuple <bool, Obj_AI_Base> IsCanLastHit(Vector3 from, float range, MinionTypes _MinionType, MinionTeam _MinionTeam, MinionOrderTypes _MinionOrderType, bool _IsRanged)
        {
            bool        result = false;
            Obj_AI_Base target = null;

            if (HasTargonItem && !player.IsDead && player.Buffs.Any(x => x.Count > 0 && x.Name == "talentreaperdisplay") && IsAllyInRange(1500))
            {
                var minions = MinionManager.GetMinions(from, range, _MinionType, _MinionTeam, _MinionOrderType);
                var itemNum = player.InventoryItems.Any(x => x.Id == ItemId.Face_of_the_Mountain || x.Id == ItemId.Relic_Shield || x.Id == ItemId.Targons_Brace);

                foreach (var minion in minions)
                {
                    var a   = player.Buffs.Any(x => x.DisplayName.Contains("ThreshPassiveSoulsGain")) ? player.Buffs.Find(x => x.DisplayName.Contains("ThreshPassiveSoulsGain")).Count : 0;
                    var dmg = _IsRanged ? player.GetAutoAttackDamage(minion) + a : GetItemDmg();

                    if (minion.Health < dmg && player.CanAttack && Orbwalking.InAutoAttackRange(minion))
                    {
                        result = true;
                        target = minion;
                    }
                }
            }

            return(new Tuple <bool, Obj_AI_Base>(result, target));
        }
コード例 #22
0
ファイル: Prediction.cs プロジェクト: chienhao10/Elobuddy-10
        public static List<Obj_AI_Base> GetMinions(Vector3 from,
            float range,
            MinionTypes type = MinionTypes.All,
            MinionTeam team = MinionTeam.Enemy,
            MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = (from minion in ObjectManager.Get<Obj_AI_Minion>()
                          where minion.IsValidTarget(range, false, @from)
                          let minionTeam = minion.Team
                          where
                              team == MinionTeam.Neutral && minionTeam == GameObjectTeam.Neutral ||
                              team == MinionTeam.Ally &&
                              minionTeam ==
                              (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Chaos : GameObjectTeam.Order) ||
                              team == MinionTeam.Enemy &&
                              minionTeam ==
                              (ObjectManager.Player.Team == GameObjectTeam.Chaos ? GameObjectTeam.Order : GameObjectTeam.Chaos) ||
                              team == MinionTeam.NotAlly && minionTeam != ObjectManager.Player.Team ||
                              team == MinionTeam.NotAllyForEnemy &&
                              (minionTeam == ObjectManager.Player.Team || minionTeam == GameObjectTeam.Neutral) ||
                              team == MinionTeam.All
                          where
                              !minion.IsRanged && type == MinionTypes.Melee || minion.IsRanged && type == MinionTypes.Ranged ||
                              type == MinionTypes.All
                          where IsMinion(minion) || minionTeam == GameObjectTeam.Neutral && minion.MaxHealth > 5 && minion.IsHPBarRendered
                          select minion).Cast<Obj_AI_Base>().ToList();

            switch (order)
            {
                case MinionOrderTypes.Health:
                    result = result.OrderBy(o => o.Health).ToList();
                    break;
                case MinionOrderTypes.MaxHealth:
                    result = result.OrderByDescending(o => o.MaxHealth).ToList();
                    break;
            }

            return result;
        }
コード例 #23
0
        /// <summary>
        ///     Gets minions based on range, type, team and then orders them.
        /// </summary>
        /// <param name="from">The point to get the minions from.</param>
        /// <param name="range">The range.</param>
        /// <param name="type">The type.</param>
        /// <param name="team">The team.</param>
        /// <param name="order">The order.</param>
        /// <returns>List&lt;Obj_AI_Base&gt;.</returns>
        public static List <Obj_AI_Base> GetMinions(
            Vector3 from,
            float range,
            MinionTypes type       = MinionTypes.All,
            MinionTeam team        = MinionTeam.Enemy,
            MinionOrderTypes order = MinionOrderTypes.Health)
        {
            var result = EloBuddy.SDK.EntityManager.MinionsAndMonsters.Monsters.Cast <Obj_AI_Base>().ToList();

            if (team == MinionTeam.All)
            {
                var a = EloBuddy.SDK.EntityManager.MinionsAndMonsters.Minions.Cast <Obj_AI_Base>().ToList();
                var b = EloBuddy.SDK.EntityManager.MinionsAndMonsters.Monsters.Cast <Obj_AI_Base>().ToList();
                result = a.Concat(b).ToList();
            }

            if (team == MinionTeam.Ally)
            {
                result = EloBuddy.SDK.EntityManager.MinionsAndMonsters.AlliedMinions.Cast <Obj_AI_Base>().ToList();
            }

            if (team == MinionTeam.Enemy)
            {
                result = EloBuddy.SDK.EntityManager.MinionsAndMonsters.EnemyMinions.Cast <Obj_AI_Base>().ToList();
            }

            if (team == MinionTeam.Neutral)
            {
                result = EloBuddy.SDK.EntityManager.MinionsAndMonsters.Monsters.Cast <Obj_AI_Base>().ToList();
            }

            if (team == MinionTeam.NotAlly)
            {
                var a = EloBuddy.SDK.EntityManager.MinionsAndMonsters.EnemyMinions.Cast <Obj_AI_Base>().ToList();
                var b = EloBuddy.SDK.EntityManager.MinionsAndMonsters.Monsters.Cast <Obj_AI_Base>().ToList();
                result = a.Concat(b).ToList();
            }

            if (team == MinionTeam.NotAllyForEnemy)
            {
                var a = EloBuddy.SDK.EntityManager.MinionsAndMonsters.AlliedMinions.Cast <Obj_AI_Base>().ToList();
                var b = EloBuddy.SDK.EntityManager.MinionsAndMonsters.Monsters.Cast <Obj_AI_Base>().ToList();
                result = a.Concat(b).ToList();
            }

            switch (type)
            {
            case MinionTypes.All:
                result = result;
                break;

            case MinionTypes.Melee:
                result = result.Where(x => x.IsMelee).ToList();
                break;

            case MinionTypes.Ranged:
                result = result.Where(x => !x.IsMelee).ToList();
                break;

            case MinionTypes.Wards:
                result = result.Where(x => x.Name.Contains("Ward") && x.IsHPBarRendered).ToList();
                break;
            }

            switch (order)
            {
            case MinionOrderTypes.Health:
                result = result.OrderBy(o => o.Health).ToList();
                break;

            case MinionOrderTypes.MaxHealth:
                result = result.OrderByDescending(o => o.MaxHealth).ToList();
                break;
            }

            result = result.Where(x => x.IsValidTarget(range, false, @from)).ToList();

            return(result);
        }
コード例 #24
0
 internal static List <AIMinionClient> GetMinions(Vector3 position, float range, MinionTypes all, GameObjectTeam team)
 {
     return(GameObjects.Minions.Where(x =>
                                      x.Distance(position) < range && x.Team == team).ToList());
 }