Esempio n. 1
0
        private void OnDrawingDraw(EventArgs args)
        {
            try
            {
                if (!Utils.ShouldDraw(true))
                {
                    return;
                }

                var x = Player.HPBarPosition.X + 45;
                var y = Player.HPBarPosition.Y - 25;

                if (E.Level > 0 && _eStacks != null && _eStacks.GetValue <bool>())
                {
                    var stacks = HasEBuff() ? 3 : Player.GetBuffCount("cardmasterstackholder") - 1;
                    if (stacks > -1)
                    {
                        for (var i = 0; 3 > i; i++)
                        {
                            Drawing.DrawLine(
                                x + (i * 20), y, x + (i * 20) + 10, y, 10, (i > stacks ? Color.DarkGray : Color.Orange));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Esempio n. 2
0
        public static void Draw()
        {
            try
            {
                if (Menu == null || _champion.Spells == null || !Utils.ShouldDraw())
                {
                    return;
                }

                var circleThickness = Menu.Item(Menu.Name + ".circle-thickness").GetValue <Slider>().Value;
                foreach (
                    var spell in _champion.Spells.Where(s => s != null && s.Range > 0 && s.Range < 5000 && s.Level > 0))
                {
                    if (spell.IsChargedSpell)
                    {
                        var min =
                            Menu.Item(Menu.Name + "." + spell.Slot.ToString().ToLower() + "-min").GetValue <Circle>();
                        var max =
                            Menu.Item(Menu.Name + "." + spell.Slot.ToString().ToLower() + "-max").GetValue <Circle>();
                        if (min.Active && ObjectManager.Player.Position.IsOnScreen(spell.ChargedMinRange))
                        {
                            Render.Circle.DrawCircle(
                                ObjectManager.Player.Position, spell.ChargedMinRange, min.Color, circleThickness);
                        }
                        if (max.Active && ObjectManager.Player.Position.IsOnScreen(spell.ChargedMaxRange))
                        {
                            Render.Circle.DrawCircle(
                                ObjectManager.Player.Position, spell.ChargedMaxRange, max.Color, circleThickness);
                        }
                    }
                    else
                    {
                        var item = Menu.Item(Menu.Name + "." + spell.Slot.ToString().ToLower()).GetValue <Circle>();
                        if (item.Active && ObjectManager.Player.Position.IsOnScreen(spell.Range))
                        {
                            Render.Circle.DrawCircle(
                                ObjectManager.Player.Position, spell.Range, item.Color, circleThickness);
                        }
                    }
                }

                foreach (var custom in Customs)
                {
                    var item = Menu.Item(Menu.Name + "." + custom.Key).GetValue <Circle>();
                    if (item.Active && ObjectManager.Player.Position.IsOnScreen(custom.Value))
                    {
                        Render.Circle.DrawCircle(
                            ObjectManager.Player.Position, custom.Value, item.Color, circleThickness);
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Esempio n. 3
0
 private void OnDrawingEndScene(EventArgs args)
 {
     try
     {
         if (!Utils.ShouldDraw())
         {
             return;
         }
         if (_rMinimap.GetValue <bool>() && R.Level > 0 && (R.Instance.CooldownExpires - Game.Time) < 3 &&
             !Player.IsDead)
         {
             Utility.DrawCircle(Player.Position, R.Range, Color.White, 1, 30, true);
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
        private static void DrawingOnEndScene(EventArgs args)
        {
            try
            {
                if (Drawing.Direct3DDevice == null || Drawing.Direct3DDevice.IsDisposed || !Utils.ShouldDraw())
                {
                    return;
                }

                if (_line != null && !_line.IsDisposed)
                {
                    if (_menu == null || !_menu.Item(_menu.Name + ".enabled").GetValue <bool>())
                    {
                        return;
                    }
                    var color      = _menu.Item(_menu.Name + ".color").GetValue <Color>();
                    var alpha      = (byte)(_menu.Item(_menu.Name + ".opacity").GetValue <Slider>().Value * 255 / 100);
                    var sharpColor = new ColorBGRA(color.R, color.G, color.B, alpha);
                    foreach (var unit in
                             GameObjects.EnemyHeroes.Where(
                                 u => u.IsHPBarRendered && u.Position.IsOnScreen() && u.IsValidTarget()))
                    {
                        var damage = CalculateDamage(unit);
                        if (damage <= 0)
                        {
                            continue;
                        }
                        var damagePercentage = ((unit.Health - damage) > 0 ? (unit.Health - damage) : 0) /
                                               unit.MaxHealth;
                        var currentHealthPercentage = unit.Health / unit.MaxHealth;
                        var startPoint =
                            new Vector2(
                                (int)(unit.HPBarPosition.X + BarOffset.X + damagePercentage * BarWidth),
                                (int)(unit.HPBarPosition.Y + BarOffset.Y) - 5);
                        var endPoint =
                            new Vector2(
                                (int)(unit.HPBarPosition.X + BarOffset.X + currentHealthPercentage * BarWidth) + 1,
                                (int)(unit.HPBarPosition.Y + BarOffset.Y) - 5);
                        _line.Begin();
                        _line.Draw(new[] { startPoint, endPoint }, sharpColor);
                        _line.End();
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }