Example #1
0
        public TopPanel(Hero hero)
        {
            IconPosition = HUDInfo.GetTopPanelPosition(hero);

            var ratioPercentage = HUDInfo.RatioPercentage;

            HelthManaBackPosition = IconPosition + new Vector2(0.5f, SizeY);
            HelthManaBackSize     = new Vector2(SizeX, (4 * ratioPercentage) + HealthSizeY + ManaSizeY);

            HealthPosition = HelthManaBackPosition + new Vector2(1, 1.21f * ratioPercentage);
            ManaPosition   = HealthPosition + new Vector2(0, 1.5f + HealthSizeY);

            var midle = (SizeX / 2) - (21.565f * ratioPercentage);

            UltimateBackPosition  = HelthManaBackPosition + new Vector2(midle, HelthManaBackSize.Y + (8 * ratioPercentage));
            UltimateSpellPosition = HelthManaBackPosition + new Vector2(midle + 3.6f, HelthManaBackSize.Y + (11.4f * ratioPercentage));

            if (hero.Team == Team.Radiant)
            {
                VisibleIconName = "hero_visible_left";
            }
            else
            {
                VisibleIconName = "hero_visible_right";
            }

            VisibleIconRectangle = new RectangleF(IconPosition.X - 4, IconPosition.Y + 4.5f, SizeX + 8.5f, SizeY - 5);
        }
Example #2
0
        /// <summary>
        ///     The On Window Procedure Event
        /// </summary>
        /// <param name="args">
        ///     The args.
        /// </param>
        public void Game_OnWndProc(WndEventArgs args)
        {
            foreach (var module in Variables.Modules.Where(x => x.CanDraw()))
            {
                module.OnWndProc(args);
            }

            if (args.Msg != (ulong)Utils.WindowsMessages.WM_LBUTTONDOWN)
            {
                return;
            }

            foreach (var hero in
                     from play in Heroes.GetByTeam(Variables.EnemyTeam).Where(x => x.IsValid && !x.IsIllusion)
                     select play
                     into hero
                     let sizeX = (float)HUDInfo.GetTopPanelSizeX(hero)
                                 let x = HUDInfo.GetTopPanelPosition(hero).X
                                         let sizey = HUDInfo.GetTopPanelSizeY(hero) * 1.4
                                                     where Utils.IsUnderRectangle(Game.MouseScreenPosition, x, 0, sizeX, (float)(sizey * 1.4))
                                                     select hero)
            {
                bool enabled;
                if (this.EnabledHeroes.TryGetValue(hero.ClassID, out enabled))
                {
                    this.EnabledHeroes[hero.ClassID] = !enabled;
                }
            }
        }
Example #3
0
 private static void Game_OnWndProc(WndEventArgs args)
 {
     if (args.Msg != (ulong)Utils.WindowsMessages.WM_LBUTTONDOWN)
     {
         return;
     }
     try
     {
         foreach (var hero in
                  from play in players
                  select play.Hero
                  into hero
                  let sizeX = (float)HUDInfo.GetTopPanelSizeX(hero)
                              let x = HUDInfo.GetTopPanelPosition(hero).X
                                      let sizey = HUDInfo.GetTopPanelSizeY(hero) * 1.4
                                                  where Utils.IsUnderRectangle(Game.MouseScreenPosition, x, 0, sizeX, (float)(sizey * 1.4))
                                                  select hero)
         {
             bool enabled;
             if (enabledHeroes.TryGetValue(hero.ClassID, out enabled))
             {
                 enabledHeroes[hero.ClassID] = !enabled;
             }
         }
     }
     catch (Exception)
     {
         //
     }
 }
Example #4
0
        /// <summary>
        ///     The drawing_ on draw.
        /// </summary>
        /// <param name="args">
        ///     The args.
        /// </param>
        public void Drawing_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsPaused || Variables.Techies == null || !Variables.Techies.IsValid)
            {
                return;
            }

            foreach (var module in Variables.Modules.Where(module => module.CanDraw()))
            {
                module.Draw();
            }

            foreach (var hero in Heroes.GetByTeam(Variables.EnemyTeam).Where(x => x.IsValid && !x.IsIllusion))
            {
                var  classId = hero.ClassID;
                bool enabled;
                if (!this.EnabledHeroes.TryGetValue(classId, out enabled))
                {
                    this.EnabledHeroes[classId] = true;
                }

                var health = hero.Health;
                if (!hero.IsAlive)
                {
                    health = hero.MaximumHealth;
                }

                double[] topPanel;
                if (!this.heroTopPanel.TryGetValue(classId, out topPanel))
                {
                    topPanel    = new double[3];
                    topPanel[0] = HUDInfo.GetTopPanelSizeX(hero);
                    topPanel[1] = HUDInfo.GetTopPanelPosition(hero).X;
                    topPanel[2] = HUDInfo.GetTopPanelSizeY(hero) * 1.4;
                    this.heroTopPanel.Add(classId, topPanel);
                }

                var sizeX = topPanel[0];
                var x     = topPanel[1];
                var sizey = topPanel[2];
                var meepo = hero as Meepo;
                if ((meepo == null || meepo.WhichMeepo == 0) &&
                    Variables.Menu.DrawingsMenu.Item("drawTopPanel").GetValue <bool>())
                {
                    DrawingUtils.DrawRemoteMineNumber(hero.Handle, health, x, sizeX, sizey, enabled, hero);
                    DrawingUtils.DrawLandMineNumber(hero.Handle, health, x, sizey, enabled, hero);
                }

                if (!Variables.Damage.GetSuicideDamage().ContainsKey(hero.Handle))
                {
                    continue;
                }

                DrawingUtils.DrawSuicide(hero.Handle, health, x, sizey, sizeX, enabled, hero);
            }
        }
