Example #1
0
 public Dmg(AIHeroClient target,
     float dmg,
     float delete,
     bool isAA = false,
     bool TargetedCC = false,
     Skillshot spell = null)
 {
     this.Target = target;
     Damage = dmg;
     Time = Game.Time;
     this.delete = delete;
     this.isAA = isAA;
     this.TargetedCC = TargetedCC;
     SkillShot = spell;
 }
Example #2
0
        public static Vector2 GetCollisionPoint(Skillshot skillshot)
        {
            var collisions = new List<DetectedCollision>();
            var from = skillshot.GetMissilePosition(0);
            skillshot.ForceDisabled = false;
            foreach (var cObject in skillshot.SkillshotData.CollisionObjects)
            {
                switch (cObject)
                {
                    case CollisionObjectTypes.Minion:

                        collisions.AddRange(from minion in MinionManager.GetMinions(@from.To3D(), 1200, MinionTypes.All, skillshot.Caster.Team == ObjectManager.Player.Team ? MinionTeam.NotAlly : MinionTeam.NotAllyForEnemy)
                            let pred = FastPrediction(@from, minion, Math.Max(0, skillshot.SkillshotData.Delay - (System.Environment.TickCount - skillshot.StartTick)), skillshot.SkillshotData.MissileSpeed)
                            let pos = pred.PredictedPos
                            let w = skillshot.SkillshotData.RawRadius + (!pred.IsMoving ? minion.BoundingRadius - 15 : 0) - pos.LSDistance(@from, skillshot.EndPosition, true)
                            where w > 0
                            select new DetectedCollision
                            {
                                Position = pos.ProjectOn(skillshot.EndPosition, skillshot.StartPosition).LinePoint + skillshot.Direction*30, Unit = minion, Type = CollisionObjectTypes.Minion, Distance = pos.LSDistance(@from), Diff = w
                            });

                        break;

                    case CollisionObjectTypes.Champions:
                        collisions.AddRange(from hero in ObjectManager.Get<AIHeroClient>().Where(h => h.LSIsValidTarget(1200) && h.Team == ObjectManager.Player.Team && !h.IsMe || h.Team != ObjectManager.Player.Team)
                            let pred = FastPrediction(@from, hero, Math.Max(0, skillshot.SkillshotData.Delay - (System.Environment.TickCount - skillshot.StartTick)), skillshot.SkillshotData.MissileSpeed)
                            let pos = pred.PredictedPos
                            let w = skillshot.SkillshotData.RawRadius + 30 - pos.LSDistance(@from, skillshot.EndPosition, true)
                            where w > 0
                            select new DetectedCollision
                            {
                                Position = pos.ProjectOn(skillshot.EndPosition, skillshot.StartPosition).LinePoint + skillshot.Direction*30, Unit = hero, Type = CollisionObjectTypes.Minion, Distance = pos.LSDistance(@from), Diff = w
                            });
                        break;

                    case CollisionObjectTypes.YasuoWall:
                        if (
                            !ObjectManager.Get<AIHeroClient>()
                                .Any(
                                    hero =>
                                        hero.LSIsValidTarget(float.MaxValue) &&
                                        hero.Team == ObjectManager.Player.Team && hero.ChampionName == "Yasuo"))
                        {
                            break;
                        }
                        GameObject wall = null;
                        foreach (var gameObject in ObjectManager.Get<GameObject>())
                        {
                            if (gameObject.IsValid &&
                                Regex.IsMatch(gameObject.Name, "_w_windwall.\\.troy", RegexOptions.IgnoreCase))
                            {
                                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.LSTo2D() - _yasuoWallCastedPos).Normalized().Perpendicular();
                        var wallStart = wall.Position.LSTo2D() + wallWidth/2*wallDirection;
                        var wallEnd = wallStart - wallWidth*wallDirection;
                        var wallPolygon = new SkillshotGeometry.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.EndPosition);
                            if (inter.Intersects)
                            {
                                intersections.Add(inter.Point);
                            }
                        }

                        if (intersections.Count > 0)
                        {
                            intersection = intersections.OrderBy(item => item.LSDistance(from)).ToList()[0];
                            var collisionT = System.Environment.TickCount +
                                             Math.Max(
                                                 0,
                                                 skillshot.SkillshotData.Delay -
                                                 (System.Environment.TickCount - skillshot.StartTick)) + 100 +
                                             1000*intersection.LSDistance(@from)/skillshot.SkillshotData.MissileSpeed;
                            if (collisionT - _wallCastT < 4000)
                            {
                                if (skillshot.SkillshotData.Type != SkillShotType.SkillshotMissileLine)
                                {
                                    skillshot.ForceDisabled = true;
                                }
                                return intersection;
                            }
                        }

                        break;
                }
            }

            Vector2 result;
            result = collisions.Count > 0 ? collisions.OrderBy(c => c.Distance).ToList()[0].Position : new Vector2();

            return result;
        }
