Пример #1
0
        public static void SpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }
            if ((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) &&
                 MenuManager.LaneClearMenu["LCQ"].Cast <CheckBox>().CurrentValue) &&
                Program.Q.IsReady())
            {
                if (Orbwalker.CanAutoAttack)
                {
                    return;
                }
                foreach (var minion in EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                       Variables._Player.ServerPosition, Variables._Player.GetAutoAttackRange()))
                {
                    if (minion == null)
                    {
                        return;
                    }
                    var dmg = Variables._Player.GetSpellDamage(minion, SpellSlot.Q) +
                              Variables._Player.GetAutoAttackDamage(minion);
                    if (Prediction.Health.GetPrediction(minion, (int)(Variables._Player.AttackDelay * 1000)) <= dmg / 2 &&
                        (Orbwalker.LastTarget == null || Orbwalker.LastTarget.NetworkId != minion.NetworkId))
                    {
                        Player.CastSpell(SpellSlot.Q, Game.CursorPos);
                    }
                }
            }
            var LastHitE = Variables._Player;

            foreach (
                var Etarget in
                EntityManager.Heroes.Enemies.Where(
                    Etarget => Etarget.IsValidTarget(Program.E.Range) && Etarget.Path.Count() < 2))
            {
                if (MenuManager.ComboMenu["Ekill"].Cast <CheckBox>().CurrentValue&& Program.E.IsReady() &&
                    Variables._Player.CountEnemiesInRange(600) <= 1)
                {
                    var dmgE = Variables._Player.GetSpellDamage(Etarget, SpellSlot.E);
                    if (dmgE > Etarget.Health ||
                        (Damages.WTarget(Etarget) == 2 && dmgE + Damages.Wdmg(Etarget) > Etarget.Health))
                    {
                        LastHitE = Etarget;
                    }
                }

                if (LastHitE != Variables._Player)
                {
                    Program.E.Cast(LastHitE);
                }
            }
        }