private static void QFarmCheck() { if (!Q.IsReady()) { return; } var posAfterQ = Player.Position.To2D().Extend(Game.CursorPos.To2D(), 300); var minList = MinionManager.GetMinions(Player.Position, 550f) .Where( min => HealthPrediction.GetHealthPrediction( min, (int)(Q.Delay + min.Distance(posAfterQ) / Orbwalking.GetMyProjectileSpeed()) * 1000) + (Game.Ping / 2) <= (Q.GetDamage(min) + Player.GetAutoAttackDamage(min)) && HealthPrediction.GetHealthPrediction( min, (int)(Q.Delay + min.Distance(posAfterQ) / Orbwalking.GetMyProjectileSpeed()) * 1000) + (Game.Ping / 2) > Player.GetAutoAttackDamage(min)); //Player.GetAutoAttackDamage(min) var objAiBases = minList as Obj_AI_Base[] ?? minList.ToArray(); if (!objAiBases.Any()) { return; } CastQ(Vector3.Zero, objAiBases.First()); }
private static bool IsKillableWaa(Obj_AI_Hero wTarget) { if (Player.Distance(wTarget) > W.Range) { return(false); } return(Player.GetAutoAttackDamage(wTarget) + W.GetDamage(wTarget) > HealthPrediction.GetHealthPrediction( wTarget, (int) ((Player.Distance(wTarget) / W.Speed) * 1000 + (Player.Distance(wTarget) / Orbwalking.GetMyProjectileSpeed()) * 1000) + (Game.Ping / 2)) && Player.Distance(wTarget) <= Orbwalking.GetRealAutoAttackRange(null)); }
public static bool MinionThere() { var list = MinionManager.GetMinions(_player.Position, xSLxOrbwalker.GetAutoAttackRange()) .Where( m => HealthPrediction.GetHealthPrediction( m, (int)(_player.Distance(m) / Orbwalking.GetMyProjectileSpeed()) * 1000) <= Q.GetDamage(m) + _player.GetAutoAttackDamage(m)) .ToList(); // Game.PrintChat("QDmg "+Q.GetDamage(List.FirstOrDefault())); return(list.Count > 0); }
private void OnOrbwalkingAfterAttack(AttackableUnit unit, AttackableUnit target) { try { if (unit.IsMe) { var minion = target as Obj_AI_Minion; if (minion != null) { _lastAaMinion = minion; _lastAaMinionEndTime = Game.Time + minion.Distance(Player) / Orbwalking.GetMyProjectileSpeed() + 0.25f; } } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
public double TimeToHit(AttackableUnit target) { return(Player.Distance(target, false) / Orbwalking.GetMyProjectileSpeed()); }
public bool minionThere() { var List = MinionManager.GetMinions(player.Position, DeathWalker.getTargetSearchDist()) .Where(m => HealthPrediction.GetHealthPrediction(m, (int)(player.Distance(m) / Orbwalking.GetMyProjectileSpeed()) * 1000) <= Q.GetDamage(m) + player.GetAutoAttackDamage(m) ).ToList(); // Game.PrintChat("QDmg "+Q.GetDamage(List.FirstOrDefault())); return(List.Count > 0); }
void QFarmCheck() { // if (COrbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LastHit || // COrbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LaneClear || // COrbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed) return; //Tempfix if (!Q.IsReady()) { return; } var PosAfterQ = Player.Position.To2D().Extend(Game.CursorPos.To2D(), 300); var minList = MinionManager.GetMinions(Player.Position, 550f).Where(min => HealthPrediction.GetHealthPrediction(min, (int)(Q.Delay + min.Distance(PosAfterQ) / Orbwalking.GetMyProjectileSpeed()) * 1000) + Game.Ping <= (Q.GetDamage(min) + Player.GetAutoAttackDamage(min)) && HealthPrediction.GetHealthPrediction(min, (int)(Q.Delay + min.Distance(PosAfterQ) / Orbwalking.GetMyProjectileSpeed()) * 1000) + Game.Ping > 0); if (!minList.First().IsValidTarget()) { return; } CastQ(Vector3.Zero, minList.First()); }
public static AttackableUnit GetTarget() { AttackableUnit result; if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.None) { return(null); } /*Killable Minion*/ if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit) { foreach (var minion in ObjectManager.Get <Obj_AI_Minion>() .Where( minion => minion.IsValidTarget() && Orbwalker.InAutoAttackRange(minion) && minion.Health < 2 * (RealAutoAttack(minion)))) { var t = (int)(Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)Player.Distance(minion) / (int)Orbwalking.GetMyProjectileSpeed(); var predHealth = HealthPrediction.GetHealthPrediction( minion, t, Program.Config.Item("FarmDelay").GetValue <Slider>().Value); if (minion.Team != GameObjectTeam.Neutral && MinionManager.IsMinion(minion, true)) { if (predHealth > 0 && predHealth <= RealAutoAttack(minion)) { return(minion); } } } } /* turrets / inhibitors / nexus */ if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear) { /* turrets */ foreach (var turret in ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsValidTarget() && Orbwalker.InAutoAttackRange(t))) { return(turret); } /* inhibitor */ foreach (var turret in ObjectManager.Get <Obj_BarracksDampener>() .Where(t => t.IsValidTarget() && Orbwalker.InAutoAttackRange(t))) { return(turret); } /* nexus */ foreach (var nexus in ObjectManager.Get <Obj_HQ>().Where(t => t.IsValidTarget() && Orbwalker.InAutoAttackRange(t))) { return(nexus); } } /*Champions*/ if (Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LastHit) { var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical); if (target.IsValidTarget()) { return(target); } } /*Jungle minions*/ if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear || Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed) { result = ObjectManager.Get <Obj_AI_Minion>() .Where( mob => mob.IsValidTarget() && Orbwalker.InAutoAttackRange(mob) && mob.Team == GameObjectTeam.Neutral) .MaxOrDefault(mob => mob.MaxHealth); if (result != null) { return(result); } } /*Lane Clear minions*/ if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear) { if (!ShouldWait()) { if (_prevMinion.IsValidTarget() && Orbwalker.InAutoAttackRange(_prevMinion)) { var predHealth = HealthPrediction.LaneClearHealthPrediction( _prevMinion, (int)((Player.AttackDelay * 1000) * 2f), Program.Config.Item("FarmDelay").GetValue <Slider>().Value); if (predHealth >= 2 * RealAutoAttack(_prevMinion) || Math.Abs(predHealth - _prevMinion.Health) < float.Epsilon) { return(_prevMinion); } } result = (from minion in ObjectManager.Get <Obj_AI_Minion>() .Where(minion => minion.IsValidTarget() && Orbwalker.InAutoAttackRange(minion)) let predHealth = HealthPrediction.LaneClearHealthPrediction( minion, (int)((Player.AttackDelay * 1000) * 2f), Program.Config.Item("FarmDelay").GetValue <Slider>().Value) where predHealth >= 2 * RealAutoAttack(minion) || Math.Abs(predHealth - minion.Health) < float.Epsilon select minion).MaxOrDefault(m => m.Health); if (result != null) { _prevMinion = (Obj_AI_Minion)result; } } } return(null); }
private static Obj_AI_Base GetPossibleTarget() { Obj_AI_Base Target = null; if (Config.Item("OW_Misc_PriorityUnit").GetValue <StringList>().SelectedIndex == 1 && (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze)) { var Obj = GetBestHeroTarget(); if (Program.IsValid(Obj)) { return(Obj); } } if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze || CurrentMode == Mode.LastHit) { foreach (var Obj in ObjectManager.Get <Obj_AI_Minion>().Where(i => Program.IsValid(i) && i.Name != "Beacon" && InAutoAttackRange(i) && i.Team != GameObjectTeam.Neutral && i.Health < 2 * Player.GetAutoAttackDamage(i, true))) { var Time = (int)(Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)(Player.Distance3D(Obj) / Orbwalking.GetMyProjectileSpeed()); var predHp = HealthPrediction.GetHealthPrediction(Obj, Time, Config.Item("OW_Misc_FarmDelay").GetValue <Slider>().Value); if (predHp <= 0) { FireOnNonKillableMinion(Obj); } if (predHp > 0 && predHp <= Player.GetAutoAttackDamage(Obj, true)) { return(Obj); } } } if (Program.IsValid(ForcedTarget) && InAutoAttackRange(ForcedTarget)) { return(ForcedTarget); } if (CurrentMode != Mode.LastHit) { var Obj = GetBestHeroTarget(); if (Program.IsValid(Obj)) { return(Obj); } } var maxHp = float.MaxValue; if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze) { foreach (var Obj in ObjectManager.Get <Obj_AI_Minion>().Where(i => Program.IsValid(i) && i.Name != "Beacon" && InAutoAttackRange(i) && i.Team == GameObjectTeam.Neutral && (i.MaxHealth >= maxHp || Math.Abs(maxHp - float.MaxValue) < float.Epsilon))) { Target = Obj; maxHp = Obj.MaxHealth; } if (Program.IsValid(Target)) { return(Target); } } if ((CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze) && !ShouldWait()) { if (Program.IsValid(PrevMinion) && InAutoAttackRange(PrevMinion)) { var predHp = HealthPrediction.LaneClearHealthPrediction(PrevMinion, (int)(Player.AttackDelay * 1000 * ClearWaitTimeMod), Config.Item("OW_Misc_FarmDelay").GetValue <Slider>().Value); if (predHp >= Player.GetAutoAttackDamage(PrevMinion, true) * 2 || Math.Abs(predHp - PrevMinion.Health) < float.Epsilon) { return(PrevMinion); } } foreach (var Obj in ObjectManager.Get <Obj_AI_Minion>().Where(i => Program.IsValid(i) && i.Name != "Beacon" && InAutoAttackRange(i))) { var predHp = HealthPrediction.LaneClearHealthPrediction(Obj, (int)(Player.AttackDelay * 1000 * ClearWaitTimeMod), Config.Item("OW_Misc_FarmDelay").GetValue <Slider>().Value); if (predHp >= Player.GetAutoAttackDamage(Obj, true) * 2 || Math.Abs(predHp - Obj.Health) < float.Epsilon) { if (Obj.Health >= maxHp || Math.Abs(maxHp - float.MaxValue) < float.Epsilon) { Target = Obj; maxHp = Obj.Health; PrevMinion = Obj; } } } if (Program.IsValid(Target)) { return(Target); } } if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze) { foreach (var Obj in ObjectManager.Get <Obj_AI_Turret>().Where(i => Program.IsValid(i) && InAutoAttackRange(i))) { return(Obj); } } return(null); }
private static AttackableUnit GetPossibleTarget() { AttackableUnit Target = null; var R = float.MaxValue; if (Config.Item("OW_Misc_PriorityUnit").GetValue <StringList>().SelectedIndex == 1 && (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear)) { var Obj = GetBestHeroTarget(); if (Obj.IsValidTarget()) { return(Obj); } } if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LastHit) { foreach (var Obj in ObjectManager.Get <Obj_AI_Minion>().Where(i => i.IsValidTarget() && i.Name != "Beacon" && InAutoAttackRange(i) && i.Team != GameObjectTeam.Neutral)) { var Time = (int)(Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)(Player.Distance(Obj.ServerPosition) / Orbwalking.GetMyProjectileSpeed()); var predHp = HealthPrediction.GetHealthPrediction(Obj, Time, GetCurrentFarmDelay()); if (predHp <= 0) { FireOnNonKillableMinion(Obj); } if (predHp > 0 && predHp <= Player.GetAutoAttackDamage(Obj, true)) { return(Obj); } } } if (ForcedTarget.IsValidTarget() && InAutoAttackRange(ForcedTarget)) { return(ForcedTarget); } if (CurrentMode == Mode.LaneClear) { foreach (var Obj in ObjectManager.Get <Obj_AI_Turret>().Where(i => i.IsValidTarget() && InAutoAttackRange(i))) { return(Obj); } foreach (var Obj in ObjectManager.Get <Obj_BarracksDampener>().Where(i => i.IsValidTarget() && InAutoAttackRange(i))) { return(Obj); } foreach (var Obj in ObjectManager.Get <Obj_HQ>().Where(i => i.IsValidTarget() && InAutoAttackRange(i))) { return(Obj); } } if (CurrentMode != Mode.LastHit) { var Obj = GetBestHeroTarget(); if (Obj.IsValidTarget()) { return(Obj); } } if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear) { foreach (var Obj in ObjectManager.Get <Obj_AI_Minion>().Where(i => i.IsValidTarget() && i.Name != "Beacon" && InAutoAttackRange(i) && i.Team == GameObjectTeam.Neutral && (i.MaxHealth >= R || Math.Abs(R - float.MaxValue) < float.Epsilon))) { Target = Obj; R = Obj.MaxHealth; } } if (CurrentMode == Mode.LaneClear && !ShouldWait()) { if (PrevMinion.IsValidTarget() && InAutoAttackRange(PrevMinion)) { var predHp = HealthPrediction.LaneClearHealthPrediction(PrevMinion, (int)(Player.AttackDelay * 1000 * ClearWaitTimeMod), GetCurrentFarmDelay()); if (predHp >= 2 * Player.GetAutoAttackDamage(PrevMinion, true) || Math.Abs(predHp - PrevMinion.Health) < float.Epsilon) { return(PrevMinion); } } foreach (var Obj in ObjectManager.Get <Obj_AI_Minion>().Where(i => i.IsValidTarget() && i.Name != "Beacon" && InAutoAttackRange(i))) { var predHp = HealthPrediction.LaneClearHealthPrediction(Obj, (int)(Player.AttackDelay * 1000 * ClearWaitTimeMod), GetCurrentFarmDelay()); if ((predHp >= 2 * Player.GetAutoAttackDamage(Obj, true) || Math.Abs(predHp - Obj.Health) < float.Epsilon) && (Obj.Health >= R || Math.Abs(R - float.MaxValue) < float.Epsilon)) { Target = Obj; R = Obj.MaxHealth; PrevMinion = Obj; } } } return(Target); }
private static void Main() { CustomEvents.Game.OnGameLoad += delegate { if (new [] { "Azir", "Kalista" }.Contains(Player.ChampionName)) { Game.PrintChat("[ST] LastHit Assistant : " + Player.ChampionName + " is not working properly and has been disabled."); // SadMemes(); return; } config = new Menu("[ST] LastHit Assistant", "ST_LHA", true); var menuDrawing = new Menu("Drawings", "LastHit_Draw"); { menuDrawing.AddItem( new MenuItem("LastHit_Draw_AARange", "AA Range").SetValue( new Circle(false, Color.FromArgb(255, 255, 0, 255)))); menuDrawing.AddItem( new MenuItem("LastHit_Draw_MinionHPBar", "Your AA Damage on Minions' Health Bars").SetValue( new Circle(true, Color.Black))); menuDrawing.AddItem( new MenuItem("LastHit_Draw_Lasthit", "Minion Last Hit Circle").SetValue( new Circle(true, Color.Lime))); menuDrawing.AddItem( new MenuItem("LastHit_Draw_nearKill", "Minion Near Kill Circle").SetValue( new Circle(true, Color.Gold))); } config.AddSubMenu(menuDrawing); var menuMisc = new Menu("Miscallenous", "LastHit_Misc"); { menuMisc.AddItem(new MenuItem("LastHit_Misc_Holdzone", "Hold Position").SetValue(new Slider(0, 100, 0))); menuMisc.AddItem(new MenuItem("LastHit_Misc_Farmdelay", "Farm Delay").SetValue(new Slider(0, 100, 0))); menuMisc.AddItem( new MenuItem("LastHit_Misc_ExtraWindUp", "Extra Winduptime").SetValue(new Slider(35, 200, 0))); menuMisc.AddItem(new MenuItem("LastHit_Misc_AutoWindUp", "Autoset Windup").SetValue(false)); menuMisc.AddItem( new MenuItem("LastHit_Misc_Humanizer", "Humanizer/Movement Delay").SetValue(new Slider(50, 150, 0))); menuMisc.AddItem(new MenuItem("LastHit_Misc_Path", "Send Short Move Commands").SetValue(true)); config.AddItem(new MenuItem("LastHit_Move", "Movement").SetValue(true)); } config.AddSubMenu(menuMisc); config.AddItem( new MenuItem("LastHit_Key", "Active").SetValue(new KeyBind('Z', KeyBindType.Press))); config.AddToMainMenu(); Drawing.OnDraw += OnDraw; Game.OnUpdate += delegate { if (config.Item("LastHit_Key").GetValue <KeyBind>().Active && !Player.IsCastingInterruptableSpell(true) && !Player.IsChannelingImportantSpell() && !MenuGUI.IsChatOpen && !Player.IsDead) { Orbwalk( Game.CursorPos, (from minion in ObjectManager.Get <Obj_AI_Minion>() where Orbwalking.InAutoAttackRange(minion) let t = (int)(Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)Player.Distance(minion) / (int)Orbwalking.GetMyProjectileSpeed() let predHealth = HealthPrediction.GetHealthPrediction( minion, t, config.Item("LastHit_Misc_Farmdelay").GetValue <Slider>().Value) where minion.Team != GameObjectTeam.Neutral && predHealth > 0 && predHealth <= Player.GetAutoAttackDamage(minion, true) select minion).FirstOrDefault()); } if (!config.Item("LastHit_Misc_AutoWindUp").GetValue <bool>()) { return; } var additional = 0; if (Game.Ping >= 100) { additional = Game.Ping / 100 * 10; } else if (Game.Ping > 40 && Game.Ping < 100) { additional = Game.Ping / 100 * 20; } else if (Game.Ping <= 40) { additional = +20; } var windUp = Game.Ping + additional; if (windUp < 40) { windUp = 40; } config.Item("LastHit_Misc_ExtraWindUp") .SetValue(windUp < 200 ? new Slider(windUp, 200, 0) : new Slider(200, 200, 0)); }; Obj_AI_Base.OnProcessSpellCast += (sender, args) => { if (sender.IsMe && Orbwalking.IsAutoAttack(args.SData.Name)) { lastAutoAttackTick = Environment.TickCount; } }; }; }
private void Harass() { AIHeroClient target = LeagueSharp.Common.TargetSelector.GetTarget(Q.Range, LeagueSharp.Common.TargetSelector.DamageType.Physical); float perc = config.Item("minmanaH", true).GetValue <Slider>().Value / 100f; if (player.Mana < player.MaxMana * perc) { return; } if (target == null) { return; } if (config.Item("useqH", true).GetValue <bool>() && Q.IsReady()) { var miniPred = MinionManager.GetMinions( Orbwalking.GetRealAutoAttackRange(player), MinionTypes.All, MinionTeam.NotAlly) .FirstOrDefault( minion => minion.Health > 5 && HealthPrediction.GetHealthPrediction( minion, (int)(player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)player.Distance(minion) / (int)Orbwalking.GetMyProjectileSpeed()) < 0); var priortarg = orbwalker.GetTarget(); var canHArass = priortarg != null && !(priortarg is AIHeroClient); if (canHArass || (!canHArass && miniPred == null)) { if (Program.IsSPrediction) { Q.SPredictionCast(target, HitChance.High); } else { var targQ = Q.GetPrediction(target); if (Q.Range - 100 > targQ.CastPosition.Distance(player.Position) && targQ.Hitchance >= HitChance.High) { Q.Cast(targQ.CastPosition); } } } } if (config.Item("usewH", true).GetValue <bool>() && W.IsReady()) { if (Program.IsSPrediction) { W.SPredictionCast(target, HitChance.High); } else { var tarPered = W.GetPrediction(target); if (W.Range - 80 > tarPered.CastPosition.Distance(player.Position) && tarPered.Hitchance >= HitChance.High) { W.Cast(tarPered.CastPosition); } } } }