示例#1
0
        private static void OnCombo()
        {
            var target = TargetSelector.GetTarget(W.Range, DamageType.Magical);

            if (target != null)
            {
                if (getCheckBoxItem(comboMenu, "w.combo") && W.IsReady())
                {
                    W.Cast(target);
                }
            }

            if (getCheckBoxItem(comboMenu, "q.combo"))
            {
                switch (getBoxItem(qsettings, "q.settings"))
                {
                case 0:
                    foreach (var enemy in EntityManager.Heroes.Enemies.Where(x => x.LSIsValidTarget(Q.Range)))
                    {
                        Q.CastIfHitchanceEquals(enemy, HikiChance("q.normal.hit.chance"));
                    }
                    break;

                case 1:
                    if (ObjectManager.Player.CountEnemiesInRange(Q.Range) >= getSliderItem(qsettings, "q.hit.count"))
                    {
                        foreach (var enemy in EntityManager.Heroes.Enemies.Where(x => x.LSIsValidTarget(Q.Range) && Q.GetHitCount() >= getSliderItem(qsettings, "q.hit.count")))
                        {
                            Q.CastIfWillHit(enemy, getSliderItem(qsettings, "q.hit.count"));
                        }
                    }
                    break;
                }
            }
        }
示例#2
0
        private static void OnCombo()
        {
            if (getCheckBoxItem(comboMenu, "q.combo"))
            {
                switch (getBoxItem(qsettings, "q.settings"))
                {
                case 0:
                    foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Q.Range)))
                    {
                        Q.CastIfHitchanceEquals(enemy, HikiChance("q.normal.hit.chance"));
                    }
                    break;

                case 1:
                    if (ObjectManager.Player.CountEnemiesInRange(Q.Range) >= getSliderItem(qsettings, "q.hit.count"))
                    {
                        foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Q.Range) && Q.GetHitCount() >= getSliderItem(qsettings, "q.hit.count")))
                        {
                            Q.CastIfWillHit(enemy, getSliderItem(qsettings, "q.hit.count"));
                        }
                    }
                    break;
                }
            }
            if (getCheckBoxItem(comboMenu, "w.combo") && Q.IsReady())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(W.Range)))
                {
                    W.CastOnUnit(enemy);
                }
            }
        }
示例#3
0
        private void LogicE()
        {
            foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTargetLS(E.Range) && !LeagueSharp.Common.Orbwalking.InAutoAttackRange(enemy) && E.GetDamage(enemy) > enemy.Health))
            {
                Program.CastSpell(E, enemy);
                return;
            }

            var t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);

            if (t.IsValidTargetLS())
            {
                if (Program.Combo)
                {
                    if (Player.Mana > RMANA + EMANA)
                    {
                        if (!LeagueSharp.Common.Orbwalking.InAutoAttackRange(t))
                        {
                            Program.CastSpell(E, t);
                        }
                        if (Player.Health < Player.MaxHealth * 0.5)
                        {
                            Program.CastSpell(E, t);
                        }
                    }

                    if (Player.Mana > RMANA + EMANA + QMANA)
                    {
                        E.CastIfWillHit(t, 2, true);
                    }
                }
                if (Program.Farm && Config.Item("autoE2", true).GetValue <bool>() && Player.Mana > RMANA + EMANA + WMANA + QMANA)
                {
                    E.CastIfWillHit(t, 2, true);
                }
            }
            foreach (var target in HeroManager.Enemies.Where(target => target.IsValidTargetLS(E.Range)))
            {
                if (target.IsValidTargetLS(300) && target.IsMelee)
                {
                    Program.CastSpell(E, t);
                }
            }
        }
示例#4
0
        private static void CastSpell(Spell QWER, Obj_AI_Hero target, int HitChanceNum)
        {
            //HitChance 0 - 2
            // example CastSpell(Q, ts, 2);
            if (HitChanceNum == 0)
                QWER.Cast(target, true);
            else if (HitChanceNum == 1)
                QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh, true);
            else if (HitChanceNum == 2)
            {
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);
                if (target.Path.Count() < 2)
                    QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh, true);
            }
            else if (HitChanceNum == 3)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                //debug("" + target.Path.Count() + " " + (target.Position == target.ServerPosition) + (waypoints.Last<Vector2>().To3D() == target.ServerPosition));
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);

                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
            else if (HitChanceNum == 4 && (int)QWER.GetPrediction(target).Hitchance > 4)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                //debug("" + target.Path.Count() + " " + (target.Position == target.ServerPosition) + (waypoints.Last<Vector2>().To3D() == target.ServerPosition));
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);

                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
        }
