Example #1
0
 private void OnInterruptableTarget(Obj_AI_Hero target, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (E.CanCast(target) && config.Item("useEint", true).GetValue<bool>())
     {
         if (E.CastIfHitchanceEquals(target, HitChance.High, config.Item("packets").GetValue<bool>()))
         {
             return;
         }
     }
     if (R.CanCast(target) && config.Item("useRint", true).GetValue<bool>())
     {
         if (savedQ != null && !SimpleQ && !target.IsMoving && target.Distance(qPos) > QExplosionRange &&
             target.Distance(player) < R.Range - 100 &&
             target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2 &&
             !target.HasBuffOfType(BuffType.Knockback))
         {
             var cast = Prediction.GetPrediction(target, 1000f).UnitPosition.Extend(savedQ.position, -100);
             R.Cast(cast);
         }
         else if (target.Distance(player) < R.Range - 100)
         {
             if (player.CountEnemiesInRange(2000) <= player.CountAlliesInRange(2000))
             {
                 var cast = target.Position.Extend(player.Position, -100);
                 R.Cast(cast);
             }
             else
             {
                 var cast = target.Position.Extend(player.Position, 100);
                 R.Cast(cast);
             }
         }
     }
 }
Example #2
0
        public override void Execute(Obj_AI_Hero target)
        {
            if (target == null)
                target = TargetSelector.GetTarget(1200, TargetSelector.DamageType.Magical);
            if (target == null) return;

            var dmgPerBounce = ObjectManager.Player.GetSpellDamage(target, Slot) + BrandCombo.GetPassiveDamage(target);
            if (dmgPerBounce > target.Health && target.Distance(ObjectManager.Player) > 750)
            {
                TryBridgeUlt(target);

                //   Console.WriteLine("ayy lmao bridge bois");
            }

            if (dmgPerBounce > target.Health && !Provider.ShouldBeDead(target) && ObjectManager.Player.GetAutoAttackDamage(target, true) < target.Health && ((_otherSkills.All(skill => skill.Instance.State != SpellState.Ready && skill.Instance.State != SpellState.Surpressed /*&& !skill.IsSafeCasting(1)*/) /*|| target.Distance(ObjectManager.Player) > 650*/) || ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) + dmgPerBounce + ObjectManager.Player.GetAutoAttackDamage(target) > target.Health && !target.HasBuff("brandablaze") && target.Distance(ObjectManager.Player) < 750))
            {
                if (ObjectManager.Player.HealthPercent - target.HealthPercent < OverkillPercent || !AntiOverkill || IgnoreAntiOverkillOnFlee && target.Distance(ObjectManager.Player) > ObjectManager.Player.AttackRange)
                {
                    Cast(target);
                }
                else if (ObjectManager.Player.HealthPercent < target.HealthPercent && IgniteManager.CanBeUsed() && IgniteManager.GetDamage() + dmgPerBounce > target.Health)
                {
                    if (target.Distance(ObjectManager.Player) < 600)
                        IgniteManager.UseIgnite(target);
                    Cast(target);
                }
            }

            // if (target.Distance(ObjectManager.Player) > 750) return;
            var inBounce = new bool[HeroManager.Enemies.Count];
            var canBounce = BounceCheck(target, inBounce);
            if (canBounce)
            {

                var inBounceEnemies = HeroManager.Enemies.Where(enemy => inBounce[HeroManager.Enemies.IndexOf(enemy)]).ToArray();
                var distance = target.Distance(ObjectManager.Player);

                var bounceCount = inBounce.Count(item => item);
                if (bounceCount <= 1) return;
                //Console.WriteLine("bounce r " + bounceCount);

                if ((inBounceEnemies.Any(enemy => (dmgPerBounce > enemy.Health && MaxDamage > enemy.Health)) && (bounceCount == 2 || RiskyUlt)))
                {
                    TryUlt(target, inBounceEnemies, distance);
                }
                else if (bounceCount == 2 && dmgPerBounce * 3 > target.Health && MaxDamage > target.Health && distance < 750 && RiskyUlt)
                {
                    Cast(target);
                }
                else if (dmgPerBounce * 2 > target.Health && MaxDamage > target.Health)
                {
                    TryUlt(target, inBounceEnemies, distance);
                }
                else if (UltNonKillable && MinBounceTargets <= bounceCount)
                {
                    TryUlt(target, inBounceEnemies, distance, false);
                }
            }
        }
