Example #1
0
        public static IEnumerable <Obj_AI_Base> GetMobGroup(this LeagueSharp.Common.Spell spell,
                                                            FarmMode farmMode,
                                                            GameObjectTeam minionTeam,
                                                            MinionType minionType   = MinionType.All,
                                                            MinionGroup minionGroup = MinionGroup.Alone,
                                                            int minionCount         = 1)
        {
            IEnumerable <Obj_AI_Base> list =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(m => m.LSIsValidTarget(spell.Range) && m.Team == GameObjectTeam.Neutral);

            if (minionType == MinionType.BigMobs)
            {
                IEnumerable <Obj_AI_Base> oMob = (from fMobs in list
                                                  from fBigBoys in
                                                  new[]
                {
                    "SRU_Blue", "SRU_Gromp", "SRU_Murkwolf", "SRU_Razorbeak", "SRU_Red",
                    "SRU_Krug", "SRU_Dragon", "SRU_Baron", "Sru_Crab"
                }
                                                  where fBigBoys == fMobs.BaseSkinName
                                                  select fMobs).AsEnumerable();
                list = oMob;
            }
            return(list);
        }
Example #2
0
        public static IEnumerable <Obj_AI_Base> GetMins(this Spell spell, FarmMode farmMode, GameObjectTeam minionTeam, MinionType minionType = MinionType.All, MinionGroup minionGroup = MinionGroup.Alone, int minionCount = 1)
        {
            IEnumerable <Obj_AI_Base> list = ObjectManager.Get <Obj_AI_Minion>().Where(m => m.IsValidTarget(spell.Range));
            IEnumerable <Obj_AI_Base> mobs;

            if (farmMode == FarmMode.JungleClear)
            {
                mobs = list.Where(w => w.Team == minionTeam);
                if (minionType == MinionType.BigMobs)
                {
                    IEnumerable <Obj_AI_Base> oMob = (from fMobs in mobs
                                                      from fBigBoys in
                                                      new[]
                    {
                        "SRU_Blue", "SRU_Gromp", "SRU_Murkwolf", "SRU_Razorbeak", "SRU_Red",
                        "SRU_Krug", "SRU_Dragon", "SRU_Baron", "Sru_Crab"
                    }
                                                      where fBigBoys == fMobs.SkinName
                                                      select fMobs).AsEnumerable();

                    mobs = oMob;
                }
            }
            else
            {
                mobs = list;
            }

            var objAiBases        = mobs as IList <Obj_AI_Base> ?? mobs.ToList();
            List <Obj_AI_Base> m1 = objAiBases.ToList();

            var locLine = spell.GetLineFarmLocation(m1);

            if (locLine.MinionsHit >= 3 && spell.IsInRange(locLine.Position.To3D()))
            {
                spell.Cast(locLine.Position);
            }

            var locCircular = spell.GetCircularFarmLocation(m1, spell.Width);

            if (locCircular.MinionsHit >= minionCount && spell.IsInRange(locCircular.Position.To3D()))
            {
                spell.Cast(locCircular.Position);
            }

            return(null);
        }