Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
        internal static void EQWLogic(Obj_AI_Hero target, bool useQ, bool useW, bool useE)
        {
            if (target == null || !target.IsValidTarget())
            {
                target = TargetSelector.GetTarget(MyLogic.E.Range + 300f);
            }

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

            if (useE && MyLogic.E.Ready && target.IsValidTarget(MyLogic.E.Range + 300f))
            {
                var ePos = GetEPosition(target);

                if (ePos != Vector3.Zero && ePos.DistanceToPlayer() <= MyLogic.E.Range && CanCastE(ePos, target))
                {
                    if (MyLogic.MiscMenu["FlowersKatarina.MiscMenu.EHumanizer"].As <MenuSliderBool>().Enabled)
                    {
                        MyDelayAction.Queue(
                            MyLogic.MiscMenu["FlowersKatarina.MiscMenu.EHumanizer"].As <MenuSliderBool>().Value,
                            () => MyLogic.E.Cast(ePos));
                    }
                    else
                    {
                        MyLogic.E.Cast(ePos);
                    }
                }
            }

            if (useQ && MyLogic.Q.Ready && target.IsValidTarget(MyLogic.Q.Range) && !MyLogic.E.Ready)
            {
                if (target.IsValidTarget(MyLogic.Q.Range))
                {
                    if (!(MyLogic.W.Ready && MyLogic.E.Ready) && target.DistanceToPlayer() <= 300 ||
                        !target.IsFacingUnit(ObjectManager.GetLocalPlayer()) && target.DistanceToPlayer() > 300)
                    {
                        MyLogic.Q.CastOnUnit(target);
                    }
                }
                else if (target.IsValidTarget(MyLogic.E.Range) &&
                         (MyLogic.Orbwalker.Mode == OrbwalkingMode.Combo &&
                          MyLogic.ComboMenu["FlowersKatarina.ComboMenu.QOnMinion"].Enabled ||
                          MyLogic.Orbwalker.Mode == OrbwalkingMode.Mixed &&
                          MyLogic.HarassMenu["FlowersKatarina.HarassMenu.QOnMinion"].Enabled))
                {
                    var extraDagger = target.ServerPosition.Extend(ObjectManager.GetLocalPlayer().ServerPosition, 350f);
                    var min         = ObjectManager.Get <Obj_AI_Base>().Aggregate((x, y) => x.Distance(extraDagger) < y.Distance(extraDagger) ? x : y);

                    if (min.Distance(extraDagger) < 130)
                    {
                        MyLogic.Q.CastOnUnit(min);
                    }
                }
            }

            if (useW && MyLogic.W.Ready && target.IsValidTarget(MyLogic.W.Range))
            {
                MyLogic.W.Cast();
            }
        }