Example #3
0
 public ChampionInfo(Obj_AI_Hero hero, bool ally)
 {
     index++;
     int textoffset = index * 50;
     _hero = hero;
     Render.Text text = new Render.Text(
         new Vector2(), _hero.ChampionName, 20,
         ally
             ? new Color { R = 205, G = 255, B = 205, A = 255 }
             : new Color { R = 255, G = 205, B = 205, A = 255 })
     {
         PositionUpdate =
             () =>
                 Drawing.WorldToScreen(
                     ObjectManager.Player.Position.Extend(_hero.Position, 300 + textoffset)),
         VisibleCondition = delegate
         {
             float dist = _hero.Distance(ObjectManager.Player.Position);
             return Program.Instance().ShowChampionNames && !_hero.IsDead &&
                    Game.ClockTime - _lineStart < Program.Instance().LineDuration &&
                    (!_hero.IsVisible || !Render.OnScreen(Drawing.WorldToScreen(_hero.Position))) &&
                    dist < Program.Instance().Radius && dist > 300 + textoffset;
         },
         Centered = true,
         OutLined = true,
     };
     text.Add(1);
     _line = new Render.Line(
         new Vector2(), new Vector2(), 5,
         ally ? new Color { R = 0, G = 255, B = 0, A = 125 } : new Color { R = 255, G = 0, B = 0, A = 125 })
     {
         StartPositionUpdate = () => Drawing.WorldToScreen(ObjectManager.Player.Position),
         EndPositionUpdate = () => Drawing.WorldToScreen(_hero.Position),
         VisibleCondition =
             delegate
             {
                 return !_hero.IsDead && Game.ClockTime - _lineStart < Program.Instance().LineDuration &&
                        _hero.Distance(ObjectManager.Player.Position) < (Program.Instance().Radius + 1000);
             }
     };
     _line.Add(0);
     Render.Line minimapLine = new Render.Line(
         new Vector2(), new Vector2(), 2,
         ally ? new Color { R = 0, G = 255, B = 0, A = 255 } : new Color { R = 255, G = 0, B = 0, A = 255 })
     {
         StartPositionUpdate = () => Drawing.WorldToMinimap(ObjectManager.Player.Position),
         EndPositionUpdate = () => Drawing.WorldToMinimap(_hero.Position),
         VisibleCondition =
             delegate
             {
                 return Program.Instance().DrawMinimapLines && !_hero.IsDead && Game.ClockTime - _lineStart < Program.Instance().LineDuration;
             }
     };
     minimapLine.Add(0);
     Game.OnUpdate += Game_OnGameUpdate;
     OnEnterRange += ChampionInfo_OnEnterRange;
 }
Example #4
0
        public override void Cast(Obj_AI_Hero target, bool force = false, HitChance minChance = HitChance.Low)
        {
            if (target == null) return;
            if (ObjectManager.Player.HasBuff("ekkoattackbuff") && target.Distance(ObjectManager.Player) < 500)
            {
                ObjectManager.Player.IssueOrder(GameObjectOrder.AutoAttack, target);

            }

            if (HasBeenSafeCast() || target.Distance(ObjectManager.Player) < ObjectManager.Player.AttackRange + ObjectManager.Player.BoundingRadius + target.BoundingRadius) return;
            SafeCast(() => Spell.Cast(target.Position));
        }
Example #5
0
        public float GetComboDamage(Obj_AI_Hero target)
        {
            if (target == null) return 0;

            float comboDmg = 0;

            var aaDmg = (float)ObjectManager.Player.GetAutoAttackDamage(target, true);

            if (qSpell.Spell.IsReady())
            {
                comboDmg += qSpell.GetDamage(target) + aaDmg;
            }

            if (wSpell.Spell.IsReady())
            {
                comboDmg += wSpell.Spell.GetDamage(target) + aaDmg;
            }

            if (eSpell.Spell.IsReady())
            {
                comboDmg += aaDmg;
            }

            if (target.Distance(ObjectManager.Player) >= 900 && rSpell.Spell.IsReady())
            {
                comboDmg += rSpell.GetDamage(target);
            }

            return comboDmg;
        }
