示例#1
0
        private void Game_OnUpdate(EventArgs args)
        {
            if (Config.Item("focusE", true).GetValue <bool>())
            {
                var eTarget = HeroManager.Enemies.FirstOrDefault(target => target.IsValidTarget() && Orbwalking.InAutoAttackRange(target) && target.HasBuff("tristanaechargesound"));
                if (eTarget != null)
                {
                    Orbwalker.ForceTarget(eTarget);
                }
            }

            if (W.IsReady() && Config.Item("smartW", true).GetValue <KeyBind>().Active)
            {
                W.Cast(Game.CursorPos);
            }

            if (Program.LagFree(1))
            {
                var lvl = 7 * (Player.Level - 1);

                E.Range = 620 + lvl;
                R.Range = 620 + lvl;

                SetMana();
                Jungle();
            }

            if ((Program.LagFree(4) || Program.LagFree(2)) && R.IsReady())
            {
                LogicR();
            }
            if (Program.LagFree(3) && W.IsReady() && !Player.Spellbook.IsAutoAttacking)
            {
                LogicW();
            }
        }
示例#2
0
        static void Orbwalking_AfterAttack(Obj_AI_Base unit, Obj_AI_Base target)
        {
            if (!unit.IsMe)
            {
                return;
            }

            var tar = (Obj_AI_Hero)target;

            switch (Orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                if (isEn("QC"))
                {
                    CastQ();
                }
                if (isEn("WC") && (ObjectManager.Player.Buffs.FirstOrDefault(
                                       buff => buff.Name == "dravenfurybuff" || buff.Name == "DravenFury") == null))
                {
                    var WManaCombo = menu.Item("WManaC").GetValue <Slider>().Value;
                    if (getManaPer() >= WManaCombo)
                    {
                        W.Cast();
                    }
                }
                //Botrk
                if (isEn("BOTRK"))
                {
                    useItem(3153, (Obj_AI_Hero)target);
                }
                //Youmuu
                if (isEn("Youmuu"))
                {
                    useItem(3142);
                }
                //SOTD
                if (isEn("SOTD"))
                {
                    var hasIE = Items.HasItem(3031);
                    var coeff = hasIE ? 2.5 : 2.0;
                    if ((player.GetAutoAttackDamage(target) * coeff * 3 >= target.Health))
                    {
                        useItem(3131);
                        Orbwalker.ForceTarget(target);
                    }
                }
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                if (isEn("QM"))
                {
                    CastQ();
                }
                if (isEn("WM") && (ObjectManager.Player.Buffs.FirstOrDefault(
                                       buff => buff.Name == "dravenfurybuff" || buff.Name == "DravenFury") == null))
                {
                    var WManaMix = menu.Item("WManaM").GetValue <Slider>().Value;
                    if (getManaPer() >= WManaMix)
                    {
                        W.Cast();
                    }
                }

                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                if (isEn("QLH"))
                {
                    CastQ();
                }
                if (isEn("WLH") && (ObjectManager.Player.Buffs.FirstOrDefault(
                                        buff => buff.Name == "dravenfurybuff" || buff.Name == "DravenFury") == null))
                {
                    W.Cast();
                }

                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                if (isEn("WLC") && (ObjectManager.Player.Buffs.FirstOrDefault(
                                        buff => buff.Name == "dravenfurybuff" || buff.Name == "DravenFury") == null))
                {
                    W.Cast();
                }
                if (isEn("QLC"))
                {
                    CastQ();
                }

                break;

            default:
                return;
            }
        }
示例#3
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            Orbwalker.SetOrbwalkingPoint(Vector3.Zero);

            if (Player.IsDead || Flee())
            {
                return;
            }

            KillstealQ();
            KillstealW();
            DuelistMode();
            Farm();

            if (Player.IsDashing() || Player.IsWindingUp || Player.Spellbook.IsCastingSpell)
            {
                return;
            }

            if (!Orbwalker.ActiveMode.IsComboMode())
            {
                return;
            }

            var aaTarget = GetTarget(true);
            var passive  = new FioraPassive();

            if (aaTarget.IsValidTarget())
            {
                passive = aaTarget.GetNearestPassive();
                if (Menu.Item("OrbwalkPassive").IsActive() &&
                    Menu.Item("Orbwalk" + Orbwalker.ActiveMode.GetModeString()).IsActive())
                {
                    var selTarget = TargetSelector.SelectedTarget;
                    //Console.WriteLine("START ORBWALK TO PASSIVE");
                    if (!Menu.Item("OrbwalkSelected").IsActive() ||
                        (selTarget != null && selTarget.NetworkId.Equals(aaTarget.NetworkId)))
                    {
                        OrbwalkToPassive(aaTarget, passive);
                    }
                }
                Orbwalker.ForceTarget(aaTarget);
            }

            var target = GetTarget();

            if (!target.IsValidTarget(W.Range))
            {
                return;
            }

            var vital = aaTarget != null && target.NetworkId.Equals(aaTarget.NetworkId)
                ? passive
                : target.GetNearestPassive();

            if (Orbwalker.ActiveMode.Equals(Orbwalking.OrbwalkingMode.Mixed) &&
                Player.ManaPercent < Menu.Item("ManaHarass").GetValue <Slider>().Value)
            {
                return;
            }

            if (R.IsActive() /*&& !R.HasManaCondition()*/ &&
                Menu.Item("RMode").GetValue <StringList>().SelectedIndex.Equals(1) && ComboR(target))
            {
                return;
            }

            if (Q.IsActive()) // && !Q.HasManaCondition())
            {
                if (target.IsValidTarget(FioraAutoAttackRange) && !Orbwalking.IsAutoAttack(Player.LastCastedSpellName()))
                {
                    return;
                }

                if (target.ChampionName.Equals("Poppy") && target.HasBuff("poppywzone"))
                {
                    return;
                }

                var count = target.GetUltPassiveCount();

                if (!Menu.Item("RSmartQ").IsActive() || count == 0)
                {
                    CastQ(target, vital);
                    return;
                }
                if (count > 2)
                {
                    return;
                }

                CastQ(target, target.GetFurthestPassive());

                /*  var path = target.GetWaypoints();
                 * if (path.Count == 1 || Player.Distance(target) < 700)
                 * {
                 *  CastQ(target);
                 *  return;
                 * }
                 *
                 * var d = target.Distance(path[1]);
                 * var d2 = Player.Distance(path[1]);
                 * var t = d / target.MoveSpeed;
                 * var dT = Q.Delay + Game.Ping / 2000f - t;
                 * if ((dT > .2f || (d2 < 690 && dT > -1)) && CastQ(target))
                 * {
                 *  //  Console.WriteLine("{0} {1}", dT, d2);
                 * }*/
            }
        }
