Beispiel #1
0
        private void AntiGapcloser_OnGapcloser(AIHeroClient sender, AntiGapcloser.GapcloserArgs args)
        {
            if (!OktwCommon.CheckGapcloser(sender, args))
            {
                return;
            }

            if (dashSpell.IsReady() && egcChampions.Any(e => e.Enabled && e.Name == "egcChampion" + sender.CharacterName))
            {
                switch (gapcloserMode.Index)
                {
                case 0:
                {
                    var bestPoint = Player.Position.Extend(Game.CursorPos, dashSpell.Range);

                    if (IsGoodPosition(bestPoint))
                    {
                        dashSpell.Cast(bestPoint);
                    }

                    break;
                }

                case 1:
                {
                    var points    = OktwCommon.CirclePoints(10, dashSpell.Range, Player.Position);
                    var bestPoint = Player.Position.Extend(sender.Position, -dashSpell.Range);
                    var enemies   = bestPoint.CountEnemyHeroesInRange(dashSpell.Range);

                    foreach (var point in points)
                    {
                        var count = point.CountEnemyHeroesInRange(dashSpell.Range);

                        if (count < enemies)
                        {
                            bestPoint = point;
                            enemies   = count;
                        }
                        else if (count == enemies && Game.CursorPos.Distance(point) < Game.CursorPos.Distance(bestPoint))
                        {
                            bestPoint = point;
                            enemies   = count;
                        }
                    }

                    if (IsGoodPosition(bestPoint))
                    {
                        dashSpell.Cast(bestPoint);
                    }

                    break;
                }
                }
            }
        }
Beispiel #2
0
        private void AntiGapcloser_OnGapcloser(AIHeroClient sender, AntiGapcloser.GapcloserArgs args)
        {
            if (!OktwCommon.CheckGapcloser(sender, args))
            {
                return;
            }

            if (Player.Mana > EMANA + RMANA)
            {
                if (sender.IsValidTarget(E.Range))
                {
                    if (agcW.Enabled && W.IsReady())
                    {
                        W.Cast(args.EndPosition);
                    }
                }
            }
        }