Example #5
0
        public static Vector2 GetTopPanelPosition(Hero v)
        {
            Vector2 pos;

            if (Members.TopPanelPostiion.TryGetValue(v.StoredName(), out pos))
            {
                return(pos);
            }
            Members.TopPanelPostiion.Add(v.StoredName(), HUDInfo.GetTopPanelPosition(v));
            return(HUDInfo.GetTopPanelPosition(v));
        }
Example #6
0
        public static Vector2 GetTopPanelPosition(Hero _Unit)
        {
            if (HUDHelper._TopPanelPoses.ContainsKey(_Unit.ClassId))
            {
                return(HUDHelper._TopPanelPoses[_Unit.ClassId]);
            }
            Vector2 vector2 = HUDInfo.GetTopPanelPosition(_Unit) + new Vector2(0.0f, (float)HUDInfo.GetTopPanelSizeX(_Unit));

            HUDHelper._TopPanelPoses.Add(_Unit.ClassId, vector2);
            return(vector2);
        }
Example #7
0
        private static void Render_HUD(EventArgs args)
        {
            for (uint i = 0; i < 10; i++)
            {
                var player = ObjectMgr.GetPlayerById(i);
                if (player == null)
                {
                    continue;
                }
                Hero h = player.Hero;
                if (h == null)
                {
                    continue;
                }

                var Pos  = HUDInfo.GetTopPanelPosition(h);
                var PosX = (float)HUDInfo.GetTopPanelSizeX(h);
                var PosY = (float)HUDInfo.GetTopPanelSizeY(h);

                var PosHealth = new Vector2(h.Health * PosX / h.MaximumHealth, 0);
                var PosMana   = new Vector2(h.Mana * PosX / h.MaximumMana, 0);

                float BPos = PosY + 1;

                if (h.Health == 0)
                {
                    continue;
                }
                if (h.Mana == 0)
                {
                    continue;
                }

                //uint HPX = h.Health * 100 / h.MaximumHealth;
                //string buff = Convert.ToString(HPX);

                if (Menu.Item("HPBarShow").GetValue <bool>())
                {
                    Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), new Color(0, 0, 0, 100));
                    Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosHealth.X, 7), new Color(0, 255, 0, 255));
                    Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), Color.Black, true);
                    BPos += 7;
                }

                if (Menu.Item("ManaBarShow").GetValue <bool>())
                {
                    Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), new Color(0, 0, 0, 100));
                    Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosMana.X, 7), new Color(0, 122, 204, 255));
                    Drawing.DrawRect(Pos + new Vector2(0, BPos), new Vector2(PosX, 7), Color.Black, true);
                }
                // Ebala...
                //Drawing.DrawText(string.Format("({0}% | 999%)", buff), "Arial", Pos + new Vector2(0, PosY + 18), new Vector2(13, 5), Color.White, 0);
            }
        }
Example #8
0
        private static void Overlay1(EventArgs args)
        {
            if (!Game.IsInGame)
            {
                return;
            }
            if (Menu.Item("manabar").GetValue <bool>())
            {
                var player = ObjectMgr.LocalPlayer;
                if (player == null || player.Team == Team.Observer)
                {
                    return;
                }

                var enemies = ObjectMgr.GetEntities <Hero>()
                              .Where(x => x.IsVisible && x.IsAlive && x.MaximumMana > 0 && !x.IsIllusion && x.Team != player.Team)
                              .ToList();
                foreach (var enemy in enemies)
                {
                    var start    = HUDInfo.GetHPbarPosition(enemy) + new Vector2(0, HUDInfo.GetHpBarSizeY(enemy) + 1);
                    var manaperc = enemy.Mana / enemy.MaximumMana;
                    var size     = new Vector2(HUDInfo.GetHPBarSizeX(enemy), HUDInfo.GetHpBarSizeY(enemy) * 2 / 5);

                    Drawing.DrawRect(start, size + new Vector2(1, 1), Color.Black);
                    Drawing.DrawRect(start, new Vector2(size.X * manaperc, size.Y), new Color(100, 135, 240, 255));
                    Drawing.DrawRect(start + new Vector2(-1, -2), size + new Vector2(4, 3), Color.Black, true);
                }
            }
            if (Menu.Item("toppanel").GetValue <bool>())
            {
                for (uint i = 0; i < 10; i++)
                {
                    var v = ObjectMgr.GetPlayerById(i).Hero;
                    if (v == null || !v.IsAlive)
                    {
                        continue;
                    }
                    var       pos         = HUDInfo.GetTopPanelPosition(v);
                    var       sizeX       = (float)HUDInfo.GetTopPanelSizeX(v);
                    var       sizeY       = (float)HUDInfo.GetTopPanelSizeY(v);
                    var       healthDelta = new Vector2(v.Health * sizeX / v.MaximumHealth, 0);
                    var       manaDelta   = new Vector2(v.Mana * sizeX / v.MaximumMana, 0);
                    const int height      = 7;

                    Drawing.DrawRect(pos + new Vector2(0, sizeY + 1), new Vector2(healthDelta.X, height), new Color(0, 255, 0, 100));
                    Drawing.DrawRect(pos + new Vector2(0, sizeY + 1), new Vector2(sizeX, height), Color.Black, true);

                    Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(manaDelta.X, height), new Color(80, 120, 255, 255));
                    Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(sizeX, height), Color.Black, true);
                }
            }
        }
Example #9
0
        private static Vector2 GetTopPanelPosition(Hero hero)
        {
            Vector2 vector2;
            var     handle = hero.Handle;

            if (TopPos.TryGetValue(handle, out vector2))
            {
                return(vector2);
            }
            vector2 = HUDInfo.GetTopPanelPosition(hero);
            TopPos.Add(handle, vector2);
            return(vector2);
        }