示例#4
0
        private static void Obj_AI_Base_OnSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            var enemy = TargetSelector2.GetTarget(E.Range, TargetSelector2.DamageType.Physical);

            if (enemy == null)
            {
                return;
            }

            if (enemy != null)
            {
                var mousePos = myHero.Position.Extend2(Game.CursorPos, Q.Range);
                if (SubMenu["Harass"]["Q"].Cast <CheckBox>().CurrentValue&& orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed &&
                    enemy.IsValidTarget(myHero.GetAutoAttackRange()) && Q.IsReady())
                {
                    myHero.Spellbook.CastSpell(SpellSlot.Q, mousePos, true);
                    orbwalker.ForceTarget(enemy);
                }

                if (SubMenu["Harass"]["E"].Cast <CheckBox>().CurrentValue&& E.IsReady() && !Q.IsReady() &&
                    orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed &&
                    enemy.IsValidTarget(myHero.GetAutoAttackRange()))
                {
                    E.Cast(enemy);
                    orbwalker.ForceTarget(enemy);
                }
            }

            var LastHitE = myHero;

            foreach (var Etarget in EntityManager.Heroes.Enemies.Where(Etarget => Etarget.IsValidTarget(E.Range) && Etarget.Path.Count() < 2))
            {
                if (SubMenu["Combo"]["ELast"].Cast <CheckBox>().CurrentValue&& E.IsReady() && myHero.CountEnemiesInRange2(600) <= 1)
                {
                    var dmgE = myHero.GetSpellDamage2(Etarget, SpellSlot.E);
                    if (dmgE > Etarget.Health || (WTarget(Etarget) == 2 && dmgE + Wdmg(Etarget) > Etarget.Health))
                    {
                        LastHitE = Etarget;
                    }
                }

                if (LastHitE != myHero)
                {
                    E.CastOnUnit(LastHitE);
                }
            }

            if (sender.Spellbook.Owner.IsMe)
            {
                if (args.Slot == SpellSlot.Q)
                {
                    if (Tumble.TumbleOrderPos != Vector3.Zero)
                    {
                        if (Tumble.TumbleOrderPos.IsDangerousPosition())
                        {
                            Tumble.TumbleOrderPos = Vector3.Zero;
                            args.Process          = false;
                        }
                        else
                        {
                            Tumble.TumbleOrderPos = Vector3.Zero;
                        }
                    }
                }
            }
        }
        private void OnUpdateFunctions()
        {
            #region Auto E
            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.autoe"))
            {
                Obj_AI_Hero target;
                if (CondemnCheck(ObjectManager.Player.ServerPosition, out target))
                {
                    if (target.IsValidTarget(_spells[SpellSlot.E].Range) && (target is Obj_AI_Hero))
                    {
                        _spells[SpellSlot.E].Cast(target);
                    }
                }
            }
            #endregion

            #region Focus 2 W stacks
            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.general.specialfocus"))
            {
                var target = HeroManager.Enemies.Find(en => en.IsValidTarget(ObjectManager.Player.AttackRange) && en.Has2WStacks());
                if (target != null)
                {
                    Orbwalker.ForceTarget(target);
                    Hud.SelectedUnit = target;
                }
            }
            #endregion

            #region Disable AA Stealth
            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.noaastealth"))
            {
                Orbwalker.SetAttack(!Helpers.IsPlayerFaded());
            }
            #endregion

            #region Condemn KS
            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.eks"))
            {
                var target = HeroManager.Enemies.Find(en => en.IsValidTarget(_spells[SpellSlot.E].Range) && en.Has2WStacks());
                if (target != null && target.Health + 20 <= (_spells[SpellSlot.E].GetDamage(target) + _spells[SpellSlot.W].GetDamage(target)) && (target is Obj_AI_Hero))
                {
                    _spells[SpellSlot.E].Cast(target);
                }
            }
            #endregion

            #region WallTumble
            if (Menu.Item("dz191.vhr.misc.tumble.walltumble").GetValue <KeyBind>().Active)
            {
                WallTumble();
            }
            #endregion

            #region Low Life Peel

            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.lowlifepeel") && ObjectManager.Player.HealthPercentage() <= 20)
            {
                var meleeEnemies = ObjectManager.Player.GetEnemiesInRange(350f).FindAll(m => m.IsMelee());
                if (meleeEnemies.Any())
                {
                    var mostDangerous = meleeEnemies.OrderByDescending(m => m.GetAutoAttackDamage(ObjectManager.Player)).First();
                    if (mostDangerous is Obj_AI_Hero)
                    {
                        _spells[SpellSlot.E].Cast(mostDangerous);
                    }
                }
            }
            #endregion
        }
示例#6
0
文件: Renekton.cs 项目: hama1/Port
        private void Harass()
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(E.Range, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }
            switch (config.Item("useCH", true).GetValue <StringList>().SelectedIndex)
            {
            case 1:
                if (Q.IsReady() && E.IsReady() && lastE.Equals(0) && fury && !rene)
                {
                    if (config.Item("donteqwebtower", true).GetValue <bool>() &&
                        player.Position.Extend(target.Position, E.Range).UnderTurret(true))
                    {
                        return;
                    }
                    var closeGapTarget =
                        MinionManager.GetMinions(E.Range, MinionTypes.All, MinionTeam.NotAlly)
                        .Where(i => i.Distance(target.ServerPosition) < Q.Range - 40)
                        .OrderByDescending(i => Environment.Minion.countMinionsInrange(i.Position, Q.Range))
                        .FirstOrDefault();
                    if (closeGapTarget != null)
                    {
                        lastEpos = player.ServerPosition;
                        LeagueSharp.Common.Utility.DelayAction.Add(4100, () => lastEpos = new Vector3());
                        E.Cast(closeGapTarget.Position);
                        lastE = System.Environment.TickCount;
                        return;
                    }
                    else
                    {
                        lastEpos = player.ServerPosition;
                        LeagueSharp.Common.Utility.DelayAction.Add(4100, () => lastEpos = new Vector3());
                        E.Cast(target.Position);
                        lastE = System.Environment.TickCount;
                        return;
                    }
                }
                if (player.Distance(target) < Orbwalking.GetRealAutoAttackRange(target) && Q.IsReady() &&
                    E.IsReady() && E.IsReady())
                {
                    orbwalker.ForceTarget(target);
                }
                return;

                break;

            case 0:
                if (Q.IsReady() && W.IsReady() && !rene && E.CanCast(target))
                {
                    if (config.Item("donteqwebtower", true).GetValue <bool>() &&
                        player.Position.Extend(target.Position, E.Range).UnderTurret(true))
                    {
                        return;
                    }
                    if (E.CastIfHitchanceEquals(target, HitChance.High))
                    {
                        lastE = System.Environment.TickCount;
                    }
                }
                if (rene && E.CanCast(target) && !lastE.Equals(0) && System.Environment.TickCount - lastE > 3600)
                {
                    E.CastIfHitchanceEquals(target, HitChance.High);
                }
                if (player.Distance(target) < Orbwalking.GetRealAutoAttackRange(target) && Q.IsReady() &&
                    E.IsReady() && E.IsReady())
                {
                    orbwalker.ForceTarget(target);
                }
                return;

                break;

            default:
                break;
            }

            if (config.Item("useqH", true).GetValue <bool>() && Q.CanCast(target))
            {
                Q.Cast();
            }

            if (config.Item("useCH", true).GetValue <StringList>().SelectedIndex == 0 && !lastE.Equals(0) && rene &&
                !Q.IsReady() && !renw)
            {
                if (lastEpos.IsValid())
                {
                    E.Cast(player.Position.Extend(lastEpos, 350f));
                }
            }
        }