Example #3
0
        public static Vector2 GetCollisionPoint(Skillshot skillshot)
        {
            var collisions = new List <DetectedCollision>();
            var from       = skillshot.GetMissilePosition(0);

            skillshot.ForceDisabled = false;
            foreach (var cObject in skillshot.SkillshotData.CollisionObjects)
            {
                switch (cObject)
                {
                case CollisionObjectTypes.Minion:

                    collisions.AddRange(from minion in MinionManager.GetMinions(@from.To3D(), 1200, MinionTypes.All, skillshot.Caster.Team == ObjectManager.Player.Team ? MinionTeam.NotAlly : MinionTeam.NotAllyForEnemy)
                                        let pred                                             = FastPrediction(@from, minion, Math.Max(0, skillshot.SkillshotData.Delay - (System.Environment.TickCount - skillshot.StartTick)), skillshot.SkillshotData.MissileSpeed)
                                                                     let pos                 = pred.PredictedPos
                                                                                       let w = skillshot.SkillshotData.RawRadius + (!pred.IsMoving ? minion.BoundingRadius - 15 : 0) - pos.LSDistance(@from, skillshot.EndPosition, true)
                                                                                               where w > 0
                                                                                               select new DetectedCollision
                    {
                        Position = pos.ProjectOn(skillshot.EndPosition, skillshot.StartPosition).LinePoint + skillshot.Direction * 30, Unit = minion, Type = CollisionObjectTypes.Minion, Distance = pos.LSDistance(@from), Diff = w
                    });

                    break;

                case CollisionObjectTypes.Champions:
                    collisions.AddRange(from hero in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget(1200) && h.Team == ObjectManager.Player.Team && !h.IsMe || h.Team != ObjectManager.Player.Team)
                                        let pred                                             = FastPrediction(@from, hero, Math.Max(0, skillshot.SkillshotData.Delay - (System.Environment.TickCount - skillshot.StartTick)), skillshot.SkillshotData.MissileSpeed)
                                                                     let pos                 = pred.PredictedPos
                                                                                       let w = skillshot.SkillshotData.RawRadius + 30 - pos.LSDistance(@from, skillshot.EndPosition, true)
                                                                                               where w > 0
                                                                                               select new DetectedCollision
                    {
                        Position = pos.ProjectOn(skillshot.EndPosition, skillshot.StartPosition).LinePoint + skillshot.Direction * 30, Unit = hero, Type = CollisionObjectTypes.Minion, Distance = pos.LSDistance(@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 &&
                            Regex.IsMatch(gameObject.Name, "_w_windwall.\\.troy", RegexOptions.IgnoreCase))
                        {
                            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 SkillshotGeometry.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.EndPosition);
                        if (inter.Intersects)
                        {
                            intersections.Add(inter.Point);
                        }
                    }

                    if (intersections.Count > 0)
                    {
                        intersection = intersections.OrderBy(item => item.LSDistance(from)).ToList()[0];
                        var collisionT = System.Environment.TickCount +
                                         Math.Max(
                            0,
                            skillshot.SkillshotData.Delay -
                            (System.Environment.TickCount - skillshot.StartTick)) + 100 +
                                         1000 * intersection.LSDistance(@from) / skillshot.SkillshotData.MissileSpeed;
                        if (collisionT - _wallCastT < 4000)
                        {
                            if (skillshot.SkillshotData.Type != SkillShotType.SkillshotMissileLine)
                            {
                                skillshot.ForceDisabled = true;
                            }
                            return(intersection);
                        }
                    }

                    break;
                }
            }

            Vector2 result;

            result = collisions.Count > 0 ? collisions.OrderBy(c => c.Distance).ToList()[0].Position : new Vector2();

            return(result);
        }
        private static void OnDetectSkillshotProcessing(Skillshot skillshot)
        {
            try
            {
                var hero = (Obj_AI_Hero)skillshot.Caster;
                //Check if the skillshot is already added.
                var alreadyAdded = false;
                if (!DrawHelper.damagePredEnabled(hero.ChampionName, skillshot.SkillshotData.Slot))
                {
                    return;
                }
                // Integration disabled

                foreach (var item in ActiveSkillshots)
                {
                    if (item.SkillshotData.SpellName == skillshot.SkillshotData.SpellName &&
                        (item.Caster.NetworkId == skillshot.Caster.NetworkId &&
                         (skillshot.Direction).AngleBetween(item.Direction) < 5 &&
                         (skillshot.StartPosition.Distance(item.StartPosition) < 100 ||
                          skillshot.SkillshotData.FromObjects.Length == 0)))
                    {
                        alreadyAdded = true;
                    }
                }

                //Add the skillshot to the detected skillshot list.
                if (!alreadyAdded)
                {
                    //Multiple skillshots like twisted fate Q.
                    if (skillshot.DetectionType == DetectionType.ProcessSpell)
                    {
                        if (skillshot.SkillshotData.MultipleNumber != -1)
                        {
                            var originalDirection = skillshot.Direction;

                            for (var i = -(skillshot.SkillshotData.MultipleNumber - 1) / 2;
                                 i <= (skillshot.SkillshotData.MultipleNumber - 1) / 2;
                                 i++)
                            {
                                var end = skillshot.StartPosition +
                                          skillshot.SkillshotData.Range *
                                          originalDirection.Rotated(skillshot.SkillshotData.MultipleAngle * i);
                                var skillshotToAdd = new Skillshot(
                                    skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick,
                                    skillshot.StartPosition, end, skillshot.Caster);

                                ActiveSkillshots.Add(skillshotToAdd);
                            }
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "UFSlash")
                        {
                            skillshot.SkillshotData.MissileSpeed = 1600 + (int)skillshot.Caster.MoveSpeed;
                        }

                        if (skillshot.SkillshotData.Invert)
                        {
                            var newDirection = -(skillshot.EndPosition - skillshot.StartPosition).Normalized();
                            var end          = skillshot.StartPosition +
                                               newDirection * skillshot.StartPosition.Distance(skillshot.EndPosition);
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick,
                                skillshot.StartPosition, end, skillshot.Caster);
                            ActiveSkillshots.Add(skillshotToAdd);
                            return;
                        }

                        if (skillshot.SkillshotData.Centered)
                        {
                            var start          = skillshot.StartPosition - skillshot.Direction * skillshot.SkillshotData.Range;
                            var end            = skillshot.StartPosition + skillshot.Direction * skillshot.SkillshotData.Range;
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick, start, end,
                                skillshot.Caster);
                            ActiveSkillshots.Add(skillshotToAdd);
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "SyndraE" ||
                            skillshot.SkillshotData.SpellName == "syndrae5")
                        {
                            var angle = 60;
                            var edge1 =
                                (skillshot.EndPosition - skillshot.Caster.ServerPosition.To2D()).Rotated(
                                    -angle / 2 * (float)Math.PI / 180);
                            var edge2 = edge1.Rotated(angle * (float)Math.PI / 180);

                            foreach (var minion in ObjectManager.Get <Obj_AI_Minion>())
                            {
                                var v = minion.ServerPosition.To2D() - skillshot.Caster.ServerPosition.To2D();
                                if (minion.Name == "Seed" && edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 &&
                                    minion.Distance(skillshot.Caster) < 800 &&
                                    (minion.Team != ObjectManager.Player.Team))
                                {
                                    var start = minion.ServerPosition.To2D();
                                    var end   = skillshot.Caster.ServerPosition.To2D()
                                                .Extend(
                                        minion.ServerPosition.To2D(),
                                        skillshot.Caster.Distance(minion) > 200 ? 1300 : 1000);

                                    var skillshotToAdd = new Skillshot(
                                        skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick, start,
                                        end, skillshot.Caster);
                                    ActiveSkillshots.Add(skillshotToAdd);
                                }
                            }
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "AlZaharCalloftheVoid")
                        {
                            var start          = skillshot.EndPosition - skillshot.Direction.Perpendicular() * 400;
                            var end            = skillshot.EndPosition + skillshot.Direction.Perpendicular() * 400;
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick, start, end,
                                skillshot.Caster);
                            ActiveSkillshots.Add(skillshotToAdd);
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "ZiggsQ")
                        {
                            var d1 = skillshot.StartPosition.Distance(skillshot.EndPosition);
                            var d2 = d1 * 0.4f;
                            var d3 = d2 * 0.69f;


                            var bounce1SpellData = SpellDatabase.GetByName("ZiggsQBounce1");
                            var bounce2SpellData = SpellDatabase.GetByName("ZiggsQBounce2");

                            var bounce1Pos = skillshot.EndPosition + skillshot.Direction * d2;
                            var bounce2Pos = bounce1Pos + skillshot.Direction * d3;

                            bounce1SpellData.Delay =
                                (int)
                                (skillshot.SkillshotData.Delay + d1 * 1000f / skillshot.SkillshotData.MissileSpeed +
                                 500);
                            bounce2SpellData.Delay =
                                (int)(bounce1SpellData.Delay + d2 * 1000f / bounce1SpellData.MissileSpeed + 500);

                            var bounce1 = new Skillshot(
                                skillshot.DetectionType, bounce1SpellData, skillshot.StartTick, skillshot.EndPosition,
                                bounce1Pos, skillshot.Caster);
                            var bounce2 = new Skillshot(
                                skillshot.DetectionType, bounce2SpellData, skillshot.StartTick, bounce1Pos, bounce2Pos,
                                skillshot.Caster);

                            ActiveSkillshots.Add(bounce1);
                            ActiveSkillshots.Add(bounce2);
                        }

                        if (skillshot.SkillshotData.SpellName == "ZiggsR")
                        {
                            skillshot.SkillshotData.Delay =
                                (int)
                                (1500 +
                                 1500 * skillshot.EndPosition.Distance(skillshot.StartPosition) /
                                 skillshot.SkillshotData.Range);
                        }

                        if (skillshot.SkillshotData.SpellName == "JarvanIVDragonStrike")
                        {
                            var endPos = new Vector2();

                            foreach (var s in ActiveSkillshots)
                            {
                                if (s.Caster.NetworkId == skillshot.Caster.NetworkId &&
                                    s.SkillshotData.Slot == SpellSlot.E)
                                {
                                    endPos = s.EndPosition;
                                }
                            }

                            foreach (var m in ObjectManager.Get <Obj_AI_Minion>())
                            {
                                if (m.BaseSkinName == "jarvanivstandard" && m.Team == skillshot.Caster.Team &&
                                    skillshot.IsDanger(m.Position.To2D()))
                                {
                                    endPos = m.Position.To2D();
                                }
                            }

                            if (!endPos.IsValid())
                            {
                                return;
                            }

                            skillshot.EndPosition = endPos + 200 * (endPos - skillshot.StartPosition).Normalized();
                            skillshot.Direction   = (skillshot.EndPosition - skillshot.StartPosition).Normalized();
                        }
                    }

                    if (skillshot.SkillshotData.SpellName == "OriannasQ")
                    {
                        var endCSpellData = SpellDatabase.GetByName("OriannaQend");

                        var skillshotToAdd = new Skillshot(
                            skillshot.DetectionType, endCSpellData, skillshot.StartTick, skillshot.StartPosition,
                            skillshot.EndPosition, skillshot.Caster);

                        ActiveSkillshots.Add(skillshotToAdd);
                    }

                    /*
                     * //Dont allow fow detection.
                     * if (skillshot.SkillshotData.DisableFowDetection &&
                     *  skillshot.DetectionType == DetectionType.RecvPacket)
                     * {
                     *  return;
                     * }*/
                    ActiveSkillshots.Add(skillshot);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #5
