コード例 #1
0
ファイル: JungleClear.cs プロジェクト: waldow90/PortAIO
        internal static void Init()
        {
            if (SpellManager.isCastingUlt || !ManaManager.SpellFarm)
            {
                return;
            }

            var mobs = MinionManager.GetMinions(Me.Position, Q.Range, MinionTypes.All, MinionTeam.Neutral,
                                                MinionOrderTypes.MaxHealth);

            if (mobs.Any())
            {
                var mob = mobs.FirstOrDefault();

                if (mob != null && mob.IsValidTarget(Q.Range))
                {
                    if (Menu.GetBool("JungleClearQ") && Q.IsReady() && mob.IsValidTarget(Q.Range))
                    {
                        Q.CastOnUnit(mob, true);
                    }

                    if (Menu.GetBool("JungleClearW") && W.IsReady() && mob.IsValidTarget(W.Range))
                    {
                        W.Cast();
                    }

                    if (Menu.GetBool("JungleClearE") && E.IsReady())
                    {
                        if (Daggers.Any(
                                x =>
                                mobs.Any(a => a.Distance(x.Position) <= SpellManager.PassiveRange) &&
                                x.Position.DistanceToPlayer() <= E.Range))
                        {
                            foreach (
                                var obj in
                                Daggers.Where(x => x.Position.Distance(mob.Position) <= SpellManager.PassiveRange)
                                .OrderByDescending(x => x.Position.Distance(mob.Position)))
                            {
                                if (obj.Dagger != null && obj.Dagger.IsValid && obj.Position.DistanceToPlayer() <= E.Range)
                                {
                                    E.Cast(obj.Position, true);
                                }
                            }
                        }
                        else if (mob.DistanceToPlayer() <= E.Range + 130)
                        {
                            var pos = Me.Position.Extend(mob.Position, mob.DistanceToPlayer() + 130);

                            E.Cast(pos, true);
                        }
                        else if (mob.IsValidTarget(E.Range))
                        {
                            E.Cast(mob, true);
                        }
                    }
                }
            }
        }
