private void AntiGapcloser_OnGapcloser(AIHeroClient sender, AntiGapcloser.GapcloserArgs args) { if (!OktwCommon.CheckGapcloser(sender, args)) { return; } if (dashSpell.IsReady() && egcChampions.Any(e => e.Enabled && e.Name == "egcChampion" + sender.CharacterName)) { switch (gapcloserMode.Index) { case 0: { var bestPoint = Player.Position.Extend(Game.CursorPos, dashSpell.Range); if (IsGoodPosition(bestPoint)) { dashSpell.Cast(bestPoint); } break; } case 1: { var points = OktwCommon.CirclePoints(10, dashSpell.Range, Player.Position); var bestPoint = Player.Position.Extend(sender.Position, -dashSpell.Range); var enemies = bestPoint.CountEnemyHeroesInRange(dashSpell.Range); foreach (var point in points) { var count = point.CountEnemyHeroesInRange(dashSpell.Range); if (count < enemies) { bestPoint = point; enemies = count; } else if (count == enemies && Game.CursorPos.Distance(point) < Game.CursorPos.Distance(bestPoint)) { bestPoint = point; enemies = count; } } if (IsGoodPosition(bestPoint)) { dashSpell.Cast(bestPoint); } break; } } } }
private void LogicW() { if (Player.Mana > RMANA + WMANA) { if (Program.Combo) { return; } if (Config.Item("autoW", true).GetValue <bool>()) { foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(W.Range) && !OktwCommon.CanMove(enemy) && !enemy.HasBuff("caitlynyordletrapinternal"))) { if (Utils.TickCount - W.LastCastAttemptT > 1000) { W.Cast(enemy); LastW = enemy; } else if (LastW.NetworkId != enemy.NetworkId) { W.Cast(enemy); LastW = enemy; } } } if (Config.Item("telE", true).GetValue <bool>()) { var trapPos = OktwCommon.GetTrapPos(W.Range); if (!trapPos.IsZero) { W.Cast(trapPos); } } if ((int)(Game.Time * 10) % 2 == 0 && Config.Item("bushW2", true).GetValue <bool>()) { if (Player.Spellbook.GetSpell(SpellSlot.W).Ammo == new int[] { 0, 3, 3, 4, 4, 5 }[W.Level] && Player.CountEnemiesInRange(1000) == 0) { var points = OktwCommon.CirclePoints(8, W.Range, Player.Position); foreach (var point in points) { if (NavMesh.IsWallOfGrass(point, 0) || point.UnderTurret(true)) { if (!OktwCommon.CirclePoints(8, 150, point).Any(x => x.IsWall())) { W.Cast(point); return; } } } } } } }
private void LogicW() { var orbT = Orbwalker.GetTarget() as Obj_AI_Hero; if (orbT != null && orbT.Health - OktwCommon.GetIncomingDamage(orbT) < Player.GetAutoAttackDamage(orbT) * 2) { return; } if (Player.Mana > RMANA + WMANA) { if (Config.Item("autoW", true).GetValue <bool>()) { foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(W.Range) && !OktwCommon.CanMove(enemy) && !enemy.HasBuff("caitlynyordletrapinternal"))) { W.Cast(enemy); } } if (Config.Item("telE", true).GetValue <bool>()) { var trapPos = OktwCommon.GetTrapPos(W.Range); if (!trapPos.IsZero) { W.Cast(trapPos); } } if (!SebbyLib.Orbwalking.CanMove(40)) { return; } if ((int)(Game.Time * 10) % 2 == 0 && Config.Item("bushW2", true).GetValue <bool>()) { if (Player.Spellbook.GetSpell(SpellSlot.W).Ammo == new int[] { 0, 3, 3, 4, 4, 5 }[W.Level] && Player.CountEnemiesInRange(1000) == 0) { var points = OktwCommon.CirclePoints(8, W.Range, Player.Position); foreach (var point in points) { if (NavMesh.IsWallOfGrass(point, 0) || point.UnderTurret(true)) { if (!OktwCommon.CirclePoints(8, 150, point).Any(x => x.IsWall())) { W.Cast(point); return; } } } } } } }
private void LogicW() { if (Player.Mana > RMANA + WMANA) { var w = Config[Player.CharacterName]["WConfig"]; if (w.GetValue <MenuBool>("autoW").Enabled) { foreach (var enemy in GameObjects.EnemyHeroes.Where(enemy => enemy.IsValidTarget(W.Range) && !OktwCommon.CanMove(enemy) && !enemy.HasBuff("caitlynyordletrapinternal"))) { W.Cast(enemy); } } if (w.GetValue <MenuBool>("telE").Enabled) { var trapPos = OktwCommon.GetTrapPos(W.Range); if (!trapPos.IsZero) { W.Cast(trapPos); } } if (!Orbwalker.CanMove(40, false)) { return; } if ((int)(Game.Time * 10) % 2 == 0 && w.GetValue <MenuBool>("bushW2").Enabled) { if (Player.Spellbook.GetSpell(SpellSlot.W).Ammo == new int[] { 0, 3, 3, 4, 4, 5 }[W.Level] && Player.CountEnemyHeroesInRange(1000) == 0) { var points = OktwCommon.CirclePoints(8, W.Range, Player.Position); foreach (var point in points) { if (NavMesh.IsWallOfGrass(point, 0) || point.IsUnderEnemyTurret()) { if (!OktwCommon.CirclePoints(8, 150, point).Any(x => x.IsWall())) { W.Cast(point); return; } } } } } } }
private void AntiGapcloser_OnEnemyGapcloser(ActiveGapcloser gapcloser) { if (DashSpell.IsReady()) { if (Sub["EGCchampion" + gapcloser.Sender.NetworkId] == null) { return; } if (getCheckBoxItem("EGCchampion" + gapcloser.Sender.NetworkId)) { var GapcloserMode = getSliderItem("GapcloserMode"); if (GapcloserMode == 0) { var bestpoint = Player.Position.LSExtend(Game.CursorPos, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } else if (GapcloserMode == 1) { var points = OktwCommon.CirclePoints(10, DashSpell.Range, Player.Position); var bestpoint = Player.Position.LSExtend(gapcloser.Sender.Position, -DashSpell.Range); var enemies = bestpoint.CountEnemiesInRange(DashSpell.Range); foreach (var point in points) { var count = point.CountEnemiesInRange(DashSpell.Range); if (count < enemies) { enemies = count; bestpoint = point; } else if (count == enemies && Game.CursorPos.LSDistance(point) < Game.CursorPos.LSDistance(bestpoint)) { enemies = count; bestpoint = point; } } if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } } } }
private void OnGapCloser(object sender, Events.GapCloserEventArgs args) { var g = Config[Player.CharacterName][DashSpell.Slot + "config"]["gapcloser"] as Menu; var e = g["EGCchampion" + args.Sender.CharacterName] as MenuBool; if (DashSpell.IsReady() && e != null && e.Value) { var gapcloserMode = g.GetValue <MenuList <string> >("GapcloserMode").Index; if (gapcloserMode == 0) { var bestpoint = Player.Position.Extend(Game.CursorPosRaw, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } else if (gapcloserMode == 1) { var points = OktwCommon.CirclePoints(10, DashSpell.Range, Player.Position); var bestpoint = Player.Position.Extend(args.Sender.FearLeashPoint, -DashSpell.Range); var enemies = bestpoint.CountEnemyHeroesInRange(DashSpell.Range); foreach (var point in points) { var count = point.CountEnemyHeroesInRange(DashSpell.Range); if (count < enemies) { enemies = count; bestpoint = point; } else if (count == enemies && Game.CursorPosRaw.Distance(point) < Game.CursorPosRaw.Distance(bestpoint)) { enemies = count; bestpoint = point; } } if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } } }
private void LogicW() { if (Player.Mana > RMANA + WMANA && Orbwalking.CanMove(50) && !Orbwalking.CanAttack()) { if (MainMenu.Item("autoW", true).GetValue <bool>()) { foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(W.Range) && !OktwCommon.CanMove(enemy) && !enemy.HasBuff("caitlynyordletrapinternal"))) { Program.CastSpell(W, enemy); } } if (MainMenu.Item("telE", true).GetValue <bool>()) { var trapPos = OktwCommon.GetTrapPos(W.Range); if (!trapPos.IsZero) { W.Cast(trapPos); } } if ((int)(Game.Time * 10) % 2 == 0 && MainMenu.Item("bushW2", true).GetValue <bool>() && !Orbwalker.ShouldWait()) { if (Player.Spellbook.GetSpell(SpellSlot.W).Ammo == new int[] { 0, 3, 3, 4, 4, 5 }[W.Level] && Player.CountEnemiesInRange(1000) == 0) { var points = OktwCommon.CirclePoints(8, W.Range, Player.Position); foreach (var point in points) { if (NavMesh.IsWallOfGrass(point, 0) || point.UnderTurret(true)) { if (!OktwCommon.CirclePoints(8, 150, point).Any(x => x.IsWall())) { W.Cast(point); return; } } } } } } }
private void AntiGapcloser_OnEnemyGapcloser(ActiveGapcloser gapcloser) { if (DashSpell.IsReady() && Config.Item("EGCchampion" + gapcloser.Sender.ChampionName, true).GetValue <bool>()) { int GapcloserMode = Config.Item("GapcloserMode", true).GetValue <StringList>().SelectedIndex; if (GapcloserMode == 0) { var bestpoint = Player.Position.Extend(Game.CursorPos, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } else { var points = OktwCommon.CirclePoints(10, DashSpell.Range, Player.Position); var bestpoint = Player.Position.Extend(gapcloser.Sender.Position, -DashSpell.Range); int enemies = bestpoint.CountEnemiesInRange(DashSpell.Range); foreach (var point in points) { int count = point.CountEnemiesInRange(DashSpell.Range); if (count < enemies) { enemies = count; bestpoint = point; } else if (count == enemies && Game.CursorPos.Distance(point) < Game.CursorPos.Distance(bestpoint)) { enemies = count; bestpoint = point; } } if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } } }
private void Gapcloser_OnGapcloser(AIHeroClient sender, Gapcloser.GapcloserArgs args) { if (DashSpell.IsReady() && menu["gap"].GetValue <MenuBool>("EGCchampion" + sender.CharacterName).Enabled) { var gapcloserMode = menu["gap"].GetValue <MenuList <string> >("GapcloserMode").Index; if (gapcloserMode == 0) { var bestpoint = Player.Position.Extend(Game.CursorPosRaw, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } else if (gapcloserMode == 1) { var points = OktwCommon.CirclePoints(10, DashSpell.Range, Player.Position); var bestpoint = Player.Position.Extend(sender.Position, -DashSpell.Range); var enemies = bestpoint.CountEnemyHeroesInRange(DashSpell.Range); foreach (var point in points) { var count = point.CountEnemyHeroesInRange(DashSpell.Range); if (count < enemies) { bestpoint = point; enemies = count; } else if (count == enemies && point.DistanceToCursor() < bestpoint.DistanceToCursor()) { bestpoint = point; enemies = count; } } if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } } }
public Vector3 CastDash(bool asap = false) { int DashMode = Config.Item("DashMode", true).GetValue <StringList>().SelectedIndex; Vector3 bestpoint = Vector3.Zero; if (DashMode == 0) { bestpoint = Player.Position.Extend(Game.CursorPos, DashSpell.Range); } else if (DashMode == 1) { var orbT = Orbwalker.GetTarget(); if (orbT != null && orbT is AIHeroClient) { Vector2 start = Player.Position.To2D(); Vector2 end = orbT.Position.To2D(); var dir = (end - start).Normalized(); var pDir = dir.Perpendicular(); var rightEndPos = end + pDir * Player.Distance(orbT); var leftEndPos = end - pDir * Player.Distance(orbT); var rEndPos = new Vector3(rightEndPos.X, rightEndPos.Y, Player.Position.Z); var lEndPos = new Vector3(leftEndPos.X, leftEndPos.Y, Player.Position.Z); if (Game.CursorPos.Distance(rEndPos) < Game.CursorPos.Distance(lEndPos)) { bestpoint = Player.Position.Extend(rEndPos, DashSpell.Range); } else { bestpoint = Player.Position.Extend(lEndPos, DashSpell.Range); } } } else if (DashMode == 2) { var points = OktwCommon.CirclePoints(15, DashSpell.Range, Player.Position); bestpoint = Player.Position.Extend(Game.CursorPos, DashSpell.Range); int enemies = bestpoint.CountEnemiesInRange(350); foreach (var point in points) { int count = point.CountEnemiesInRange(350); if (!InAARange(point)) { continue; } if (point.UnderAllyTurret()) { bestpoint = point; enemies = count - 1; } else if (count < enemies) { enemies = count; bestpoint = point; } else if (count == enemies && Game.CursorPos.Distance(point) < Game.CursorPos.Distance(bestpoint)) { enemies = count; bestpoint = point; } } } if (bestpoint.IsZero) { return(Vector3.Zero); } var isGoodPos = IsGoodPosition(bestpoint); if (asap && isGoodPos) { return(bestpoint); } else if (isGoodPos && InAARange(bestpoint)) { return(bestpoint); } return(Vector3.Zero); }
public Vector3 CastDash(bool asap = false) { var DashMode = menu.GetValue <MenuList <string> >("DashMode").Index; var bestpoint = Vector3.Zero; if (DashMode == 0) { bestpoint = Player.Position.Extend(Game.CursorPosRaw, DashSpell.Range); } else if (DashMode == 1) { var orbT = Orbwalker.GetTarget(); if (orbT != null && orbT is AIHeroClient) { var start = Player.Position.ToVector2(); var end = orbT.Position.ToVector2(); var dir = (end - start).Normalized(); var pDir = dir.Perpendicular(); var rightEndPos = end + pDir * Player.Distance(orbT); var leftEndPos = end - pDir * Player.Distance(orbT); var rEndPos = new Vector3(rightEndPos.X, rightEndPos.Y, Player.Position.Z); var lEndPos = new Vector3(leftEndPos.X, leftEndPos.Y, Player.Position.Z); if (rEndPos.DistanceToCursor() < lEndPos.DistanceToCursor()) { bestpoint = Player.Position.Extend(rEndPos, DashSpell.Range); } else { bestpoint = Player.Position.Extend(lEndPos, DashSpell.Range); } } } else if (DashMode == 2) { var points = OktwCommon.CirclePoints(15, DashSpell.Range, Player.Position); bestpoint = Player.Position.Extend(Game.CursorPosRaw, DashSpell.Range); var enemies = bestpoint.CountEnemyHeroesInRange(350); foreach (var point in points) { var count = point.CountEnemyHeroesInRange(350); if (!InAARange(point)) { continue; } if (point.IsUnderAllyTurret()) { bestpoint = point; enemies = count - 1; } else if (count < enemies) { bestpoint = point; enemies = count; } else if (count == enemies && point.DistanceToCursor() < bestpoint.DistanceToCursor()) { bestpoint = point; enemies = count; } } } if (bestpoint.IsZero) { return(Vector3.Zero); } var isGoodPos = IsGoodPosition(bestpoint); if (asap && isGoodPos) { return(bestpoint); } else if (isGoodPos && InAARange(bestpoint)) { return(bestpoint); } return(Vector3.Zero); }
public Vector3 CastDash(bool asap = false) { var DashMode = getSliderItem("DashMode"); var bestpoint = Vector3.Zero; if (DashMode == 0) { bestpoint = Player.Position.LSExtend(Game.CursorPos, DashSpell.Range); } else if (DashMode == 1) { var orbT = Orbwalker.LastTarget; if (orbT is AIHeroClient) { var start = Player.Position.LSTo2D(); var end = orbT.Position.LSTo2D(); var dir = (end - start).Normalized(); var pDir = dir.Perpendicular(); var rightEndPos = end + pDir * Player.LSDistance(orbT); var leftEndPos = end - pDir * Player.LSDistance(orbT); var rEndPos = new Vector3(rightEndPos.X, rightEndPos.Y, Player.Position.Z); var lEndPos = new Vector3(leftEndPos.X, leftEndPos.Y, Player.Position.Z); bestpoint = Game.CursorPos.LSDistance(rEndPos) < Game.CursorPos.LSDistance(lEndPos) ? Player.Position.LSExtend(rEndPos, DashSpell.Range) : Player.Position.LSExtend(lEndPos, DashSpell.Range); } } else if (DashMode == 2) { var points = OktwCommon.CirclePoints(15, DashSpell.Range, Player.Position); bestpoint = Player.Position.LSExtend(Game.CursorPos, DashSpell.Range); var enemies = bestpoint.CountEnemiesInRange(350); foreach (var point in points) { int count = point.CountEnemiesInRange(350); if (!InAARange(point)) { continue; } if (point.UnderAllyTurret()) { bestpoint = point; enemies = count - 1; } else if (count < enemies) { enemies = count; bestpoint = point; } else if (count == enemies && Game.CursorPos.LSDistance(point) < Game.CursorPos.LSDistance(bestpoint)) { enemies = count; bestpoint = point; } } } if (bestpoint.IsZero) { return(Vector3.Zero); } var isGoodPos = IsGoodPosition(bestpoint); if (asap && isGoodPos) { return(bestpoint); } if (isGoodPos && InAARange(bestpoint)) { return(bestpoint); } return(Vector3.Zero); }
private static void CastQ(Obj_AI_Base target) { SebbyLib.Prediction.PredictionOutput prediction = GetPred(Q1, target); Vector3 pos1 = Vector3.Zero, pos2 = Vector3.Zero, pos3 = Vector3.Zero; SebbyLib.Prediction.HitChance hitchance = SebbyLib.Prediction.HitChance.Low; if (Config.Item("QHitChance", true).GetValue <StringList>().SelectedIndex == 0) { hitchance = SebbyLib.Prediction.HitChance.VeryHigh; } else if (Config.Item("QHitChance", true).GetValue <StringList>().SelectedIndex == 1) { hitchance = SebbyLib.Prediction.HitChance.High; } else if (Config.Item("QHitChance", true).GetValue <StringList>().SelectedIndex == 2) { hitchance = SebbyLib.Prediction.HitChance.Medium; } if (prediction.Hitchance == SebbyLib.Prediction.HitChance.OutOfRange) { prediction = GetPred(Q2, target); pos1 = Player.Position.Extend(prediction.CastPosition, Q1.Range); if (Cache.GetMinions(pos1, 280).Any()) { return; } if (OktwCommon.CirclePoints(10, 150, pos1).Any(x => x.IsWall())) { return; } if (prediction.Hitchance == SebbyLib.Prediction.HitChance.OutOfRange) { prediction = GetPred(Q3, target); pos2 = Player.Position.Extend(prediction.CastPosition, Q2.Range); if (Cache.GetMinions(pos2, 280).Any()) { return; } if (OktwCommon.CirclePoints(10, 150, pos2).Any(x => x.IsWall())) { return; } if (prediction.Hitchance == SebbyLib.Prediction.HitChance.OutOfRange) { return; } else if (prediction.Hitchance >= hitchance) { Q3.Cast(prediction.CastPosition); } } else if (prediction.Hitchance >= hitchance) { Q2.Cast(prediction.CastPosition); } } else if (prediction.Hitchance >= hitchance) { Q1.Cast(prediction.CastPosition); } }
private static void Game_OnGameUpdate(EventArgs args) { BarrelList.RemoveAll(x => !x.IsValid || x.Health < 1); var eAmmo = Player.Spellbook.GetSpell(SpellSlot.E).Ammo; var barrelCount = BarrelList.Count(); var barrelInAaRange = BarrelList.FirstOrDefault(x => SebbyLib.Orbwalking.InAutoAttackRange(x) && CanAa(x)); var barrelInQRange = BarrelList.FirstOrDefault(x => x.IsValidTarget(Q.Range) && CanQ(x)); var barrelFullHp = BarrelList.FirstOrDefault(x => SebbyLib.Orbwalking.InAutoAttackRange(x) && !CanQ(x)); if (barrelFullHp != null) { Orbwalker.ForceTarget(barrelFullHp); } else { Orbwalker.ForceTarget(null); } if (eAmmo > 1 && barrelCount == 0 && E.IsReady()) { var t = TargetSelector.GetTarget(1500, TargetSelector.DamageType.Physical); if (t.IsValidTarget()) { var healthDecayRate = Player.Level >= 13 ? 0.5f : (Player.Level >= 7 ? 1f : 2f); var predPos = SebbyLib.Prediction.Prediction.GetPrediction(t, healthDecayRate * 2 - 0.5f); var ePos = Player.Position.Extend(predPos.CastPosition, 500); if (predPos.CastPosition.Distance(Player.Position) < Q.Range) { ePos = predPos.CastPosition; } if (!OktwCommon.CirclePoints(8, 450, ePos).Any(x => x.IsWall())) { E.Cast(ePos); } } } foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(1500))) { var eRadius = 290 + enemy.BoundingRadius; var pred = E.GetPrediction(enemy, true); Utility.DrawCircle(pred.CastPosition, 100, System.Drawing.Color.Yellow, 1, 1); foreach (var barrel in BarrelList) { if (barrel.Distance(pred.CastPosition) < eRadius && barrel.Distance(pred.UnitPosition) < eRadius) { //continue; if (barrelInAaRange != null) { if (barrelInAaRange == barrel) { Orbwalker.ForceTarget(barrelInAaRange); } else if (barrelInAaRange.HasBuff("gangplankebarrellink") && barrel.HasBuff("gangplankebarrellink")) { Orbwalker.ForceTarget(barrelInAaRange); } } else if (Q.IsReady() && barrelInQRange != null) { if (barrelInQRange == barrel) { Q.CastOnUnit(barrelInQRange); } else if (barrelInQRange.HasBuff("gangplankebarrellink") && barrel.HasBuff("gangplankebarrellink")) { Q.CastOnUnit(barrelInQRange); } } break; } else if (E.IsReady()) { var tryPosition = barrel.Position.Extend(pred.CastPosition, 670); if (tryPosition.Distance(Player.ServerPosition) < E.Range) { if (tryPosition.Distance(pred.CastPosition) < eRadius && tryPosition.Distance(pred.UnitPosition) < eRadius) { if (barrelInAaRange != null) { if (barrelInAaRange == barrel) { E.Cast(tryPosition); Orbwalker.ForceTarget(barrelInAaRange); } else if (barrelInAaRange.HasBuff("gangplankebarrellink") && barrel.HasBuff("gangplankebarrellink")) { E.Cast(tryPosition); Orbwalker.ForceTarget(barrelInAaRange); } } else if (Q.IsReady() && barrelInQRange != null) { if (barrelInQRange == barrel) { E.Cast(tryPosition); Q.CastOnUnit(barrelInQRange); } else if (barrelInQRange.HasBuff("gangplankebarrellink") && barrel.HasBuff("gangplankebarrellink")) { E.Cast(tryPosition); Q.CastOnUnit(barrelInQRange); } } break; } } } } } }
public Vector3 CastDash(bool asap = false) { var bestPoint = Vector3.Zero; switch (dashMode.Index) { case 0: { bestPoint = Player.Position.Extend(Game.CursorPos, dashSpell.Range); break; } case 1: { var orbT = Orbwalker.GetTarget(); if (orbT != null && orbT.Type == GameObjectType.AIHeroClient) { var start = Player.Position.ToVector2(); var end = orbT.Position.ToVector2(); var dir = (end - start).Normalized().Perpendicular(); var dis = Player.Distance(orbT); var rightEndPos = end + dir * dis; var leftEndPos = end - dir * dis; var rEndPos = new Vector3(rightEndPos.X, rightEndPos.Y, Player.Position.Z); var lEndPos = new Vector3(leftEndPos.X, leftEndPos.Y, Player.Position.Z); if (Game.CursorPos.Distance(rEndPos) < Game.CursorPos.Distance(lEndPos)) { bestPoint = Player.Position.Extend(rEndPos, dashSpell.Range); } else { bestPoint = Player.Position.Extend(lEndPos, dashSpell.Range); } } break; } case 2: { bestPoint = Player.Position.Extend(Game.CursorPos, dashSpell.Range); var points = OktwCommon.CirclePoints(15, dashSpell.Range, Player.Position); var enemies = bestPoint.CountEnemyHeroesInRange(350); foreach (var point in points) { var count = point.CountEnemyHeroesInRange(350); if (!InAARange(point)) { continue; } if (point.IsUnderAllyTurret()) { bestPoint = point; enemies = count - 1; } else if (count < enemies) { bestPoint = point; enemies = count; } else if (count == enemies && Game.CursorPos.Distance(point) < Game.CursorPos.Distance(bestPoint)) { bestPoint = point; enemies = count; } } break; } } if (bestPoint.IsZero) { return(Vector3.Zero); } var isGoodPos = IsGoodPosition(bestPoint); if (asap && isGoodPos) { return(bestPoint); } else if (isGoodPos && InAARange(bestPoint)) { return(bestPoint); } return(Vector3.Zero); }
public Vector3 CastDash() { int DashMode = Config.Item("DashMode", true).GetValue <StringList>().SelectedIndex; Vector3 bestpoint = Vector3.Zero; if (DashMode == 0) { bestpoint = Player.Position.Extend(Game.CursorPos, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } else if (DashMode == 1) { var orbT = Orbwalker.GetTarget(); if (orbT != null && orbT.Type == GameObjectType.obj_AI_Hero) { Vector2 start = Player.Position.To2D(); Vector2 end = orbT.Position.To2D(); var dir = (end - start).Normalized(); var pDir = dir.Perpendicular(); var rightEndPos = end + pDir * Player.Distance(orbT); var leftEndPos = end - pDir * Player.Distance(orbT); var rEndPos = new Vector3(rightEndPos.X, rightEndPos.Y, Player.Position.Z); var lEndPos = new Vector3(leftEndPos.X, leftEndPos.Y, Player.Position.Z); if (Game.CursorPos.Distance(rEndPos) < Game.CursorPos.Distance(lEndPos)) { bestpoint = Player.Position.Extend(rEndPos, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } else { bestpoint = Player.Position.Extend(lEndPos, DashSpell.Range); if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } } } else if (DashMode == 2) { var points = OktwCommon.CirclePoints(12, DashSpell.Range, Player.Position); bestpoint = Player.Position.Extend(Game.CursorPos, DashSpell.Range); int enemies = bestpoint.CountEnemiesInRange(400); foreach (var point in points) { int count = point.CountEnemiesInRange(400); if (count < enemies) { enemies = count; bestpoint = point; } else if (count == enemies && Game.CursorPos.Distance(point) < Game.CursorPos.Distance(bestpoint)) { enemies = count; bestpoint = point; } } if (IsGoodPosition(bestpoint)) { DashSpell.Cast(bestpoint); } } if (!bestpoint.IsZero && bestpoint.CountEnemiesInRange(Player.BoundingRadius + Player.AttackRange + 100) == 0) { return(Vector3.Zero); } return(bestpoint); }
private void LogicR() { if (Player.Mana > RMANA + QMANA && (Player.IsMoving || !Program.None)) { if (Program.LagFree(1) && Orbwalking.CanMove(50)) { foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(R.Range + 100))) { if (Config.Item("autoRcc", true).GetValue <bool>() && !OktwCommon.CanMove(enemy)) { R.Cast(enemy); } if (Config.Item("autoRdash", true).GetValue <bool>()) { R.CastIfHitchanceEquals(enemy, HitChance.Dashing); } if (Config.Item("autoRslow", true).GetValue <bool>() && enemy.HasBuffOfType(BuffType.Slow)) { Program.CastSpell(R, enemy); } if (Config.Item("Raoe", true).GetValue <bool>()) { R.CastIfWillHit(enemy, 2); } if (Config.Item("comboR", true).GetValue <bool>() && OktwCommon.IsMovingInSameDirection(Player, enemy)) { var predPos = R.GetPrediction(enemy, true); if (predPos.CastPosition.Distance(enemy.Position) > 300 && predPos.Hitchance >= HitChance.Low) { if (!OktwCommon.CirclePoints(8, 120, predPos.CastPosition).Any(x => x.IsWall())) { R.Cast(predPos.CastPosition); return; } } } } } if (Program.LagFree(2) && Config.Item("telR", true).GetValue <bool>()) { var trapPos = OktwCommon.GetTrapPos(R.Range); if (!trapPos.IsZero) { R.Cast(trapPos); } } if (Program.LagFree(3) && Orbwalking.CanMove(50) && Player.Mana > RMANA + QMANA + WMANA && Config.Item("bushR2", true).GetValue <bool>() && Utils.TickCount - R.LastCastAttemptT > 2000) { if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > 1 + Player.CountEnemiesInRange(1200) && Player.CountEnemiesInRange(800) == 0) { var points = OktwCommon.CirclePoints(12, R.Range, Player.Position); points.Add(Player.Position); foreach (var point in points) { if (NavMesh.IsWallOfGrass(point, 10)) { if (!OktwCommon.CirclePoints(8, 110, point).Any(x => x.IsWall()) && !ObjectManager.Get <Obj_AI_Base>().Any(obj => obj.IsValid && obj.Mana > 40 && obj.Health > 0 && obj.Position.Distance(point) < 500 && obj.Name.ToLower().Contains("noxious trap".ToLower()))) { R.Cast(point); return; } } } } } } }
private void LogicR() { if (Player.Mana > RMANA + QMANA) { if (Program.LagFree(1)) { foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTargetLS(R.Range + 100))) { if (Config.Item("autoRcc", true).GetValue <bool>() && !OktwCommon.CanMove(enemy)) { R.Cast(enemy); } if (Config.Item("autoRdash", true).GetValue <bool>()) { R.CastIfHitchanceEquals(enemy, HitChance.Dashing); } if (Config.Item("autoRslow", true).GetValue <bool>() && enemy.HasBuffOfType(BuffType.Slow)) { Program.CastSpell(R, enemy); } if (Config.Item("Raoe", true).GetValue <bool>()) { R.CastIfWillHit(enemy, 2); } if (Config.Item("comboR", true).GetValue <bool>() && OktwCommon.IsMovingInSameDirection(Player, enemy)) { var predPos = R.GetPrediction(enemy); if (predPos.CastPosition.Distance(enemy.Position) > 200 && predPos.Hitchance >= HitChance.Low) { R.Cast(predPos.CastPosition); } } } } if (Program.LagFree(2) && Config.Item("telR", true).GetValue <bool>()) { var trapPos = OktwCommon.GetTrapPos(R.Range); if (!trapPos.IsZero) { R.Cast(trapPos); } } if ((int)(Game.Time * 10) % 2 == 0 && Config.Item("bushR2", true).GetValue <bool>() && Utils.TickCount - R.LastCastAttemptT > 4000) { if (Player.Spellbook.GetSpell(SpellSlot.R).Ammo > 1 && Player.CountEnemiesInRange(800) == 0) { var points = OktwCommon.CirclePoints(8, R.Range, Player.Position); foreach (var point in points) { if (NavMesh.IsWallOfGrass(point, 0)) { if (!OktwCommon.CirclePoints(8, 120, point).Any(x => x.IsWall())) { R.Cast(point); return; } } } } } } }