private static rUtility Find_R_BestPos(Obj_AI_Base target) { rUtility result = new rUtility(new Vector3(), 0); Vector3 bestPos = new Vector3(); int unitHit = 1; int maxHit = 1; foreach (var unit in HeroManager.Enemies) { if (unit.NetworkId != target.NetworkId && unit.IsValidTarget()) { var pred = LeagueSharp.Common.Prediction.GetPrediction(unit, 300); if (target.Position.Distance(pred.UnitPosition) < 900) { Vector3 startPos = target.Position; Vector3 endPos = pred.UnitPosition; endPos = startPos + (endPos - startPos).Normalized() * 900; var zone = new LeagueSharp.Common.Geometry.Polygon.Rectangle(startPos, endPos, target.BoundingRadius - 5); foreach (var unit2 in HeroManager.Enemies) { if (unit2.NetworkId != target.NetworkId && unit2.NetworkId != unit.NetworkId && unit2.IsValidTarget()) { pred = LeagueSharp.Common.Prediction.GetPrediction(unit2, 300); if (zone.IsInside(pred.UnitPosition)) { unitHit++; if (unitHit > maxHit) { maxHit = unitHit; bestPos = target.Position + (target.Position - unit2.Position).Normalized() * 250; result.pos = bestPos; result.hit = maxHit; } } } } if (maxHit == 1) { maxHit = 2; bestPos = target.Position + (target.Position - unit.Position).Normalized() * 250; result.pos = bestPos; result.hit = maxHit; } } } } return(result); }
private static void CastR(AIHeroClient target) { if (LeeSin.R.IsReady()) { if (MenuManager.myMenu.Item("combo.rLogic").GetValue <Boolean>()) { // Find best pos to kick Spell wardSpell = LeeSin.FindWard(); rUtility value = Find_R_BestPos(target); if (value.hit > 1 && value.pos.Distance(LeeSin.myHero.Position) < 600) { if (target.Position.Distance(LeeSin.myHero.Position) < LeeSin.R.Range && Environment.TickCount - jumpToPos < 2000) { LeeSin.R.Cast(target); } else if (LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W) && wardSpell != null) { jumpToPos = Environment.TickCount; LeeSin.WardJump_Position(value.pos); } } } // Kill if (LeeSin.myHero.Position.Distance(target.Position) < LeeSin.R.Range) { var r_dmg = LeeSin.GetDamage_R(target); if (target.Health < r_dmg) { LeeSin.R.Cast(target); } if (LeeSin.Q.IsReady() && !LeeSin.IsSecondCast(LeeSin.Q)) { if (LeeSin.GetDamage_Q(target, r_dmg) + r_dmg > target.Health) { LeeSin.R.Cast(target); } } if (LeeSin.Q.IsReady() && LeeSin.IsSecondCast(LeeSin.Q) && target.HasBuff("BlindMonkQOne")) { if (LeeSin.GetDamage_Q2(target, r_dmg) + r_dmg > target.Health) { LeeSin.R.Cast(target); } } } } }