示例#5
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            //Combo & Harass
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ||
                (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) &&
                 ObjectManager.Player.Mana / ObjectManager.Player.MaxMana * 100 >
                 getSliderItem(harassMenu, "ManaSliderHarass")))
            {
                var target = TargetSelector.GetTarget(1200f, DamageType.Magical);
                if (target != null)
                {
                    var comboActive  = Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo);
                    var harassActive = Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass);

                    if (((comboActive && getCheckBoxItem(comboMenu, "UseQCombo")) ||
                         (harassActive && getCheckBoxItem(harassMenu, "UseQHarass"))) && Q1.IsReady())
                    {
                        CastQ(target);
                    }

                    if (((comboActive && getCheckBoxItem(comboMenu, "UseWCombo")) ||
                         (harassActive && getCheckBoxItem(harassMenu, "UseWHarass"))) && W.IsReady())
                    {
                        var prediction = W.GetPrediction(target);
                        if (prediction.Hitchance >= HitChance.High)
                        {
                            if (ObjectManager.Player.ServerPosition.Distance(prediction.UnitPosition) < W.Range &&
                                ObjectManager.Player.ServerPosition.Distance(prediction.UnitPosition) > W.Range - 250 &&
                                prediction.UnitPosition.Distance(ObjectManager.Player.ServerPosition) >
                                target.Distance(ObjectManager.Player))
                            {
                                var cp =
                                    ObjectManager.Player.ServerPosition.To2D()
                                    .Extend(prediction.UnitPosition.To2D(), W.Range)
                                    .To3D();
                                W.Cast(cp);
                                UseSecondWT = Utils.TickCount;
                            }
                        }
                    }

                    if (((comboActive && getCheckBoxItem(comboMenu, "UseECombo")) ||
                         (harassActive && getCheckBoxItem(harassMenu, "UseEHarass"))) && E.IsReady())
                    {
                        E.Cast(target, false, true);
                    }

                    var useR = getCheckBoxItem(comboMenu, "UseRCombo");

                    //R at close range
                    if (comboActive && useR && R.IsReady() &&
                        (ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) +
                         ObjectManager.Player.GetSpellDamage(target, SpellSlot.W) +
                         ObjectManager.Player.GetSpellDamage(target, SpellSlot.E) +
                         ObjectManager.Player.GetSpellDamage(target, SpellSlot.R) > target.Health) &&
                        ObjectManager.Player.Distance(target) <= Q2.Range)
                    {
                        R.Delay = 2000 + 1500 * target.Distance(ObjectManager.Player) / 5300;
                        R.Cast(target, true, true);
                    }

                    //R aoe in teamfights
                    if (comboActive && useR && R.IsReady())
                    {
                        var alliesarround = 0;
                        var n             = 0;
                        foreach (var ally in ObjectManager.Get <AIHeroClient>())
                        {
                            if (ally.IsAlly && !ally.IsMe && ally.IsValidTarget(float.MaxValue) &&
                                ally.Distance(target) < 700)
                            {
                                alliesarround++;
                                if (Utils.TickCount - ally.LastCastedSpellT() < 1500)
                                {
                                    n++;
                                }
                            }
                        }

                        if (n < Math.Max(alliesarround / 2 - 1, 1))
                        {
                            return;
                        }

                        switch (alliesarround)
                        {
                        case 2:
                            R.CastIfWillHit(target, 2);
                            break;

                        case 3:
                            R.CastIfWillHit(target, 3);
                            break;

                        case 4:
                            R.CastIfWillHit(target, 4);
                            break;
                        }
                    }

                    //R if killable
                    if (comboActive && useR && R.IsReady() &&
                        ObjectManager.Player.GetSpellDamage(target, SpellSlot.R) > target.Health)
                    {
                        R.Delay = 2000 + 1500 * target.Distance(ObjectManager.Player) / 5300;
                        R.Cast(target, true, true);
                    }
                }
            }

            if (Utils.TickCount - UseSecondWT < 500 &&
                ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "ziggswtoggle")
            {
                W.Cast(ObjectManager.Player.ServerPosition, true);
            }

            //Farm
            var lc = Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) ||
                     Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear);

            if (lc)
            {
                Farm();
                JungleFarm();
            }

            //W to mouse
            var castToMouse = getKeyBindItem(miscMenu, "WToMouse");

            if (castToMouse || Utils.TickCount - LastWToMouseT < 400)
            {
                var pos = ObjectManager.Player.ServerPosition.To2D().Extend(Game.CursorPos.To2D(), -150).To3D();
                W.Cast(pos, true);
                if (castToMouse)
                {
                    LastWToMouseT = Utils.TickCount;
                }
            }

            //Peel from melees
            if (getCheckBoxItem(miscMenu, "Peel"))
            {
                foreach (var pos in from enemy in ObjectManager.Get <AIHeroClient>()
                         where
                         enemy.IsValidTarget() &&
                         enemy.Distance(ObjectManager.Player) <=
                         enemy.BoundingRadius + enemy.AttackRange + ObjectManager.Player.BoundingRadius &&
                         enemy.IsMelee()
                         let direction =
                             (enemy.ServerPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized()
                             let pos = ObjectManager.Player.ServerPosition.To2D()
                                       select pos + Math.Min(200, Math.Max(50, enemy.Distance(ObjectManager.Player) / 2)) * direction)
                {
                    W.Cast(pos.To3D(), true);
                    UseSecondWT = Utils.TickCount;
                }
            }
        }