Example #10
0
 public static Vector2 GetTopPanelPosition(Hero _Unit)
 {
     if (_TopPanelPoses.ContainsKey(_Unit.ClassId))
     {
         return(_TopPanelPoses[_Unit.ClassId]);
     }
     else
     {
         var _Pos = HUDInfo.GetTopPanelPosition(_Unit) + new Vector2(0, (float)HUDInfo.GetTopPanelSizeX(_Unit));
         _TopPanelPoses.Add(_Unit.ClassId, _Pos);
         return(_Pos);
     }
 }
        public Notification Notificate(Hero hero, AbilityId id, float time)
        {
            var find = Notifications.FirstOrDefault(x => x.Hero.Equals(hero));

            if (find != null)
            {
                return(find);
            }
            var n = new Notification(hero,
                                     HUDInfo.GetTopPanelPosition((CHero)UnitManager.GetUnitByHandle(hero.Handle)), id, time);

            Notifications.Add(n);
            return(n);
        }
        private void DrawingOnOnDraw(EventArgs args)
        {
            var heroes =
                EntityManager <Hero> .Entities.Where(
                    x => x.IsAlive && !x.IsAlly(_main.Invoker.Owner) && x.IsVisible);

            if (!DrawDamageHero && !DrawDamageTop)
            {
                return;
            }
            if (_main.Invoker.Exort.Level == 0)
            {
                return;
            }
            var damage = GetSunStikeDamage;

            foreach (var hero in heroes)
            {
                var text = $"{(int)(hero.Health - damage)}";
                if (DrawDamageHero)
                {
                    var pos = HUDInfo.GetHPbarPosition(hero);
                    if (!pos.IsZero)
                    {
                        var size     = new Vector2(HUDInfo.HpBarY / 1.5f);
                        var textSize = Drawing.MeasureText(text, "Arial", size,
                                                           FontFlags.AntiAlias | FontFlags.StrikeOut);
                        pos -= new Vector2(textSize.X + 5, 0);
                        Drawing.DrawText(text, pos, size, Color.White,
                                         FontFlags.AntiAlias | FontFlags.StrikeOut);
                    }
                }
                if (DrawDamageTop)
                {
                    var sizeY = (float)HUDInfo.GetTopPanelSizeY(hero);
                    var pos   = HUDInfo.GetTopPanelPosition(hero) +
                                new Vector2(0, sizeY * 2);
                    var size = new Vector2(sizeY / 1.5f);

                    /*var textSize = Drawing.MeasureText(text, "Arial", size,
                     *  FontFlags.AntiAlias | FontFlags.StrikeOut);*/
                    Drawing.DrawText(text, pos, size, Color.White,
                                     FontFlags.AntiAlias | FontFlags.StrikeOut);
                }
            }
        }
Example #13
0
        private static void DrawOnTopPanel(BombDamageManager.HeroDamageContainer heroCont)
        {
            var hero   = heroCont.Hero;
            var topPos = HUDInfo.GetTopPanelPosition(hero) + new Vector2(0, (float)HUDInfo.GetTopPanelSizeX(hero)) +
                         MenuManager.GetExtraPosForTopPanel;
            var size     = new Vector2((float)HUDInfo.GetTopPanelSizeX(hero), (float)HUDInfo.GetTopPanelSizeY(hero));
            var iconSize = new Vector2(size.X / 2, size.Y) / 2 + MenuManager.GetTopPanelExtraSize;

            Drawing.DrawRect(topPos, iconSize,
                             Textures.GetSpellTexture(AbilityId.techies_land_mines.ToString()));
            var text     = heroCont.GetLandDamage;
            var textSize = Drawing.MeasureText(text, "Arial",
                                               new Vector2((float)(iconSize.Y * .80), (float)(iconSize.Y * .95)), FontFlags.AntiAlias);
            var textPos = topPos + new Vector2(iconSize.X + 2, 0);

            Drawing.DrawText(
                text,
                textPos + new Vector2(2, 2),
                new Vector2(textSize.Y, 0),
                Color.White,
                FontFlags.AntiAlias | FontFlags.StrikeOut);
            Drawing.DrawRect(topPos + new Vector2(0, iconSize.Y), iconSize,
                             Textures.GetSpellTexture(AbilityId.techies_suicide.ToString()));
            text     = heroCont.GetSuicideStatus;
            textSize = Drawing.MeasureText(text, "Arial",
                                           new Vector2((float)(iconSize.Y * .80), (float)(iconSize.Y * .95)), FontFlags.AntiAlias);
            textPos = topPos + new Vector2(iconSize.X + 2, iconSize.Y);
            Drawing.DrawText(
                text,
                textPos + new Vector2(2, 2),
                new Vector2(textSize.Y, 0),
                Color.White,
                FontFlags.AntiAlias | FontFlags.StrikeOut);
            Drawing.DrawRect(topPos + new Vector2(0, iconSize.Y * 2), iconSize,
                             Textures.GetSpellTexture(AbilityId.techies_remote_mines.ToString()));
            text     = heroCont.GetRemoteDamage;
            textSize = Drawing.MeasureText(text, "Arial",
                                           new Vector2((float)(iconSize.Y * .80), (float)(iconSize.Y * .95)), FontFlags.AntiAlias);
            textPos = topPos + new Vector2(iconSize.X + 2, iconSize.Y * 2);
            Drawing.DrawText(
                text,
                textPos + new Vector2(2, 2),
                new Vector2(textSize.Y, 0),
                Color.White,
                FontFlags.AntiAlias | FontFlags.StrikeOut);
        }