示例#7
0
 private static void Qlogic()
 {
     if (FishBoneActive)
     {
         var orbT = Orbwalker.GetTarget();
         if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear && Player.ManaPercent > Config.Item("QmanaLC").GetValue <Slider>().Value&& orbT.IsValid <Obj_AI_Minion>())
         {
         }
         else if (Config.Item("Qchange").GetValue <StringList>().SelectedIndex == 0 && orbT.IsValid <Obj_AI_Hero>())
         {
             var t = (Obj_AI_Hero)Orbwalker.GetTarget();
             FishBoneToMiniGun(t);
         }
         else
         {
             if (!Combo && Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None)
             {
                 Q.Cast();
             }
         }
     }
     else
     {
         var t = TargetSelector.GetTarget(Q.Range + 40, TargetSelector.DamageType.Physical);
         if (t.IsValidTarget())
         {
             if ((!Orbwalking.InAutoAttackRange(t) || t.CountEnemiesInRange(250) >= Config.Item("Qaoe").GetValue <Slider>().Value))
             {
                 if (Combo && Config.Item("Qcombo").GetValue <bool>() && (Player.ManaPercent > Config.Item("QmanaCombo").GetValue <Slider>().Value || Player.GetAutoAttackDamage(t) * Config.Item("QmanaIgnore").GetValue <Slider>().Value > t.Health))
                 {
                     Q.Cast();
                 }
                 if (Farm && Orbwalking.CanAttack() && !Player.IsWindingUp && Config.Item("harasQ" + t.ChampionName).GetValue <bool>() && Config.Item("Qharass").GetValue <bool>() && (Player.ManaPercent > Config.Item("QmanaHarass").GetValue <Slider>().Value || Player.GetAutoAttackDamage(t) * Config.Item("QmanaIgnore").GetValue <Slider>().Value > t.Health))
                 {
                     Q.Cast();
                 }
             }
         }
         else
         {
             if (Combo && Player.ManaPercent > Config.Item("QmanaCombo").GetValue <Slider>().Value)
             {
                 Q.Cast();
             }
             else if (Farm && !Player.IsWindingUp && Config.Item("farmQout").GetValue <bool>() && Orbwalking.CanAttack())
             {
                 foreach (var minion in MinionManager.GetMinions(Q.Range + 30).Where(
                              minion => !Orbwalking.InAutoAttackRange(minion) && minion.Health < Player.GetAutoAttackDamage(minion) * 1.2 && GetRealPowPowRange(minion) < GetRealDistance(minion) && Q.Range < GetRealDistance(minion)))
                 {
                     Orbwalker.ForceTarget(minion);
                     Q.Cast();
                     return;
                 }
             }
             if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear && Player.ManaPercent > Config.Item("QmanaLC").GetValue <Slider>().Value)
             {
                 var orbT = Orbwalker.GetTarget();
                 if (orbT.IsValid <Obj_AI_Minion>() && CountMinionsInRange(250, orbT.Position) >= Config.Item("Qlaneclear").GetValue <Slider>().Value)
                 {
                     Q.Cast();
                 }
             }
         }
     }
 }
示例#8
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }

            foreach (var entry in rPoint)
            {
                var timestamp = entry.Key;
                if (Game.Time - timestamp > 4f)
                {
                    rPoint.Remove(timestamp);
                    break;
                }
            }

            if (RootMenu.Item("useflee").GetValue <KeyBind>().Active)
            {
                Orbwalking.Orbwalk(null, Game.CursorPos);
                UseE(Game.CursorPos, false);
            }

            if (RootMenu.Item("useskin").GetValue <bool>())
            {
                //Player.SetSkin(Player.BaseSkinName, RootMenu.Item("skinid").GetValue<Slider>().Value);
            }

            if (RootMenu.Item("r33").GetValue <bool>())
            {
                var rtarget = HeroManager.Enemies.FirstOrDefault(x => x.HasBuff(RBuffName));
                if (rtarget != null && rtarget.IsValidTarget() && !rtarget.IsZombie)
                {
                    if (Orbwalking.InAutoAttackRange(rtarget))
                    {
                        TargetSelector.SetTarget(rtarget);
                        Orbwalker.ForceTarget(rtarget);
                    }
                }
            }

            if (IsDashing || OnWall)
            {
                return;
            }

            if (RootMenu.Item("usecombo").GetValue <KeyBind>().Active)
            {
                Combo();
            }

            if (RootMenu.Item("useclear").GetValue <KeyBind>().Active)
            {
                if (Player.Mana / Player.MaxMana * 100 > RootMenu.Item("clearmana").GetValue <Slider>().Value)
                {
                    Clear();
                }
            }

            if (RootMenu.Item("useharass").GetValue <KeyBind>().Active)
            {
                if (Player.Mana / Player.MaxMana * 100 > RootMenu.Item("harassmana").GetValue <Slider>().Value)
                {
                    Harass();
                }
            }

            tt = Player.CountAlliesInRange(1500) > 1 && Player.CountEnemiesInRange(1350) > 2 ||
                 Player.CountEnemiesInRange(1200) > 2;
        }
示例#9
0
        private void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            var packet = new GamePacket(args.PacketData);

            if (packet.Header == 0xb0 && config.Item("blockanim").GetValue <bool>())
            {
                packet.Position = 0x1;
                if (packet.ReadInteger() == me.NetworkId)
                {
                    args.Process = false;
                }
            }

            //else if (packet.Header == 0x61)
            //{
            //    packet.Position = 0xc;
            //    if (packet.ReadInteger() != me.NetworkId)
            //        return;

            //    if (Orbwalking.Move && orbwalker.GetTarget() != null)
            //        Orbwalking.Move = !blockmove;
            //}

            else if (packet.Header == 0x65)
            {
                packet.Position = 0x10;
                int sourceId = packet.ReadInteger();

                if (sourceId != me.NetworkId)
                {
                    return;
                }

                packet.Position = 0x1;
                int targetId = packet.ReadInteger();
                int dmgType  = packet.ReadByte();

                var trueTarget = ObjectManager.GetUnitByNetworkId <Obj_AI_Base>(targetId);
                var trueOutput = wings.GetPrediction(trueTarget);

                var nonstickyPosition = new Vector3();
                if (trueOutput.Hitchance >= HitChance.Low)
                {
                    nonstickyPosition = new Vector3(nonstickyPosition.X, nonstickyPosition.Y, nonstickyPosition.Z);
                }

                var nosticky = config.Item("nostickyq").GetValue <bool>();
                if ((dmgType == 0x4 || dmgType == 0x3) && wings.IsReady())
                {
                    switch (trueTarget.Type)
                    {
                    case GameObjectType.obj_Barracks:
                    case GameObjectType.obj_AI_Turret:
                        if (!config.Item("clearkey").GetValue <KeyBind>().Active)
                        {
                            return;
                        }
                        castitems(trueTarget);
                        wings.Cast(trueTarget.Position, true);
                        break;

                    case GameObjectType.obj_AI_Hero:
                        if (config.Item("combokey").GetValue <KeyBind>().Active)
                        {
                            castitems(trueTarget);
                        }
                        if (config.Item("combokey").GetValue <KeyBind>().Active)
                        {
                            wings.Cast(nosticky ? nonstickyPosition : trueTarget.Position, true);
                        }
                        if (config.Item("harasskey").GetValue <KeyBind>().Active)
                        {
                            wings.Cast(nosticky ? nonstickyPosition : trueTarget.Position, true);
                        }
                        break;

                    case GameObjectType.obj_AI_Minion:
                        if (!config.Item("clearkey").GetValue <KeyBind>().Active)
                        {
                            return;
                        }
                        if (jungleminions.Any(name => trueTarget.Name.StartsWith(name)) && !trueTarget.Name.Contains("Mini") &&
                            wings.IsReady() && config.Item("jungleQ").GetValue <bool>())
                        {
                            wings.Cast(trueTarget.Position, true);
                        }
                        if (trueTarget.Name.StartsWith("Minion") && config.Item("farmQ").GetValue <bool>())
                        {
                            wings.Cast(trueTarget.Position, true);
                            orbwalker.ForceTarget(trueTarget);
                        }
                        if (valor.IsReady() && cleavecount >= 1 && config.Item("jungleE").GetValue <bool>())
                        {
                            valor.Cast(trueTarget.Position);
                        }
                        break;
                    }
                }
            }
            else if (packet.Header == 0x38 && packet.Size() == 0x9)
            {
                packet.Position = 0x1;
                int sourceId = packet.ReadInteger();
                if (sourceId != me.NetworkId)
                {
                    return;
                }

                var movePos    = new Vector3();
                var targetId   = orbwalker.GetTarget().NetworkId;
                var trueTarget = ObjectManager.GetUnitByNetworkId <Obj_AI_Base>(targetId);

                if (trueTarget.Type == GameObjectType.obj_Barracks || trueTarget.Type == GameObjectType.obj_AI_Turret ||
                    trueTarget.Type == GameObjectType.obj_AI_Minion)
                {
                    movePos = trueTarget.Position + Vector3.Normalize(me.Position -
                                                                      trueTarget.Position) * (me.Distance(trueTarget.Position) + 63);
                }

                else if (trueTarget.Type == GameObjectType.obj_AI_Hero)
                {
                    movePos = trueTarget.Position + Vector3.Normalize(me.Position -
                                                                      trueTarget.Position) * (me.Distance(trueTarget.Position) + 58);
                }

                me.IssueOrder(GameObjectOrder.MoveTo, new Vector3(movePos.X, movePos.Y, movePos.Z));
                if (trueTarget.Type == GameObjectType.obj_AI_Minion)
                {
                    Utility.DelayAction.Add(Game.Ping + 75, () => Orbwalking.LastAATick = 0);
                }
                else
                {
                    Orbwalking.LastAATick = 0;
                }
            }

            else if (packet.Header == 0xfe && packet.Size() == 0x18)
            {
                packet.Position = 1;
                if (packet.ReadInteger() == me.NetworkId)
                {
                    Orbwalking.LastAATick       = Environment.TickCount;
                    Orbwalking.LastMoveCommandT = Environment.TickCount;
                }
            }
        }