示例#6
0
文件: Jhin.cs 项目: yashine59fr/Port
        private void LogicE()
        {
            if (Config.Item("autoE", true).GetValue <bool>())
            {
                var trapPos = OktwCommon.GetTrapPos(E.Range);
                if (!trapPos.IsZero)
                {
                    E.Cast(trapPos);
                }

                foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTargetLS(E.Range) && !OktwCommon.CanMove(enemy)))
                {
                    E.Cast(enemy);
                }
            }

            var t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);

            if (t.IsValidTargetLS() && Config.Item("EmodeCombo", true).GetValue <StringList>().SelectedIndex != 2)
            {
                if (Program.Combo && !Player.Spellbook.IsAutoAttacking)
                {
                    if (Config.Item("EmodeCombo", true).GetValue <StringList>().SelectedIndex == 1)
                    {
                        if (E.GetPrediction(t).CastPosition.Distance(t.Position) > 100)
                        {
                            if (Player.Position.Distance(t.ServerPosition) > Player.Position.Distance(t.Position))
                            {
                                if (t.Position.Distance(Player.ServerPosition) < t.Position.Distance(Player.Position))
                                {
                                    Program.CastSpell(E, t);
                                }
                            }
                            else
                            {
                                if (t.Position.Distance(Player.ServerPosition) > t.Position.Distance(Player.Position))
                                {
                                    Program.CastSpell(E, t);
                                }
                            }
                        }
                    }
                    else
                    {
                        Program.CastSpell(E, t);
                    }
                }

                E.CastIfWillHit(t, Config.Item("Eaoe", true).GetValue <Slider>().Value);
            }
            else if (Program.LaneClear && Player.ManaPercent > Config.Item("Mana", true).GetValue <Slider>().Value&& Config.Item("farmE", true).GetValue <bool>())
            {
                var minionList   = Cache.GetMinions(Player.ServerPosition, E.Range);
                var farmPosition = E.GetCircularFarmLocation(minionList, E.Width);

                if (farmPosition.MinionsHit >= Config.Item("LCminions", true).GetValue <Slider>().Value)
                {
                    E.Cast(farmPosition.Position);
                }
            }
        }