Example #14
0
        public ScreenInfo(IAbilityUnit unit)
        {
            this.Unit = unit;

            var hero = unit.SourceUnit as Hero;

            if (hero != null)
            {
                this.TopPanelPosition = HUDInfo.GetTopPanelPosition(hero);
                this.TopPanelIconSize = new Vector2(
                    (float)HUDInfo.GetTopPanelSizeX(hero),
                    (float)HUDInfo.GetTopPanelSizeY(hero));
            }

            this.HealthBarSize = new Vector2(
                HUDInfo.GetHPBarSizeX(hero ?? unit.SourceUnit),
                HUDInfo.GetHpBarSizeY(hero ?? unit.SourceUnit));
        }
Example #15
0
 public static Vector2 GetTopPanelPosition(Hero v)
 {
     try
     {
         Vector2 pos;
         if (Members.TopPanelPostiion.TryGetValue(v.StoredName(), out pos))
         {
             return(pos);
         }
         Members.TopPanelPostiion.Add(v.StoredName(), HUDInfo.GetTopPanelPosition(v));
         return(HUDInfo.GetTopPanelPosition(v));
     }
     catch (Exception e)
     {
         Printer.Print("GetTopPanelPosition: " + e.Message);
         return(new Vector2());
     }
 }
Example #16
0
        public static void OnDraw(object sender, EventArgs eventArgs)
        {
            if (Core.Logics.MainLogic.DoStack)
            {
                if (Core.Config._Menu.Drawings.DrawingsOnTop)
                {
                    var _Temp = HUDInfo.GetTopPanelPosition(Core.Config._Hero) + new Vector2(0, 60);
                    Core.Config._Renderer.DrawRectangle(new RectangleF(_Temp.X, _Temp.Y, (float)HUDInfo.GetTopPanelSizeX(Core.Config._Hero), (float)HUDInfo.GetTopPanelSizeY(Core.Config._Hero)), System.Drawing.Color.Green, 2);
                }

                if (Core.Config._Menu.Drawings.DrawingsOnHero)
                {
                    String _Text     = "Pulling...";
                    var    _Pos      = HUDInfo.GetHPbarPosition(Core.Config._Hero);
                    var    _Size     = new Vector2((float)HUDInfo.GetHPBarSizeX(Core.Config._Hero), (float)HUDInfo.GetHpBarSizeY(Core.Config._Hero));
                    var    _TextSize = Core.Config._Renderer.MessureText(_Text);
                    var    _TextPos  = _Pos - new Vector2(_TextSize.X + 10, 5);
                    Core.Config._Renderer.DrawText(_TextPos, _Text, System.Drawing.Color.White);
                }
            }
        }
Example #17
0
        public static void OnDraw(object sender, EventArgs eventArgs)
        {
            //foreach (var C in Core.Config.GetCamps)
            //{
            //    Drawing.DrawText("Camp " + C.Id, "Arial", Drawing.WorldToScreen(C.TablePos), new Vector2(20, 20), Color.Red, FontFlags.Italic);
            //    Drawing.DrawCircle(Drawing.WorldToScreen(C.StackPos), 10, 10, Color.Red);
            //    Drawing.DrawCircle(Drawing.WorldToScreen(C.PreparePos), 10, 10, Color.Red);
            //}

            //if (Core.Config.DrawConsole)
            //{
            //    Drawing.DrawText("POS " + Core.Config._Hero.Position.X + " " + Core.Config._Hero.Position.Y + " " + Core.Config._Hero.Position.Z,
            //        "Arial", Drawing.WorldToScreen(Core.Config._Hero.Position), new Vector2(40, 40), Color.Red, FontFlags.Italic);
            //}
            //else
            //{
            //    Drawing.DrawText("Status " + Core.Config.Status + " " + " " + Core.Config._Hero.IsAttacking() + " " + Core.Config.ForTest,
            //       "Arial", Drawing.WorldToScreen(Core.Config._Hero.Position), new Vector2(40, 40), Color.Red, FontFlags.Italic);
            //}

            if (Core.Config.DoStack)
            {
                if (Core.Config._Menu.Drawings.DrawingsOnTop)
                {
                    var _Temp = HUDInfo.GetTopPanelPosition(Core.Config._Hero) + new Vector2(0, 60);
                    Core.Config._Renderer.DrawRectangle(new RectangleF(_Temp.X, _Temp.Y, (float)HUDInfo.GetTopPanelSizeX(Core.Config._Hero), (float)HUDInfo.GetTopPanelSizeY(Core.Config._Hero)), Color.Green, 2);
                }

                if (Core.Config._Menu.Drawings.DrawingsOnHero)
                {
                    String _Text     = "Pulling...";
                    var    _Pos      = HUDInfo.GetHPbarPosition(Core.Config._Hero);
                    var    _TextSize = Core.Config._Renderer.MessureText(_Text);
                    var    _TextPos  = _Pos - new Vector2(_TextSize.X + 10, 5);
                    Core.Config._Renderer.DrawText(_TextPos, _Text, Color.White);
                }
            }

            //Core.Config._Renderer.DrawText(Drawing.WorldToScreen(Core.Config._Hero.Position), "!" + Core.Config.Test, Color.White);
        }
