Example #1
0
        public override void LastHit()
        {
            if (ObjectManager.Player.ManaPercent < 60)
            {
                return;
            }
            Obj_AI_Base minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    ObjectManager.Player.Position,
                    Q.Range).FirstOrDefault(m => m.Health <= Q.GetRealDamage(m));

            if (Q.IsReady() && minion != null)
            {
                Q.Cast(minion);
            }
            minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    ObjectManager.Player.Position,
                    W.Range).FirstOrDefault(m => m.Health <= W.GetRealDamage(m));
            if (Q.IsReady() && minion != null)
            {
                W.Cast(minion);
            }
            minion =
                EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    ObjectManager.Player.Position,
                    E.Range).FirstOrDefault(m => m.Health <= E.GetRealDamage(m));
            if (Q.IsReady() && minion != null)
            {
                E.Cast(minion);
            }
        }
Example #2
0
        public static void CastExtendedQ()
        {
            var target = TargetSelector.GetTarget(Q.Range, DamageType.Magical);

            if (target == null || target.IsZombie)
            {
                return;
            }

            /* var t = TargetSelector.SelectedTarget != null &&
             *       TargetSelector.SelectedTarget.Distance(ObjectManager.Player) < Q1.Range
             *   ? TargetSelector.SelectedTarget
             *   : TargetSelector.GetTarget(Q1.Range, DamageType.Physical);
             *
             * if (!t.IsValidTarget(Q1.Range) ||
             *   t.IsZombie ||
             *   Orbwalker.IsAutoAttacking ||
             *   t.HasBuffOfType(BuffType.Invulnerability))
             *   return;
             * {
             *   var q1Pred = Q1.GetPrediction(t);
             *   var q1Col = q1Pred.CollisionObjects;
             *   if (!q1Col.Any()) return;
             *   {
             *       var qMinion = q1Col.Last();
             *       if (!qMinion.IsValidTarget(Q.Range)) return;
             *       {
             *           if (qMinion.Distance(q1Pred.CastPosition) < 380 &&
             *               qMinion.Distance(t.Position) < 380)
             *           {
             *               Q.Cast(qMinion);
             *           }
             *       }
             *   }
             * }*/
            if (Q.IsReady() && target.IsValidTarget(Q1.Range))
            {
                var minionQ =
                    EntityManager.MinionsAndMonsters.GetLaneMinions().OrderByDescending(m => m.Health)
                    .FirstOrDefault(m => m.IsValidTarget(Q.Range) && m.Health <= Q.GetRealDamage(m));
                if (minionQ != null)
                {
                    const float rad = (float)Math.PI / 180f;

                    var cone = new Geometry.Polygon.Sector(target.ServerPosition, target.ServerPosition.Extend(Player, -400).To3D(), 60f * rad, 250f);

                    if (cone.IsInside(target))
                    {
                        Q.Cast(minionQ);
                    }
                }
            }
        }