예제 #1
0
        private void DrawingOnOnDraw(EventArgs args)
        {
            if (!Modes.ModeDraw.MenuLocal.Item("Draw.Enable").GetValue <bool>())
            {
                return;
            }

            foreach (var hero in HeroManager.AllHeroes)
            {
                var passiveBuffs = (from b in hero.Buffs join b1 in PassiveBuffs on b.DisplayName equals b1.BuffName select new { b, b1 }).Distinct();
                foreach (var buffName in passiveBuffs)
                {
                    for (int i = 0; i < passiveBuffs.Count(); i++)
                    {
                        if (buffName.b.EndTime >= Game.Time)
                        {
                            CommonGeometry.DrawBox(new Vector2(hero.HPBarPosition.X + 10, (i * 8) + hero.HPBarPosition.Y + 32), 130, 6, Color.FromArgb(100, 255, 200, 37), 1, Color.Black);

                            var buffTime = buffName.b.EndTime - buffName.b.StartTime;
                            CommonGeometry.DrawBox(new Vector2(hero.HPBarPosition.X + 11, (i * 8) + hero.HPBarPosition.Y + 33), (130 / buffTime) * (buffName.b.EndTime - Game.Time), 4, buffName.b1.Color, 1, buffName.b1.Color);

                            TimeSpan timeSpan = TimeSpan.FromSeconds(buffName.b.EndTime - Game.Time);
                            var      timer    = $"{timeSpan.Minutes:D2}:{timeSpan.Seconds:D2}";
                            CommonGeometry.DrawText(CommonGeometry.TextPassive, timer, hero.HPBarPosition.X + 142, (i * 8) + hero.HPBarPosition.Y + 29, SharpDX.Color.Wheat);
                        }
                    }
                }

                var jungleBuffs = (from b in hero.Buffs join b1 in JungleBuffs on b.DisplayName equals b1.BuffName select new { b, b1 }).Distinct();
                foreach (var buffName in jungleBuffs.ToList())
                {
                    var circle1 = new CommonGeometry.Circle2(new Vector2(hero.Position.X + 3, hero.Position.Y - 3), 140 + (buffName.b1.Number * 20), Game.Time - buffName.b.StartTime, buffName.b.EndTime - buffName.b.StartTime).ToPolygon();
                    circle1.Draw(Color.Black, 3);

                    var circle = new CommonGeometry.Circle2(hero.Position.To2D(), 140 + (buffName.b1.Number * 20), Game.Time - buffName.b.StartTime, buffName.b.EndTime - buffName.b.StartTime).ToPolygon();
                    circle.Draw(buffName.b1.Color, 3);
                }
            }
        }