コード例 #2
0
        private static void OnRender()
        {
            try
            {
                if (Me.IsDead || MenuGUI.IsChatOpen() || MenuGUI.IsShopOpen())
                {
                    return;
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.Dagger"].Enabled)
                {
                    foreach (var position in Daggers.Where(x => !x.obj.IsDead && x.obj.IsValid).Select(x => x.pos))
                    {
                        if (position != Vector3.Zero)
                        {
                            Render.Circle(position, PassiveRange, 30, Color.FromArgb(69, 0, 255));
                        }
                    }
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.Q"].Enabled && Q.Ready)
                {
                    Render.Circle(Me.Position, Q.Range, 23, Color.FromArgb(251, 0, 133));
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.E"].Enabled && E.Ready)
                {
                    Render.Circle(Me.Position, E.Range, 23, Color.FromArgb(0, 136, 255));
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.R"].Enabled && R.Ready)
                {
                    Render.Circle(Me.Position, R.Range, 23, Color.FromArgb(0, 255, 161));
                }

                Vector2 MePos = Vector2.Zero;
                Render.WorldToScreen(ObjectManager.GetLocalPlayer().ServerPosition, out MePos);

                if (DrawMenu["FlowersKatarina.DrawMenu.ComboE"].Enabled)
                {
                    Render.Text(MePos.X - 57, MePos.Y + 68, Color.Orange,
                                "Only E KillAble(" + ComboMenu["FlowersKatarina.ComboMenu.EKillAble"].As <MenuKeyBind>().Key + "): " +
                                (ComboMenu["FlowersKatarina.ComboMenu.EKillAble"].As <MenuKeyBind>().Enabled ? "On" : "Off"));
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.ComboMode"].Enabled)
                {
                    Render.Text(MePos.X - 57, MePos.Y + 88, Color.Orange,
                                "Combo Mode(" + ComboMenu["FlowersKatarina.ComboMenu.SwitchMode"].As <MenuKeyBind>().Key + "): " +
                                ComboMenu["FlowersKatarina.ComboMenu.Mode"].As <MenuList>().SelectedItem);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventManager.OnRender." + ex);
            }
        }
コード例 #3
0
ファイル: SpellManager.cs プロジェクト: Dekryptor/Port-1
        internal static Vector3 GetEPosition(AIHeroClient target)
        {
            if (Daggers.Any(
                    x =>
                    HeroManager.Enemies.Any(a => a.Distance(x.Position) <= PassiveRange) &&
                    x.Position.DistanceToPlayer() <= E.Range))
            {
                foreach (
                    var obj in
                    Daggers.Where(x => x.Position.Distance(target.Position) <= PassiveRange)
                    .OrderByDescending(x => x.Position.Distance(target.Position)))
                {
                    if (obj.Dagger != null && obj.Dagger.IsValid && obj.Position.DistanceToPlayer() <= E.Range)
                    {
                        return(obj.Position);
                    }
                }
            }
            else if (
                Daggers.Any(
                    x =>
                    HeroManager.Enemies.Any(a => a.Distance(x.Position) <= E.Range) &&
                    x.Position.DistanceToPlayer() <= E.Range))
            {
                foreach (
                    var obj in
                    Daggers.Where(x => x.Position.Distance(target.Position) <= E.Range)
                    .OrderBy(x => x.Position.Distance(target.Position)))
                {
                    if (obj.Dagger != null && obj.Dagger.IsValid && obj.Position.DistanceToPlayer() <= E.Range)
                    {
                        return(obj.Position);
                    }
                }
            }
            else if (target.DistanceToPlayer() <= E.Range - 130)
            {
                return(Me.Position.Extend(target.Position, target.DistanceToPlayer() + 130));
            }
            else if (target.IsValidTarget(E.Range))
            {
                return(target.Position);
            }
            else
            {
                return(Vector3.Zero);
            }

            return(Vector3.Zero);
        }
コード例 #4
0
        private static void OnRender()
        {
            try
            {
                if (Me.IsDead || MenuGUI.IsChatOpen || MenuGUI.IsShopOpen)
                {
                    return;
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.Dagger"].GetValue <MenuBool>().Enabled)
                {
                    foreach (var position in Daggers.Where(x => !x.Dagger.IsDead && x.Dagger.IsValid).Select(x => x.Position))
                    {
                        if (position != Vector3.Zero)
                        {
                            Render.Circle.DrawCircle(position, PassiveRange, Color.FromArgb(69, 0, 255), 1);
                        }
                    }
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.Q"].GetValue <MenuBool>().Enabled&& Q.IsReady())
                {
                    Render.Circle.DrawCircle(Me.Position, Q.Range, Color.FromArgb(251, 0, 133), 1);
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.E"].GetValue <MenuBool>().Enabled&& E.IsReady())
                {
                    Render.Circle.DrawCircle(Me.Position, E.Range, Color.FromArgb(0, 136, 255), 1);
                }

                if (DrawMenu["FlowersKatarina.DrawMenu.R"].GetValue <MenuBool>().Enabled&& R.IsReady())
                {
                    Render.Circle.DrawCircle(Me.Position, R.Range, Color.FromArgb(0, 255, 161), 1);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventManager.OnRender." + ex);
            }
        }
コード例 #5
0
        private static void JungleClearEvent()
        {
            try
            {
                if (isCastingUlt)
                {
                    return;
                }

                var mobs = GameObjects.EnemyMinions.Where(x => x.IsValidTarget(Q.Range) && x.IsMob()).ToArray();

                if (mobs.Any())
                {
                    var mob = mobs.FirstOrDefault();

                    if (mob != null && mob.IsValidTarget(Q.Range))
                    {
                        if (ClearMenu["FlowersKatarina.ClearMenu.JungleClearQ"].Enabled && Q.Ready && mob.IsValidTarget(Q.Range))
                        {
                            Q.CastOnUnit(mob);
                        }

                        if (ClearMenu["FlowersKatarina.ClearMenu.JungleClearW"].Enabled && W.Ready && mob.IsValidTarget(W.Range))
                        {
                            W.Cast();
                        }

                        if (ClearMenu["FlowersKatarina.ClearMenu.JungleClearE"].Enabled && E.Ready)
                        {
                            if (Daggers.Any(
                                    x =>
                                    mobs.Any(a => a.Distance(x.pos) <= PassiveRange) &&
                                    x.pos.DistanceToPlayer() <= E.Range))
                            {
                                foreach (
                                    var obj in
                                    Daggers.Where(x => x.pos.Distance(mob.Position) <= PassiveRange)
                                    .OrderByDescending(x => x.pos.Distance(mob.Position)))
                                {
                                    if (obj.obj != null && obj.obj.IsValid && obj.pos.DistanceToPlayer() <= E.Range)
                                    {
                                        E.Cast(obj.pos);
                                    }
                                }
                            }
                            else if (mob.DistanceToPlayer() <= E.Range + 130)
                            {
                                var pos = Me.Position.Extend(mob.Position, mob.DistanceToPlayer() + 130);

                                E.Cast(pos);
                            }
                            else if (mob.IsValidTarget(E.Range))
                            {
                                E.Cast(mob);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventManager.JungleClearEvent." + ex);
            }
        }
コード例 #6
0
        private static void KillStealEvent()
        {
            try
            {
                if (isCastingUlt && !KillStealMenu["FlowersKatarina.KillStealMenu.CancelR"].Enabled)
                {
                    return;
                }

                if (Me.CountEnemyHeroesInRange(E.Range) == 0)
                {
                    return;
                }

                foreach (
                    var target in
                    GameObjects.EnemyHeroes.Where(x => !x.IsDead && x.IsValidTarget(E.Range + 300))
                    .OrderBy(x => x.Health))
                {
                    if (target.IsValidTarget(E.Range + 300))
                    {
                        if (KillStealMenu["FlowersKatarina.KillStealMenu.Q"].Enabled && target.Health < Q.GetDamage(target) && Q.Ready &&
                            target.IsValidTarget(Q.Range))
                        {
                            if (isCastingUlt)
                            {
                                MyExtraManager.CancelUlt(true);
                                Q.CastOnUnit(target);
                                return;
                            }
                            Q.CastOnUnit(target);
                            return;
                        }

                        if (KillStealMenu["FlowersKatarina.KillStealMenu.E"].Enabled && target.Health < E.GetDamage(target) && E.Ready)
                        {
                            if (target.DistanceToPlayer() <= E.Range + 130)
                            {
                                var pos = Me.Position.Extend(target.Position, target.DistanceToPlayer() + 130);
                                if (isCastingUlt)
                                {
                                    MyExtraManager.CancelUlt(true);
                                    E.Cast(pos);
                                    return;
                                }
                                E.Cast(pos);
                                return;
                            }

                            if (target.IsValidTarget(E.Range))
                            {
                                if (isCastingUlt)
                                {
                                    MyExtraManager.CancelUlt(true);
                                    E.Cast(target);
                                    return;
                                }
                                E.Cast(target);
                                return;
                            }
                        }

                        if (KillStealMenu["FlowersKatarina.KillStealMenu.Q"].Enabled && target.Health < Q.GetDamage(target) + E.GetDamage(target) &&
                            KillStealMenu["FlowersKatarina.KillStealMenu.E"].Enabled && Q.Ready && E.Ready &&
                            target.IsValidTarget(E.Range))
                        {
                            if (isCastingUlt)
                            {
                                MyExtraManager.CancelUlt(true);
                                Q.CastOnUnit(target);
                                E.Cast(target);
                                return;
                            }
                            Q.CastOnUnit(target);
                            E.Cast(target);
                            return;
                        }

                        if (target.Health < MyExtraManager.GetKataPassiveDamage(target) + E.GetDamage(target) &&
                            KillStealMenu["FlowersKatarina.KillStealMenu.E"].Enabled && E.Ready &&
                            Daggers.Any(
                                x =>
                                x.obj.IsValid &&
                                x.pos.Distance(target.Position) <= PassiveRange &&
                                x.pos.DistanceToPlayer() <= E.Range))
                        {
                            foreach (
                                var obj in
                                Daggers.Where(x => x.pos.Distance(target.Position) <= PassiveRange)
                                .OrderBy(x => x.pos.Distance(target.Position)))
                            {
                                if (obj.obj != null && obj.obj.IsValid && obj.pos.DistanceToPlayer() <= E.Range)
                                {
                                    if (isCastingUlt)
                                    {
                                        MyExtraManager.CancelUlt(true);
                                        E.Cast(obj.pos);
                                        MyDelayAction.Queue(100 + Game.Ping, () => E.Cast(target));
                                        return;
                                    }
                                    E.Cast(obj.pos);
                                    MyDelayAction.Queue(100 + Game.Ping, () => E.Cast(target));
                                    return;
                                }
                            }
                        }

                        if (target.Health < R.GetDamage(target) * 0.6 && KillStealMenu["FlowersKatarina.KillStealMenu.R"].Enabled &&
                            R.Ready && target.IsValidTarget(R.Range) && target.Health > 50 * target.Level)
                        {
                            R.Cast();
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventManager.KillStealEvent." + ex);
            }
        }
コード例 #7
0
ファイル: SpellManager.cs プロジェクト: waldow90/PortAIO
        internal static void EQWLogic(bool useQ, bool useW, bool useE)
        {
            var target = TargetSelector.GetTarget(E.Range + 300f, TargetSelector.DamageType.Magical);

            if (target.Check(E.Range + 300f))
            {
                if (useE && E.IsReady() && target.IsValidTarget(E.Range + 300f))
                {
                    if (Daggers.Any(
                            x =>
                            HeroManager.Enemies.Any(a => a.Distance(x.Position) <= PassiveRange) &&
                            x.Position.DistanceToPlayer() <= E.Range))
                    {
                        foreach (
                            var obj in
                            Daggers.Where(x => x.Position.Distance(target.Position) <= PassiveRange)
                            .OrderByDescending(x => x.Position.Distance(target.Position)))
                        {
                            if (obj.Dagger != null && obj.Dagger.IsValid && obj.Position.DistanceToPlayer() <= E.Range)
                            {
                                E.Cast(obj.Position, true);
                            }
                        }
                    }
                    else if (
                        Daggers.Any(
                            x =>
                            HeroManager.Enemies.Any(a => a.Distance(x.Position) <= E.Range) &&
                            x.Position.DistanceToPlayer() <= E.Range))
                    {
                        foreach (
                            var obj in
                            Daggers.Where(x => x.Position.Distance(target.Position) <= E.Range)
                            .OrderBy(x => x.Position.Distance(target.Position)))
                        {
                            if (obj.Dagger != null && obj.Dagger.IsValid && obj.Position.DistanceToPlayer() <= E.Range)
                            {
                                E.Cast(obj.Position, true);
                            }
                        }
                    }
                    else if (target.DistanceToPlayer() <= E.Range + 130)
                    {
                        var pos = Me.Position.Extend(target.Position, target.DistanceToPlayer() + 130);

                        E.Cast(pos, true);
                    }
                    else if (target.IsValidTarget(E.Range))
                    {
                        E.Cast(target, true);
                    }
                }

                if (useQ && Q.IsReady() && target.IsValidTarget(Q.Range) && !E.IsReady())
                {
                    Q.CastOnUnit(target, true);
                }

                if (useW && W.IsReady() && target.IsValidTarget(W.Range))
                {
                    W.Cast();
                }
            }
        }
コード例 #8
0
        internal static void Init()
        {
            if (SpellManager.isCastingUlt && !Menu.GetBool("KillStealCancel"))
            {
                return;
            }

            foreach (
                var target in
                HeroManager.Enemies.Where(x => !x.IsDead && !x.IsZombie && x.IsValidTarget(E.Range + 300))
                .OrderBy(x => x.Health))
            {
                if (target.Check(E.Range + 300))
                {
                    if (target.Health < DamageCalculate.GetQDamage(target) && Menu.GetBool("KillStealQ") && Q.IsReady() &&
                        target.IsValidTarget(Q.Range))
                    {
                        if (SpellManager.isCastingUlt)
                        {
                            SpellManager.CancelUlt(true);
                            Q.CastOnUnit(target, true);
                            return;
                        }
                        Q.CastOnUnit(target, true);
                        return;
                    }

                    if (target.Health < DamageCalculate.GetEDamage(target) && Menu.GetBool("KillStealE") && E.IsReady())
                    {
                        if (target.DistanceToPlayer() <= E.Range + 130)
                        {
                            var pos = Me.Position.Extend(target.Position, target.DistanceToPlayer() + 130);
                            if (SpellManager.isCastingUlt)
                            {
                                SpellManager.CancelUlt(true);
                                E.Cast(pos, true);
                                return;
                            }
                            E.Cast(pos, true);
                            return;
                        }

                        if (target.IsValidTarget(E.Range))
                        {
                            if (SpellManager.isCastingUlt)
                            {
                                SpellManager.CancelUlt(true);
                                E.Cast(target, true);
                                return;
                            }
                            E.Cast(target, true);
                            return;
                        }
                    }

                    if (target.Health < DamageCalculate.GetQDamage(target) + DamageCalculate.GetEDamage(target) &&
                        Menu.GetBool("KillStealQ") && Menu.GetBool("KillStealE") && Q.IsReady() && E.IsReady() &&
                        target.IsValidTarget(E.Range))
                    {
                        if (SpellManager.isCastingUlt)
                        {
                            SpellManager.CancelUlt(true);
                            Q.CastOnUnit(target, true);
                            E.Cast(target, true);
                            return;
                        }
                        Q.CastOnUnit(target, true);
                        E.Cast(target, true);
                        return;
                    }

                    if (target.Health < DamageCalculate.GetPassiveDamage(target) + DamageCalculate.GetEDamage(target) &&
                        Menu.GetBool("KillStealE") && E.IsReady() &&
                        Daggers.Any(
                            x =>
                            x.Dagger.IsValid &&
                            x.Position.Distance(target.Position) <= SpellManager.PassiveRange &&
                            x.Position.DistanceToPlayer() <= E.Range))
                    {
                        foreach (
                            var obj in
                            Daggers.Where(x => x.Position.Distance(target.Position) <= SpellManager.PassiveRange)
                            .OrderBy(x => x.Position.Distance(target.Position)))
                        {
                            if (obj.Dagger != null && obj.Dagger.IsValid && obj.Position.DistanceToPlayer() <= E.Range)
                            {
                                if (SpellManager.isCastingUlt)
                                {
                                    SpellManager.CancelUlt(true);
                                    E.Cast(obj.Position, true);
                                    LeagueSharp.Common.Utility.DelayAction.Add(100 + Game.Ping, () => E.Cast(target, true));
                                    return;
                                }
                                E.Cast(obj.Position, true);
                                LeagueSharp.Common.Utility.DelayAction.Add(100 + Game.Ping, () => E.Cast(target, true));
                                return;
                            }
                        }
                    }
                }
            }
        }