Example #18
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            if (Drawing.Direct3DDevice9 == null || Drawing.Direct3DDevice9.IsDisposed || !Game.IsInGame || me == null ||
                (!Menu.Item("drawTopPanel").GetValue <bool>() && !Menu.Item("drawSuicideKills").GetValue <bool>()))
            {
                return;
            }

            //Console.WriteLine(players.Count());
            try
            {
                if (players == null || players.Count() < 5)
                {
                    players =
                        ObjectMgr.GetEntities <Player>()
                        .Where(x => x != null && x.Hero != null && x.Hero.Team == me.GetEnemyTeam());
                }
                var enumerable = players as Player[] ?? players.ToArray();
                //Console.WriteLine(enumerable.Count());
                foreach (var hero in
                         enumerable.Select(x => x.Hero))
                {
                    var  classId = hero.ClassID;
                    bool enabled;
                    if (!enabledHeroes.TryGetValue(classId, out enabled))
                    {
                        enabledHeroes[classId] = true;
                    }
                    var health = hero.Health;
                    if (!hero.IsAlive)
                    {
                        health = hero.MaximumHealth;
                    }
                    double[] topPanel;
                    if (!heroTopPanel.TryGetValue(classId, out topPanel))
                    {
                        topPanel    = new double[3];
                        topPanel[0] = HUDInfo.GetTopPanelSizeX(hero);
                        topPanel[1] = HUDInfo.GetTopPanelPosition(hero).X;
                        topPanel[2] = HUDInfo.GetTopPanelSizeY(hero) * 1.4;
                        heroTopPanel.Add(classId, topPanel);
                    }
                    var sizeX = topPanel[0];
                    var x     = topPanel[1];
                    var sizey = topPanel[2];
                    if (Menu.Item("drawTopPanel").GetValue <bool>())
                    {
                        if (remoteMinesDmg > 0)
                        {
                            double remoteNumber;
                            if (!RemoteMinesHeroDmg.TryGetValue(classId, out remoteNumber))
                            {
                                remoteNumber =
                                    Math.Ceiling(health / hero.DamageTaken(remoteMinesDmg, DamageType.Magical, me));
                                RemoteMinesHeroDmg.Add(classId, remoteNumber);
                                Utils.Sleep(1000, classId + " remoteNumber");
                            }
                            else if (Utils.SleepCheck(classId + " remoteNumber"))
                            {
                                remoteNumber =
                                    Math.Ceiling(health / hero.DamageTaken(remoteMinesDmg, DamageType.Magical, me));
                                RemoteMinesHeroDmg[classId] = remoteNumber;
                                Utils.Sleep(1000, classId + " remoteNumber");
                            }
                            panelText.DrawText(
                                null,
                                remoteNumber.ToString(CultureInfo.InvariantCulture),
                                (int)(x + sizeX / 3.6),
                                (int)sizey,
                                enabled ? Color.Green : Color.DimGray);
                        }
                        if (landMinesDmg > 0)
                        {
                            double landNumber;
                            if (!landMinesHeroDmg.TryGetValue(classId, out landNumber))
                            {
                                landNumber =
                                    Math.Ceiling(health / hero.DamageTaken(landMinesDmg, DamageType.Physical, me));
                                landMinesHeroDmg.Add(classId, landNumber);
                                Utils.Sleep(1000, classId + " remoteNumber");
                            }
                            else if (Utils.SleepCheck(classId + " remoteNumber"))
                            {
                                landNumber =
                                    Math.Ceiling(health / hero.DamageTaken(landMinesDmg, DamageType.Physical, me));
                                landMinesHeroDmg[classId] = landNumber;
                                Utils.Sleep(1000, classId + " remoteNumber");
                            }
                            panelText.DrawText(
                                null,
                                landNumber.ToString(CultureInfo.InvariantCulture),
                                (int)x,
                                (int)sizey,
                                enabled ? Color.Red : Color.DimGray);
                        }
                    }
                    if (suicideAttackDmg > 0)
                    {
                        float dmg;

                        if (!suicideHeroDmg.TryGetValue(classId, out dmg))
                        {
                            dmg = health - hero.DamageTaken(suicideAttackDmg, DamageType.Physical, me);
                            suicideHeroDmg.Add(classId, dmg);
                            Utils.Sleep(150, classId + " canKill");
                        }
                        else if (Utils.SleepCheck(classId + " canKill"))
                        {
                            dmg = health - hero.DamageTaken(suicideAttackDmg, DamageType.Physical, me);
                            suicideHeroDmg[classId] = dmg;
                            Utils.Sleep(150, classId + " canKill");
                        }
                        var canKill = dmg <= 0;
                        if (Menu.Item("drawTopPanel").GetValue <bool>())
                        {
                            panelText.DrawText(
                                null,
                                canKill ? "Yes" : "No",
                                canKill ? (int)(x + sizeX / 2) : (int)(x + sizeX / 1.7),
                                (int)sizey,
                                enabled ? Color.DarkOrange : Color.DimGray);
                        }
                        if (!hero.IsVisible || !hero.IsAlive)
                        {
                            continue;
                        }
                        if (Menu.Item("drawSuicideKills").GetValue <bool>())
                        {
                            var screenPos = HUDInfo.GetHPbarPosition(hero);
                            if (screenPos.X + 20 > Drawing.Width || screenPos.X - 20 < 0 ||
                                screenPos.Y + 100 > Drawing.Height || screenPos.Y - 30 < 0)
                            {
                                continue;
                            }
                            suicideDmgText.DrawText(
                                null,
                                canKill ? "Yes" : "No " + Math.Floor(dmg),
                                (int)(screenPos.X),
                                (int)(screenPos.Y - HUDInfo.GetHpBarSizeY(hero) * 1.5),
                                enabled ? (canKill ? Color.LawnGreen : Color.Red) : Color.Gray);
                        }
                    }
                }
            }
            catch (Exception)
            {
                players =
                    ObjectMgr.GetEntities <Player>()
                    .Where(x => x != null && x.Hero != null && x.Hero.Team == me.GetEnemyTeam());
            }
        }
