コード例 #1
0
        public static void TargetSkill(Obj_AI_Base target, Spell spell)
        {
            if (!spell.IsReady() || target == null)
            {
                return;
            }

            spell.CastOnUnit(target);
        }
コード例 #2
0
 public static void Farm(Spell spell,
                         List <Obj_AI_Base> minions,
                         int minHit          = 3,
                         float overrideWidth = -1f,
                         bool chargeMax      = true)
 {
     if (!spell.IsReady() || minions.Count == 0)
     {
         return;
     }
     if (spell.IsSkillshot)
     {
         if (spell.Collision)
         {
             minHit = 1;
         }
         if (spell.Type == SkillshotType.SkillshotCircle)
         {
             CircleFarm(spell, minions, minHit, overrideWidth);
         }
         else if (spell.Type == SkillshotType.SkillshotLine)
         {
             LineFarm(spell, minions, minHit, overrideWidth);
         }
         else if (spell.Type == SkillshotType.SkillshotCone)
         {
             ConeFarm(spell, minions, minHit, overrideWidth);
         }
     }
     else
     {
         var minion =
             minions.OrderBy(m => spell.IsKillable(m))
             .FirstOrDefault(
                 m =>
                 spell.IsInRange(m) && spell.GetDamage(m) > m.Health ||
                 m.Health - spell.GetDamage(m) > m.MaxHealth * 0.25f);
         if (minion != null)
         {
             spell.CastOnUnit(minion);
         }
     }
 }
コード例 #3
0
ファイル: Casting.cs プロジェクト: 4859aa/LeagueSharp-Dev
        public static void TargetSkill(Obj_AI_Base target, Spell spell)
        {
            if (!spell.IsReady() || target == null)
            {
                return;
            }

            spell.CastOnUnit(target);
        }
コード例 #4
0
ファイル: Casting.cs プロジェクト: 47110572/LeagueSharp-Dev
        public static void Farm(Spell spell,
            int minHit = 3,
            float overrideWidth = -1f,
            bool chargeMax = true,
            List<Obj_AI_Base> minions = null)
        {
            if (!spell.IsReady())
            {
                return;
            }
            var spellWidth = overrideWidth > 0 ? overrideWidth : spell.Width;

            if (minions == null)
            {
                minions =
                    MinionManager.GetMinions(
                        (((chargeMax && spell.IsChargedSpell ? spell.ChargedMaxRange : spell.Range) + spellWidth) * 1.5f),
                        MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth);
            }

            if (minions.Count == 0)
            {
                return;
            }

            if (minHit > 1)
            {
                var nearest = minions.OrderBy(m => m.Distance(ObjectManager.Player)).FirstOrDefault();
                if (nearest != null && nearest.Team == GameObjectTeam.Neutral)
                {
                    minHit = 1;
                }
            }
            if (spell.IsSkillshot)
            {
                if (spell.Type == SkillshotType.SkillshotCircle)
                {
                    CircleFarm(spell, minions, minHit, overrideWidth);
                }
                else if (spell.Type == SkillshotType.SkillshotLine)
                {
                    LineFarm(spell, minions, minHit, overrideWidth);
                }
                else if (spell.Type == SkillshotType.SkillshotCone)
                {
                    ConeFarm(spell, minions, minHit, overrideWidth);
                }
            }
            else
            {
                var minion =
                    minions.OrderBy(m => spell.IsKillable(m))
                        .FirstOrDefault(
                            m =>
                                spell.IsInRange(m) && spell.GetDamage(m) > m.Health ||
                                m.Health - spell.GetDamage(m) > m.MaxHealth * 0.25f);
                if (minion != null)
                {
                    spell.CastOnUnit(minion);
                }
            }
        }
コード例 #5
0
        public static void Farm(Spell spell,
                                int minHit                 = 3,
                                float overrideWidth        = -1f,
                                bool chargeMax             = true,
                                List <Obj_AI_Base> minions = null)
        {
            if (!spell.IsReady())
            {
                return;
            }
            var spellWidth = overrideWidth > 0 ? overrideWidth : spell.Width;

            if (minions == null)
            {
                minions =
                    MinionManager.GetMinions(
                        (((chargeMax && spell.IsChargedSpell ? spell.ChargedMaxRange : spell.Range) + spellWidth) * 1.5f),
                        MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth);
            }

            if (minions.Count == 0)
            {
                return;
            }

            if (minHit > 1)
            {
                var nearest = minions.OrderBy(m => m.Distance(ObjectManager.Player)).FirstOrDefault();
                if (nearest != null && nearest.Team == GameObjectTeam.Neutral)
                {
                    minHit = 1;
                }
            }
            if (spell.IsSkillshot)
            {
                if (spell.Type == SkillshotType.SkillshotCircle)
                {
                    CircleFarm(spell, minions, minHit, overrideWidth);
                }
                else if (spell.Type == SkillshotType.SkillshotLine)
                {
                    LineFarm(spell, minions, minHit, overrideWidth);
                }
                else if (spell.Type == SkillshotType.SkillshotCone)
                {
                    ConeFarm(spell, minions, minHit, overrideWidth);
                }
            }
            else
            {
                var minion =
                    minions.OrderBy(m => spell.IsKillable(m))
                    .FirstOrDefault(
                        m =>
                        spell.IsInRange(m) && spell.GetDamage(m) > m.Health ||
                        m.Health - spell.GetDamage(m) > m.MaxHealth * 0.25f);
                if (minion != null)
                {
                    spell.CastOnUnit(minion);
                }
            }
        }
コード例 #6
0
ファイル: Casting.cs プロジェクト: aikoy/LeagueSharp-Dev
 public static void Farm(Spell spell,
     List<Obj_AI_Base> minions,
     int minHit = 3,
     float overrideWidth = -1f,
     bool chargeMax = true)
 {
     if (!spell.IsReady() || minions.Count == 0)
     {
         return;
     }
     if (spell.IsSkillshot)
     {
         if (spell.Collision)
         {
             minHit = 1;
         }
         if (spell.Type == SkillshotType.SkillshotCircle)
         {
             CircleFarm(spell, minions, minHit, overrideWidth);
         }
         else if (spell.Type == SkillshotType.SkillshotLine)
         {
             LineFarm(spell, minions, minHit, overrideWidth);
         }
         else if (spell.Type == SkillshotType.SkillshotCone)
         {
             ConeFarm(spell, minions, minHit, overrideWidth);
         }
     }
     else
     {
         var minion =
             minions.OrderBy(m => spell.IsKillable(m))
                 .FirstOrDefault(
                     m =>
                         spell.IsInRange(m) && spell.GetDamage(m) > m.Health ||
                         m.Health - spell.GetDamage(m) > m.MaxHealth * 0.25f);
         if (minion != null)
         {
             spell.CastOnUnit(minion);
         }
     }
 }