public static Geometry.Polygon getERectangle(Vector3 finalPosition, float BoundingRadius) { var halfERange = 150f; var eRectangle = new Geometry.Polygon( Geometry.Polygon.Rectangle( ObjectManager.Player.ServerPosition.To2D(), ObjectManager.Player.ServerPosition.To2D().Extend(finalPosition.To2D(), halfERange), BoundingRadius) ); return eRectangle; }
static Boolean checkYasuoWall(Vector3 enemyPos) { if (wallCastTick > Environment.TickCount) { GameObject wall = null; foreach (var gameObject in ObjectManager.Get<GameObject>()) { if (gameObject.IsValid && Regex.IsMatch(gameObject.Name, "_w_windwall", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { wall = gameObject; break; } } if (wall == null) return false; int wallWidth = (300 + 50 * Convert.ToInt32(wall.Name.Substring(wall.Name.Length - 6, 1))); var wallDirection = (wall.Position.To2D() - yasuoWallPos).Normalized().Perpendicular(); var wallStart = wall.Position.To2D() + wallWidth / 2 * wallDirection; var wallEnd = wallStart - wallWidth * wallDirection; Vector2 Direction = (wallEnd - wallStart).Normalized(); Vector2 Perpendicular = Direction.Perpendicular(); Geometry.Polygon wallPolygon = new Geometry.Polygon(); int widthWall = 75; wallPolygon.Add(wallStart + widthWall * Perpendicular); wallPolygon.Add(wallStart - widthWall * Perpendicular); wallPolygon.Add(wallEnd - widthWall * Perpendicular); wallPolygon.Add(wallEnd + widthWall * Perpendicular); int polygonCounts = wallPolygon.Points.Count; for (var i = 0; i < polygonCounts; i++) { var inter = wallPolygon.Points[i].Intersection(wallPolygon.Points[i != polygonCounts - 1 ? i + 1 : 0], player.ServerPosition.To2D(), enemyPos.To2D()); if (inter.Intersects) return true; } } return false; }
public QPosition(Vector3 position, FioraPassive.PassiveType passiveType = FioraPassive.PassiveType.None, Geometry.Polygon polygon = null, Geometry.Polygon simplePolygon = null) { Position = position; PassiveType = passiveType; Polygon = polygon; SimplePolygon = simplePolygon; }
private static void getAllUnsafePositions() { List<Geometry.Polygon> dangerousPositions = new List<Geometry.Polygon>(); foreach (var Hero in ObjectManager.Get<Obj_AI_Hero>()) { var Q = Hero.Spellbook.GetSpell(SpellSlot.Q); var W = Hero.Spellbook.GetSpell(SpellSlot.W); var E = Hero.Spellbook.GetSpell(SpellSlot.E); var R = Hero.Spellbook.GetSpell(SpellSlot.R); var AARange = Hero.AttackRange; List<float> Ranges = new List<float>(); if (Q.SData.CastRange <= 900 && Q.Cooldown <= 0)//filter global skillshots and Spells on cooldown { Ranges.Add(Q.SData.CastRange); } if (W.SData.CastRange <= 900 && W.Cooldown <= 0)//filter global skillshots and Spells on cooldown { Ranges.Add(W.SData.CastRange); } if (E.SData.CastRange <= 900 && E.Cooldown <= 0)//filter global skillshots and Spells on cooldown { Ranges.Add(E.SData.CastRange); } if (R.SData.CastRange <= 900 && R.Cooldown <= 0)//filter global skillshots and Spells on cooldown { Ranges.Add(R.SData.CastRange); } Ranges.Add(AARange); float maxRange = Ranges.Max(); var Poly = new Geometry.Polygon(); int sensitivity = 60; for(int i = 0; i < sensitivity; i ++){//Todo, allow user interactivity var Circle = new Vector2(Hero.Position + maxRange * Math.Cos(360/sensitivity), Hero.Position + maxRange * Math.Sin(360/sensitivity)); Poly.Add(Circle); } dangerousPositions.Add(Poly); } return dangerousPositions; }
void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { //Patented by XcxooxL if (!sender.IsEnemy || !sender.IsValidTarget() || !sender.IsVisible) return; if (args.Target != null && !args.Target.IsAlly) return; double damage = 0; //if it is an Auto Attack ! if (args.SData.IsAutoAttack()) { var Target = args.Target as Obj_AI_Hero; if (Target == null) return; //must be a champion if (args.SData.Name.ToLower().Contains("crit")) { damage += sender.GetAutoAttackDamage(Target) * 2; //Console.WriteLine("Critical " + damage); if (sender.InventoryItems.Any(item => item.Id.Equals(3031))) { Console.WriteLine("Infinity Edge"); damage += damage * 1.25; } //Infinity edge } else { damage += sender.GetAutoAttackDamage(Target, true); } damage += 2; //to be on the safe side Add(Target, damage, sender.Distance(Target) / args.SData.MissileSpeed + 1 / sender.AttackDelay); Console.WriteLine( "Target : " + Target.Name + "Damage : " + damage + " Time To Hit : " + sender.Distance(Target) / args.SData.MissileSpeed * 1000); } else //if its a Spell { float delay = 0; var missileSpeed = args.SData.MissileSpeed; foreach (var spellInfo in SpellDatabase.Spells.Where(spellInfo => spellInfo.spellName.Equals(args.SData.Name))) { if (spellInfo.spellType.Equals(SpellType.Line)) { _myPoly = new Geometry.Polygon.Rectangle( args.Start, args.Start.Extend(args.End, spellInfo.range), spellInfo.radius); } else if (spellInfo.spellType.Equals(SpellType.Circular)) { var pos = sender.Distance(args.End) > spellInfo.range ? sender.Position.Extend(args.End, spellInfo.range) : args.End; _myPoly = new Geometry.Polygon.Circle(pos, spellInfo.radius); } missileSpeed = spellInfo.projectileSpeed; delay += spellInfo.spellDelay; break; } //Patented by xcxooxl ALL OF THIS IS MINE ! YOU WANT IT? CREDIT ME! if (sender is Obj_AI_Hero) { var enemy = sender as Obj_AI_Hero; foreach (var ally in TrackList) { var timeToHit = delay + ally.Distance(args.Start) / missileSpeed * 1000 + args.SData.ChannelDuration + args.SData.DelayTotalTimePercent * -1; if (args.SData.TargettingType.Equals(SpellDataTargetType.Unit)) //Targeted { damage += enemy.GetDamageSpell(args.Target as Obj_AI_Base, args.Slot).CalculatedDamage; Add(ally, damage, timeToHit); } Console.WriteLine( "Spellname" + args.SData.Name + " Time to hit " + timeToHit + "MissileSpeed " + missileSpeed); var futurePos = Prediction.GetPrediction(ally, timeToHit / 1000).UnitPosition; futurePosCircle = new Geometry.Polygon.Circle(futurePos, 125); if (_myPoly.IsInside(futurePos)) { damage += enemy.GetDamageSpell(ally, args.Slot).CalculatedDamage; Add(ally, damage, timeToHit); } Utility.DelayAction.Add( (int) (timeToHit + 1200), () => { futurePosCircle = null; _myPoly = null; }); //stop drawing polygons } } } //Patented by XcxooxL }
private Geometry.Polygon GetPoly(Vector3 pos) { var POS = player.ServerPosition.Extend(pos, Q.ChargedMaxRange); var direction = (POS.To2D() - player.ServerPosition.To2D()).Normalized(); var pos1 = (player.ServerPosition.To2D() - direction.Perpendicular() * qWidth / 2f).To3D(); var pos2 = (POS.To2D() + (POS.To2D() - player.ServerPosition.To2D()).Normalized() + direction.Perpendicular() * qWidth / 2f).To3D(); var pos3 = (player.ServerPosition.To2D() + direction.Perpendicular() * qWidth / 2f).To3D(); var pos4 = (POS.To2D() + (POS.To2D() - player.ServerPosition.To2D()).Normalized() - direction.Perpendicular() * qWidth / 2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return poly; }
public QPosition(Vector3 position, FioraPassive.PassiveType type = FioraPassive.PassiveType.None, Geometry.Polygon polygon = null) { Position = position; Type = type; Polygon = polygon; }
private void UpdatePolygon() { switch (SpellData.Type) { case SkillShotType.SkillshotCircle: Circle.UpdatePolygon(); Polygon = Circle; break; case SkillShotType.SkillshotLine: case SkillShotType.SkillshotMissileLine: Rectangle.UpdatePolygon(); Polygon = Rectangle; break; case SkillShotType.SkillshotCone: Sector.UpdatePolygon(); Polygon = Sector; break; case SkillShotType.SkillshotRing: Ring.UpdatePolygon(); Polygon = Ring; break; } }
public static Geometry.Polygon GetPoly(Vector3 pos, float range, float widht) { var POS = player.ServerPosition.Extend(pos, range); var direction = (POS.To2D() - player.ServerPosition.To2D()).Normalized(); var pos1 = (player.ServerPosition.To2D() - direction.Perpendicular() * widht / 2f).To3D(); var pos2 = (POS.To2D() + (POS.To2D() - player.ServerPosition.To2D()).Normalized() + direction.Perpendicular() * widht / 2f).To3D(); var pos3 = (player.ServerPosition.To2D() + direction.Perpendicular() * widht / 2f).To3D(); var pos4 = (POS.To2D() + (POS.To2D() - player.ServerPosition.To2D()).Normalized() - direction.Perpendicular() * widht / 2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return poly; }
private void UpdatePolygon() { switch (this.SpellData.Type) { case SkillShotType.SkillshotCircle: this.Circle.UpdatePolygon(); this.Polygon = this.Circle; break; case SkillShotType.SkillshotLine: case SkillShotType.SkillshotMissileLine: this.Rectangle.UpdatePolygon(); this.Polygon = this.Rectangle; break; case SkillShotType.SkillshotCone: this.Sector.UpdatePolygon(); this.Polygon = this.Sector; break; case SkillShotType.SkillshotRing: this.Ring.UpdatePolygon(); this.Polygon = this.Ring; break; case SkillShotType.SkillshotArc: this.Arc.UpdatePolygon(); this.Polygon = this.Arc; break; } }