/// <summary> /// Initializes the Experience Tracker. /// </summary> public static void Initialize() { foreach (var hero in ObjectManager.Get <Obj_AI_Hero>().Where(h => !h.IsDead && h.IsVisible && Math.Abs(h.FloatingHealthBarPosition.X) > 0)) { if (hero.Name.Equals("Target Dummy")) { continue; } if (hero.IsMe && !MenuClass.ExpTracker["me"].As <MenuBool>().Enabled) { continue; } if (hero.IsEnemy && !MenuClass.ExpTracker["enemies"].As <MenuBool>().Enabled) { continue; } if (!hero.IsMe && hero.IsAlly && !MenuClass.ExpTracker["allies"].As <MenuBool>().Enabled) { continue; } var xOffset = (int)hero.FloatingHealthBarPosition.X + UtilityClass.ExpXAdjustment(hero); var yOffset = (int)hero.FloatingHealthBarPosition.Y + UtilityClass.ExpYAdjustment(hero); var actualExp = hero.Exp; if (hero.Level > 1) { actualExp -= (280 + 80 + 100 * hero.Level) / 2 * (hero.Level - 1); } var levelLimit = hero.HasBuff("AwesomeBuff") ? 30 : 18; if (hero.Level < levelLimit) { Render.Line(xOffset - 76, yOffset + 20, xOffset + 56, yOffset + 20, 7, true, Colors.GetRealColor(Color.Purple)); var neededExp = 180 + 100 * hero.Level; var expPercent = (int)(actualExp / neededExp * 100); if (expPercent > 0) { Render.Line(xOffset - 76, yOffset + 20, xOffset - 76 + (float)(1.32 * expPercent), yOffset + 20, 7, true, Colors.GetRealColor(Color.Red)); } Render.Text(expPercent > 0 ? expPercent + "%" : "0%", new Vector2(xOffset - 13, yOffset + 17), RenderTextFlags.None, Colors.GetRealColor(Color.Yellow)); } } }
/// <summary> /// Initializes the Experience Tracker. /// </summary> public static void Initialize() { foreach (var unit in ObjectManager.Get <Obj_AI_Hero>().Where(e => Math.Abs(e.FloatingHealthBarPosition.X) > 0 && !e.IsDead && e.IsVisible && (e.IsMe && MenuClass.ExpTracker["me"].As <MenuBool>().Enabled || e.IsEnemy && MenuClass.ExpTracker["enemies"].As <MenuBool>().Enabled || e.IsAlly && !e.IsMe && MenuClass.ExpTracker["allies"].As <MenuBool>().Enabled)) ) { if (unit.Name.Equals("Target Dummy")) { return; } var xOffset = (int)unit.FloatingHealthBarPosition.X + UtilityClass.ExpXAdjustment(unit); var yOffset = (int)unit.FloatingHealthBarPosition.Y + UtilityClass.ExpYAdjustment(unit); var actualExp = unit.Exp; if (unit.Level > 1) { actualExp -= (280 + 80 + 100 * unit.Level) / 2 * (unit.Level - 1); } var neededExp = 180 + 100 * unit.Level; var expPercent = (int)(actualExp / neededExp * 100); if (unit.Level < 18 || UtilityClass.Player.HasBuff("AwesomeBuff") && unit.Level < 30) { Render.Line(xOffset - 76, yOffset + 20, xOffset + 56, yOffset + 20, 7, true, Colors.GetRealColor(Color.Purple)); if (expPercent > 0) { Render.Line(xOffset - 76, yOffset + 20, xOffset - 76 + (float)(1.32 * expPercent), yOffset + 20, 7, true, Colors.GetRealColor(Color.Red)); } Render.Text(xOffset - 13, yOffset + 17, Colors.GetRealColor(Color.Yellow), expPercent > 0 ? expPercent + "%" : "0%"); } } }