示例#10
0
文件: Program.cs 项目: ncmp/L-
        public static void Combo()
        {
            try
            {
                barrelpoints.Clear();
                var           targetfore            = TargetSelector.GetTarget(E.Range + BarrelExplosionRange, TargetSelector.DamageType.Physical);
                var           targetforq            = TargetSelector.GetTarget(Q.Range + BarrelExplosionRange, TargetSelector.DamageType.Physical);
                int           secondrequired        = 0;
                Obj_AI_Minion FindChainBarrelObject = null;
                Obj_AI_Minion meleeRangeBarrel      = null;
                Obj_AI_Minion rangedbarrel          = null;
                bool          blockQ = false;
                if (!targetfore.IsValidTarget())
                {
                    return;
                }
                foreach (var barrel in savedbarrels.Where(b => b.IsValidTarget(Q.Range)))
                {
                    if (KillableBarrel(barrel, true))
                    {
                        if (secondrequired == 0)
                        {
                            secondrequired = 2;
                        }

                        var newP = GetBarrelPoints(barrel.Position).Where(p => !p.IsWall() && player.Distance(p) < E.Range && barrel.Distance(p) < BarrelConnectionRange);
                        if (newP.Any())
                        {
                            barrelpoints.AddRange(newP);
                        }
                        foreach (var enemy1 in HeroManager.Enemies.Where(b => b.IsValidTarget(E.Range + BarrelConnectionRange)))
                        {
                            barrelpoints.AddRange(GetBarrelPoints(enemy1.ServerPosition).Where(p => !p.IsWall() && player.Distance(p) < E.Range && barrel.Distance(p) < BarrelConnectionRange));
                        }

                        if ((barrel.Distance(targetforq) < BarrelConnectionRange && E.Instance.Ammo > 0) ||
                            (barrel.Distance(targetforq) < BarrelExplosionRange))
                        {
                            blockQ         = true;
                            secondrequired = 1;
                        }


                        if (KillableBarrel(barrel))
                        {
                            if (Orbwalking.InAutoAttackRange(barrel) && HeroManager.Enemies.Count(o =>
                                                                                                  o.IsValidTarget(E.Range + BarrelConnectionRange) && o.Distance(barrel) < BarrelExplosionRange) > 0)
                            {
                                meleeRangeBarrel = barrel;
                            }



                            if (barrel.Distance(targetforq) < BarrelExplosionRange)
                            {
                                rangedbarrel = barrel;
                            }
                        }
                    }
                }

                var pos     = Prediction.GetPrediction(targetfore, 0.5f);
                var closest = barrelpoints.OrderBy(point => point.Distance(pos.UnitPosition)).ThenByDescending(point => point.CountEnemiesInRange(BarrelExplosionRange)).FirstOrDefault(point => savedbarrels.Count(b => b.Distance(point) < BarrelConnectionRange - 100) == 0);
                if (E.IsReady() && Q.IsReady() && secondrequired == 2)
                {
                    if (savedbarrels.Count(b => b.Distance(closest) <= BarrelConnectionRange) == 0)
                    {
                        return;
                    }
                    if (closest != null && pos.Hitchance > HitChance.High && closest.CountEnemiesInRange(BarrelExplosionRange) >= Config.Item("detoneateTargets").GetValue <Slider>().Value)
                    {
                        if (closest != EDelay.position)
                        {
                            EDelay.position = closest;
                            EDelay.time     = Utils.TickCount;
                            var qtarget = savedbarrels.MinOrDefault(b => b.IsValidTarget(Q.Range) && KillableBarrel(b, true) && b.Distance(closest) < BarrelConnectionRange);

                            E.Cast(closest);
                            Utility.DelayAction.Add(100, () => Q.Cast(qtarget));
                            if (Config.Item("trieplb", true).GetValue <bool>())
                            {
                                foreach (var barrel in savedbarrels)
                                {
                                    foreach (var enemy3 in ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero.IsValidTarget(E.Range + BarrelExplosionRange) && hero.Distance(barrel) > BarrelExplosionRange && hero.Distance(barrel) < BarrelConnectionRange))
                                    {
                                        Utility.DelayAction.Add(200, () => E.Cast(enemy3.ServerPosition));
                                    }
                                }
                            }
                        }
                    }
                }
                if (rangedbarrel.IsValidTarget(Q.Range) && Q.IsReady())
                {
                    Q.Cast(rangedbarrel);
                }


                if (meleeRangeBarrel.IsValidTarget() && !Q.IsReady())
                {
                    Orbwalker.ForceTarget(meleeRangeBarrel);
                }

                var closestbarrel = savedbarrels.Where(barrel => KillableBarrel(barrel) && barrel.IsValidTarget(Q.Range)).MinOrDefault(point => point.Distance(targetfore.ServerPosition));

                if (closestbarrel != null)
                {
                    FindChainBarrelObject = FindChainBarrels(closestbarrel.ServerPosition);

                    if (FindChainBarrelObject.IsValidTarget())
                    {
                        if (Q.IsReady())
                        {
                            Q.Cast(closestbarrel);
                        }
                        else if (Orbwalking.InAutoAttackRange(closestbarrel))
                        {
                            Orbwalker.ForceTarget(closestbarrel);
                        }
                    }
                }
                if (targetforq.IsValidTarget(Q.Range) &&
                    (blockQ == false || player.GetSpellDamage(targetforq, SpellSlot.Q) > targetforq.Health))
                {
                    Q.Cast(targetforq);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#11
0
        private static void Combo(Boolean harass = false)
        {
            Boolean checkTarget = true;

            if (menu.Item("focusSelectedTarget").GetValue <bool>())
            {
                if (selectedTarget.IsValidTarget())
                {
                    checkTarget = false;

                    if (dontUseQW2 > Game.ClockTime)
                    {
                        if (selectedTarget.NetworkId == dontUseQW)
                        {
                            checkTarget = true;
                        }
                    }
                }
            }

            try
            {
                if (checkTarget)
                {
                    Orbwalker.ForceTarget(GetEnemyList().Where(x => x.IsValidTarget(Orbwalking.GetRealAutoAttackRange(x))).OrderBy(x => x.Health / getEDmg(x)).FirstOrDefault());
                }
                else
                {
                    Orbwalker.ForceTarget(selectedTarget);
                }
            }
            catch (Exception ex) { }

            Boolean packetCast = menu.Item("PacketCast").GetValue <bool>();

            if (R.IsReady() && !harass)
            {
                if (menu.Item("comboR").GetValue <bool>())
                {
                    var enemyRList = GetEnemyList().Where(x => x.IsValidTarget(825) && !checkYasuoWall(x.Position) && Prediction.GetPrediction(x, R.Delay).UnitPosition.Distance(player.Position) <= 650f).OrderBy(x => x.Health / getRDmg(x)).ToList();
                    if (enemyRList.Any())
                    {
                        Obj_AI_Hero      enemyR   = enemyRList.FirstOrDefault();
                        PredictionOutput castPred = R.GetPrediction(enemyR, true, R.Range);

                        List <Obj_AI_Hero> enemiesHit = GetEnemyList().Where(x => R.WillHit(x.Position, castPred.CastPosition) && !checkYasuoWall(x.Position)).ToList();
                        int facingEnemies             = enemiesHit.Where(x => x.IsFacing(player)).Count();
                        int countList2 = GetEnemyList().Where(x => x.Distance(enemyR.Position) < 250 && !checkYasuoWall(x.Position)).Count();
                        int countList  = enemiesHit.Count();

                        if ((countList >= 2 && facingEnemies >= 1) || countList >= 3 || countList2 >= 3 || (countList == 1 && player.Level < 11))
                        {
                            Boolean ult = true;

                            if (countList == 1)
                            {
                                ult = false;
                                if (player.Level < 11)
                                {
                                    int    multipleE  = (facingEnemies == 1) ? 5 : 3;
                                    int    multipleQ  = (facingEnemies == 1) ? 2 : 1;
                                    double procHealth = (getEDmg(enemyR) * multipleE + getQDmg(enemyR) * multipleQ + getRDmg(enemyR)) / enemyR.Health;
                                    if (procHealth > 1 && procHealth < 2.5 && (enemyR.HasBuffOfType(BuffType.Poison) || Q.IsReady() || W.IsReady()) && (E.IsReady() || player.Spellbook.GetSpell(E.Slot).CooldownExpires < 1))
                                    {
                                        ult = true;
                                    }
                                }
                            }

                            if (ult)
                            {
                                R.Cast(castPred.CastPosition, packetCast);
                            }
                        }
                    }
                }
            }


            if (E.IsReady() && Environment.TickCount > legitEdelay && (!harass || menu.Item("eHarass").GetValue <bool>()))
            {
                Obj_AI_Hero mainTarget = null;

                if (checkTarget)
                {
                    List <Obj_AI_Hero> Eenemies = GetEnemyList();

                    Obj_AI_Hero eTarget  = null;
                    Obj_AI_Hero eTarget2 = null;

                    if (Eenemies.Count() > 0)
                    {
                        double minCast1 = -1;
                        double minCast2 = -1;

                        foreach (Obj_AI_Hero enemyto in Eenemies)
                        {
                            if (!enemyto.IsValidTarget(E.Range))
                            {
                                continue;
                            }
                            if (checkYasuoWall(enemyto.ServerPosition))
                            {
                                continue;
                            }

                            Boolean buffedEnemy = false;
                            if (enemyto.HasBuffOfType(BuffType.Poison))
                            {
                                var buffEndTime = GetPoisonBuffEndTime(enemyto);
                                if (buffEndTime > Game.Time + E.Delay)
                                {
                                    buffedEnemy = true;
                                }
                            }

                            if (buffedEnemy)
                            {
                                double casts = enemyto.Health / getEDmg(enemyto);
                                if (minCast1 == -1 || minCast1 > casts)
                                {
                                    minCast1 = casts;
                                    eTarget  = enemyto;
                                }
                            }
                            else if (getEDmg(enemyto) > enemyto.Health * 1.03)
                            {
                                float dist = player.Distance(enemyto.Position);
                                if (minCast2 == -1 || minCast2 < dist)
                                {
                                    minCast2 = dist;
                                    eTarget2 = enemyto;
                                }
                            }
                        }
                    }

                    mainTarget = (eTarget != null) ? eTarget : eTarget2;
                }
                else
                {
                    if (player.Distance(selectedTarget.Position) <= E.Range && ((selectedTarget.HasBuffOfType(BuffType.Poison) && GetPoisonBuffEndTime(selectedTarget) > Game.Time + E.Delay) || getEDmg(selectedTarget) > selectedTarget.Health * 1.03))
                    {
                        mainTarget = selectedTarget;
                    }
                }

                if (mainTarget != null)
                {
                    Orbwalker.ForceTarget(mainTarget);

                    if (E.Cast(mainTarget, packetCast) == Spell.CastStates.SuccessfullyCasted)
                    {
                        int castEdelay  = menu.Item("castedalay").GetValue <Slider>().Value;
                        int castEdelay2 = menu.Item("castedalay2").GetValue <Slider>().Value;
                        if (castEdelay > 0 || castEdelay2 > 0)
                        {
                            if (castEdelay2 <= castEdelay)
                            {
                                legitEdelay = Environment.TickCount + castEdelay;
                            }
                            else
                            {
                                Random rand = new Random();
                                legitEdelay = Environment.TickCount + rand.Next(castEdelay, castEdelay2);
                            }
                        }

                        if (getEDmg(mainTarget) > mainTarget.Health * 1.1)
                        {
                            dontUseQW  = mainTarget.NetworkId;
                            dontUseQW2 = Game.ClockTime + 0.6f;
                        }
                    }
                }
            }

            Obj_AI_Hero enemy = (!checkTarget) ? selectedTarget : getTarget(Q.Range);

            if (enemy != null)
            {
                if (Q.IsReady() && (!harass || menu.Item("qHarass").GetValue <bool>()))
                {
                    if (Q.CastIfHitchanceEquals(enemy, HitChance.High, packetCast))
                    {
                        castWafter = Game.Time + Q.Delay;
                        return;
                    }
                }

                if (!Q.IsReady() && castWafter < Game.Time && W.IsReady() && (!enemy.HasBuffOfType(BuffType.Poison) || !menu.Item("castWPoisoned").GetValue <bool>()) && (!harass || menu.Item("wHarass").GetValue <bool>()))
                {
                    W.CastIfHitchanceEquals(enemy, HitChance.High, packetCast);
                    return;
                }
            }
        }
示例#12
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            Orbwalker.SetOrbwalkingPoint(Vector3.Zero);

            if (Player.IsDead || Flee())
            {
                return;
            }

            KillstealQ();
            KillstealW();
            DuelistMode();
            Farm();

            if (Player.IsDashing() || Player.IsWindingUp) // || Player.Spellbook.IsCastingSpell)
            {
                return;
            }

            if (!Orbwalker.ActiveMode.IsComboMode())
            {
                return;
            }

            var aaTarget = UltTarget.Target != null && UltTarget.Target.IsValidTarget(1000)
                ? UltTarget.Target
                : LockedTargetSelector.GetTarget(FioraAutoAttackRange, TargetSelector.DamageType.Physical);

            if (aaTarget != null)
            {
                Orbwalker.ForceTarget(aaTarget);

                if (Menu.Item("OrbwalkPassive").IsActive() &&
                    Menu.Item("Orbwalk" + Orbwalker.ActiveMode.GetModeString()).IsActive())
                {
                    OrbwalkToPassive(aaTarget);
                }
            }

            var target = UltTarget.Target != null && UltTarget.Target.IsValidTarget(Q.Range)
                ? UltTarget.Target
                : LockedTargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

            //TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

            if (target == null || !target.IsValidTarget(W.Range))
            {
                return;
            }


            if (Orbwalker.ActiveMode.Equals(Orbwalking.OrbwalkingMode.Mixed) &&
                Player.ManaPercent < Menu.Item("ManaHarass").GetValue <Slider>().Value)
            {
                return;
            }

            if (R.IsActive() && Menu.Item("RMode").GetValue <StringList>().SelectedIndex.Equals(1) && ComboR(target))
            {
                return;
            }

            if (Q.IsActive())
            {
                if (target.IsValidTarget(FioraAutoAttackRange) && !Orbwalking.IsAutoAttack(Player.LastCastedSpellName()))
                {
                    return;
                }

                CastQ(target);

                /*  var path = target.GetWaypoints();
                 * if (path.Count == 1 || Player.Distance(target) < 700)
                 * {
                 *  CastQ(target);
                 *  return;
                 * }
                 *
                 * var d = target.Distance(path[1]);
                 * var d2 = Player.Distance(path[1]);
                 * var t = d / target.MoveSpeed;
                 * var dT = Q.Delay + Game.Ping / 2000f - t;
                 * if ((dT > .2f || (d2 < 690 && dT > -1)) && CastQ(target))
                 * {
                 *  //  Console.WriteLine("{0} {1}", dT, d2);
                 * }*/
            }
        }
示例#13
0
        private void Combo()
        {
            AIHeroClient target = getTarget();

            if (target == null)
            {
                return;
            }
            if (config.Item("selected").GetValue <bool>())
            {
                target = CombatHelper.SetTarget(target, LeagueSharp.Common.TargetSelector.GetSelectedTarget());
                orbwalker.ForceTarget(target);
            }
            var cmbDmg = GetComboDamage(target);

            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, cmbDmg);
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.IsReady() && Orbwalking.CanMove(100) &&
                target.IsValidTargetLS() && !justJumped)
            {
                if (Program.IsSPrediction)
                {
                    Q.SPredictionCast(target, HitChance.High);
                    return;
                }
                else
                {
                    var targQ = Q.GetPrediction(target);
                    if (Q.Range - 100 > targQ.CastPosition.Distance(player.Position) &&
                        targQ.Hitchance >= HitChance.High)
                    {
                        Q.Cast(targQ.CastPosition);
                        return;
                    }
                }
            }
            if (config.Item("usew", true).GetValue <bool>() && W.IsReady() && Orbwalking.CanMove(100) && !justJumped &&
                (cmbDmg + player.GetAutoAttackDamage(target) > target.Health || player.Mana > Q.Instance.SData.Mana * 2))
            {
                if (Program.IsSPrediction)
                {
                    W.SPredictionCast(target, HitChance.High);
                    return;
                }
                else
                {
                    var tarPered = W.GetPrediction(target);
                    if (W.Range - 80 > tarPered.CastPosition.Distance(player.Position))
                    {
                        W.CastIfHitchanceEquals(target, HitChance.High);
                        return;
                    }
                }
            }
            if (R.IsReady() && !justJumped)
            {
                var dist = player.Distance(target);
                if (config.Item("user", true).GetValue <bool>() && !justQ && !Q.CanCast(target) && !justW &&
                    !W.CanCast(target) && !CombatHelper.CheckCriticalBuffs(target) &&
                    config.Item("usermin", true).GetValue <Slider>().Value < dist && 3000 > dist &&
                    target.Health < R.GetDamage(target) * 0.7 && target.CountAlliesInRange(600) < 1)
                {
                    R.CastIfHitchanceEquals(target, HitChance.High);
                }
                if (target.CountAlliesInRange(700) > 0)
                {
                    R.CastIfWillHit(
                        target, config.Item("usertf", true).GetValue <Slider>().Value);
                }
            }
            bool canKill = cmbDmg > target.Health;

            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() &&
                ((config.Item("useekill", true).GetValue <bool>() && canKill) ||
                 (!config.Item("useekill", true).GetValue <bool>() &&
                  (target.CountEnemiesInRange(1200) <= target.CountAlliesInRange(1200) && player.Health > target.Health &&
                   LeagueSharp.Common.TargetSelector.GetPriority(target) >= 2f) || canKill)))
            {
                var bestPositons =
                    (from pos in
                     CombatHelper.PointsAroundTheTarget(target.Position, 750)
                     .Where(
                         p =>
                         !p.IsWall() && p.IsValid() && p.Distance(player.Position) < E.Range &&
                         p.Distance(target.Position) < 680 && !p.UnderTurret(true))
                     let mob =
                         ObjectManager.Get <Obj_AI_Base>()
                         .Where(
                             m =>
                             m.IsEnemy && m.IsValidTargetLS() && m.Distance(target.Position) < 750 &&
                             m.BaseSkinName != target.BaseSkinName)
                         .OrderBy(m => m.Distance(pos))
                         .FirstOrDefault()
                         where (mob != null && mob.Distance(pos) > pos.Distance(target.Position) + 80) || (mob == null)
                         select pos).ToList();

                CastE(bestPositons, target);
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() && ignitedmg > target.Health && hasIgnite &&
                !player.IsChannelingImportantSpell() && !justQ && !Q.CanCast(target) && !justW && !W.CanCast(target) &&
                !justJumped)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
        }
