private void HandleR(Obj_AI_Base target, bool manual = false) { var targE = R.GetPrediction(target); if ((getCheckBoxItem(menuC, "user") && player.CountEnemiesInRange(R.Range + 175) <= 1) || manual) { if (target.IsMoving) { var pos = targE.CastPosition; if (pos.IsValid() && pos.Distance(player.Position) < R.Range + 1000 && targE.Hitchance >= HitChance.VeryHigh) { R.Cast(target.Position.LSExtend(pos, -target.MoveSpeed), pos); } } else { R.Cast(target.Position.LSExtend(player.Position, 500), target.Position); } } else if (targE.Hitchance >= HitChance.VeryHigh) { var pred = getBestRVector3(target, targE); if (pred != Vector3.Zero && CombatHelper.GetCollisionCount( target, target.Position.LSExtend(pred, 1000), R.Width, new[] { CollisionableObjects.Heroes }) >= getSliderItem(menuC, "Rmin")) { R.Cast(target.Position.LSExtend(pred, -target.MoveSpeed), pred); } } }
private void HandleR(Obj_AI_Base target, bool manual = false) { if (Program.IsSPrediction) { if (config.Item("userEnabled", true).GetValue <bool>()) { R.SPredictionCastVector(target as AIHeroClient, 1000f, HitChance.High); } } else { var targE = R.GetPrediction(target); if ((config.Item("user", true).GetValue <bool>() && player.CountEnemiesInRange(R.Range + 175) <= 1 && config.Item("userEnabled", true).GetValue <bool>()) || manual) { if (target.IsMoving) { var pos = targE.CastPosition; if (pos.IsValid() && pos.Distance(player.Position) < R.Range + 1000 && targE.Hitchance >= HitChance.High) { R.Cast(target.Position.Extend(pos, -500), pos); } } else { R.Cast(target.Position.Extend(player.Position, 500), target.Position); } } else if (targE.Hitchance >= HitChance.High && config.Item("userEnabled", true).GetValue <bool>()) { var pred = getBestRVector3(target, targE); if (pred != Vector3.Zero && CombatHelper.GetCollisionCount( target, target.Position.Extend(pred, 1000), R.Width, new[] { CollisionableObjects.Heroes, }) >= config.Item("Rmin", true).GetValue <Slider>().Value) { R.Cast(target.Position.Extend(pred, -target.MoveSpeed), pred); } } } }
private Vector3 getBestRVector3(Obj_AI_Base target, PredictionOutput targE) { var otherHeroes = HeroManager.Enemies.Where( e => e.IsValidTarget() && e.NetworkId != target.NetworkId && player.Distance(e) < 1000) .Select(e => R.GetPrediction(e)) .Where(o => o.Hitchance > HitChance.High && o.CastPosition.Distance(targE.UnitPosition) < 1000); if (otherHeroes.Any()) { var best = otherHeroes.OrderByDescending( hero => CombatHelper.GetCollisionCount( target, target.Position.LSExtend(hero.CastPosition, 1000), R.Width, new[] { CollisionableObjects.Heroes })).FirstOrDefault(); if (best != null) { return(best.CastPosition); } } return(Vector3.Zero); }