Example #6
0
        public static void doCombo(Obj_AI_Hero target)
        {
            igniteIfKIllable(target);
            if (!target.IsValidTarget())
                return;

            if (!W.IsReady() && !E.IsReady() && R.IsReady() && Rdata.Name == "TalonShadowAssault" && (target.Health > getAAdmg(target) || targetInRange(target, 125f))
                && target.Health<(getRdmg(target)*2 + getTargetBleedDmg(target)))
            {
                PredictionOutput po = R.GetPrediction(target);
                if (po.Hitchance >= HitChance.Medium)
                {
                    R.Cast();
                    posRCast = Player.ServerPosition;
                }
            }

            if (Rdata.Name == "TalonShadowAssault")
            {
                if (target.Health<= getRdmg(target) && target.Distance(posRCast) < R.Range)
                    R.Cast();
            }

            if (E.IsReady() && targetInRange(target, E.Range))
            {
                E.Cast(target);
            }
            if (W.IsReady() && !E.IsReady() && targetInRange(target, W.Range) && !targetInRange(target, 100) && !Player.IsChanneling
                && (!targetInRange(target,250) || targetHasCut(target)))
            {

                    W.Cast(target);
            }
            castItemsFull(target);
        }
Example #7
0
        void CastE(Obj_AI_Hero target)
        {
            if (target != null)
            {
                if (SpellSlot.E.IsReady() && isHealthy)
                {
                    if (DashCount >= 1 && GetDashPos(target).IsCloser(target) && target.IsDashable() &&
                        (GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(target).PointUnderEnemyTurret()))
                    {
                        Spells[E].CastOnUnit(target);
                        return;
                    }

                    if (DashCount == 0)
                    {
                        var dist = Yasuo.Distance(target);

                        var bestminion =
                            ObjectManager.Get<Obj_AI_Base>()
                                .Where(
                                    x =>
                                         x.IsDashable()
                                         && target.Distance(GetDashPos(x)) < dist &&
                                        (GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(x).PointUnderEnemyTurret()))
                                .OrderBy(x => Vector2.Distance(GetDashPos(x), target.ServerPosition.To2D()))
                                .FirstOrDefault();
                        if (bestminion != null)
                        {
                            Spells[E].CastOnUnit(bestminion);
                        }

                        else
                        {
                            var minion =
                              ObjectManager.Get<Obj_AI_Base>()
                                  .Where(x => x.IsDashable() && (GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(x).PointUnderEnemyTurret()))
                                  .OrderBy(x => GetDashPos(x).Distance(target)).FirstOrDefault();

                            if (minion != null && GetDashPos(minion).IsCloser(target))
                            {
                                Spells[E].CastOnUnit(minion);
                            }
                        }
                    }

                    else
                    {
                        var minion =
                            ObjectManager.Get<Obj_AI_Base>()
                                .Where(x =>  x.IsDashable() && (GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(x).PointUnderEnemyTurret()))
                                .OrderBy(x => GetDashPos(x).Distance(target)).FirstOrDefault();

                        if (minion != null && GetDashPos(minion).IsCloser(target))
                        {
                            Spells[E].CastOnUnit(minion);
                        }
                    }
                }
            }
        }
Example #8
0
 public void Update(Obj_AI_Hero target)
 {
     if ((target.HealthPercent >= _minEnemyHealth || ObjectManager.Player.HealthPercent < 20) && ObjectManager.Player.HealthPercent <= _maxPlayerHealth && target.Distance(ObjectManager.Player) < 550)
     {
         Use(target);
     }
 }