示例#14
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (Config.Item("disableBlock", true).GetValue <KeyBind>().Active)
            {
                Orbwalking.Attack      = true;
                Orbwalking.Move        = true;
                OktwCommon.blockSpells = false;
                OktwCommon.blockAttack = false;
                OktwCommon.blockMove   = false;
                return;
            }
            else if (Player.IsChannelingImportantSpell() || Game.Time - RCastTime < 0.3)
            {
                if (Config.Item("forceBlockMove", true).GetValue <bool>())
                {
                    OktwCommon.blockMove   = true;
                    OktwCommon.blockAttack = true;
                    OktwCommon.blockSpells = true;
                }

                Orbwalking.Attack = false;
                Orbwalking.Move   = false;

                Program.debug("cast R");
                return;
            }
            else
            {
                Orbwalking.Attack = true;
                Orbwalking.Move   = true;
                if (Config.Item("forceBlockMove", true).GetValue <bool>())
                {
                    OktwCommon.blockAttack = false;
                    OktwCommon.blockMove   = false;
                    OktwCommon.blockSpells = false;
                }
                if (R.IsReady() && Config.Item("useR", true).GetValue <KeyBind>().Active)
                {
                    var t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
                    if (t.IsValidTarget(R.Range))
                    {
                        R.Cast(t, true, true);
                        RCastTime = Game.Time;
                        return;
                    }
                }
            }

            if (Config.Item("newTarget", true).GetValue <bool>())
            {
                var orbT = Orbwalker.GetTarget();

                Obj_AI_Hero t2 = null;

                if (orbT != null && orbT is Obj_AI_Hero)
                {
                    t2 = (Obj_AI_Hero)orbT;
                }

                if (t2.IsValidTarget() && t2.NetworkId == LastAttackId)
                {
                    var ta = ObjectManager.Get <Obj_AI_Hero>().Where(enemy =>
                                                                     enemy.IsValidTarget() && Orbwalking.InAutoAttackRange(enemy) &&
                                                                     (enemy.NetworkId != LastAttackId || enemy.Health < Player.GetAutoAttackDamage(enemy) * 2)).FirstOrDefault();

                    if (ta != null)
                    {
                        Orbwalker.ForceTarget(ta);
                    }
                }
            }

            if (Program.LagFree(1))
            {
                SetMana();
                Jungle();
            }

            if (Program.LagFree(2) && !Player.IsWindingUp && Q.IsReady() && Config.Item("autoQ", true).GetValue <bool>())
            {
                LogicQ();
            }

            if (Program.LagFree(3) && !Player.IsWindingUp && E.IsReady() && Config.Item("autoE", true).GetValue <bool>())
            {
                LogicE();
            }

            if (Program.LagFree(4) && !Player.IsWindingUp && R.IsReady() && Config.Item("autoR", true).GetValue <bool>())
            {
                LogicR();
            }
        }