Example #19
0
        private static void Drawing_OnDraw(EventArgs args)
        {
            var player = ObjectMgr.LocalPlayer;

            if (player == null || player.Team == Team.Observer || !_loaded)
            {
                return;
            }
            var me = player.Hero;

            #region SS ACTION

            var exort      = me.Spellbook.SpellE;
            var topDamage  = Menu.Item("ssDamageontop").GetValue <bool>();
            var heroDamage = Menu.Item("ssDamageonhero").GetValue <bool>();
            var predDamage = Menu.Item("ssPrediction").GetValue <bool>();
            if (exort != null && exort.Level > 0 && (topDamage || heroDamage || predDamage))
            {
                var damage = 100 + 62.5 * (exort.Level - 1);
                if (topDamage)
                {
                    var enemy = ObjectMgr.GetEntities <Hero>()
                                .Where(x => x.IsAlive && x.Team != me.Team && !x.IsIllusion);
                    if (me.AghanimState())
                    {
                        damage += 62.5;
                    }
                    foreach (var hero in enemy)
                    {
                        Drawing.DrawText((hero.Health - damage).ToString(CultureInfo.InvariantCulture),
                                         HUDInfo.GetTopPanelPosition(hero) + new Vector2(0, 90), Color.White,
                                         FontFlags.AntiAlias | FontFlags.DropShadow);
                    }
                }
                var target = ClosestToMouse(me);
                if (target != null && target.IsValid)
                {
                    if (heroDamage)
                    {
                        try
                        {
                            Drawing.DrawText((target.Health - damage).ToString(CultureInfo.InvariantCulture),
                                             HUDInfo.GetHPbarPosition(target) + new Vector2(0, -35), Color.White,
                                             FontFlags.AntiAlias | FontFlags.DropShadow);
                        }
                        catch
                        {
                            // ignored
                        }
                    }
                    var predVector3 = target.NetworkActivity == NetworkActivity.Move
                        ? Prediction.InFront(target, (float)(target.MovementSpeed * 1.7 + Game.Ping / 1000))
                        : target.Position;
                    if (predDamage)
                    {
                        if (_predictionEffect == null)
                        {
                            _predictionEffect = new ParticleEffect(@"particles\ui_mouseactions\range_display.vpcf",
                                                                   predVector3);
                            _predictionEffect.SetControlPoint(1, new Vector3(175, 0, 0));
                        }
                        _predictionEffect.SetControlPoint(0, predVector3);
                    }
                    else
                    {
                        if (_predictionEffect != null)
                        {
                            _predictionEffect.Dispose();
                            _predictionEffect = null;
                        }
                    }
                    if (_sunstrikekill && Utils.SleepCheck("SunStrike"))
                    {
                        var sunstrike = me.FindSpell("invoker_sun_strike");
                        var active1   = me.Spellbook.Spell4;
                        var active2   = me.Spellbook.Spell5;
                        if (active2 != null && active1 != null && sunstrike != null && (Equals(sunstrike, active1) || Equals(sunstrike, active2)))
                        {
                            if (sunstrike.CanBeCasted())
                            {
                                sunstrike.UseAbility(predVector3);
                                Utils.Sleep(250, "SunStrike");
                            }
                        }
                    }
                }
                else
                {
                    if (_predictionEffect != null)
                    {
                        _predictionEffect.Dispose();
                        _predictionEffect = null;
                    }
                }
            }

            #endregion

            #region Menu
            if (!Menu.Item("ShowComboMenu").GetValue <bool>())
            {
                return;
            }
            var pos   = new Vector2(Menu.Item("MenuPosX").GetValue <Slider>().Value, Menu.Item("MenuPosY").GetValue <Slider>().Value);
            var size2 = new Vector2(_size.X * _maxComboSpells + 10 /*150 * Percent*/, 10 + _maxCombo * (_size.Y + 2) /*250 * Percent*/);

            Drawing.DrawRect(pos, size2, new Color(0, 0, 0, 100));
            Drawing.DrawRect(pos, size2, new Color(0, 155, 255, 255), true);
            var i = 0;

            //var max = Combos.Length;
            foreach (var comboStruct in Combos)
            {
                var     sizeY       = 4 + i * (_size.Y + 2);
                var     eul         = comboStruct.CheckEul();
                var     texturename = "materials/ensage_ui/items/cyclone.vmat";
                var     selected    = _combo == i;
                Vector2 itemStartPos;
                if (eul)
                {
                    itemStartPos = pos + new Vector2(10, sizeY);

                    Drawing.DrawRect(
                        itemStartPos,
                        new Vector2((float)(_size.X + _size.X * 0.16), _size.Y),
                        Drawing.GetTexture(texturename));
                    if (_stage == 1 && selected)
                    {
                        Drawing.DrawRect(
                            itemStartPos + new Vector2(1, 1),
                            new Vector2(_size.X - 6, _size.Y - 2),
                            Color.Red, true);
                    }
                }
                var j     = 0;//eul ? 0 : 0;
                var legal = 1;
                //PrintInfo(i.ToString());
                //PrintInfo(i+": "+Combos[i]);
                for (; j <= Combos[i].GetSpellsInCombo(); j++)
                {
                    try
                    {
                        texturename = $"materials/ensage_ui/spellicons/{comboStruct.GetComboAbilities()[j].Name}.vmat";
                        var sizeX = _size.X * (j + (eul?1:0)) + 10;
                        itemStartPos = pos + new Vector2(sizeX, sizeY);
                        Drawing.DrawRect(
                            itemStartPos,
                            new Vector2(_size.X - 6, _size.Y),
                            Drawing.GetTexture(texturename));
                        legal++;
                        if (Equals(comboStruct.GetComboAbilities()[j], Combos[_combo].GetComboAbilities()[_stage - 2]) && selected)
                        {
                            Drawing.DrawRect(
                                itemStartPos,
                                new Vector2(_size.X - 3, _size.Y),
                                Color.Red, true);
                        }
                    }
                    catch (Exception)
                    {
                        // ignored
                    }
                }
                if (selected)
                {
                    Drawing.DrawRect(
                        pos + new Vector2(10, sizeY),
                        new Vector2(_size.X * (legal - (eul ? 0 : 1)) - 6, _size.Y),
                        Color.YellowGreen, true);
                }
                i++;
            }
            #endregion
        }