Example #9
0
        public static Obj_AI_Base QMinion(Obj_AI_Hero t)
        {
            var m = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All,
                MinionTeam.NotAlly, MinionOrderTypes.None);

            return (from vM
                        in m.Where(vM => vM.IsValidTarget(Q.Range))
                    let endPoint = vM.ServerPosition.To2D().Extend(ObjectManager.Player.ServerPosition.To2D(), -Q2.Range).To3D()
                    where
                        vM.Distance(t) <= t.Distance(ObjectManager.Player) &&
                        Intersection(ObjectManager.Player.ServerPosition.To2D(), endPoint.To2D(), t.ServerPosition.To2D(), t.BoundingRadius + vM.BoundingRadius)
                    //Intersection(ObjectManager.Player.ServerPosition.To2D(), endPoint.To2D(), t.ServerPosition.To2D(), t.BoundingRadius + Q.Width/4)
                    select vM).FirstOrDefault();
            //get
            //{
            //    var vTarget = TargetSelector.GetTarget(Q2.Range, TargetSelector.DamageType.Physical);
            //    var vMinions = MinionManager.GetMinions(
            //        ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly,
            //        MinionOrderTypes.None);

            //    return (from vMinion in vMinions.Where(vMinion => vMinion.IsValidTarget(Q.Range))
            //            let endPoint =
            //                vMinion.ServerPosition.To2D()
            //                    .Extend(ObjectManager.Player.ServerPosition.To2D(), -Q2.Range)
            //                    .To3D()
            //            where
            //                vMinion.Distance(vTarget) <= vTarget.Distance(ObjectManager.Player) &&
            //                Intersection(ObjectManager.Player.ServerPosition.To2D(), endPoint.To2D(),
            //                    vTarget.ServerPosition.To2D(), vTarget.BoundingRadius + vMinion.BoundingRadius)
            //            select vMinion).FirstOrDefault();
            //}
        }
 public static void WardJumpFlashInsec(Obj_AI_Hero enemy)
 {
     if (Config.Item("insec.whitelist." + enemy.ChampionName).GetValue<bool>() && HybridCommon.Utility.GetPriority(enemy.ChampionName) > 2)
     {
         if (ObjectManager.Player.Distance(enemy.Position) > Spells[Q].Range &&
         ObjectManager.Player.Distance(enemy.Position) < Spells[Q].Range + 600 && WardJump.WardCastable)
         {
             WardJump.HikiJump(Spells[W], Helper.WardJumpToEnemy(enemy, 600));
         }
         if (enemy.Distance(LeeSin.Position) < Spells[Q].Range && Spells[Q].GetPrediction(enemy).Hitchance > HitChance.High)
         {
             Spells[Q].Cast(enemy);
         }
         if (Helper.QTwo(Spells[Q]) && Spells[Q2].IsReady())
         {
             Spells[Q2].Cast();
         }
         if (Flashable && LeeSin.Distance(Helper.InsecPositions()) < FlashRange)
         {
             Utility.DelayAction.Add(Helper.SliderCheck("flash.insec.flash.delay"),
                 () => LeeSin.Spellbook.CastSpell(FlashSlot, Helper.InsecPositions()));
         }
         if (LeeSin.Spellbook.CanUseSpell(FlashSlot) == SpellState.Cooldown && !Spells[Q].IsReady() &&
             LeeSin.Distance(enemy.Position) < Spells[R].Range)
         {
             Spells[R].Cast(enemy);
         }
     }  
 }
Example #11
0
 private void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender,
     Interrupter2.InterruptableTargetEventArgs args)
 {
     if (R.IsReady() && config.Item("Interrupt", true).GetValue<bool>() && sender.Distance(player) < R.Range)
     {
         CastR();
     }
 }
Example #12
0
        public override void Interruptable(ComboProvider combo, Obj_AI_Hero sender, ComboProvider.InterruptableSpell interruptableSpell, float endTime)
        {
            var distance = sender.Distance(ObjectManager.Player);
            if (sender.HasBuff("brandablaze") || Provider.IsMarked(sender) || !_brandQ.CouldHit(sender) || !InterruptW) return;

            if (Cast(sender) == CastStates.SuccessfullyCasted)
                Provider.SetMarked(sender); //Todo: risky, keep an eye on this. If the W misses u r fucked
        }
Example #13
0
 public override void Interruptable(ComboProvider combo, Obj_AI_Hero sender, ComboProvider.InterruptableSpell interruptableSpell, float endTime)
 {
     if (endTime - Game.Time > Math.Max(sender.Distance(ObjectManager.Player) - Orbwalking.GetRealAutoAttackRange(sender), 0)/ObjectManager.Player.MoveSpeed + 0.5f)
     {
         SafeCast();
         Orbwalking.Orbwalk(sender, sender.Position);
     }
 }