0
        private static void TriggerOnDetectSkillshot(DetectionType detectionType,
            SkillshotData skillshotData,
            int startT,
            Vector2 start,
            Vector2 end,
            Obj_AI_Base unit)
        {
            var skillshot = new Skillshot(detectionType, skillshotData, startT, start, end, unit);

            if (OnDetectSkillshot != null)
            {
                OnDetectSkillshot(skillshot);
            }
        }
Example #6
0
        private static void OnDetectSkillshotProcessing(Skillshot skillshot)
        {
            try
            {
                var hero = (AIHeroClient) skillshot.Caster;
                //Check if the skillshot is already added.
                var alreadyAdded = false;

                // Integration disabled

                foreach (var item in ActiveSkillshots)
                {
                    if (item.SkillshotData.SpellName == skillshot.SkillshotData.SpellName &&
                        item.Caster.NetworkId == skillshot.Caster.NetworkId &&
                        skillshot.Direction.AngleBetween(item.Direction) < 5 &&
                        (skillshot.StartPosition.LSDistance(item.StartPosition) < 100 ||
                         skillshot.SkillshotData.FromObjects.Length == 0))
                    {
                        alreadyAdded = true;
                    }
                }

                //Add the skillshot to the detected skillshot list.
                if (!alreadyAdded)
                {
                    //Multiple skillshots like twisted fate Q.
                    if (skillshot.DetectionType == DetectionType.ProcessSpell)
                    {
                        if (skillshot.SkillshotData.MultipleNumber != -1)
                        {
                            var originalDirection = skillshot.Direction;

                            for (var i = -(skillshot.SkillshotData.MultipleNumber - 1)/2;
                                i <= (skillshot.SkillshotData.MultipleNumber - 1)/2;
                                i++)
                            {
                                var end = skillshot.StartPosition +
                                          skillshot.SkillshotData.Range*
                                          originalDirection.Rotated(skillshot.SkillshotData.MultipleAngle*i);
                                var skillshotToAdd = new Skillshot(
                                    skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick,
                                    skillshot.StartPosition, end, skillshot.Caster);

                                ActiveSkillshots.Add(skillshotToAdd);
                            }
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "UFSlash")
                        {
                            skillshot.SkillshotData.MissileSpeed = 1600 + (int) skillshot.Caster.MoveSpeed;
                        }

                        if (skillshot.SkillshotData.Invert)
                        {
                            var newDirection = -(skillshot.EndPosition - skillshot.StartPosition).Normalized();
                            var end = skillshot.StartPosition +
                                      newDirection*skillshot.StartPosition.LSDistance(skillshot.EndPosition);
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick,
                                skillshot.StartPosition, end, skillshot.Caster);
                            ActiveSkillshots.Add(skillshotToAdd);
                            return;
                        }

                        if (skillshot.SkillshotData.Centered)
                        {
                            var start = skillshot.StartPosition - skillshot.Direction*skillshot.SkillshotData.Range;
                            var end = skillshot.StartPosition + skillshot.Direction*skillshot.SkillshotData.Range;
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick, start, end,
                                skillshot.Caster);
                            ActiveSkillshots.Add(skillshotToAdd);
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "SyndraE" ||
                            skillshot.SkillshotData.SpellName == "syndrae5")
                        {
                            var angle = 60;
                            var edge1 =
                                (skillshot.EndPosition - skillshot.Caster.ServerPosition.LSTo2D()).Rotated(
                                    -angle/2*(float) Math.PI/180);
                            var edge2 = edge1.Rotated(angle*(float) Math.PI/180);

                            foreach (var minion in ObjectManager.Get<Obj_AI_Minion>())
                            {
                                var v = minion.ServerPosition.LSTo2D() - skillshot.Caster.ServerPosition.LSTo2D();
                                if (minion.Name == "Seed" && edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 &&
                                    minion.LSDistance(skillshot.Caster) < 800 &&
                                    (minion.Team != ObjectManager.Player.Team))
                                {
                                    var start = minion.ServerPosition.LSTo2D();
                                    var end = skillshot.Caster.ServerPosition.LSTo2D()
                                        .LSExtend(
                                            minion.ServerPosition.LSTo2D(),
                                            skillshot.Caster.LSDistance(minion) > 200 ? 1300 : 1000);

                                    var skillshotToAdd = new Skillshot(
                                        skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick, start,
                                        end, skillshot.Caster);
                                    ActiveSkillshots.Add(skillshotToAdd);
                                }
                            }
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "AlZaharCalloftheVoid")
                        {
                            var start = skillshot.EndPosition - skillshot.Direction.Perpendicular()*400;
                            var end = skillshot.EndPosition + skillshot.Direction.Perpendicular()*400;
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SkillshotData, skillshot.StartTick, start, end,
                                skillshot.Caster);
                            ActiveSkillshots.Add(skillshotToAdd);
                            return;
                        }

                        if (skillshot.SkillshotData.SpellName == "ZiggsQ")
                        {
                            var d1 = skillshot.StartPosition.LSDistance(skillshot.EndPosition);
                            var d2 = d1*0.4f;
                            var d3 = d2*0.69f;

                            var bounce1SpellData = SpellDatabase.GetByName("ZiggsQBounce1");
                            var bounce2SpellData = SpellDatabase.GetByName("ZiggsQBounce2");

                            var bounce1Pos = skillshot.EndPosition + skillshot.Direction*d2;
                            var bounce2Pos = bounce1Pos + skillshot.Direction*d3;

                            bounce1SpellData.Delay =
                                (int)
                                    (skillshot.SkillshotData.Delay + d1*1000f/skillshot.SkillshotData.MissileSpeed +
                                     500);
                            bounce2SpellData.Delay =
                                (int) (bounce1SpellData.Delay + d2*1000f/bounce1SpellData.MissileSpeed + 500);

                            var bounce1 = new Skillshot(
                                skillshot.DetectionType, bounce1SpellData, skillshot.StartTick, skillshot.EndPosition,
                                bounce1Pos, skillshot.Caster);
                            var bounce2 = new Skillshot(
                                skillshot.DetectionType, bounce2SpellData, skillshot.StartTick, bounce1Pos, bounce2Pos,
                                skillshot.Caster);

                            ActiveSkillshots.Add(bounce1);
                            ActiveSkillshots.Add(bounce2);
                        }

                        if (skillshot.SkillshotData.SpellName == "ZiggsR")
                        {
                            skillshot.SkillshotData.Delay =
                                (int)
                                    (1500 +
                                     1500*skillshot.EndPosition.LSDistance(skillshot.StartPosition)/
                                     skillshot.SkillshotData.Range);
                        }

                        if (skillshot.SkillshotData.SpellName == "JarvanIVDragonStrike")
                        {
                            var endPos = new Vector2();

                            foreach (var s in ActiveSkillshots)
                            {
                                if (s.Caster.NetworkId == skillshot.Caster.NetworkId &&
                                    s.SkillshotData.Slot == SpellSlot.E)
                                {
                                    endPos = s.EndPosition;
                                }
                            }

                            foreach (var m in ObjectManager.Get<Obj_AI_Minion>())
                            {
                                if (m.BaseSkinName == "jarvanivstandard" && m.Team == skillshot.Caster.Team &&
                                    skillshot.IsDanger(m.Position.LSTo2D()))
                                {
                                    endPos = m.Position.LSTo2D();
                                }
                            }

                            if (!endPos.IsValid())
                            {
                                return;
                            }

                            skillshot.EndPosition = endPos + 200*(endPos - skillshot.StartPosition).Normalized();
                            skillshot.Direction = (skillshot.EndPosition - skillshot.StartPosition).Normalized();
                        }
                    }

                    if (skillshot.SkillshotData.SpellName == "OriannasQ")
                    {
                        var endCSpellData = SpellDatabase.GetByName("OriannaQend");

                        var skillshotToAdd = new Skillshot(
                            skillshot.DetectionType, endCSpellData, skillshot.StartTick, skillshot.StartPosition,
                            skillshot.EndPosition, skillshot.Caster);

                        ActiveSkillshots.Add(skillshotToAdd);
                    }

                    /*
                    //Dont allow fow detection.
                    if (skillshot.SkillshotData.DisableFowDetection &&
                        skillshot.DetectionType == DetectionType.RecvPacket)
                    {
                        return;
                    }*/
                    ActiveSkillshots.Add(skillshot);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }