コード例 #1
0
        private static void OnLaneClear()
        {
            var count =
                EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.ServerPosition,
                                                                Player.AttackRange, false).Count();
            var tawah  = EntityManager.Turrets.Enemies.FirstOrDefault(t => !t.IsDead && t.IsInRange(Player, 800));
            var source =
                EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.ServerPosition,
                                                                Player.AttackRange).OrderByDescending(a => a.MaxHealth).FirstOrDefault();
            var sourceE =
                EntityManager.MinionsAndMonsters.GetLaneMinions()
                .FirstOrDefault(m => m.IsValidTarget(Player.AttackRange) && m.GetBuffCount("tristanaecharge") > 0);

            if (count == 0)
            {
                return;
            }
            if (E.IsReady() && TristanaMenu.LcE() && source.IsValidTarget(E.Range) &&
                Player.ManaPercent >= TristanaMenu.LcM())
            {
                E.Cast(source);
                Orbwalker.ForcedTarget = sourceE;
            }
            if (Q.IsReady() && TristanaMenu.LcQ() && source.IsValidTarget(Q.Range) &&
                Player.ManaPercent >= TristanaMenu.LcM())
            {
                Q.Cast();
            }
            if (W.IsReady() && TristanaMenu.LcW() && TristanaMenu.LcW1() <= count &&
                Player.ManaPercent >= TristanaMenu.LcM())
            {
                if (source != null)
                {
                    W.Cast(source.Position);
                }
            }
            if (tawah == null)
            {
                return;
            }
            if (TristanaMenu.LcE1() && tawah.IsInRange(Player, E.Range) && E.IsReady() &&
                Player.ManaPercent >= TristanaMenu.LcM())
            {
                E.Cast(tawah);
                Q.Cast();
            }

            if (TristanaMenu.LcQ() && tawah.IsInRange(Player, Q.Range) && Q.IsReady() &&
                Player.ManaPercent >= TristanaMenu.LcM())
            {
                Q.Cast();
            }
        }