示例#15
0
        private void Combo()
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(E.Range, TargetSelector.DamageType.Magical);

            if (target == null)
            {
                if (maoR)
                {
                    if (!turnOff)
                    {
                        turnOff = true;
                        LeagueSharp.Common.Utility.DelayAction.Add(2600, () => turnOffUlt());
                    }
                }
                return;
            }
            if (config.Item("selected", true).GetValue <bool>())
            {
                target = CombatHelper.SetTarget(target, TargetSelector.GetSelectedTarget());
                orbwalker.ForceTarget(target);
            }
            var manaperc = player.Mana / player.MaxMana * 100;

            if (player.HasBuff("MaokaiSapMagicMelee") &&
                player.Distance(target) < Orbwalking.GetRealAutoAttackRange(target) + 75)
            {
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config, ComboDamage(target));
            }
            if (config.Item("useq", true).GetValue <bool>() && Q.CanCast(target) && !player.Spellbook.IsAutoAttacking &&
                ((config.Item("useqroot", true).GetValue <bool>() &&
                  (!target.HasBuffOfType(BuffType.Snare) && !target.HasBuffOfType(BuffType.Stun) &&
                   !target.HasBuffOfType(BuffType.Suppression))) || !config.Item("useqroot", true).GetValue <bool>()) &&
                !W.CanCast(target))
            {
                Q.Cast(target);
            }
            if (config.Item("usew", true).GetValue <bool>())
            {
                if (config.Item("blocke", true).GetValue <bool>() && player.Distance(target) < W.Range && W.IsReady() &&
                    E.CanCast(target))
                {
                    E.Cast(target);
                    CastR(target);
                    LeagueSharp.Common.Utility.DelayAction.Add(100, () => W.Cast(target));
                }
                else if (W.CanCast(target))
                {
                    CastR(target);
                    W.Cast(target);
                }
            }
            if (config.Item("usee", true).GetValue <bool>() && E.CanCast(target))
            {
                if (!config.Item("blocke", true).GetValue <bool>() ||
                    config.Item("blocke", true).GetValue <bool>() && !W.IsReady())
                {
                    E.Cast(target);
                }
            }

            if (R.IsReady())
            {
                bool enoughEnemies = config.Item("user", true).GetValue <Slider>().Value <=
                                     player.CountEnemiesInRange(R.Range - 50);
                AIHeroClient targetR = DrawHelper.GetBetterTarget(R.Range, TargetSelector.DamageType.Magical);

                if (maoR && targetR != null &&
                    ((config.Item("rks", true).GetValue <bool>() &&
                      (Damage.GetSpellDamage(player, targetR, SpellSlot.R) +
                       player.CalcDamage(target, Damage.DamageType.Magical, maoRStack)) > targetR.Health) ||
                     manaperc < config.Item("rmana", true).GetValue <Slider>().Value ||
                     (!enoughEnemies && player.Distance(targetR) > R.Range - 50)))
                {
                    R.Cast();
                }

                if (targetR != null && !maoR && manaperc > config.Item("rmana", true).GetValue <Slider>().Value&&
                    (enoughEnemies || R.IsInRange(targetR)))
                {
                    R.Cast();
                }
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite").GetValue <bool>() && ignitedmg > target.Health && hasIgnite &&
                !E.CanCast(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
        }
示例#16
0
        private void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            GamePacket packet = new GamePacket(args.PacketData);

            if (packet.Header == 0xb0)
            {
                packet.Position = 1;
                if (packet.ReadInteger() == _player.NetworkId && config.Item("blockanim").GetValue <bool>())
                {
                    args.Process = false;
                }
            }

            if (packet.Header == 0x65 && (use_combo || killsteal + extraqtime > now))
            {
                packet.Position = 16;
                int sourceId = packet.ReadInteger();

                packet.Position = 1;
                int targetId = packet.ReadInteger();
                int dmgType  = packet.ReadByte();

                var trueTarget = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(targetId);

                if (sourceId == _player.NetworkId && (dmgType == 4 || dmgType == 3) && _q.IsReady())
                {
                    _useitems(trueTarget);
                    _q.Cast(trueTarget.Position, true);
                }
            }

            if (packet.Header == 0x65 && use_clear)
            {
                packet.Position = 16;
                int sourceId = packet.ReadInteger();

                packet.Position = 1;
                int targetId = packet.ReadInteger();
                int dmgType  = packet.ReadByte();

                Obj_AI_Minion trueTarget = ObjectManager.GetUnitByNetworkId <Obj_AI_Minion>(targetId);
                if (sourceId == _player.NetworkId && (dmgType == 4 || dmgType == 3))
                {
                    if (jungleminions.Any(name => trueTarget.Name.StartsWith(name)) && _q.IsReady() &&
                        config.Item("jungleQ").GetValue <bool>())
                    {
                        _q.Cast(trueTarget.Position, true);
                    }

                    var minionList =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(x => x.Name.StartsWith("Minion") && x.IsValidTarget(800))
                        .ToList();

                    if (minionList.Any() && _q.IsReady())
                    {
                        if (!config.Item("farmQ").GetValue <bool>())
                        {
                            return;
                        }

                        foreach (var minion in minionList)
                        {
                            if (_e.IsReady() && cleavecount >= 1 && config.Item("jungleE").GetValue <bool>())
                            {
                                _e.Cast(minion.Position);
                            }

                            _q.Cast(minion.Position, true);
                            _orbwalker.ForceTarget(minion);
                        }
                    }
                }
            }

            if (packet.Header == 0x38 && packet.Size() == 9 && (use_combo || killsteal + extraqtime > now))
            {
                packet.Position = 1;
                int sourceId = packet.ReadInteger();
                if (sourceId == _player.NetworkId)
                {
                    int targetId = _orbwalker.GetTarget().NetworkId;
                    int method   = config.Item("cancelanim").GetValue <StringList>().SelectedIndex;

                    Obj_AI_Hero truetarget = ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(targetId);
                    if (_player.Distance(_orbwalker.GetTarget().Position) <= truerange + 25 && Orbwalking.Move)
                    {
                        Vector3 movePos = truetarget.Position + _player.Position -
                                          Vector3.Normalize(_player.Position) * (_player.Distance(truetarget.Position) + 57);

                        switch (method)
                        {
                        case 1:
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(movePos.X, movePos.Y, 3, _orbwalker.GetTarget().NetworkId)).Send();
                            Orbwalking.LastAATick = 0;
                            break;

                        case 0:
                            _player.IssueOrder(GameObjectOrder.MoveTo, new Vector3(movePos.X, movePos.Y, movePos.Z));
                            Orbwalking.LastAATick = 0;
                            break;

                        case 2:
                            Utility.DelayAction.Add(cc, () => _player.IssueOrder(GameObjectOrder.MoveTo, new Vector3(movePos.X, movePos.Y, movePos.Z)));
                            Utility.DelayAction.Add(dd, () => Orbwalking.LastAATick = 0);
                            break;
                        }
                    }
                }
            }

            if (packet.Header == 0x38 && packet.Size() == 9 && use_clear)
            {
                packet.Position = 1;
                int sourceId = packet.ReadInteger();
                if (sourceId == _player.NetworkId)
                {
                    int           targetId   = _orbwalker.GetTarget().NetworkId;
                    Obj_AI_Minion truetarget = ObjectManager.GetUnitByNetworkId <Obj_AI_Minion>(targetId);

                    if (_player.Distance(_orbwalker.GetTarget().Position) <= truerange + 25 && Orbwalking.Move)
                    {
                        Vector3 movePos = truetarget.Position + _player.Position -
                                          Vector3.Normalize(_player.Position) * (_player.Distance(truetarget.Position) + 63);

                        if (jungleminions.Any(name => truetarget.Name.StartsWith(name)))
                        {
                            Utility.DelayAction.Add(cc, () => _player.IssueOrder(GameObjectOrder.MoveTo, new Vector3(movePos.X, movePos.Y, movePos.Z)));
                            Utility.DelayAction.Add(dd, () => Orbwalking.LastAATick = 0);
                        }

                        if (jungleminions.Any(name => truetarget.Name.StartsWith("Minion")))
                        {
                            Utility.DelayAction.Add(cc, () => _player.IssueOrder(GameObjectOrder.MoveTo, new Vector3(movePos.X, movePos.Y, movePos.Z)));
                            Utility.DelayAction.Add(dd, () => Orbwalking.LastAATick = 0);
                        }
                    }
                }
            }

            if (packet.Header == 0xfe && packet.Size() == 24)
            {
                packet.Position = 1;
                if (packet.ReadInteger() == _player.NetworkId)
                {
                    Orbwalking.LastAATick       = Environment.TickCount;
                    Orbwalking.LastMoveCommandT = Environment.TickCount;
                }
            }
        }
