Exemplo n.º 1
0
    public void draw_circle_on_minimap(SharpDX.Vector3 center, float radius, System.Drawing.Color color, float thickness, int quality)
    {
        Geometry.Polygon result = new Geometry.Polygon();

        result.Add(new SharpDX.Vector3(0, 0, 0));
        result.Add(new SharpDX.Vector3(0, 14800, 0));
        result.Add(new SharpDX.Vector3(14800, 14800, 0));
        result.Add(new SharpDX.Vector3(14800, 0, 0));

        List <SharpDX.Vector3> points = new List <SharpDX.Vector3>();

        for (var i = 1; i <= quality; ++i)
        {
            var angle = i * 2 * Math.PI / quality;
            points.Add(new SharpDX.Vector3(center.X + radius * (float)(Math.Cos(angle)), center.Y + radius * (float)(Math.Sin(angle)), 0));
        }

        for (var i = 0; i < points.Count; ++i)
        {
            var start = points[i];
            var end   = points[points.Count - 1 == i ? 0 : i + 1];
            if (!result.IsInside(start) && !result.IsInside(end))
            {
                continue;
            }

            DrawingInternal.AddLineOnScreen(Drawing.WorldToMinimap(start).To3D(), Drawing.WorldToMinimap(end).To3D(), color, thickness);
        }
    }
Exemplo n.º 2
0
        private IEnumerable <NavMeshCell> CellsAnalyze(Vector2 pos, Geometry.Polygon poly) // Credits to Hellsing
        {
            var sourceGrid = pos.ToNavMeshCell();
            var GridSize   = 50f;
            var startPos   = new NavMeshCell(sourceGrid.GridX - (short)Math.Floor(GridSize / 2f), sourceGrid.GridY - (short)Math.Floor(GridSize / 2f));

            var cells = new List <NavMeshCell> {
                startPos
            };

            for (var y = startPos.GridY; y < startPos.GridY + GridSize; y++)
            {
                for (var x = startPos.GridX; x < startPos.GridX + GridSize; x++)
                {
                    if (x == startPos.GridX && y == startPos.GridY)
                    {
                        continue;
                    }
                    if (x == sourceGrid.GridX && y == sourceGrid.GridY)
                    {
                        cells.Add(sourceGrid);
                    }
                    else
                    {
                        cells.Add(new NavMeshCell(x, y));
                    }
                }
            }

            return(cells.Where(c => poly.IsInside(c.WorldPosition) && (c.WorldPosition.IsBuilding() || c.WorldPosition.IsWall())));
        }
Exemplo n.º 3
0
        public static int GetUltimateHits()
        {
            int maxHitCount = 0;

            for (int i = 0; i < 360; i += 20)
            {
                var endVec            = PointOnCircle(i);
                Geometry.Polygon Cone = CreateUltimateCone(endVec);

                int currentHits = EntityManager.Heroes.Enemies.Where(x => x.IsValid && !x.IsDead && !x.IsZombie).Count(
                    x =>
                {
                    var pred = Prediction.Position.PredictUnitPosition(x, (int)(Spells.R2.CastDelay + x.Distance(Player.Instance) /
                                                                                Spells.R2.Speed * 1000));
                    bool inside = Cone.IsInside(pred);

                    return(inside);
                });

                if (currentHits > maxHitCount)
                {
                    maxHitCount = currentHits;
                }
            }
            return(maxHitCount);
        }
Exemplo n.º 4
0
 private void OnMinionCreated(Obj_AI_Minion minion)
 {
     try
     {
         if (minion.IsValid && !minion.IsDead)
         {
             if (_midRegion.IsInside(minion))
             {
                 if (minion.Team == GameObjectTeam.Chaos)
                 {
                     _midChaosMinions.Add(minion);
                 }
                 else if (minion.Team == GameObjectTeam.Order)
                 {
                     _midOrderMinions.Add(minion);
                 }
             }
             else if (_topRegion.IsInside(minion))
             {
                 if (minion.Team == GameObjectTeam.Chaos)
                 {
                     _topChaosMinions.Add(minion);
                 }
                 else if (minion.Team == GameObjectTeam.Order)
                 {
                     _topOrderMinions.Add(minion);
                 }
             }
             else if (_botRegion.IsInside(minion))
             {
                 if (minion.Team == GameObjectTeam.Chaos)
                 {
                     _botChaosMinions.Add(minion);
                 }
                 else if (minion.Team == GameObjectTeam.Order)
                 {
                     _botOrderMinions.Add(minion);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// returns if main target gets hit by Q
        /// </summary>
        /// <param name="mainvec"></param>
        /// <param name="poly"></param>
        /// <param name="poly2"></param>
        /// <returns></returns>
        bool isMainVectorInPolygon(Vector2 mainvec, Geometry.Polygon poly, Geometry.Polygon poly2)
        {
            float maxAllowedDist = config.predictionMenu.Get <Slider>("qTargetPredictionQuality").CurrentValue;

            if (poly.IsInside(mainvec))
            {
                float dist = GetDistanceToPolygonEdge(mainvec, poly);
                if (dist <= maxAllowedDist)
                {
                    return(true);
                }
            }
            else if (poly2.IsInside(mainvec))
            {
                float dist = GetDistanceToPolygonEdge(mainvec, poly2);
                if (dist <= maxAllowedDist)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 6
0
        public static void CheckUltimateHits()
        {
            int     maxHitCount = 0;
            Vector2 bestEndVec  = Vector2.Zero;

            Geometry.Polygon BestCone = null;

            for (int i = 0; i < 360; i += 20)
            {
                var endVec            = PointOnCircle(i);
                Geometry.Polygon Cone = CreateUltimateCone(endVec);

                int currentHits = EntityManager.Heroes.Enemies.Where(x => x.IsValid && !x.IsDead && !x.IsZombie).Count(
                    x =>
                {
                    var pred = Prediction.Position.PredictUnitPosition(x, (int)(Spells.R2.CastDelay + x.Distance(Player.Instance) /
                                                                                Spells.R2.Speed * 1000));
                    bool inside = Cone.IsInside(pred);

                    return(inside);
                });

                if (currentHits > maxHitCount)
                {
                    maxHitCount = currentHits;
                    bestEndVec  = endVec;

                    BestCone = Cone;
                }
            }

            if (BestCone != null && maxHitCount >= RivenMenu.Combo["minR2Hits"].Cast <Slider>().CurrentValue)
            {
                Spells.ForceR2(Player.Instance.Position.Extend(bestEndVec, 100));
            }
        }
Exemplo n.º 7
0
        //-----------------------------------------------PriorityCast---------------------------------------------

        static void PriorityCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args, List <AIHeroClient> Allies, Geometry.Polygon polygon)
        {
            int delay = new int();

            Allies.OrderBy(it => it.Distance(args.Start));

            var ally = Allies.First();

            if (Allies.Count == 1)
            {
                delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 300 - Game.Ping);

                Core.DelayAction(delegate
                {
                    if (polygon.IsInside(ally) && E.IsInRange(ally))
                    {
                        E.Cast(ally);
                    }
                    return;
                }, delay);

                //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());
                return;
            }
            else
            {
                if (CollisionSpells.Any(it => it == args.SData.Name))
                {
                    delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 300 - Game.Ping);

                    Core.DelayAction(delegate
                    {
                        foreach (var Ally in Allies)
                        {
                            if (polygon.IsInside(Ally) && E.IsInRange(Ally))
                            {
                                E.Cast(Ally); return;
                            }
                        }
                        return;
                    }, delay);

                    //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());

                    return;
                }

                else
                {
                    IEnumerable <AIHeroClient> priorities = from aliado in EntityManager.Heroes.Allies orderby EMenu[aliado.BaseSkinName].Cast <Slider>().CurrentValue descending select aliado;

                    delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 200 - Game.Ping);

                    Core.DelayAction(delegate
                    {
                        foreach (var Ally in priorities)
                        {
                            if (polygon.IsInside(Ally) && E.IsInRange(Ally))
                            {
                                E.Cast(Ally); return;
                            }
                        }
                        return;
                    }, delay);

                    //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());
                    return;
                }
            }
        }
Exemplo n.º 8
0
        public static void ExecuteW()
        {
            if (!LocalMenu.Item("Flee.UseW").GetValue<bool>())
            {
                return;
            }


            var pos = Game.CursorPos;
            if (jumpingWithQ)
            {
                return;
            }
            if (WStage != Program.WCastStage.IsReady)
            {
                canJumpWithW = false;
                return;
            }

            toPolygon =
                new Geometry.Rectangle(ObjectManager.Player.Position.To2D(),
                    ObjectManager.Player.Position.To2D()
                        .Extend(pos.To2D(),
                            ObjectManager.Player.Position.Distance(pos) < W.Range
                                ? W.Range
                                : +ObjectManager.Player.Position.Distance(pos)),
                    LocalMenu.Item("Flee.Range").GetValue<Slider>().Value).ToPolygon();


            if (wardJumpObjectforFlee != null && WStage == Program.WCastStage.IsReady)
            {
                Render.Circle.DrawCircle(wardJumpObjectforFlee.Position, 85f, Color.Coral);
                canJumpWithW = true;
                W.CastOnUnit(wardJumpObjectforFlee);

                return;
            }

            var jObjects = ObjectManager.Get<Obj_AI_Base>()
                .OrderByDescending(obj => obj.Distance(ObjectManager.Player.ServerPosition))
                .FirstOrDefault(obj => obj.IsAlly && !obj.IsMe && !obj.IsDead &&
                                       !(obj.Name.IndexOf("turret", StringComparison.InvariantCultureIgnoreCase) >= 0) &&
                                       obj.Distance(ObjectManager.Player.Position) <= W.Range &&
                                       obj.Distance(ObjectManager.Player.Position) >
                                       Orbwalking.GetRealAutoAttackRange(null) + 100 &&
                                       toPolygon.IsInside(obj.Position));

            if (jObjects != null)
            {
                Render.Circle.DrawCircle(jObjects.Position, 85f, Color.Coral);
                Program.WardJump(jObjects.Position);
                canJumpWithW = true;
                return;
            }

            if (Items.GetWardSlot() != null && Items.GetWardSlot().Stacks > 0)
            {
                canJumpWithW = true;
                Program.PutWard(ObjectManager.Player.Position.Extend(pos, wardRange));
                return;
            }
            canJumpWithW = false;
        }
Exemplo n.º 9
0
        /// <summary>
        /// + minion hitbox
        /// </summary>
        public static Vector2[] GetCollisionPoints(this AsheW skillshot)
        {
            var collisions = new List <Vector2>();

            if (Environment.TickCount - LastMinionPosArrayTick < 1000)
            {
                collisions.AddRange(LastMinionPosArray);
            }


            Vector2[] edges = skillshot.GetEdgePoints();

            Vector2 rightEdge = edges[0];
            Vector2 leftEdge  = edges[1];

            var triangle = new Geometry.Polygon();

            triangle.Points.AddRange(new List <Vector2> {
                skillshot.FixedStartPosition.To2D(), rightEdge, leftEdge
            });

            if (EvadeMenu.CollisionMenu["minion"].Cast <CheckBox>().CurrentValue)
            {
                foreach (var minion in
                         EntityManager.MinionsAndMonsters.AlliedMinions.Where(x => !x.IsDead && x.IsValid && x.Health >= 100 &&
                                                                              x.Distance(skillshot.FixedStartPosition) < skillshot.OwnSpellData.Range))
                {
                    if (GetHitboxCirclePoints(minion).Any(x => triangle.IsInside(x)))
                    {
                        LastMinionPosArray.Add(minion.Position.To2D());
                        LastMinionPosArrayTick = Environment.TickCount;

                        collisions.Add(minion.Position.To2D());
                    }
                }
            }

            if (EvadeMenu.CollisionMenu["yasuoWall"].Cast <CheckBox>().CurrentValue&& skillshot.Missile != null)
            {
                GameObject wall = null;
                foreach (var gameObject in ObjectManager.Get <GameObject>().
                         Where(gameObject => gameObject.IsValid && System.Text.RegularExpressions.Regex.IsMatch(
                                   gameObject.Name, "_w_windwall.\\.troy", System.Text.RegularExpressions.RegexOptions.IgnoreCase)))
                {
                    wall = gameObject;
                }
                if (wall != null)
                {
                    var level         = wall.Name.Substring(wall.Name.Length - 6, 1);
                    var wallWidth     = 300 + 50 * Convert.ToInt32(level);
                    var wallDirection = (wall.Position.To2D() - WindWallStartPosition).Normalized().Perpendicular();

                    var wallStart   = wall.Position.To2D() + wallWidth / 2f * wallDirection;
                    var wallEnd     = wallStart - wallWidth * wallDirection;
                    var wallPolygon = new Geometry.Polygon.Rectangle(wallStart, wallEnd, 75).GetDetailedPolygon();

                    collisions.AddRange(wallPolygon.Points.Where(wallPoint => triangle.IsInside(wallPoint)));
                }
            }

            return(collisions.ToArray());
        }
Exemplo n.º 10
0
        public override Geometry.Polygon ToPolygon()
        {
            Vector2[] edges     = GetEdgePoints();
            Vector2   rightEdge = edges[0];
            Vector2   leftEdge  = edges[1];

            var     beginPoints     = GetBeginEdgePoints(edges);
            Vector2 rightBeginPoint = beginPoints[0];
            Vector2 leftBeginPoint  = beginPoints.Length == 1 ? Vector2.Zero : beginPoints[1];

            if (leftBeginPoint.IsZero)
            {
                return(new Geometry.Polygon());
            }

            var baseTriangle = new Geometry.Polygon();

            baseTriangle.Points.AddRange(new List <Vector2> {
                FixedStartPosition.To2D(), rightEdge, leftEdge
            });

            var advancedTriangle = new Geometry.Polygon();

            advancedTriangle.Points.AddRange(new List <Vector2> {
                FixedStartPosition.To2D(), rightEdge
            });

            var dummyTriangle = advancedTriangle;

            if (CollisionPoints.Any())
            {
                foreach (var collisionPoint in OrderCollisionPointsHorizontally(rightEdge))
                {
                    var dir       = collisionPoint - FixedStartPosition.To2D();
                    var leftColl  = FixedStartPosition.To2D() + dir + dir.Perpendicular().Normalized() * 25;
                    var rightColl = FixedStartPosition.To2D() + dir + dir.Perpendicular2().Normalized() * 25;

                    var backToLineRight = FixedStartPosition.Extend(rightColl, FixedEndPosition.Distance(FixedStartPosition));
                    var backToLineLeft  = FixedStartPosition.Extend(leftColl, FixedEndPosition.Distance(FixedStartPosition));

                    var earlyCollCheck_Left  = backToLineLeft.Extend(leftColl, FixedEndPosition.Distance(FixedStartPosition));
                    var earlyCollCheck_Right = backToLineRight.Extend(rightColl, FixedEndPosition.Distance(FixedStartPosition));

                    Geometry.Polygon earlyCollisionRectangle = new Geometry.Polygon();
                    earlyCollisionRectangle.Points.AddRange(new List <Vector2>
                    {
                        leftColl, earlyCollCheck_Left, earlyCollCheck_Right, rightColl
                    });
                    bool EarlyCollision =
                        CollisionPoints.Any(x => x != collisionPoint && earlyCollisionRectangle.IsInside(x));

                    Func <Vector2, bool> outsideDummy = point => dummyTriangle.Points.Count < 3 || dummyTriangle.IsOutside(point);

                    if (baseTriangle.IsInside(rightColl) && baseTriangle.IsInside(leftColl) &&
                        outsideDummy(rightColl) && outsideDummy(leftColl) && !EarlyCollision &&
                        backToLineLeft.Distance(backToLineRight) >= OwnSpellData.Radius * 2)
                    {
                        CollisionInfo info = AreCollisionPointsBehindBegin(rightColl, leftColl, rightBeginPoint,
                                                                           leftBeginPoint);

                        if (!info.BehindStartLine)
                        {
                            dummyTriangle.Points.Add(backToLineRight);
                            advancedTriangle.Points.Add(backToLineRight);

                            dummyTriangle.Points.Add(rightColl);
                            advancedTriangle.Points.Add(rightColl);


                            dummyTriangle.Points.Add(leftColl);
                            advancedTriangle.Points.Add(leftColl);

                            dummyTriangle.Points.Add(backToLineLeft);
                            advancedTriangle.Points.Add(backToLineLeft);
                        }
                        else //collision points behind startLine
                        {
                            leftColl  = info.New_LeftCollPointOnStartLine;
                            rightColl = info.New_RightCollPointOnStartLine;

                            backToLineRight = FixedStartPosition.Extend(rightColl, FixedEndPosition.Distance(FixedStartPosition));
                            backToLineLeft  = FixedStartPosition.Extend(leftColl, FixedEndPosition.Distance(FixedStartPosition));

                            dummyTriangle.Points.Add(backToLineRight);
                            advancedTriangle.Points.Add(backToLineRight);

                            dummyTriangle.Points.Add(rightColl);
                            advancedTriangle.Points.Add(rightColl);


                            dummyTriangle.Points.Add(leftColl);
                            advancedTriangle.Points.Add(leftColl);

                            dummyTriangle.Points.Add(backToLineLeft);
                            advancedTriangle.Points.Add(backToLineLeft);
                        }
                    }
                }
            }

            advancedTriangle.Points.Add(leftEdge);
            advancedTriangle.Points.RemoveAt(0);
            advancedTriangle.Points.Insert(0, rightBeginPoint);
            advancedTriangle.Points.Insert(0, leftBeginPoint);

            return(advancedTriangle);
        }
Exemplo n.º 11
0
        private static void Drawing_RKickWaveForKillableEnemy(EventArgs args)
        {
            if (Config.Item("Insec").GetValue<KeyBind>().Active || Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo)
            {
                return;
            }

            if (!MenuCombo.Item("Combo.R.UseRKickWaveForKill").GetValue<bool>() || !R.IsReady())
            {
                return;
            }

            Obj_AI_Hero t =
                HeroManager.Enemies.Find(
                    e =>
                        e.IsValidTarget(Q.Range + W.Range) && !e.IsDead && !e.IsZombie &&
                        e.Distance(Game.CursorPos) < e.Distance(ObjectManager.Player.Position) &&
                        /*if I'm fallowing the enemy*/
                        !e.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65) && e.Health < e.MaxHealth*0.14);
                    //.OrderByDescending(o => o.MaxHealth)
                    //.FirstOrDefault();
            if (t == null)
            {
                return;
            }

            foreach (var enemy in HeroManager.Enemies.Where(e => e.Distance(t.Position) < 800 && e.NetworkId != t.NetworkId && ObjectManager.Player.Distance(e) < ObjectManager.Player.Distance(t)))
            {
                toPolygon = new Geometry.Rectangle(t.Position.To2D(), t.Position.To2D().Extend(ObjectManager.Player.Position.To2D(), 800), 100).ToPolygon();
                toPolygon.Draw(Color.Blue, 3);

                if (toPolygon.IsInside(enemy.Position.To2D()))
                {
                        //Render.Circle.DrawCircle(enemy.Position, 150f, Color.Black);
                        R.CastOnUnit(enemy);
                }
            }

        }
Exemplo n.º 12
0
        private static void Drawing_RKickWaveForHitToEnemy(EventArgs args)
        {
            if (Config.Item("Insec").GetValue<KeyBind>().Active || Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo)
            {
                return;
            }

            if (MenuCombo.Item("Combo.R.UseRKickWaveForDamage").GetValue<StringList>().SelectedIndex == 0 || !R.IsReady())
            {
                return;
            }

            var hitCount = MenuCombo.Item("Combo.R.UseRKickWaveForDamage").GetValue<StringList>().SelectedIndex;
            
            Obj_AI_Hero t =
                HeroManager.Enemies.Where(
                    e =>
                        e.IsValidTarget(Q.Range + W.Range) && !e.IsDead && !e.IsZombie)
                    .OrderBy(o => o.Distance(ObjectManager.Player.Position))
                    .FirstOrDefault();

            if (t == null)
            {
                return;
            }

            toPolygon = new Geometry.Rectangle(t.Position.To2D(), t.Position.To2D().Extend(ObjectManager.Player.Position.To2D(), 800), 100).ToPolygon();

            var enemyCount =
                HeroManager.Enemies.Where(e => e.Distance(ObjectManager.Player) < 1100 && e.IsValidTarget(1100))
                    .Count(e => e.NetworkId != t.NetworkId && !e.IsDead && toPolygon.IsInside(e.ServerPosition));

            if (enemyCount == 0)
            {
                return;
            }
            
            if (enemyCount + 1 <= hitCount + 1)
            {
                R.CastOnUnit(t);
            }

            //List<Obj_AI_Hero> xEnemy = new List<Obj_AI_Hero>();
            //foreach (
            //    Obj_AI_Hero enemy in
            //        HeroManager.Enemies.Where(
            //            e =>
            //                e.Distance(t.Position) < 2800 &&
            //                ObjectManager.Player.Distance(e) > ObjectManager.Player.Distance(t)))
            //{

            //    //var tt = t.ServerPosition.Extend(ObjectManager.Player.Position, +800);
            //    //var startpos = t.Position;
            //    //var endpos = tt;
            //    //var x = new LeagueSharp.Common.Geometry.Polygon.Rectangle(startpos, endpos, 145);
            //    //x.Draw(Color.Blue, 3);
            //    toPolygon = new Geometry.Rectangle(t.Position.To2D(), t.Position.To2D().Extend(ObjectManager.Player.Position.To2D(), -700), 210).ToPolygon();
            //    //toPolygon.Draw(Color.Blue, 3);
            //    if (toPolygon.IsInside(enemy.Position.To2D()))
            //    {
            //        //if (xEnemy.Find(hero => hero.ChampionName != enemy.ChampionName) != null)
            //        xEnemy.Add(enemy);
            //        //Render.Circle.DrawCircle(enemy.Position, 150f, Color.Black);
            //        //R.CastOnUnit(enemy);
            //    }
            //    var xCount = xEnemy.Count + 1;
            //    if (hitCount + 1 >= xEnemy.Count + 1 && t.IsValidTarget(R.Range))
            //    {
            //        R.CastOnUnit(t);
            //    }
                
            //}
        }
Exemplo n.º 13
0
        protected override void OnInitialize()
        {
            try
            {
                #region Regions

                _topRegion.Add(new Vector3(1576.24f, 1902.23f, 94.70f));
                _topRegion.Add(new Vector3(1661.70f, 2289.45f, 95.75f));
                _topRegion.Add(new Vector3(2380.17f, 4091.17f, 95.75f));
                _topRegion.Add(new Vector3(2725.03f, 5469.05f, 52.67f));
                _topRegion.Add(new Vector3(2515.89f, 10313.13f, 54.33f));
                _topRegion.Add(new Vector3(4407.59f, 11827.64f, 55.64f));
                _topRegion.Add(new Vector3(4876.42f, 12259.18f, 56.48f));
                _topRegion.Add(new Vector3(9414.86f, 12181.32f, 52.31f));
                _topRegion.Add(new Vector3(10870.46f, 12646.18f, 91.43f));
                _topRegion.Add(new Vector3(13060.38f, 13277.48f, 92.83f));
                _topRegion.Add(new Vector3(13900.90f, 13907.86f, 148.66f));
                _topRegion.Add(new Vector3(13614.24f, 14538.74f, 154.61f));
                _topRegion.Add(new Vector3(3099.85f, 14303.65f, 52.84f));
                _topRegion.Add(new Vector3(1314.28f, 13313.79f, 54.59f));
                _topRegion.Add(new Vector3(734.45f, 12169.86f, 52.84f));
                _topRegion.Add(new Vector3(430.93f, 10373.04f, 52.84f));
                _topRegion.Add(new Vector3(435.87f, 4959.91f, 131.13f));
                _topRegion.Add(new Vector3(242.55f, 4269.17f, 93.61f));
                _topRegion.Add(new Vector3(292.16f, 1174.47f, 146.87f));
                _topRegion.Add(new Vector3(931.74f, 999.36f, 151.49f));
                _topRegion.Add(new Vector3(1576.24f, 1902.23f, 94.70f));

                _midRegion.Add(new Vector3(13871.14f, 14021.69f, 155.72f));
                _midRegion.Add(new Vector3(13008.55f, 13299.83f, 91.88f));
                _midRegion.Add(new Vector3(10887.83f, 12486.93f, 91.43f));
                _midRegion.Add(new Vector3(9197.48f, 11867.53f, 52.31f));
                _midRegion.Add(new Vector3(4857.02f, 8788.97f, -65.16f));
                _midRegion.Add(new Vector3(2903.06f, 5427.32f, 52.45f));
                _midRegion.Add(new Vector3(2554.77f, 3976.37f, 95.75f));
                _midRegion.Add(new Vector3(1819.52f, 2226.85f, 95.75f));
                _midRegion.Add(new Vector3(1504.61f, 1763.40f, 93.38f));
                _midRegion.Add(new Vector3(866.45f, 1057.75f, 140.08f));
                _midRegion.Add(new Vector3(1087.19f, 674.40f, 157.85f));
                _midRegion.Add(new Vector3(1875.13f, 1649.40f, 95.75f));
                _midRegion.Add(new Vector3(2201.99f, 1856.39f, 95.75f));
                _midRegion.Add(new Vector3(4020.46f, 2469.27f, 95.75f));
                _midRegion.Add(new Vector3(6070.94f, 3567.61f, 50.33f));
                _midRegion.Add(new Vector3(9287.77f, 5912.96f, -71.24f));
                _midRegion.Add(new Vector3(10487.25f, 7606.01f, 51.67f));
                _midRegion.Add(new Vector3(12330.79f, 11017.61f, 91.43f));
                _midRegion.Add(new Vector3(13027.33f, 12675.33f, 93.34f));
                _midRegion.Add(new Vector3(13174.45f, 13057.41f, 91.83f));
                _midRegion.Add(new Vector3(14089.08f, 13842.00f, 153.87f));
                _midRegion.Add(new Vector3(13871.14f, 14021.69f, 155.72f));

                _botRegion.Add(new Vector3(1059.34f, 746.28f, 156.04f));
                _botRegion.Add(new Vector3(2203.51f, 1795.44f, 95.75f));
                _botRegion.Add(new Vector3(4059.19f, 2374.68f, 95.75f));
                _botRegion.Add(new Vector3(7394.06f, 3361.99f, 52.59f));
                _botRegion.Add(new Vector3(9484.03f, 3413.96f, 60.04f));
                _botRegion.Add(new Vector3(11380.81f, 4031.34f, -71.24f));
                _botRegion.Add(new Vector3(11368.18f, 7687.61f, 52.22f));
                _botRegion.Add(new Vector3(12474.98f, 10944.70f, 91.43f));
                _botRegion.Add(new Vector3(13262.80f, 12976.91f, 91.43f));
                _botRegion.Add(new Vector3(13990.51f, 13894.96f, 153.36f));
                _botRegion.Add(new Vector3(14577.87f, 13772.93f, 157.70f));
                _botRegion.Add(new Vector3(14427.08f, 4090.74f, 52.48f));
                _botRegion.Add(new Vector3(13674.34f, 2334.65f, 51.37f));
                _botRegion.Add(new Vector3(12273.99f, 886.75f, 51.27f));
                _botRegion.Add(new Vector3(11367.76f, 586.92f, 50.59f));
                _botRegion.Add(new Vector3(1077.09f, 289.64f, 155.13f));
                _botRegion.Add(new Vector3(1059.34f, 746.28f, 156.04f));

                #endregion

                foreach (var minion in GameObjects.Minions)
                {
                    OnMinionCreated(minion);
                }

                foreach (var turret in
                         GameObjects.Turrets.Where(t => t.IsValid && !t.IsDead || t.Health > 1f))
                {
                    if (turret.Team == GameObjectTeam.Chaos)
                    {
                        if (_botRegion.IsInside(turret.Position))
                        {
                            _botChaosTowers = Math.Min(3, _botChaosTowers + 1);
                        }
                        else if (_midRegion.IsInside(turret.Position))
                        {
                            _midChaosTowers = Math.Min(3, _midChaosTowers + 1);
                        }
                        else if (_topRegion.IsInside(turret.Position))
                        {
                            _topChaosTowers = Math.Min(3, _topChaosTowers + 1);
                        }
                    }
                    else if (turret.Team == GameObjectTeam.Order)
                    {
                        if (_botRegion.IsInside(turret.Position))
                        {
                            _botOrderTowers = Math.Min(3, _botOrderTowers + 1);
                        }
                        else if (_midRegion.IsInside(turret.Position))
                        {
                            _midOrderTowers = Math.Min(3, _midOrderTowers + 1);
                        }
                        else if (_topRegion.IsInside(turret.Position))
                        {
                            _topOrderTowers = Math.Min(3, _topOrderTowers + 1);
                        }
                    }
                }

                base.OnInitialize();
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Exemplo n.º 14
0
 public bool WillHit(AIHeroClient target, int range = 200)
 {
     return(target.IsInRange(Miss.Position, target.BoundingRadius + range) && Poly.IsInside(target));
 }