Example #14
0
 public static void Insec(Obj_AI_Hero target)
 {
     Rpos = Player.Position.To2D().Extend(target.Position.To2D(), Player.Distance(target) + 250);
     if (Rpos.Distance(Player.Position) <= R.Range)
     {
         if (Player.Distance(Rpos.Extend(target.Position.To2D(), 700 - target.Distance(Rpos))) < E.Range && !IsWall(Rpos.To3D()) && target.IsFacing(Player))
         {
             R.Cast(Rpos);
         }
     }
 }
Example #15
0
 private static void IgniteOnTarget(Obj_AI_Hero t)
 {
     var range = 550f;
     var use = menu.Item("Spells.Ignite").GetValue<bool>();
     if (use && Program.Player.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready &&
         t.Distance(Program.Player.Position) < range &&
         Program.Player.GetSummonerSpellDamage(t, Damage.SummonerSpell.Ignite) > t.Health)
     {
         Program.Player.Spellbook.CastSpell(IgniteSlot, t);
     }
 }
Example #16
0
 //Credits to metaphorce
 public static void UseSmite(Obj_AI_Hero target)
 {
     var usesmite = Config.Item("UseS").GetValue<bool>();
     var itemscheck = SmiteBlue.Any(i => Items.HasItem(i)) || SmiteRed.Any(i => Items.HasItem(i));
     if (itemscheck && usesmite &&
         ObjectManager.Player.Spellbook.CanUseSpell(_smiteSlot) == SpellState.Ready &&
         target.Distance(player.Position) < _smite.Range)
     {
         ObjectManager.Player.Spellbook.CastSpell(_smiteSlot, target);
     }
 }
        public static Vector3 GetInsecPos(Obj_AI_Hero target)
        {
            try
            {
                if (ClicksecEnabled && Misc.GetMenuItem("clickInsec"))
                {
                    InsecLinePos = Drawing.WorldToScreen(InsecClickPos);
                    return V2E(InsecClickPos, target.Position, target.Distance(InsecClickPos) + 230).To3D();
                }

                if (isNullInsecPos)
                {
                    isNullInsecPos = false;
                    insecPos = ObjectManager.Player.Position;
                }

                if ((GetAllyHeroes(target, 1500).Count > 0) && Misc.GetMenuItem("ElLeeSin.Insec.Ally"))
                {
                    var insecPosition = InterceptionPoint(GetAllyInsec(GetAllyHeroes(target, 2000)));

                    InsecLinePos = Drawing.WorldToScreen(insecPosition);
                    return V2E(insecPosition, target.Position, target.Distance(insecPosition) + 230).To3D();
                }

                if (Misc.GetMenuItem("ElLeeSin.Insec.Tower"))
                {
                    var tower =
                        ObjectManager.Get<Obj_AI_Turret>()
                            .Where(
                                t =>
                                    t.IsVisible && t.Health > 0 && t.Distance(target) - 725 < 1100 && t.Distance(ObjectManager.Player) < 3000
                                    && t.IsAlly && !t.IsDead)
                            .MinOrDefault(t => t.Distance(target));

                    if (tower != null)
                    {
                        InsecLinePos = Drawing.WorldToScreen(tower.Position);
                        return V2E(tower.Position, target.Position, target.Distance(tower.Position) + 230).To3D();
                    }
                }

                if (Misc.GetMenuItem("ElLeeSin.Insec.Original.Pos"))
                {
                    InsecLinePos = Drawing.WorldToScreen(insecPos);
                    return V2E(insecPos, target.Position, target.Distance(insecPos) + 230).To3D();
                }
                return new Vector3();
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: '{0}'", e);
            }
            return new Vector3();
        }
