private static void DrawCondemnRectangles() { if (!MenuExtensions.GetItemValue <bool>("dz191.vhr.draw.condemn") || !Variables.spells[SpellSlot.E].IsReady()) { return; } var HeroList = HeroManager.Enemies.Where( h => h.IsValidTarget(Variables.spells[SpellSlot.E].Range + 130f) && !h.HasBuffOfType(BuffType.SpellShield) && !h.HasBuffOfType(BuffType.SpellImmunity)); //dz191.vhr.misc.condemn.rev.accuracy //dz191.vhr.misc.condemn.rev.nextprediction var MinChecksPercent = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.accuracy").Value; var PushDistance = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.pushdistance").Value; foreach (var Hero in HeroList) { if (MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.condemn.onlystuncurrent") && Hero.NetworkId != Variables.Orbwalker.GetTarget().NetworkId) { continue; } if (Hero.Health + 10 <= ObjectManager.Player.GetAutoAttackDamage(Hero) * MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.noeaa").Value) { continue; } var targetPosition = Hero.Position; var finalPosition = targetPosition.Extend(ObjectManager.Player.ServerPosition, -PushDistance); var finalPosition_ex = Hero.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -PushDistance); var condemnRectangle = new VHRPolygon(VHRPolygon.Rectangle(targetPosition.To2D(), finalPosition.To2D(), Hero.BoundingRadius)); var condemnRectangle_ex = new VHRPolygon(VHRPolygon.Rectangle(Hero.ServerPosition.To2D(), finalPosition_ex.To2D(), Hero.BoundingRadius)); var points = condemnRectangle.Points.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList(); var poly_ex = Helpers.Geometry.ToPolygon(points); if ( condemnRectangle.Points.Count( point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * (MinChecksPercent / 100f) && condemnRectangle_ex.Points.Count( point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle_ex.Points.Count() * (MinChecksPercent / 100f)) { poly_ex.Draw(Color.Chartreuse, 3); } else { poly_ex.Draw(Color.Red, 3); } } }
public static Obj_AI_Base GetTarget(Vector3 fromPosition) { var HeroList = HeroManager.Enemies.Where( h => h.IsValidTarget(Variables.spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) && !h.HasBuffOfType(BuffType.SpellImmunity)); //dz191.vhr.misc.condemn.rev.accuracy //dz191.vhr.misc.condemn.rev.nextprediction var MinChecksPercent = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.accuracy").Value; var PushDistance = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.pushdistance").Value; if (PushDistance >= 410) { var PushEx = PushDistance; PushDistance -= (10 + (PushEx - 410) / 2); } if (ObjectManager.Player.ServerPosition.UnderTurret(true)) { return(null); } foreach (var Hero in HeroList) { if (MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.condemn.onlystuncurrent") && Hero.NetworkId != Variables.Orbwalker.GetTarget().NetworkId) { continue; } if (Hero.Health + 10 <= ObjectManager.Player.GetAutoAttackDamage(Hero) * MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.noeaa").Value) { continue; } var targetPosition = Variables.spells[SpellSlot.E].GetPrediction(Hero).UnitPosition; var finalPosition = targetPosition.Extend(ObjectManager.Player.ServerPosition, -PushDistance); var finalPosition_ex = Hero.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -PushDistance); var condemnRectangle = new VHRPolygon(VHRPolygon.Rectangle(targetPosition.To2D(), finalPosition.To2D(), Hero.BoundingRadius)); var condemnRectangle_ex = new VHRPolygon(VHRPolygon.Rectangle(Hero.ServerPosition.To2D(), finalPosition_ex.To2D(), Hero.BoundingRadius)); if (IsBothNearWall(Hero)) { return(null); } if (condemnRectangle.Points.Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * (MinChecksPercent / 100f) && condemnRectangle_ex.Points.Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle_ex.Points.Count() * (MinChecksPercent / 100f)) { return(Hero); } } return(null); }
public static void Execute(EventArgs args) { if (!E.IsEnabledAndReady(Variables.Orbwalker.ActiveMode)) { return; } /** * var CondemnTarget = GetCondemnTarget(ObjectManager.Player.ServerPosition); * if (CondemnTarget.IsValidTarget()) * { * // var AAForE = MenuExtensions.GetItemValue<Slider>("dz191.vhr.misc.condemn.noeaa").Value; * * // if (CondemnTarget.Health / ObjectManager.Player.GetAutoAttackDamage(CondemnTarget, true) < AAForE) * // { * // return; * // } * var targetPosition = CondemnTarget.ServerPosition; * var myPosition = ObjectManager.Player.ServerPosition; * if (WindWall.CollidesWithWall(myPosition, targetPosition)) * { * return; * } * * E.CastOnUnit(CondemnTarget); * }*/ var pushDistance = MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.pushdistance").Value - 25; if (pushDistance >= 410) { var PushEx = pushDistance; pushDistance -= (10 + (PushEx - 410) / 2); } foreach (var target in HeroManager.Enemies.Where(en => en.IsValidTarget(E.Range) && !en.IsDashing())) { //Yasuo Windwall check if (WindWall.CollidesWithWall(ObjectManager.Player.ServerPosition, target.ServerPosition)) { continue; } if (MenuExtensions.GetItemValue <bool>("dz191.vhr.misc.condemn.onlystuncurrent") && Variables.Orbwalker.GetTarget() != null && !target.NetworkId.Equals(Variables.Orbwalker.GetTarget().NetworkId)) { continue; } if (target.Health + 10 <= ObjectManager.Player.GetAutoAttackDamage(target) * MenuExtensions.GetItemValue <Slider>("dz191.vhr.misc.condemn.noeaa").Value) { continue; } var Prediction = Variables.spells[SpellSlot.E].GetPrediction(target); var endPosition = Prediction.UnitPosition.Extend(ObjectManager.Player.ServerPosition, -pushDistance); if (Prediction.Hitchance >= HitChance.VeryHigh) { if (endPosition.IsWall()) { var condemnRectangle = new VHRPolygon(VHRPolygon.Rectangle(target.ServerPosition.To2D(), endPosition.To2D(), target.BoundingRadius)); if (condemnRectangle.Points .Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * (20 / 100f)) { E.CastOnUnit(target); TrinketBush(target.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -450f)); } } else { //It's not a wall. var step = pushDistance / 5f; for (float i = 0; i < pushDistance; i += step) { var endPositionEx = Prediction.UnitPosition.Extend(ObjectManager.Player.ServerPosition, -i); if (endPositionEx.IsWall()) { var condemnRectangle = new VHRPolygon(VHRPolygon.Rectangle(target.ServerPosition.To2D(), endPosition.To2D(), target.BoundingRadius)); if (condemnRectangle.Points .Count(point => NavMesh.GetCollisionFlags(point.X, point.Y).HasFlag(CollisionFlags.Wall)) >= condemnRectangle.Points.Count() * (20 / 100f)) { E.CastOnUnit(target); TrinketBush(target.ServerPosition.Extend(ObjectManager.Player.ServerPosition, -450f)); } return; } } } } } }