private static void OnDetectSkillshot(Skillshot skillshot) { var alreadyAdded = false; foreach (var i in SkillshotDetector.DetectedSkillshots) { if (i.SpellData.SpellName == skillshot.SpellData.SpellName && i.Unit.NetworkId == skillshot.Unit.NetworkId && skillshot.Direction.AngleBetween(i.Direction) < 5 && (skillshot.Start.Distance(i.Start) < 100 || skillshot.SpellData.FromObjects.Length == 0)) alreadyAdded = true; } if (skillshot.Unit.Team == Variables._Player.Team) { return; } if (skillshot.Start.Distance(Variables._Player.ServerPosition.To2D()) > (skillshot.SpellData.Range + skillshot.SpellData.Radius + 1000) * 1.5) { return; } if (alreadyAdded && !skillshot.SpellData.DontCheckForDuplicates) { return; } if (skillshot.DetectionType == DetectionType.ProcessSpell) { if (skillshot.SpellData.MultipleNumber != -1) { var originalDirection = skillshot.Direction; for (var i = -(skillshot.SpellData.MultipleNumber - 1) / 2; i <= (skillshot.SpellData.MultipleNumber - 1) / 2; i++) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.Start + skillshot.SpellData.Range * originalDirection.Rotated(skillshot.SpellData.MultipleAngle * i), skillshot.Unit)); } return; } if (skillshot.SpellData.SpellName == "UFSlash") { skillshot.SpellData.MissileSpeed = 1600 + (int)skillshot.Unit.MoveSpeed; } if (skillshot.SpellData.SpellName == "SionR") { skillshot.SpellData.MissileSpeed = (int)skillshot.Unit.MoveSpeed; } if (skillshot.SpellData.Invert) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.Start + -(skillshot.End - skillshot.Start).Normalized() * skillshot.Start.Distance(skillshot.End), skillshot.Unit)); return; } if (skillshot.SpellData.Centered) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start - skillshot.Direction * skillshot.SpellData.Range, skillshot.Start + skillshot.Direction * skillshot.SpellData.Range, skillshot.Unit)); return; } if (skillshot.SpellData.SpellName == "SyndraE" || skillshot.SpellData.SpellName == "syndrae5") { const int Angle = 60; var edge1 = (skillshot.End - skillshot.Unit.ServerPosition.To2D()).Rotated( -Angle / 2f * (float)Math.PI / 180); var edge2 = edge1.Rotated(Angle * (float)Math.PI / 180); foreach (var skillshotToAdd in from minion in ObjectManager.Get<Obj_AI_Minion>() let v = (minion.ServerPosition - skillshot.Unit.ServerPosition).To2D( ) where minion.Name == "Seed" && edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 && minion.Distance(skillshot.Unit) < 800 && minion.Team != Variables._Player.Team let start = minion.ServerPosition.To2D() let end = skillshot.Unit.ServerPosition.Extend( minion.ServerPosition, skillshot.Unit.Distance(minion) > 200 ? 1300 : 1000) select new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, start, end, skillshot.Unit)) { SkillshotDetector.DetectedSkillshots.Add(skillshotToAdd); } return; } if (skillshot.SpellData.SpellName == "AlZaharCalloftheVoid") { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.End - skillshot.Perpendicular * 400, skillshot.End + skillshot.Perpendicular * 400, skillshot.Unit)); return; } if (skillshot.SpellData.SpellName == "DianaArc") { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, SpellDatabase.GetByName("DianaArcArc"), skillshot.StartTick, skillshot.Start, skillshot.End, skillshot.Unit)); } if (skillshot.SpellData.SpellName == "ZiggsQ") { var d1 = skillshot.Start.Distance(skillshot.End); var d2 = d1 * 0.4f; var d3 = d2 * 0.69f; var bounce1SpellData = SpellDatabase.GetByName("ZiggsQBounce1"); var bounce2SpellData = SpellDatabase.GetByName("ZiggsQBounce2"); var bounce1Pos = skillshot.End + skillshot.Direction * d2; var bounce2Pos = bounce1Pos + skillshot.Direction * d3; bounce1SpellData.Delay = (int)(skillshot.SpellData.Delay + d1 * 1000f / skillshot.SpellData.MissileSpeed + 500); bounce2SpellData.Delay = (int)(bounce1SpellData.Delay + d2 * 1000f / bounce1SpellData.MissileSpeed + 500); SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, bounce1SpellData, skillshot.StartTick, skillshot.End, bounce1Pos, skillshot.Unit)); SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, bounce2SpellData, skillshot.StartTick, bounce1Pos, bounce2Pos, skillshot.Unit)); } if (skillshot.SpellData.SpellName == "ZiggsR") { skillshot.SpellData.Delay = (int)(1500 + 1500 * skillshot.End.Distance(skillshot.Start) / skillshot.SpellData.Range); } if (skillshot.SpellData.SpellName == "JarvanIVDragonStrike") { var endPos = new Vector2(); foreach (var s in SkillshotDetector.DetectedSkillshots) { if (s.Unit.NetworkId == skillshot.Unit.NetworkId && s.SpellData.Slot == SpellSlot.E) { var extendedE = new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.End + skillshot.Direction * 100, skillshot.Unit); if (!extendedE.IsSafePoint(s.End)) { endPos = s.End; } break; } } foreach (var m in ObjectManager.Get<Obj_AI_Minion>()) { if (m.CharData.BaseSkinName == "jarvanivstandard" && m.Team == skillshot.Unit.Team) { var extendedE = new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.End + skillshot.Direction * 100, skillshot.Unit); if (!extendedE.IsSafePoint(m.Position.To2D())) { endPos = m.Position.To2D(); } break; } } if (endPos.IsValid()) { skillshot = new Skillshot( DetectionType.ProcessSpell, SpellDatabase.GetByName("JarvanIVEQ"), Utils.GameTimeTickCount, skillshot.Start, endPos + 200 * (endPos - skillshot.Start).Normalized(), skillshot.Unit); } } } if (skillshot.SpellData.SpellName == "OriannasQ") { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, SpellDatabase.GetByName("OriannaQend"), skillshot.StartTick, skillshot.Start, skillshot.End, skillshot.Unit)); } if (skillshot.SpellData.DisableFowDetection && skillshot.DetectionType == DetectionType.RecvPacket) { return; } SkillshotDetector.DetectedSkillshots.Add(skillshot); }
public static bool wontHitOnDash(Skillshot ss, Obj_AI_Base jumpOn, Skillshot skillShot, Vector2 dashDir) { float currentDashSpeed = 700 + _Player.MoveSpeed; Vector2 intersectionPoint = LineIntersectionPoint(_Player.Position.To2D(), V2E(_Player.Position, jumpOn.Position, 475), ss.Start, ss.End); float arrivingTime = Vector2.Distance(_Player.Position.To2D(), intersectionPoint) / currentDashSpeed; Vector2 skillshotPosition = ss.GetMissilePosition((int)(arrivingTime * 1000)); if (Vector2.DistanceSquared(skillshotPosition, intersectionPoint) < (ss.SpellData.Radius + _Player.BoundingRadius) && !willColide(skillShot, _Player.Position.To2D(), 700f + _Player.MoveSpeed, dashDir, _Player.BoundingRadius + skillShot.SpellData.Radius)) return false; return true; }
private static void OnDeleteMissile(Skillshot skillshot, MissileClient missile) { if (skillshot.SpellData.SpellName != "VelkozQ" || SkillshotDetector.DetectedSkillshots.Count(i => i.SpellData.SpellName == "VelkozQSplit") != 0) { return; } var spellData = SpellDatabase.GetByName("VelkozQSplit"); for (var i = -1; i <= 1; i = i + 2) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( DetectionType.ProcessSpell, spellData, Utils.GameTimeTickCount, missile.Position.To2D(), missile.Position.To2D() + i * skillshot.Perpendicular * spellData.Range, skillshot.Unit)); } }
private static void TriggerOnDetectSkillshot(DetectionType detectionType, SpellData spellData, int startT, Vector2 start, Vector2 end, Obj_AI_Base unit, Obj_AI_Base target = null) { var skillshot = new Skillshot(detectionType, spellData, startT, start, end, unit, target); if (OnDetectSkillshot != null) { OnDetectSkillshot(skillshot); } }
public static bool willColide(Skillshot ss, Vector2 from, float speed, Vector2 direction, float radius) { Vector2 ssVel = ss.Direction.Normalized() * ss.SpellData.MissileSpeed; Vector2 dashVel = direction * speed; Vector2 a = ssVel - dashVel; Vector2 realFrom = from.Extend(direction, ss.SpellData.Delay + speed); if (!ss.IsAboutToHit((int)((dashVel.Length() / 475) * 1000) + Game.Ping + 100, ObjectManager.Player)) return false; if (ss.IsAboutToHit(1000, ObjectManager.Player) && interCir(ss.MissilePosition, ss.MissilePosition.Extend(ss.MissilePosition + a, ss.SpellData.Range + 50), from, radius)) return true; return false; }
public static Vector2 GetCollisionPoint(Skillshot skillshot) { var collisions = new List<DetectedCollision>(); var from = skillshot.GetMissilePosition(0); skillshot.ForceDisabled = false; foreach (var cObject in skillshot.SpellData.CollisionObjects) { switch (cObject) { case CollisionObjectTypes.Minion: foreach (var minion in EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, ObjectManager.Player.ServerPosition )) { var pred = FastPrediction( from, minion, Math.Max(0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)), skillshot.SpellData.MissileSpeed); var pos = pred.PredictedPos; var w = skillshot.SpellData.RawRadius + (!pred.IsMoving ? (minion.BoundingRadius - 15) : 0) - pos.Distance(from, skillshot.End, true); if (w > 0) { collisions.Add( new DetectedCollision { Position = pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint + skillshot.Direction * 30, Unit = minion, Type = CollisionObjectTypes.Minion, Distance = pos.Distance(from), Diff = w, }); } } break; case CollisionObjectTypes.Champion: foreach (var hero in ObjectManager.Get<AIHeroClient>() .Where( h => (h.IsValidTarget(1200) && h.Team == ObjectManager.Player.Team && !h.IsMe || h.Team != ObjectManager.Player.Team))) { var pred = FastPrediction( from, hero, Math.Max(0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)), skillshot.SpellData.MissileSpeed); var pos = pred.PredictedPos; var w = skillshot.SpellData.RawRadius + 30 - pos.Distance(from, skillshot.End, true); if (w > 0) { collisions.Add( new DetectedCollision { Position = pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint + skillshot.Direction * 30, Unit = hero, Type = CollisionObjectTypes.Minion, Distance = pos.Distance(from), Diff = w, }); } } break; case CollisionObjectTypes.YasuoWall: if ( !ObjectManager.Get<AIHeroClient>() .Any( hero => hero.IsValidTarget(float.MaxValue) && hero.Team == ObjectManager.Player.Team && hero.ChampionName == "Yasuo")) { break; } GameObject wall = null; foreach (var gameObject in ObjectManager.Get<GameObject>()) { if (gameObject.IsValid && Object.Equals( gameObject.Name, "_w_windwall.\\.troy" )) { wall = gameObject; } } if (wall == null) { break; } var level = wall.Name.Substring(wall.Name.Length - 6, 1); var wallWidth = (300 + 50 * Convert.ToInt32(level)); var wallDirection = (wall.Position.To2D() - YasuoWallCastedPos).Normalized().Perpendicular(); var wallStart = wall.Position.To2D() + wallWidth / 2 * wallDirection; var wallEnd = wallStart - wallWidth * wallDirection; var wallPolygon = new Geometry.Rectangle(wallStart, wallEnd, 75).ToPolygon(); var intersection = new Vector2(); var intersections = new List<Vector2>(); for (var i = 0; i < wallPolygon.Points.Count; i++) { var inter = wallPolygon.Points[i].Intersection( wallPolygon.Points[i != wallPolygon.Points.Count - 1 ? i + 1 : 0], from, skillshot.End); if (inter.Intersects) { intersections.Add(inter.Point); } } if (intersections.Count > 0) { intersection = intersections.OrderBy(item => item.Distance(from)).ToList()[0]; var collisionT = Environment.TickCount + Math.Max( 0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)) + 100 + (1000 * intersection.Distance(from)) / skillshot.SpellData.MissileSpeed; if (collisionT - WallCastT < 4000) { if (skillshot.SpellData.Type != SkillShotType.SkillshotMissileLine) { skillshot.ForceDisabled = true; } return intersection; } } break; } } Vector2 result; if (collisions.Count > 0) { result = collisions.OrderBy(c => c.Distance).ToList()[0].Position; } else { result = new Vector2(); } return result; }
private static void OnDetectSkillshot(Skillshot skillshot) { var alreadyAdded = false; foreach (var i in SkillshotDetector.DetectedSkillshots) { if (i.SpellData.SpellName == skillshot.SpellData.SpellName && i.Unit.NetworkId == skillshot.Unit.NetworkId && skillshot.Direction.AngleBetween(i.Direction) < 5 && (skillshot.Start.Distance(i.Start) < 100 || skillshot.SpellData.FromObjects.Length == 0)) { alreadyAdded = true; } } if (skillshot.Unit.Team == Variables._Player.Team) { return; } if (skillshot.Start.Distance(Variables._Player.ServerPosition.To2D()) > (skillshot.SpellData.Range + skillshot.SpellData.Radius + 1000) * 1.5) { return; } if (alreadyAdded && !skillshot.SpellData.DontCheckForDuplicates) { return; } if (skillshot.DetectionType == DetectionType.ProcessSpell) { if (skillshot.SpellData.MultipleNumber != -1) { var originalDirection = skillshot.Direction; for (var i = -(skillshot.SpellData.MultipleNumber - 1) / 2; i <= (skillshot.SpellData.MultipleNumber - 1) / 2; i++) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.Start + skillshot.SpellData.Range * originalDirection.Rotated(skillshot.SpellData.MultipleAngle * i), skillshot.Unit)); } return; } if (skillshot.SpellData.SpellName == "UFSlash") { skillshot.SpellData.MissileSpeed = 1600 + (int)skillshot.Unit.MoveSpeed; } if (skillshot.SpellData.SpellName == "SionR") { skillshot.SpellData.MissileSpeed = (int)skillshot.Unit.MoveSpeed; } if (skillshot.SpellData.Invert) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.Start + -(skillshot.End - skillshot.Start).Normalized() * skillshot.Start.Distance(skillshot.End), skillshot.Unit)); return; } if (skillshot.SpellData.Centered) { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start - skillshot.Direction * skillshot.SpellData.Range, skillshot.Start + skillshot.Direction * skillshot.SpellData.Range, skillshot.Unit)); return; } if (skillshot.SpellData.SpellName == "SyndraE" || skillshot.SpellData.SpellName == "syndrae5") { const int Angle = 60; var edge1 = (skillshot.End - skillshot.Unit.ServerPosition.To2D()).Rotated( -Angle / 2f * (float)Math.PI / 180); var edge2 = edge1.Rotated(Angle * (float)Math.PI / 180); foreach (var skillshotToAdd in from minion in ObjectManager.Get <Obj_AI_Minion>() let v = (minion.ServerPosition - skillshot.Unit.ServerPosition).To2D( ) where minion.Name == "Seed" && edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 && minion.Distance(skillshot.Unit) < 800 && minion.Team != Variables._Player.Team let start = minion.ServerPosition.To2D() let end = skillshot.Unit.ServerPosition.Extend( minion.ServerPosition, skillshot.Unit.Distance(minion) > 200 ? 1300 : 1000) select new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, start, end, skillshot.Unit)) { SkillshotDetector.DetectedSkillshots.Add(skillshotToAdd); } return; } if (skillshot.SpellData.SpellName == "AlZaharCalloftheVoid") { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.End - skillshot.Perpendicular * 400, skillshot.End + skillshot.Perpendicular * 400, skillshot.Unit)); return; } if (skillshot.SpellData.SpellName == "DianaArc") { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, SpellDatabase.GetByName("DianaArcArc"), skillshot.StartTick, skillshot.Start, skillshot.End, skillshot.Unit)); } if (skillshot.SpellData.SpellName == "ZiggsQ") { var d1 = skillshot.Start.Distance(skillshot.End); var d2 = d1 * 0.4f; var d3 = d2 * 0.69f; var bounce1SpellData = SpellDatabase.GetByName("ZiggsQBounce1"); var bounce2SpellData = SpellDatabase.GetByName("ZiggsQBounce2"); var bounce1Pos = skillshot.End + skillshot.Direction * d2; var bounce2Pos = bounce1Pos + skillshot.Direction * d3; bounce1SpellData.Delay = (int)(skillshot.SpellData.Delay + d1 * 1000f / skillshot.SpellData.MissileSpeed + 500); bounce2SpellData.Delay = (int)(bounce1SpellData.Delay + d2 * 1000f / bounce1SpellData.MissileSpeed + 500); SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, bounce1SpellData, skillshot.StartTick, skillshot.End, bounce1Pos, skillshot.Unit)); SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, bounce2SpellData, skillshot.StartTick, bounce1Pos, bounce2Pos, skillshot.Unit)); } if (skillshot.SpellData.SpellName == "ZiggsR") { skillshot.SpellData.Delay = (int)(1500 + 1500 * skillshot.End.Distance(skillshot.Start) / skillshot.SpellData.Range); } if (skillshot.SpellData.SpellName == "JarvanIVDragonStrike") { var endPos = new Vector2(); foreach (var s in SkillshotDetector.DetectedSkillshots) { if (s.Unit.NetworkId == skillshot.Unit.NetworkId && s.SpellData.Slot == SpellSlot.E) { var extendedE = new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.End + skillshot.Direction * 100, skillshot.Unit); if (!extendedE.IsSafePoint(s.End)) { endPos = s.End; } break; } } foreach (var m in ObjectManager.Get <Obj_AI_Minion>()) { if (m.CharData.BaseSkinName == "jarvanivstandard" && m.Team == skillshot.Unit.Team) { var extendedE = new Skillshot( skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, skillshot.End + skillshot.Direction * 100, skillshot.Unit); if (!extendedE.IsSafePoint(m.Position.To2D())) { endPos = m.Position.To2D(); } break; } } if (endPos.IsValid()) { skillshot = new Skillshot( DetectionType.ProcessSpell, SpellDatabase.GetByName("JarvanIVEQ"), Utils.GameTimeTickCount, skillshot.Start, endPos + 200 * (endPos - skillshot.Start).Normalized(), skillshot.Unit); } } } if (skillshot.SpellData.SpellName == "OriannasQ") { SkillshotDetector.DetectedSkillshots.Add( new Skillshot( skillshot.DetectionType, SpellDatabase.GetByName("OriannaQend"), skillshot.StartTick, skillshot.Start, skillshot.End, skillshot.Unit)); } if (skillshot.SpellData.DisableFowDetection && skillshot.DetectionType == DetectionType.RecvPacket) { return; } SkillshotDetector.DetectedSkillshots.Add(skillshot); }
public static Vector2 GetCollisionPoint(this Skillshot skillshot) { var collisions = new List <DetectedCollision>(); var from = skillshot.GetMissilePosition(0); skillshot.ForceDisabled = false; foreach (var cObject in skillshot.SpellData.CollisionObjects) { switch (cObject) { case CollisionObjectTypes.Minion: collisions.AddRange( from minion in EntityManager.MinionsAndMonsters.GetLaneMinions(skillshot.Unit.Team == ObjectManager.Player.Team ? EntityManager.UnitTeam.Enemy : EntityManager.UnitTeam.Ally, @from.To3D(), 1200) let pred = FastPrediction( @from, minion, Math.Max( 0, skillshot.SpellData.Delay - (Utils.GameTimeTickCount - skillshot.StartTick)), skillshot.SpellData.MissileSpeed) let pos = pred.PredictedPos let w = skillshot.SpellData.RawRadius + (!pred.IsMoving ? minion.BoundingRadius - 15 : 0) - pos.Distance(@from, skillshot.End, true) where w > 0 select new DetectedCollision { Position = pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint + skillshot.Direction * 30, Unit = minion, Type = CollisionObjectTypes.Minion, Distance = pos.Distance(@from), Diff = w }); break; case CollisionObjectTypes.Champion: collisions.AddRange( from hero in EntityManager.Heroes.Allies.Where(i => i.IsValidTarget(1200, false) && !i.IsMe) let pred = FastPrediction( @from, hero, Math.Max( 0, skillshot.SpellData.Delay - (Utils.GameTimeTickCount - skillshot.StartTick)), skillshot.SpellData.MissileSpeed) let pos = pred.PredictedPos let w = skillshot.SpellData.RawRadius + 30 - pos.Distance(@from, skillshot.End, true) where w > 0 select new DetectedCollision { Position = pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint + skillshot.Direction * 30, Unit = hero, Type = CollisionObjectTypes.Minion, Distance = pos.Distance(@from), Diff = w }); break; case CollisionObjectTypes.YasuoWall: if ( !EntityManager.Heroes.Allies.Any( i => i.IsValidTarget(float.MaxValue, false) && i.ChampionName == "Yasuo")) { break; } var wall = ObjectManager.Get <GameObject>() .FirstOrDefault( i => i.IsValid && Regex.IsMatch(i.Name, "_w_windwall.\\.troy", RegexOptions.IgnoreCase)); if (wall == null) { break; } var wallWidth = 300 + 50 * Convert.ToInt32(wall.Name.Substring(wall.Name.Length - 6, 1)); var wallDirection = (wall.Position.To2D() - wallCastedPos).Normalized().Perpendicular(); var wallStart = wall.Position.To2D() + wallWidth / 2f * wallDirection; var wallEnd = wallStart - wallWidth * wallDirection; var wallPolygon = new Geometry.Polygon.Rectangle(wallStart, wallEnd, 75); var intersections = new List <Vector2>(); for (var i = 0; i < wallPolygon.Points.Count; i++) { var inter = wallPolygon.Points[i].Intersection( wallPolygon.Points[i != wallPolygon.Points.Count - 1 ? i + 1 : 0], from, skillshot.End); if (inter.Intersects) { intersections.Add(inter.Point); } } if (intersections.Count > 0) { var intersection = intersections.OrderBy(i => i.Distance(@from)).ToList()[0]; var collisionT = Utils.GameTimeTickCount + Math.Max( 0, skillshot.SpellData.Delay - (Utils.GameTimeTickCount - skillshot.StartTick)) + 100 + (1000 * intersection.Distance(from)) / skillshot.SpellData.MissileSpeed; if (collisionT - wallCastT < 4000) { if (skillshot.SpellData.Type != SkillShotType.SkillshotMissileLine) { skillshot.ForceDisabled = true; } return(intersection); } } break; } } return(collisions.Count > 0 ? collisions.OrderBy(i => i.Distance).ToList()[0].Position : new Vector2()); }
private static void Evade_OnDeleteMissile(Skillshot skillshot, MissileClient missile) { Events._skillshotdetector.DeleteMissile(skillshot, missile); }
private static void Evade_OnDetectSkillshot(Skillshot skillshot) { Events._skillshotdetector.DetectSkillshot(skillshot); }