Example #18
0
        public static void JumpKs(Obj_AI_Hero target)
        {
            foreach (Obj_AI_Minion ward in ObjectManager.Get<Obj_AI_Minion>().Where(ward =>
                E.IsReady() && Q.IsReady() && ward.Name.ToLower().Contains("ward") &&
                ward.Distance(target.ServerPosition) < Q.Range && ward.Distance(Player.Position) < E.Range))
            {
                E.Cast(ward);
                return;
            }

            foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>().Where(hero =>
                E.IsReady() && Q.IsReady() && hero.Distance(target.ServerPosition) < Q.Range &&
                hero.Distance(Player.Position) < E.Range && hero.IsValidTarget(E.Range)))
            {
                E.Cast(hero);
                return;
            }

            foreach (Obj_AI_Minion minion in ObjectManager.Get<Obj_AI_Minion>().Where(minion =>
                E.IsReady() && Q.IsReady() && minion.Distance(target.ServerPosition) < Q.Range &&
                minion.Distance(Player.Position) < E.Range && minion.IsValidTarget(E.Range)))
            {
                E.Cast(minion);
                return;
            }

            if (Player.Distance(target.Position) < Q.Range)
            {
                Q.Cast(target);
                return;
            }

            if (E.IsReady() && Q.IsReady())
            {
                Vector3 position = Player.ServerPosition +
                                   Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * 590;

                if (target.Distance(position) < Q.Range)
                {
                    InventorySlot invSlot = FindBestWardItem();
                    if (invSlot == null) return;

                    Player.Spellbook.CastSpell(invSlot.SpellSlot, position);
                    LastWardPos = position;
                    LastPlaced = Utils.TickCount;
                }
            }

            if (Player.Distance(target.Position) < Q.Range)
            {
                Q.Cast(target);
            }
        }
Example #19
0
 private void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (!Config.Item("OPTI", true).GetValue<bool>())
         return;
     if (R.IsReady() && sender.Distance(BallPos) < R.Range)
     {
         R.Cast();
         Program.debug("interupt");
     }
     else if (Q.IsReady() && Player.Mana > RMANA + QMANA && sender.IsValidTarget(Q.Range))
         Q.Cast(sender.ServerPosition);
 }
Example #20
0
        public static bool IsValidTarget(Obj_AI_Hero target)
        {
            if (!IsWhitelisted(target))
                return false;

            var targetPosition = Geometry.PositionAfter(target.GetWaypoints(), 300, (int)target.MoveSpeed);

            if (target.Distance(ObjectManager.Player.ServerPosition) < 650f && IsCondemnable(ObjectManager.Player.ServerPosition.To2D(), targetPosition, target.BoundingRadius))
            {
                if (target.Path.Length == 0)
                {
                    var outRadius = (0.3f * target.MoveSpeed) / (float)Math.Cos(2 * Math.PI / 12);
                    int count = 0;
                    for (int i = 1; i <= 12; i++)
                    {
                        var angle = i * 2 * Math.PI / 12;
                        float x = target.Position.X + outRadius * (float)Math.Cos(angle);
                        float y = target.Position.Y + outRadius * (float)Math.Sin(angle);
                        if (IsCondemnable(ObjectManager.Player.ServerPosition.To2D(), new Vector2(x, y), target.BoundingRadius))
                            count++;
                    }
                    return count >= 4;
                }
                else
                    return true;
            }
            else
            {
                if (TumbleCondemn && s_Champion.Spells[Champion.Q].IsReady())
                {
                    var outRadius = 300 / (float)Math.Cos(2 * Math.PI / 12);

                    for (int i = 1; i <= 12; i++)
                    {
                        var angle = i * 2 * Math.PI / 12;
                        float x = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                        float y = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                        targetPosition = Geometry.PositionAfter(target.GetWaypoints(), 300, (int)target.MoveSpeed);
                        if (targetPosition.Distance(new Vector2(x, y)) < 550f && IsCondemnable(new Vector2(x, y), targetPosition, target.BoundingRadius, 300f))
                        {
                            s_Champion.Spells[Champion.Q].Cast(new Vector2(x, y));
                            return false;
                        }
                    }

                    return false;
                }
            }

            return false;
        }
Example #21
0
        internal static bool CanR(Obj_AI_Hero unit)
        {
            if (Me.HealthPercent <= 35 && unit.Distance(Me.ServerPosition) <= Me.AttackRange + 65)
            {
                return true;
            }

            if (unit.IsZombie || TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.Physical))
            {
                return false;
            }

            if (unit.CountAlliesInRange(400) >= 2 &&
                Me.GetAutoAttackDamage(unit, true) * 6 >= unit.Health)
            {
                return false;
            }

            if (Orbwalking.InAutoAttackRange(unit) &&
                Me.GetAutoAttackDamage(unit, true) * 3 >= unit.Health)
            {
                return false;
            }

            if (Buckshot.IsReady() && unit.Distance(Me.ServerPosition) <= Buckshot.Range &&
                Buckshot.GetDamage(unit) >= unit.Health)
            {
                return false;
            }

            if (Quickdraw.IsReady() && unit.Distance(Me.ServerPosition) <= Quickdraw.Range + 25 &&
                Me.GetAutoAttackDamage(unit, true) * 3 >= unit.Health)
            {
                return false;
            }

            return true;
        }