Example #20
0
 public static void start(bool topmenu)
 {
     me = ObjectMgr.LocalHero;
     if (me == null && !Game.IsInGame)
     {
         return;
     }
     GetHPbarSize();
     ScaleX = (float)Drawing.Width / 1400;
     ScaleY = (float)Drawing.Height / 900;
     heroes = ObjectMgr.GetEntities <Hero>().Where(x => x.IsAlive && !x.IsIllusion && x.IsVisible && x.IsValid).ToList();
     try
     {
         try
         {
             for (uint t = 0; t < 10; t++)
             {
                 player = ObjectMgr.GetPlayerById(t);
                 if (player != null && player.Team != me.Team)
                 {
                     Hero x = player.Hero;
                     if (x != null && x.IsValid && x.Health != 0)
                     {
                         if (topmenu)
                         {
                             TOP_HEALTH_BAR_POS  = new Vector2(HUDInfo.GetTopPanelPosition(x).X, (float)HUDInfo.GetTopPanelSizeY(x) + (1 * ScaleY));
                             TOP_HEALTH_BAR_SIZE = new Vector2(((float)HUDInfo.GetTopPanelSizeX(x) / (x.MaximumHealth / (float)x.Health)) - (2 * ScaleX), boxSizeY - (13 * ScaleY));
                             TOP_MANA_BAR_POS    = new Vector2(HUDInfo.GetTopPanelPosition(x).X, (float)HUDInfo.GetTopPanelSizeY(x) + 6);
                             TOP_MANA_BAR_SIZE   = new Vector2(((float)HUDInfo.GetTopPanelSizeX(x) / (x.MaximumMana / x.Mana)) - (2 * ScaleX), boxSizeY - (13 * ScaleY));
                             TOP_BAR_FULLSIZE    = new Vector2((float)HUDInfo.GetTopPanelSizeX(x) - (2 * ScaleX), boxSizeY - (13 * ScaleY));
                             TOP_ULT_BAR_POS     = new Vector2(HUDInfo.GetTopPanelPosition(x).X, (float)HUDInfo.GetTopPanelSizeY(x) + (12 * ScaleY));
                             TOP_ULT_BAR_SIZE    = new Vector2(((float)HUDInfo.GetTopPanelSizeX(x) / (x.Spellbook.SpellR.CooldownLength / x.Spellbook.SpellR.Cooldown)) - (2 * ScaleX), boxSizeY - (13 * ScaleY));
                             if (MouseOnSpot(TOP_HEALTH_BAR_POS, new Vector2((float)HUDInfo.GetTopPanelSizeX(x), 100 * ScaleY)))
                             {
                                 Drawing.DrawText("HP: " + (int)x.Health + " / MANA: " + (int)x.Mana + " / ULT: " + (int)x.Spellbook.SpellR.Cooldown, TOP_HEALTH_BAR_POS + new Vector2(-5 * ScaleX, 17 * ScaleY), new Vector2(18 * ScaleX, 15 * ScaleY), Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive);
                             }
                             Drawing.DrawRect(TOP_HEALTH_BAR_POS, TOP_HEALTH_BAR_SIZE, Color.Green, false);
                             Drawing.DrawRect(TOP_HEALTH_BAR_POS, TOP_BAR_FULLSIZE, Color.Black, true);
                             Drawing.DrawRect(TOP_MANA_BAR_POS, TOP_MANA_BAR_SIZE, new Color(0x00, 0x80, 0xF8, 0xFF), false);
                             Drawing.DrawRect(TOP_MANA_BAR_POS, TOP_BAR_FULLSIZE, Color.Black, true);
                             if (TOP_ULT_BAR_SIZE.X > 0)
                             {
                                 Drawing.DrawRect(TOP_ULT_BAR_POS, TOP_ULT_BAR_SIZE, Color.Gold, false);
                                 Drawing.DrawRect(TOP_ULT_BAR_POS, TOP_BAR_FULLSIZE, Color.Black, true);
                             }
                         }
                     }
                 }
             }
             foreach (Hero x in heroes)
             {
                 if (x == null)
                 {
                     continue;
                 }
                 if (x == me)
                 {
                     continue;
                 }
                 Herospells  = x.Spellbook.Spells;
                 DangerItems = x.Inventory.Items;
                 i           = 0;
                 i2          = 0;
                 i3          = 0;
                 if (x.Mana > 0 && x.Team != me.Team && !x.UnitState.HasFlag(UnitState.NoHealthbar))
                 {
                     Drawing.DrawRect(new Vector2((float)(HUDInfo.GetHPbarPosition(x).X - (0.5 * ScaleX)), HUDInfo.GetHPbarPosition(x).Y + (9 * ScaleY)), new Vector2((boxSizeX * 6) + (2 * ScaleX), boxSizeY - (13 * ScaleY)), new Color(0x00, 0x80, 0xF8, 0x32), false);
                     Drawing.DrawRect(new Vector2((float)(HUDInfo.GetHPbarPosition(x).X - (0.5 * ScaleX)), HUDInfo.GetHPbarPosition(x).Y + (9 * ScaleY)), new Vector2((boxSizeX * 6) + (2 * ScaleX), boxSizeY - (13 * ScaleY)), Color.Black, true);
                     Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + (1 * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (10 * ScaleY)), new Vector2(((boxSizeX * 6) / (x.MaximumMana / x.Mana)) - (1 * ScaleX), boxSizeY - (15 * ScaleY)), new Color(0x00, 0x80, 0xF8, 0xFF), false);
                 }
                 foreach (Ability y in Herospells)
                 {
                     if (y != null && !y.Name.Contains("empty") && (x.Name.Contains("rubick") ? !y.Name.Contains("hidden") : true) && !x.UnitState.HasFlag(UnitState.NoHealthbar))
                     {
                         if (y.AbilitySlot == AbilitySlot.Slot_1ULL || y.AbilitySlot == AbilitySlot.Slot_2 || y.AbilitySlot == AbilitySlot.Slot_3 || y.AbilitySlot == AbilitySlot.Slot_4 || y.AbilitySlot == AbilitySlot.Slot_5 || y.AbilitySlot == AbilitySlot.Slot_6)
                         {
                             Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Drawing.GetTexture("materials/ensage_ui/spellicons/" + y.Name + ".vmat"));
                             Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Color.Black, true);
                             if (y.Cooldown > 0 || (y.ManaCost > x.Mana && y.ManaCost > 0))
                             {
                                 Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0xCE, 0x9E), false);
                                 Drawing.DrawText((int)(y.Cooldown == 0 ? (y.ManaCost - x.Mana) : y.Cooldown) + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + (0.8 + (i * 20) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (17 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), y.Cooldown == 0 ? Color.LightSkyBlue : Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive);
                             }
                             if (y.Level <= 0)
                             {
                                 Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0x00, 0x9E), false);
                             }
                             else
                             {
                                 Drawing.DrawRect(new Vector2((HUDInfo.GetHPbarPosition(x).X + ((i * 20) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(boxSizeX - ((y.Level < 10 ? 8 : 5) * ScaleX), boxSizeY - (9 * ScaleY)), Color.Black, false);
                                 Drawing.DrawText((int)y.Level + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + (((y.Level < 10 ? 0.8 : 0) + (i * 20)) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (25 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), Color.YellowGreen, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive);
                             }
                             i += 1 * ScaleX;
                         }
                         else
                         {
                             if (y.Cooldown != 0 || y.ManaCost > x.Mana)
                             {
                                 Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i2 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (50 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Drawing.GetTexture("materials/ensage_ui/spellicons/" + y.Name + ".vmat"));
                                 Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i2 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (50 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Color.Black, true);
                                 if (y.Cooldown > 0 || (y.ManaCost > x.Mana && y.ManaCost > 0))
                                 {
                                     Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i2 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y - (50 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0xCE, 0x9E), false);
                                     Drawing.DrawText((int)(y.Cooldown == 0 ? (y.ManaCost - x.Mana) : y.Cooldown) + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + ((0.8 + (i2 * 20)) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y - (42 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), y.Cooldown == 0 ? Color.LightSkyBlue : Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive);
                                 }
                                 i2 += 1 * ScaleX;
                             }
                         }
                     }
                 }
                 foreach (Item z in DangerItems)
                 {
                     if (z != null && !x.UnitState.HasFlag(UnitState.NoHealthbar) && (z.Name == "item_gem" || z.Name == "item_dust" || z.Name == "item_sphere" || z.Name == "item_blink" || z.Name == "item_ward_observer" || z.Name == "item_ward_sentry" || z.Name == "item_black_king_bar" || z.Name == "item_ward_dispenser" || z.Name == "item_sheepstick" || z.Name == "item_blade_mail" || z.Name == "item_rapier" || z.Name == "item_cyclone" || z.Name == "item_shadow_amulet" || z.Name == "item_invis_sword" || z.Name == "item_silver_edge" || z.Name == "item_glimmer_cape" || z.Name == "item_lotus_orb" || z.Name == "item_orchid" || z.Name.Contains("item_dagon") || z.Name == "item_manta" || z.Name == "item_aegis" || z.Name == "item_cheese"))
                     {
                         Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i3 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (15 * ScaleY)), new Vector2(boxSizeX + (6 * ScaleX), boxSizeY), Drawing.GetTexture("materials/ensage_ui/items/" + z.Name.Remove(0, 5)));
                         Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i3 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (15 * ScaleY)), new Vector2(boxSizeX, boxSizeY), Color.Black, true);
                         if (z.Cooldown > 0 || (z.ManaCost > x.Mana && z.ManaCost > 0))
                         {
                             Drawing.DrawRect(new Vector2(HUDInfo.GetHPbarPosition(x).X + ((i3 * 20) * ScaleX), HUDInfo.GetHPbarPosition(x).Y + (15 * ScaleY)), new Vector2(boxSizeX, boxSizeY), new Color(0x5F, 0x00, 0xCE, 0x9E), false);
                             Drawing.DrawText((int)(z.Cooldown == 0 ? (z.ManaCost - x.Mana) : z.Cooldown) + "", new Vector2((float)(HUDInfo.GetHPbarPosition(x).X + ((1.2 + (i3 * 20)) * ScaleX)), HUDInfo.GetHPbarPosition(x).Y + (23 * ScaleY)), new Vector2(10 * ScaleX, 20 * ScaleY), z.Cooldown == 0 ? Color.LightSkyBlue : Color.White, FontFlags.AntiAlias | FontFlags.StrikeOut | FontFlags.Additive);
                         }
                         i3 += 1 * ScaleX;
                     }
                 }
             }
         }
         catch (EntityNotFoundException)
         {
         }
     }
     catch (NullReferenceException)
     {
     }
 }