示例#7
0
        private static void LogicE()
        {
            if (getCheckBoxItem(eMenu, "autoE"))
            {
                var trapPos = OktwCommon.GetTrapPos(E.Range);
                if (!trapPos.IsZero)
                {
                    E.Cast(trapPos);
                }

                foreach (var enemy in Program.Enemies.Where(enemy => enemy.LSIsValidTarget(E.Range) && !OktwCommon.CanMove(enemy)))
                {
                    E.Cast(enemy.ServerPosition);
                }
            }

            var t = TargetSelector.GetTarget(E.Range, DamageType.Physical);

            if (t.LSIsValidTarget() && getBoxItem(eMenu, "EmodeCombo") != 2)
            {
                if (Program.Combo && !Player.Spellbook.IsAutoAttacking)
                {
                    if (getBoxItem(eMenu, "EmodeCombo") == 1)
                    {
                        if (E.GetPrediction(t).CastPosition.LSDistance(t.Position) > 100)
                        {
                            if (Player.Position.LSDistance(t.ServerPosition) > Player.Position.LSDistance(t.Position))
                            {
                                if (t.Position.LSDistance(Player.ServerPosition) < t.Position.LSDistance(Player.Position))
                                {
                                    Program.CastSpell(E, t);
                                }
                            }
                            else
                            {
                                if (t.Position.LSDistance(Player.ServerPosition) > t.Position.LSDistance(Player.Position))
                                {
                                    Program.CastSpell(E, t);
                                }
                            }
                        }
                    }
                    else
                    {
                        Program.CastSpell(E, t);
                    }
                }

                E.CastIfWillHit(t, getSliderItem(eMenu, "Eaoe"));
            }
            else if (Program.LaneClear && Player.ManaPercent > getSliderItem(farmMenu, "Mana") && getCheckBoxItem(farmMenu, "farmE"))
            {
                var minionList   = Cache.GetMinions(Player.ServerPosition, E.Range);
                var farmPosition = E.GetCircularFarmLocation(minionList, E.Width);

                if (farmPosition.MinionsHit >= getSliderItem(farmMenu, "LCminions"))
                {
                    E.Cast(farmPosition.Position);
                }
            }
        }
示例#8
0
 private static void Combo()
 {
     if (IgniteSlot != SpellSlot.Unknown && IgniteSlot.IsReady() && Menu.Item("UseIgniteC").GetValue <bool>())
     {
         var t = TargetSelector.GetTarget(600, TargetSelector.DamageType.True);
         if (t != null)
         {
             if (t.Health < ComboDmg(t))
             {
                 Player.Spellbook.CastSpell(IgniteSlot, t);
             }
         }
     }
     if (Q.IsReady() && Menu.Item("UseQC").GetValue <bool>())
     {
         var t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             if (EloBuddy.Player.Instance.IsInAutoAttackRange(t))
             {
                 Q.Cast(t);
             }
             else if (!Menu.Item("UseQinAA").GetValue <bool>())
             {
                 Q.Cast(t);
             }
         }
     }
     if (W.IsReady() && Menu.Item("UseWC").GetValue <bool>())
     {
         var t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             if (t.Path.Count() < 2)
             {
                 if (t.HasBuffOfType(BuffType.Slow))
                 {
                     if (W.GetPrediction(t).Hitchance >= HitChance.VeryHigh)
                     {
                         if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                         {
                             return;
                         }
                     }
                 }
                 if (t.CountEnemiesInRange(250) > 2)
                 {
                     if (W.GetPrediction(t).Hitchance >= HitChance.VeryHigh)
                     {
                         if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                         {
                             return;
                         }
                     }
                 }
                 if (Player.Position.Distance(t.ServerPosition) < Player.Position.Distance(t.Position))
                 {
                     if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                     {
                         return;
                     }
                 }
                 else
                 {
                     if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                     {
                         return;
                     }
                 }
             }
         }
     }
     if (E.IsReady() && Menu.Item("UseEC").GetValue <bool>())
     {
         var hitchance = (HitChance)(Menu.Item("PredEC").GetValue <StringList>().SelectedIndex + 3);
         var t         = TargetSelector.GetTarget(ECastRange + E.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             CastE(t, hitchance);
         }
     }
     if (R.IsReady() && Menu.Item("UseRC").GetValue <bool>() && R.Instance.Name == "ViktorChaosStorm")
     {
         var t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             if (t.Health < ComboDmg(t) && t.HealthPercent > 5)
             {
                 LeagueSharp.Common.Utility.DelayAction.Add(100, () => R.Cast(t, false, true));
             }
         }
         foreach (var unit in HeroManager.Enemies.Where(h => h.IsValidTargetLS(R.Range)))
         {
             R.CastIfWillHit(unit, Menu.Item("HitRC").GetValue <Slider>().Value);
         }
     }
 }