Example #22
0
 private void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender,
     Interrupter2.InterruptableTargetEventArgs args)
 {
     var dist = sender.Distance(player) < 750;
     if (E.IsReady() && config.Item("Interrupt", true).GetValue<bool>() && dist && CanStun(sender))
     {
         E.Cast(config.Item("packets").GetValue<bool>());
     }
     if (stance == Stance.Bear && dist && CanStun(sender))
     {
         orbwalker.ForceTarget(sender);
         player.IssueOrder(GameObjectOrder.AttackTo, sender);
     }
 }
        public void AutoInterrupter(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (!DelayHandler.CheckInterrption()) return;
            DelayHandler.UseInterrption();
            // Game.PrintChat($"{sender.ChampionName}");

            if (!SMenu.Item(MenuItemBase + "Boolean.AntiGapClose.Use.On." + sender.ChampionName).GetValue<bool>()) return;

            if (!Champion.GetSpellR.IsReady()) return;

            if (sender.Distance(Champion.Player) > Champion.GetSpellR.Range) return;

             Logger.WriteLog($"Interrupt Cast R on : {sender}");
            Champion.GetSpellR.Cast(sender);
        }
Example #24
0
        public static double CalcDamage(Obj_AI_Hero enemy)
        {
            double damage = 0;
            if (enemy.GetBuffCount("EkkoStacks") == 2)
                damage += 10 + 10 * Player.Level + 0.7 * Player.TotalMagicalDamage;
            if (SpellManager.Q.IsReady())
                damage += 45 + SpellManager.Q.Level * 15 + Player.TotalMagicalDamage * 0.1;
            if (SpellManager.E.IsReady() || Player.HasBuff("ekkoeattackbuff"))
                damage += 20 + SpellManager.E.Level * 30 + Player.TotalMagicalDamage() * 0.2;
            if (EkkoUlt != null)
                if (enemy.Distance(EkkoUlt.Position) <= SpellManager.R.Range)
                    damage += Rdamage();

            return Player.CalcDamage(enemy, Damage.DamageType.Magical, damage);
        }
Example #25
0
        //private static void OnProcessCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        //{
        //    if (args.Slot == SpellSlot.Q)
        //    {
        //        Game.PrintChat(args.SData.DelayCastOffsetPercent.ToString());
        //    }
        //}

        //private static void OnCreate(GameObject sender, EventArgs args)
        //{
        //        var sen = (MissileClient) sender;
        //    if (sen == null) return;
        //        Game.PrintChat(sen.SData.LineMissileTimePulseBetweenCollisionSpellHits.ToString());
        //}

        private static void OnInterrupt(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (!GetBool("autoeint", typeof(bool))) return;
            if (sender.IsMe || sender.IsAlly) return;
            if (sender.Distance(Player) < Em.Range)
            {
                if (!Ismelee())
                {
                    R.Cast();
                }

                if (Ismelee())  
                {
                    Em.Cast(sender);
                }
            }
        }
Example #26
0
        // Ward position, flash position, position to be in when you have to cast r, if a parameter is not applicable eg flash pos without having flash than this param will be set to new Vector3(nullptr)
        // Func will return null when no position is found
        public static Tuple<Vector3, Vector3, Vector3> GetWardFlashPositions(bool canUseWard, bool canUseFlash, Obj_AI_Hero player, byte minHitRequirement, List<Obj_AI_Hero> enemies)
        {
            float maxTravelDistance = GetMaxTravelDistance(canUseWard, canUseFlash);
            Vector3 destination = SelectBest(GetPositions(player, maxTravelDistance, minHitRequirement, enemies),player);

            if (destination == new Vector3(null))
            {
                return null;
            }

            bool useWard, useFlash;

            if (maxTravelDistance == 187.5f)
            {
                useWard = false;
                useFlash = false;
            }
            else
            {
                if (player.Distance(destination) <= 600f)
                {
                    useWard = true;
                    useFlash = false;
                }
                else
                {
                    useWard = true;
                    useFlash = true;
                }
            }

            Vector3 wardPos = new Vector3(null), flashPos = new Vector3(null);

            if (useWard && useFlash)
            {
                wardPos = MoveVector(player.ServerPosition, destination, 600f);
                flashPos = destination;
            }

            if (useWard && !useFlash)
            {
                wardPos = destination;
            }

            return new Tuple<Vector3, Vector3, Vector3>(wardPos, flashPos, destination);
        }
