private static void CastQ(AIHeroClient unit) { if (LeeSin.Q.IsReady() && !LeeSin.IsSecondCast(LeeSin.Q)) { if (MenuManager.myMenu.Item("pred.list2").GetValue <StringList>().SelectedIndex == 0) { PredictionOutput qPred = LeeSin.Q.GetPrediction(unit); if ((int)qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value) { LeeSin.Q.Cast(qPred.CastPosition); } } else if (MenuManager.myMenu.Item("pred.list2").GetValue <StringList>().SelectedIndex == 1) { resultPred qPred = myPred.GetPrediction(unit, LeeSin.Q); if (qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value) { LeeSin.Q.Cast(qPred.predPos); } } } else if (LeeSin.Q.IsReady() && LeeSin.IsSecondCast(LeeSin.Q) && unit.HasBuff("BlindMonkQOne")) { if (LeeSin.myHero.Position.Distance(unit.Position) > 700 || Environment.TickCount - LeeSin.lastQ > 2800 || LeeSin.GetDamage_Q2(unit, 0) > unit.Health) { LeeSin.Q.Cast(); } } }
private static void startInsec() { LeeSin.myHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos); if (insecTarget == null || !insecTarget.IsValidTarget() || !LeeSin.R.IsReady()) { return; } Vector3 endPos = new Vector3(); if (insecAlly != default(Obj_AI_Hero)) { endPos = insecAlly.Position; } else if (insecTurret != default(Obj_AI_Turret)) { endPos = insecTurret.Position; } else { endPos = insecPos; } if (endPos == default(Vector3)) { return; } Vector3 WardPos = insecTarget.Position + (insecTarget.Position - endPos).Normalized() * 300; if (LeeSin.myHero.Distance(WardPos) < 100) { LeeSin.R.Cast(insecTarget); return; } Spell wardSpell = LeeSin.FindWard(); if (LeeSin.Q.IsReady() && !LeeSin.IsSecondCast(LeeSin.Q) && LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W) && wardSpell != null) { int HitChance = 0; Vector3 pos = new Vector3(); if (MenuManager.myMenu.Item("pred.list2").GetValue <StringList>().SelectedIndex == 0) { PredictionOutput pred = LeeSin.Q.GetPrediction(insecTarget); HitChance = (int)pred.Hitchance; pos = pred.CastPosition; } else { resultPred pred = myPred.GetPrediction(insecTarget, LeeSin.Q); HitChance = pred.Hitchance; pos = pred.predPos; } if (HitChance >= MenuManager.myMenu.Item("insec.qHitChance").GetValue <Slider>().Value) { LeeSin.Q.Cast(pos); return; } else { var enemyMinion = MinionManager.GetMinions(LeeSin.Q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.None); var isMinion = enemyMinion.Where(unit => unit.Position.Distance(WardPos) < 500 && unit.Health > LeeSin.GetDamage_Q1(unit)); if (isMinion.Count() > 0) { PredictionOutput qPred = LeeSin.Q.GetPrediction(isMinion.First()); if ((int)qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value) { LeeSin.Q.Cast(qPred.CastPosition); } } var secondUnit = HeroManager.Enemies.Where(unit => unit.Position.Distance(WardPos) < 500); if (secondUnit.Count() > 0) { if (MenuManager.myMenu.Item("pred.list2").GetValue <StringList>().SelectedIndex == 0) { PredictionOutput qPred = LeeSin.Q.GetPrediction(secondUnit.First()); if ((int)qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value) { LeeSin.Q.Cast(qPred.CastPosition); } } else { resultPred qPred = myPred.GetPrediction(secondUnit.First(), LeeSin.Q); if (qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value) { LeeSin.Q.Cast(qPred.predPos); } } } } } if (LeeSin.Q.IsReady() && LeeSin.IsSecondCast(LeeSin.Q) && qHit != null && qHit.Position.Distance(WardPos) < 600) { LeeSin.Q.Cast(); return; } if (LeeSin.myHero.Distance(WardPos) < 600 && LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W)) { LeeSin.WardJump_Position(WardPos); return; } }
internal static resultPred GetPrediction(Obj_AI_Hero target, Spell isSpell) { resultPred result = new resultPred(new Vector3(), 0); if (target != null & target.IsValidTarget(LeeSin.Q.Range + LeeSin.W.Range)) { Vector3[] path = target.Path; if (path.Count() == 1) { if (path[0].Distance(LeeSin.myHero.ServerPosition) < isSpell.Range) { result.Hitchance = 8; } result.predPos = path[0]; } else if (path.Count() >= 2) { if (GetNow() - newPath[target.NetworkId] < 100 || GetNow() > 3000) { float timeToHit = (LeeSin.myHero.ServerPosition.Distance(target.ServerPosition) / isSpell.Speed) + (isSpell.Delay / 1000); float DistanceRun = target.MoveSpeed * timeToHit; Vector3 pos = path[1]; pos = target.ServerPosition.Extend(path[1], (DistanceRun - (isSpell.Width / 2) - target.BoundingRadius)); if (pos.Distance(LeeSin.myHero.ServerPosition) < isSpell.Range) { if (DistanceRun > 500) { result.Hitchance = 3; } else if (DistanceRun > 400) { result.Hitchance = 4; } else if (DistanceRun > 300) { result.Hitchance = 5; } else if (DistanceRun > 200) { result.Hitchance = 6; } else if (DistanceRun < 200) { result.Hitchance = 7; } result.predPos = pos; } } } PredictionInput predInput = new PredictionInput { From = LeeSin.myHero.ServerPosition, Radius = isSpell.Width, Range = isSpell.Range }; predInput.CollisionObjects[0] = CollisionableObjects.Heroes; predInput.CollisionObjects[1] = CollisionableObjects.Minions; IEnumerable <Obj_AI_Base> rCol = Collision.GetCollision(new List <Vector3> { result.predPos }, predInput).ToArray(); IEnumerable <Obj_AI_Base> rObjCol = rCol as Obj_AI_Base[] ?? rCol.ToArray(); if (rObjCol.Count() > 0) { result.Hitchance = 0; } } return(result); }