Exemple #1
0
        private void afterAttack(AttackableUnit unit, AttackableUnit target)
        {
            var t = target as AIHeroClient;

            if (t != null)
            {
                if (E.IsReady() && Config.Item("Eks", true).GetValue <bool>())
                {
                    var incomingDMG = OktwCommon.GetIncomingDamage(t, 0.3f, false);
                    if (incomingDMG > t.Health)
                    {
                        return;
                    }

                    var dmgE = E.GetDamage(t) + incomingDMG;

                    if (GetWStacks(t) == 1)
                    {
                        dmgE += Wdmg(t);
                    }

                    if (dmgE > t.Health)
                    {
                        E.Cast(t);
                    }
                }

                if (Q.IsReady() && !Program.None && Config.Item("autoQ", true).GetValue <bool>() && (GetWStacks(t) == Config.Item("Qstack", true).GetValue <Slider>().Value - 1 || Player.HasBuff("vayneinquisition")))
                {
                    var dashPos = Dash.CastDash(true);
                    if (!dashPos.IsZero)
                    {
                        Q.Cast(dashPos);
                    }
                }
            }

            var m = target as Obj_AI_Minion;

            if (m != null && Q.IsReady() && Program.Farm && Config.Item("farmQ", true).GetValue <bool>())
            {
                var dashPosition = Player.Position.Extend(Game.CursorPos, Q.Range).To3DWorld();
                if (!Dash.IsGoodPosition(dashPosition))
                {
                    return;
                }

                if (Config.Item("farmQjungle", true).GetValue <bool>() && m.Team == GameObjectTeam.Neutral)
                {
                    Q.Cast(dashPosition, true);
                }

                if (Config.Item("farmQ", true).GetValue <bool>())
                {
                    foreach (var minion in Cache.GetMinions(dashPosition, 0).Where(minion => m.NetworkId != minion.NetworkId))
                    {
                        var time       = (int)(Player.AttackCastDelay * 1000) + Game.Ping / 2 + 1000 * (int)Math.Max(0, Player.Distance(minion) - Player.BoundingRadius) / (int)Player.BasicAttack.MissileSpeed;
                        var predHealth = LeagueSharp.Common.HealthPrediction.GetHealthPrediction(minion, time);
                        if (predHealth < Player.GetAutoAttackDamage(minion) + Q.GetDamage(minion) && predHealth > 0)
                        {
                            Q.Cast(dashPosition, true);
                        }
                    }
                }
            }
        }
Exemple #2
0
        private void afterAttack(AttackableUnit unit, AttackableUnit target)
        {
            if (target.Type != GameObjectType.obj_AI_Hero)
            {
                return;
            }

            var t = target as Obj_AI_Hero;

            if (E.IsReady() && Config.Item("Eks", true).GetValue <bool>())
            {
                var dmgE = E.GetDamage(t) + OktwCommon.GetIncomingDamage(t, 0.5f, false);

                if (GetWStacks(t) == 1)
                {
                    dmgE += Wdmg(t);
                }

                if (dmgE > t.Health)
                {
                    E.Cast(t);
                }
            }

            if (!Q.IsReady())
            {
                return;
            }

            if (t.IsValidTarget() && (Program.Combo || Program.Farm) && Config.Item("autoQ", true).GetValue <bool>() && (GetWStacks(t) == 1 || Player.HasBuff("vayneinquisition")))
            {
                var dashPos = Dash.CastDash(true);
                if (!dashPos.IsZero)
                {
                    Q.Cast(dashPos);
                }
            }
            else if (Program.Farm && Config.Item("farmQ", true).GetValue <bool>())
            {
                var dashPosition = Player.Position.Extend(Game.CursorPos, Q.Range);
                if (!Dash.IsGoodPosition(dashPosition))
                {
                    return;
                }

                var minions = Cache.GetMinions(dashPosition, Player.AttackRange);

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

                int countMinions = 0;

                foreach (var minion in minions.Where(minion => minion.Health < Player.GetAutoAttackDamage(minion) + Q.GetDamage(minion)))
                {
                    countMinions++;
                }

                if (countMinions > 1)
                {
                    Q.Cast(dashPosition, true);
                }
            }
        }