Example #27
0
        public static Vector3 GetDashPosition(Spell spell, Obj_AI_Hero target, float safetyDistance)
        {
            var distance = target.Distance(ObjectManager.Player);
            var dashPoints = new Geometry.Polygon.Circle(ObjectManager.Player.Position, spell.Range).Points;
            if (distance < safetyDistance)
            {
                dashPoints.AddRange(
                    new Geometry.Polygon.Circle(ObjectManager.Player.Position, safetyDistance - distance).Points);
            }
            dashPoints = dashPoints.Where(p => !p.IsWall()).OrderBy(p => p.Distance(Game.CursorPos)).ToList();
            foreach (var point in dashPoints)
            {
                var allies =
                    GameObjects.AllyHeroes.Where(
                        hero => !hero.IsDead && hero.Distance(point.To3D()) < ObjectManager.Player.AttackRange).ToList();
                var enemies =
                    GameObjects.EnemyHeroes.Where(
                        hero => hero.IsValidTarget(ObjectManager.Player.AttackRange, true, point.To3D())).ToList();
                var lowEnemies = enemies.Where(hero => hero.HealthPercent <= 15).ToList();

                if (!point.To3D().IsUnderTurret(false))
                {
                    if (enemies.Count == 1 &&
                        (!target.IsMelee ||
                         (target.HealthPercent <= ObjectManager.Player.HealthPercent - 25 ||
                          target.Position.Distance(point.To3D()) >= safetyDistance)) ||
                        allies.Count >
                        enemies.Count -
                        (ObjectManager.Player.HealthPercent >= (10 * lowEnemies.Count) ? lowEnemies.Count : 0))
                    {
                        return point.To3D();
                    }
                }
                else
                {
                    if (enemies.Count == 1 && lowEnemies.Any(t => t.NetworkId.Equals(target.NetworkId)))
                    {
                        return point.To3D();
                    }
                }
            }

            return Vector3.Zero;
        }
Example #28
0
        public static void doCombo(Obj_AI_Hero target)
        {
            try
            {

            if (target == null || !target.IsValid)
                return;
            if (LXOrbwalker.ForcedTarget != null && LXOrbwalker.ForcedTarget is Obj_AI_Hero)
                target = (Obj_AI_Hero)LXOrbwalker.ForcedTarget;
            useItems(target);
            if(target.Distance(player)>750 && !player.IsDashing() && LucianSharp.Config.Item("useQ").GetValue<bool>())
                useQonTarg(target,QhitChance.medium);
                //if(W.IsReady())
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Example #29
0
        public override void Execute(Obj_AI_Hero target)
        {
            var distance = target.Distance(ObjectManager.Player); //Todo: make him use fireminions even in range, just for showoff and potential AOE. Check if hes on fire too though
            if (distance < 950 && distance > 650 && UseMinions)
            {
                var fireMinion = MinionManager.GetMinions(650, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.None).Where(minion => minion.HasBuff("brandablaze") && minion.Distance(target) < 300).MinOrDefault(minion => minion.Distance(target));
                if (fireMinion != null)
                {
                    if (Cast(fireMinion) == CastStates.SuccessfullyCasted && !target.HasSpellShield())
                        Provider.SetMarked(target);
                }
            }
            if (distance < 650)
            {

                if (Cast(target) == CastStates.SuccessfullyCasted && !target.HasSpellShield())
                    Provider.SetMarked(target);
            }
        }
 internal static bool IsValidTarget(Obj_AI_Hero target,
     float range,
     DamageType damageType,
     bool ignoreShields = true,
     Vector3 from = default(Vector3))
 {
     try
     {
         return target.IsValidTarget() &&
                target.Distance(
                    (from.Equals(default(Vector3)) ? ObjectManager.Player.ServerPosition : from), true) <
                Math.Pow((range <= 0 ? Orbwalking.GetRealAutoAttackRange(target) : range), 2) &&
                !Invulnerable.Check(target, damageType, ignoreShields);
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return false;
 }