示例#17
0
        //Lane
        private static void Lane()
        {
            if ((Player.ManaPercent < Menu.Item("laneclearEMinimumMana").GetValue <Slider>().Value) ||
                (Player.ManaPercent < Menu.Item("laneclearQMinimumMana").GetValue <Slider>().Value) ||
                (Player.ManaPercent < Menu.Item("laneclearWMinimumMana").GetValue <Slider>().Value))
            {
                return;
            }

            var infectedminion =
                MinionManager.GetMinions(Player.Position, E.Range)
                .Find(x => x.HasBuff("malzahare") && x.IsValidTarget(E.Range));
            //var allMinions = Cache.GetMinions(ObjectManager.Player.ServerPosition, E.Range, MinionTeam.Enemy);
            //var allMinionsW = Cache.GetMinions(ObjectManager.Player.ServerPosition, 450f, MinionTeam.Enemy);
            var allMinions  = MinionManager.GetMinions(E.Range, MinionTypes.All, MinionTeam.Enemy);
            var allMinionsW = MinionManager.GetMinions(450f, MinionTypes.All, MinionTeam.Enemy);

            if (allMinionsW.Count > 1)
            {
                if (infectedminion != null) // Replaced Sebby with Common
                {
                    Orbwalker.ForceTarget(infectedminion);
                }
                else
                {
                    Orbwalker.ForceTarget(null);
                }
            }
            if (allMinions.Count > Menu.Item("LaneClearEMinMinions").GetValue <Slider>().Value)
            {
                if (Menu.Item("laneclearE").GetValue <bool>() && E.IsReady())
                {
                    foreach (var minion in allMinions)
                    {
                        if (minion.IsValidTarget() && !minion.HasBuff("malzahare") &&
                            (minion.Health < E.GetDamage(minion)))
                        {
                            E.CastOnUnit(minion);
                        }
                    }
                }
            }
            if (Menu.Item("laneclearW").GetValue <bool>() && W.IsReady())
            {
                foreach (var minion in allMinionsW)
                {
                    if (minion.IsValidTarget())
                    {
                        W.Cast(minion);
                    }
                }
            }
            if (Menu.Item("laneclearQ").GetValue <bool>() && Q.IsReady())
            {
                var allMinionsQ = MinionManager.GetMinions(Player.ServerPosition, Q.Range);
                var farmPos     = Q.GetCircularFarmLocation(allMinionsQ, 150);
                if (farmPos.MinionsHit > Menu.Item("LaneClearMinions").GetValue <Slider>().Value)
                {
                    Q.Cast(farmPos.Position);
                }
            }
        }