Пример #1
0
        private static bool CastQKill(LeagueSharp.SDK.Spell spell, Obj_AI_Base target)
        {
            var pred = spell.GetPrediction(target, false, -1, CollisionableObjects.YasuoWall);

            if (pred.Hitchance < Q.MinHitChance)
            {
                return(false);
            }
            var col = spell.GetCollision(
                target,
                new List <Vector3> {
                pred.UnitPosition, target.Position
            },
                CollisionableObjects.Heroes | CollisionableObjects.Minions);

            if (col.Count == 0)
            {
                return(Q.Cast(pred.CastPosition));
            }
            var subDmg = Q.GetDamage(target, DamageStage.SecondForm);

            switch (target.Type)
            {
            case GameObjectType.AIHeroClient:
                return(target.Health + target.AttackShield <= subDmg && Q.Cast(pred.CastPosition));

            case GameObjectType.obj_AI_Minion:
                return(spell.CanLastHit(target, subDmg) && Q.Cast(pred.CastPosition));
            }
            return(false);
        }
Пример #2
0
        private static void LaneClear()
        {
            if (!s_Menu["ryze.laneclear"]["enable"].GetValue <MenuBool>().Value)
            {
                return;
            }

            var minion = ObjectManager.Get <Obj_AI_Minion>()
                         .Where(p => !p.IsDead && !p.IsAlly && p.Distance(ObjectManager.Player.ServerPosition) < E.Range)
                         .OrderByDescending(q => q.MaxHealth)
                         .FirstOrDefault();

            if (minion != null)
            {
                if (minion.Health < EDmg(minion) + WDmg(minion) && ObjectManager.Get <Obj_AI_Minion>().Where(p => !p.IsDead && !p.IsAlly && p.Distance(minion) < 450 && p.NetworkId != minion.NetworkId).Count() > 2)
                {
                    if (minion.Health > EDmg(minion))
                    {
                        W.Cast(minion);
                    }
                    E.Cast(minion);
                }
            }
            else
            {
                minion = ObjectManager.Get <Obj_AI_Minion>()
                         .Where(p => !p.IsDead && !p.IsAlly && p.Distance(ObjectManager.Player.ServerPosition) < Q.Range && p.Health < QDmg(p))
                         .FirstOrDefault();

                if (minion != null && Q.GetCollision(ObjectManager.Player.ServerPosition.ToVector2(), new List <Vector2> {
                    minion.ServerPosition.ToVector2()
                }).Count < 2)
                {
                    Q.Cast(minion.ServerPosition);
                }
            }
        }