private static void Orbwalker_OnUnkillableMinion(Obj_AI_Base target, Orbwalker.UnkillableMinionArgs args) { var minion = target as Obj_AI_Minion; if (minion != null && minion.IsValidTarget(SpellManager.Q.Range) && LastConfig.UseQ && Player.Instance.ManaPercent >= LastConfig.LastMana && Prediction.Health.GetPrediction(minion, SpellManager.Q.CastDelay) > 10 && Prediction.Health.GetPrediction(minion, SpellManager.Q.CastDelay) < SpellDamage.GetRealDamage(SpellSlot.Q, minion)) { SpellManager.Q.Cast(minion); } }
private static void OnEndScene(EventArgs args) { if (Settings.DrawHealth || Settings.DrawPercent) { foreach (var unit in EntityManager.Heroes.Enemies.Where(u => u.IsValidTarget() && u.IsHPBarRendered)) { var damage = DamageToUnit(unit); if (damage <= 0) { continue; } if (Settings.DrawHealth) { var damagePercentage = ((unit.TotalShieldHealth() - damage) > 0 ? (unit.TotalShieldHealth() - damage) : 0) / (unit.MaxHealth + unit.AllShield + unit.AttackShield + unit.MagicShield); var currentHealthPercentage = unit.TotalShieldHealth() / (unit.MaxHealth + unit.AllShield + unit.AttackShield + unit.MagicShield); var startPoint = new Vector2((int)(unit.HPBarPosition.X + damagePercentage * BarWidth), (int)unit.HPBarPosition.Y - 5 + YOffSet); var endPoint = new Vector2((int)(unit.HPBarPosition.X + currentHealthPercentage * BarWidth) + 1, (int)unit.HPBarPosition.Y - 5 + YOffSet); var colorH = System.Drawing.Color.FromArgb(Settings.HealthColor.A - 120, Settings.HealthColor.R, Settings.HealthColor.G, Settings.HealthColor.B); Drawing.DrawLine(startPoint, endPoint, LineThickness, colorH); } if (Settings.DrawPercent) { var color = new Color(Settings.HealthColor.R, Settings.HealthColor.G, Settings.HealthColor.B, Settings.HealthColor.A - 5); _Font.DrawText(null, string.Concat(Math.Ceiling(damage / unit.TotalShieldHealth() * 100), "%"), (int)unit.HPBarPosition[0] + 102, (int)unit.HPBarPosition[1] + 29, color); if (Settings.DrawStatistics) { _Font2.DrawText(null, "-" + Math.Round(SpellDamage.GetTotalDamage(unit)) + " / " + Math.Round((unit.Health - SpellDamage.GetTotalDamage(unit))), (int)unit.HPBarPosition[0] + 82, (int)unit.HPBarPosition[1] - 9, color); } } } } }