Exemplo n.º 1
0
        public static void CastEQ()
        {
            var eTarget = TargetSelector.GetTarget(Q.Range * 2, TargetSelector.DamageType.Magical);

            if (eTarget == null)
            {
                return;
            }

            if (!Q.IsReady() || !E.IsReady())
            {
                return;
            }

            var useQ       = Config.Item("UseQCombo").GetValue <bool>();
            var useW       = Config.Item("UseWCombo").GetValue <bool>();
            var useE       = Config.Item("UseECombo").GetValue <bool>();
            var useR       = Config.Item("UseRCombo").GetValue <bool>();
            var packetCast = Config.Item("PacketCast").GetValue <bool>();

            var enemyList = DevHelper.GetEnemyList()
                            .Where(x => eTarget.NetworkId != x.NetworkId && Player.Distance(x) < E.Range && x.Distance(eTarget) < Q.Range).ToList();

            if (enemyList.Any())
            {
                var unit = enemyList.First();
                E.CastOnUnit(unit, packetCast);
                // Wait for ProcessGainBuff
                if (mustDebug)
                {
                    Game.PrintChat("CastEQ -> E Enemy");
                }
            }

            var allyList = DevHelper.GetAllyList()
                           .Where(x => !x.IsMe && Player.Distance(x) < E.Range && x.Distance(eTarget) < Q.Range).ToList();

            if (allyList.Any())
            {
                var unit = allyList.First();
                E.CastOnUnit(unit, packetCast);
                // Wait for ProcessGainBuff
                if (mustDebug)
                {
                    Game.PrintChat("CastEQ -> E Ally");
                }
            }

            var minionList = MinionManager.GetMinions(Player.Position, E.Range, MinionTypes.All, MinionTeam.All, MinionOrderTypes.Health)
                             .Where(x => DevHelper.GetRealDistance(x, eTarget) < Q.Range).OrderByDescending(x => x.Health).ToList();

            if (minionList.Any())
            {
                var unit = minionList.First();
                E.CastOnUnit(unit, packetCast);
                // Wait for ProcessGainBuff
                if (mustDebug)
                {
                    Game.PrintChat("CastEQ -> E Minion");
                }
            }
        }