private static void OnDoCastDelayedLC(AIBaseClientProcessSpellCastEventArgs args) { if (SP) { AAPassive = false; } else { AAPassive = Player.HasBuff("LucianPassiveBuff"); } if (args.Target is AIMinionClient && args.Target.IsValid) { if (Orbwalker.ActiveMode == OrbwalkerMode.LaneClear && Player.ManaPercent > LMinMana) { var Minions = GameObjects.GetMinions(Player.GetRealAutoAttackRange(), MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health); if (Minions[0].IsValid && Minions.Count != 0) { if (!LT) { return; } if (E.IsReady() && !AAPassive && LE) { E.Cast(Player.Position.Extend(Game.CursorPos, 70)); } if (Q.IsReady() && (!E.IsReady() || (E.IsReady() && !LE)) && LQ != 0 && !AAPassive) { var QMinions = GameObjects.GetMinions(Q.Range); var exminions = GameObjects.GetMinions(Q1.Range); foreach (var Minion in QMinions) { var QHit = new Geometry.Rectangle(Player.Position, Player.Position.Extend(Minion.Position, Q1.Range), Q1.Width); if (exminions.Count(x => !QHit.IsOutside(x.Position.ToVector2())) >= LQ) { Q.Cast(Minion); break; } } } if ((!E.IsReady() || (E.IsReady() && !LE)) && (!Q.IsReady() || (Q.IsReady() && LQ == 0)) && LW && W.IsReady() && !AAPassive) { W.Cast(Minions[0].Position); } } } } }
static void AutoUseQ() { if (Q.IsReady() && AutoQ && Player.ManaPercent > MinMana) { var extarget = TargetSelector.GetTarget(Q1.Range); var Minions = GameObjects.GetMinions(Q.Range); foreach (var Minion in Minions) { var QHit = new Geometry.Rectangle(Player.Position, Player.Position.Extend(Minion.Position, Q1.Range), Q1.Width); var QPred = Q1.GetSPrediction(extarget); if (!QHit.IsOutside(QPred.UnitPosition) && QPred.HitChance == HitChance.High) { Q.Cast(Minion); break; } } } }
private static void CastSingleLine(Spell spell, Spell spell2, bool wallCheck, float extraPrerange = 1) { if (!spell.IsReady() || Variables.TickCount - _lastCast < 0) { return; } //-------------------------------Single--------------------------- var target = TargetSelector.GetTarget(spell.Range + spell2.Range); if (target == null) { return; } var vector1 = Player.Position + Vector3.Normalize(target.Position - Player.Position) * (spell.Range * extraPrerange); spell2.UpdateSourcePosition(vector1, vector1); var pred = spell.GetPrediction(target); Geometry.Rectangle rec1 = new Geometry.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width); if (Player.Distance(target) < spell.Range) { var vector2 = pred.CastPosition.Extend(target.Position, spell2.Range * .3f); Geometry.Rectangle rec2 = new Geometry.Rectangle(vector2, vector2.Extend(pred.CastPosition, spell2.Range), spell.Width); if ((!rec2.Points.Exists(IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving) { spell2.UpdateSourcePosition(vector2, vector2); CastLineSpell(vector2, vector2.Extend(pred.CastPosition, spell2.Range)); _lastCast = Variables.TickCount + 500; } } else if (!rec1.Points.Exists(IsWall) || !wallCheck) { //wall check if (pred.Hitchance >= HitChance.High) { CastLineSpell(vector1, pred.CastPosition); } } }
private static void Harass() { if (Player.ManaPercent < HMinMana) { return; } if (Q.IsReady() && HEXQ) { var target = TargetSelector.GetTarget(Q1.Range); var Minions = GameObjects.GetMinions(Q.Range); foreach (var Minion in Minions) { var QHit = new Geometry.Rectangle(Player.Position, Player.Position.Extend(Minion.Position, Q1.Range), Q1.Width); var QPred = Q1.GetPrediction(target); if (!QHit.IsOutside(QPred.UnitPosition.ToVector2()) && QPred.Hitchance == HitChance.High) { Q.Cast(Minion); break; } } } }
static void LaneClear() { if (Player.ManaPercent < LMinMana) { return; } if (Q.IsReady() && LHQ) { var extarget = TargetSelector.GetTarget(Q1.Range); var Minions = MinionManager.GetMinions(Q.Range); foreach (var Minion in Minions) { var QHit = new Geometry.Rectangle(Player.Position, Player.Position.Extend(Minion.Position, Q1.Range), Q1.Width); var QPred = Q1.GetPrediction(extarget); if (!QHit.IsOutside(QPred.UnitPosition.ToVector2()) && QPred.Hitchance == HitChance.High) { Q.Cast(Minion); break; } } } }
private static void DrawBestLine(Spell spell, Spell spell2, int midPointRange, float extraPrerange = 1, bool wallCheck = true) { //---------------------------------MEC---------------------------- int maxHit = 0; Vector3 start = Vector3.Zero; Vector3 end = Vector3.Zero; //loop one foreach (var target in ObjectManager.Get <AIHeroClient>().Where(x => x.IsValidTarget(spell.Range))) { //loop 2 var target1 = target; var target2 = target; foreach (var enemy in ObjectManager.Get <AIHeroClient>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId && x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position))) { int hit = 2; var targetPred = spell.GetPrediction(target); var enemyPred = spell.GetPrediction(enemy); var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2; var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange; var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange; Geometry.Rectangle rec1 = new Geometry.Rectangle(startpos, endPos, spell.Width); if (!rec1.Points.Exists(IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2) { //loop 3 var target3 = target; var enemy1 = enemy; foreach (var enemy2 in ObjectManager.Get <AIHeroClient>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < spell2.Range)) { var enemy2Pred = spell.GetPrediction(enemy2); Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.ToVector2(), endPos.ToVector2(), enemy2Pred.CastPosition.ToVector2()); var isOnseg = (bool)obj[2]; var pointLine = (Vector2)obj[1]; if (pointLine.Distance(enemy2Pred.CastPosition.ToVector2()) < spell.Width && isOnseg) { hit++; } } } if (hit > maxHit && hit > 1 && !rec1.Points.Exists(IsWall)) { maxHit = hit; start = startpos; end = endPos; } } } if (maxHit >= 2) { Vector2 wts = Drawing.WorldToScreen(Player.Position); Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + maxHit); Geometry.Rectangle rec1 = new Geometry.Rectangle(start, end, spell.Width); rec1.Draw(Color.Blue, 4); } else { //-------------------------------Single--------------------------- var target = TargetSelector.GetTarget(spell.Range + spell2.Range); if (target == null) { return; } var vector1 = Player.Position + Vector3.Normalize(target.Position - Player.Position) * (spell.Range * extraPrerange); var pred = spell.GetPrediction(target); Geometry.Rectangle rec1 = new Geometry.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width); if (Player.Distance(target) < spell.Range) { vector1 = pred.CastPosition.Extend(target.Position, spell2.Range * .3f); Geometry.Rectangle rec2 = new Geometry.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width); if ((!rec2.Points.Exists(IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving) { Vector2 wts = Drawing.WorldToScreen(Player.Position); Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1); rec2.Draw(Color.Blue, 4); } } else if (!rec1.Points.Exists(IsWall) || !wallCheck) { //wall check if (pred.Hitchance >= HitChance.High) { Vector2 wts = Drawing.WorldToScreen(Player.Position); Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1); rec1.Draw(Color.Blue, 4); } } } }
private static void CastBestLine(bool forceUlt, Spell spell, Spell spell2, int midPointRange, Menu menu, float extraPrerange = 1, bool wallCheck = true) { if (!spell.IsReady()) { return; } int maxHit = 0; Vector3 start = Vector3.Zero; Vector3 end = Vector3.Zero; //loop one foreach (var target in ObjectManager.Get <AIHeroClient>().Where(x => x.IsValidTarget(spell.Range))) { //loop 2 var target1 = target; var target2 = target; foreach (var enemy in ObjectManager.Get <AIHeroClient>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId && x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position))) { int hit = 2; var targetPred = spell.GetPrediction(target); var enemyPred = spell.GetPrediction(enemy); var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2; var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange; var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange; Geometry.Rectangle rec1 = new Geometry.Rectangle(startpos, endPos, spell.Width); if (!rec1.Points.Exists(IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2) { //loop 3 var target3 = target; var enemy1 = enemy; foreach (var enemy2 in ObjectManager.Get <AIHeroClient>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < 1000)) { var enemy2Pred = spell.GetPrediction(enemy2); Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.ToVector2(), endPos.ToVector2(), enemy2Pred.CastPosition.ToVector2()); var isOnseg = (bool)obj[2]; var pointLine = (Vector2)obj[1]; if (pointLine.Distance(enemy2Pred.CastPosition.ToVector2()) < spell.Width && isOnseg) { hit++; } } } if (hit > maxHit && hit > 1 && !rec1.Points.Exists(IsWall)) { maxHit = hit; start = startpos; end = endPos; } } } if (start != Vector3.Zero && end != Vector3.Zero && spell.IsReady()) { spell2.UpdateSourcePosition(start, start); if (forceUlt) { CastLineSpell(start, end); } if (menu.Item("ComboActive").GetValue <MenuKeyBind>().Active&& maxHit >= menu.Item("Line_If_Enemy_Count_Combo").GetValue <MenuSlider>().Value) { CastLineSpell(start, end); } if (maxHit >= menu.Item("Line_If_Enemy_Count").GetValue <MenuSlider>().Value) { CastLineSpell(start, end); } } //check if only one target if (forceUlt) { CastSingleLine(spell, spell2, wallCheck, extraPrerange); } }
private static void OnDraw(EventArgs args) { if (myhero.IsDead || check(draw, "nodraw")) { return; } if (check(draw, "drawQ") && Q.Level > 0 && Q.IsReady()) { Render.Circle.DrawCircle(ObjectManager.Player.Position, Q.Range, Color.Yellow, 1); } if (check(draw, "drawR") && R.Level > 0 && R.IsReady()) { Render.Circle.DrawCircle(ObjectManager.Player.Position, R.Range, Color.Yellow, 1); } AIHeroClient target = GetTarget();//TargetSelector.GetTarget(Q.Range, DamageType.Magical, myhero.Position); if (target != null) { if (Q.IsReady()) { var qpred = Q.GetPrediction(target); if (check(draw, "DRAWPRED")) { Geometry.Rectangle Prediction = new Geometry.Rectangle(myhero.Position, qpred.CastPosition, Q.Width); Prediction.Draw(Color.Yellow, 1); } if (check(draw, "DRAWHIT")) { Drawing.DrawText(Drawing.WorldToScreen(myhero.Position).X - 50, Drawing.WorldToScreen(myhero.Position).Y + 10, Color.Yellow, "Hitchance %: "); Drawing.DrawText(Drawing.WorldToScreen(myhero.Position).X + 37, Drawing.WorldToScreen(myhero.Position).Y + 10, Color.Green, qpred.Hitchance.ToString()); } } if (check(draw, "DRAWTARGET")) { Render.Circle.DrawCircle(target.Position, 50, Color.Yellow, 1); } if (check(draw, "DRAWWAY") && target.Path.Any()) { for (var i = 1; target.Path.Length > i; i++) { if (target.Path[i - 1].IsValid() && target.Path[i].IsValid() && (target.Path[i - 1].IsOnScreen() || target.Path[i].IsOnScreen())) { Drawing.DrawLine(Drawing.WorldToScreen(target.Position), Drawing.WorldToScreen(target.Path[i]), 3, Color.White); } } } } }