예제 #2
0
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (!MenuLocal.Item("Draw.Enable").GetValue <bool>())
            {
                return;
            }

            if (MenuLocal.Item(GetPcModeStringValue + "DrawBuffs").GetValue <bool>())
            {
                var passiveBuffs =
                    (from b in ObjectManager.Player.Buffs
                     join b1 in CommonBuffManager.BuffDatabase on b.Name equals b1.BuffName
                     select new { b, b1 }).Distinct();

                var i = 0;
                foreach (var buffName in passiveBuffs)
                {
                    if (buffName.b.EndTime >= Game.Time)
                    {
                        CommonGeometry.DrawBox(
                            new Vector2(ObjectManager.Player.HPBarPosition.X + 10,
                                        (i * 8) + ObjectManager.Player.HPBarPosition.Y + 32), 130, 6,
                            Color.FromArgb(100, 255, 200, 37), 1, Color.Black);

                        var buffTime = buffName.b.EndTime - buffName.b.StartTime;
                        CommonGeometry.DrawBox(
                            new Vector2(ObjectManager.Player.HPBarPosition.X + 11,
                                        (i * 8) + ObjectManager.Player.HPBarPosition.Y + 33),
                            (130 / buffTime) * (buffName.b.EndTime - Game.Time), 4, buffName.b1.Color, 1, buffName.b1.Color);

                        TimeSpan timeSpan = TimeSpan.FromSeconds(buffName.b.EndTime - Game.Time);
                        var      timer    = $"{timeSpan.Minutes:D2}:{timeSpan.Seconds:D2}";
                        CommonGeometry.DrawText(CommonGeometry.TextPassive, timer,
                                                ObjectManager.Player.HPBarPosition.X + 142,
                                                (i * 8) + ObjectManager.Player.HPBarPosition.Y + 29,
                                                SharpDX.Color.Wheat);
                        CommonGeometry.TextPassive.DrawTextLeft(buffName.b1.Caption,
                                                                (int)ObjectManager.Player.HPBarPosition.X + 8,
                                                                (int)((i * 8) + ObjectManager.Player.HPBarPosition.Y + 35), SharpDX.Color.Wheat);
                    }
                    i += 1;
                }
            }

            DrawSpells();
            DrawMinionLastHit();
            //KillableEnemy();
            DrawBuffs();

            //Render.Circle.DrawCircle(ObjectManager.Player.Position, W.Range, System.Drawing.Color.Red);

            return;

            var t = TargetSelector.GetTarget(W.Range * 3, TargetSelector.DamageType.Magical);

            if (t == null)
            {
                return;
            }

            if (t.IsValidTarget(W.Range))
            {
                return;
            }


            List <Vector2> xList = new List <Vector2>();

            var nLocation = ObjectManager.Player.Position.To2D() + Vector2.Normalize(t.Position.To2D() - ObjectManager.Player.Position.To2D()) * W.Range;


            //if (CommonGeometry.IsWallBetween(nEvadePoint.To3D(), location.To3D()))
            //{
            //    Chat.Print("Wall");
            //}
            //else
            //{
            //    Chat.Print("Not Wall");
            //}



            Vector2 wCastPosition = nLocation;

            //Render.Circle.DrawCircle(wCastPosition.To3D(), 105f, System.Drawing.Color.Red);


            if (!wCastPosition.IsWall())
            {
                xList.Add(wCastPosition);
            }

            if (wCastPosition.IsWall())
            {
                for (int j = 20; j < 80; j += 20)
                {
                    Vector2 wcPositive = ObjectManager.Player.Position.To2D() + Vector2.Normalize(t.Position.To2D() - ObjectManager.Player.Position.To2D()).Rotated(j * (float)Math.PI / 180) * W.Range;
                    if (!wcPositive.IsWall())
                    {
                        xList.Add(wcPositive);
                    }

                    Vector2 wcNegative = ObjectManager.Player.Position.To2D() + Vector2.Normalize(t.Position.To2D() - ObjectManager.Player.Position.To2D()).Rotated(-j * (float)Math.PI / 180) * W.Range;
                    if (!wcNegative.IsWall())
                    {
                        xList.Add(wcNegative);
                    }
                }

                float xDiff = ObjectManager.Player.Position.X - t.Position.X;
                float yDiff = ObjectManager.Player.Position.Y - t.Position.Y;
                int   angle = (int)(Math.Atan2(yDiff, xDiff) * 180.0 / Math.PI);
            }

            //foreach (var aa in xList)
            //{
            //    Render.Circle.DrawCircle(aa.To3D2(), 105f, System.Drawing.Color.White);
            //}
            var nJumpPoint = xList.OrderBy(al => al.Distance(t.Position)).First();

            var color = System.Drawing.Color.DarkRed;
            var width = 4;

            var startpos = ObjectManager.Player.Position;
            var endpos   = nJumpPoint.To3D();

            if (startpos.Distance(endpos) > 100)
            {
                var endpos1 = nJumpPoint.To3D() + (startpos - endpos).To2D().Normalized().Rotated(25 * (float)Math.PI / 180).To3D() * 75;
                var endpos2 = nJumpPoint.To3D() + (startpos - endpos).To2D().Normalized().Rotated(-25 * (float)Math.PI / 180).To3D() * 75;

                var x1 = new LeagueSharp.Common.Geometry.Polygon.Line(startpos, endpos);
                x1.Draw(color, width - 2);
                var y1 = new LeagueSharp.Common.Geometry.Polygon.Line(endpos, endpos1);
                y1.Draw(color, width - 2);
                var z1 = new LeagueSharp.Common.Geometry.Polygon.Line(endpos, endpos2);
                z1.Draw(color, width - 2);

                Geometry.Polygon.Circle x2 = new LeagueSharp.Common.Geometry.Polygon.Circle(endpos, W.Width / 2);

                if (CommonGeometry.IsWallBetween(ObjectManager.Player.Position, endpos))
                {
                    x2.Draw(Color.Red, width - 2);
                }
                else
                {
                    x2.Draw(Color.Wheat, width - 2);
                }
            }

            if (!t.IsValidTarget(W.Range + Q.Range - 60))
            {
                return;
            }

            if (t.IsValidTarget(W.Range))
            {
                return;
            }

            var canJump = false;

            if (Modes.ModeCombo.ComboMode == ComboMode.Mode2xQ)
            {
                if ((t.Health < ModeCombo.GetComboDamage(t) - W.GetDamage(t) && Q.IsReady() && R.IsReady()) || (t.Health < Q.GetDamage(t) && Q.IsReady()))
                {
                    canJump = true;
                }
            }

            var nPoint = nJumpPoint.Extend(ObjectManager.Player.Position.To2D(), +ObjectManager.Player.BoundingRadius * 3);

            Render.Circle.DrawCircle(nPoint.To3D(), 50f, Color.GreenYellow);

            if (CommonGeometry.IsWallBetween(nPoint.To3D(), nJumpPoint.To3D()))
            {
                canJump = false;
            }

            if (canJump && W.IsReady() && !W.StillJumped())
            {
                if (Modes.ModeConfig.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
                {
                    W.Cast(nJumpPoint);
                }
                return;
            }
        }