Ejemplo n.º 1
0
        private static void ProcessSpell_ZedShuriken(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                                     SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "ZedQ")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.ObjTracker)
                {
                    var info = entry.Value;

                    if (info.Obj.Name == "Shadow" || info.Name == "Shadow")
                    {
                        if (info.UsePosition == false && (info.Obj == null || !info.Obj.IsValid || info.Obj.IsDead))
                        {
                            DelayAction.Add(1, () => ObjectTracker.ObjTracker.Remove(info.Obj.NetworkId));
                            continue;
                        }
                        else
                        {
                            Vector3 endPos2;
                            if (info.UsePosition == false)
                            {
                                endPos2 = info.Obj.Position.Extend(args.End, spellData.Range).To3DWorld();
                                SpellDetector.CreateSpellData(hero, info.Obj.Position, endPos2, spellData, null, 0, false);
                            }
                            else
                            {
                                endPos2 = info.Position.Extend(args.End, spellData.Range).To3DWorld();
                                SpellDetector.CreateSpellData(hero, info.Position, endPos2, spellData, null, 0, false);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private static void ProcessSpell_ZiggsQ(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args,
                                                SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "ZiggsQ")
            {
                var startPos = hero.ServerPosition.To2D();
                var endPos   = args.End.To2D();
                var dir      = (endPos - startPos).Normalized();

                if (endPos.Distance(startPos) > 850)
                {
                    endPos = startPos + dir * 850;
                }

                SpellDetector.CreateSpellData(hero, args.Start, endPos.To3D(), spellData, null, 0, false);

                var endPos2 = endPos + dir * 0.4f * startPos.Distance(endPos);
                SpellDetector.CreateSpellData(hero, args.Start, endPos2.To3D(), spellData, null, 250, false);

                var endPos3 = endPos2 + dir * 0.6f * endPos.Distance(endPos2);
                SpellDetector.CreateSpellData(hero, args.Start, endPos3.To3D(), spellData, null, 800);

                specialSpellArgs.noProcess = true;
            }
        }
Ejemplo n.º 3
0
        private static void ProcessSpell_JarvanIVDragonStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "JarvanIVDemacianStandard")
            {
                var end = args.End;
                if (args.Start.Distance(end) > spellData.range)
                {
                    end = args.Start + (args.End - args.Start).Normalized() * spellData.range;
                }

                _eSpots.Add(Game.Time, end);
            }

            if (spellData.spellName == "JarvanIVDragonStrike")
            {
                if (SpellDetector.onProcessSpells.TryGetValue("jarvanivdragonstrike2", out spellData))
                {
                    foreach (var entry in _eSpots)
                    {
                        var flagPosition = entry.Value;

                        if (args.End.To2D().Distance(flagPosition) < 300)
                        {
                            var dir         = (flagPosition.To2D() - args.Start.To2D()).Normalized();
                            var endPosition = flagPosition.To2D() + dir * 110;

                            SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                            specialSpellArgs.noProcess = true;
                            return;
                        }
                    }

                    foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                    {
                        var info = entry.Value;

                        if (info.Name == "Beacon" || info.obj.Name == "Beacon")
                        {
                            if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                            {
                                DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(info.obj.NetworkId));
                                continue;
                            }

                            var objPosition = info.usePosition ? info.position.To2D() : info.obj.Position.To2D();

                            if (args.End.To2D().Distance(objPosition) < 300)
                            {
                                var dir         = (objPosition - args.Start.To2D()).Normalized();
                                var endPosition = objPosition + dir * 110;

                                SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                                specialSpellArgs.noProcess = true;
                                return;
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private static void ProcessSpell_OrianaIzunaCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "OrianaIzunaCommand")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            SpellDetector.CreateSpellData(hero, info.position, args.End, spellData, null, 0, false);
                            SpellDetector.CreateSpellData(hero, info.position, args.End, spellData, null, 150, true, SpellType.Circular, false, spellData.secondaryRadius);
                        }
                        else
                        {
                            if (info.obj != null && info.obj.IsValid && !info.obj.IsDead)
                            {
                                SpellDetector.CreateSpellData(hero, info.obj.Position, args.End, spellData, null, 0, false);
                                SpellDetector.CreateSpellData(hero, info.obj.Position, args.End, spellData, null, 150, true, SpellType.Circular, false, spellData.secondaryRadius);
                            }
                        }

                        info.position = args.End;
                        info.usePosition = true;
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName == "OrianaDetonateCommand" || spellData.spellName == "OrianaDissonanceCommand")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            Vector3 endPos2 = info.position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj != null && info.obj.IsValid && !info.obj.IsDead)
                            {
                                Vector3 endPos2 = info.obj.Position;
                                SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                            }
                        }
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Ejemplo n.º 5
0
        private static void ProcessSpell_ZedShuriken(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args,
                                                     SpellData spellData,
                                                     SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "ZedQ")
            {
                foreach (var entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    if (info.Name == "Shadow")
                    {
                        if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                        {
                            DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(info.obj.NetworkId));
                        }
                        else
                        {
                            Vector3 endPos2;
                            if (info.usePosition == false)
                            {
                                endPos2 = info.obj.Position.Extend(args.End, spellData.range);
                                SpellDetector.CreateSpellData(hero, info.obj.Position, endPos2, spellData, null, 0,
                                                              false);
                            }
                            else
                            {
                                endPos2 = info.position.Extend(args.End, spellData.range);
                                SpellDetector.CreateSpellData(hero, info.position, endPos2, spellData, null, 0, false);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private static void ProcessSpell_AzirSoldier(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "AzirQWrapper")
            {
                foreach (var entry in ObjectTracker.ObjTracker)
                {
                    var info = entry.Value;
                    if (info.Name == "AzirQSoldier")
                    {
                        foreach (var objEntry in info.ObjList)
                        {
                            var soldier = objEntry.Value;
                            if (soldier == null || !soldier.IsValid || soldier.IsDead)
                            {
                                continue;
                            }

                            var maxMenuSliderange = 875 + hero.Distance(soldier.Position);
                            var start             = soldier.Position;
                            var end = args.End;

                            if (start.Distance(end) > maxMenuSliderange)
                            {
                                end = start + (end - start).Normalized() * maxMenuSliderange;
                            }

                            SpellDetector.CreateSpellData(hero, start, end, spellData, soldier);
                        }
                    }
                }

                specialSpellArgs.NoProcess = true;
            }
        }
Ejemplo n.º 7
0
        private static void OnCreateObj_LuxMaliceCannon(GameObject obj, EventArgs args, AIHeroClient hero, SpellData spellData)
        {
            if (obj.Name.Contains("Lux") && obj.Name.Contains("R_mis_beam_middle"))
            {
                if (hero.IsVisible)
                {
                    return;
                }

                var objList = ObjectTracker.objTracker.Values.Where(o => o.Name == "hiu");
                if (objList.Count() >= 2)
                {
                    var dir  = ObjectTracker.GetLastHiuOrientation();
                    var pos1 = obj.Position.To2D() - dir * 1750;
                    var pos2 = obj.Position.To2D() + dir * 1750;

                    SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0);

                    foreach (ObjectTrackerInfo gameObj in objList)
                    {
                        DelayAction.Add(1, () => ObjectTracker.objTracker.Remove(gameObj.obj.NetworkId));
                    }
                }
            }
        }
Ejemplo n.º 8
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "TaricE")
            {
                var sdata = new SpellData();
                sdata.charName        = "Taric";
                sdata.name            = "TaricE2";
                sdata.spellName       = "TaricE";
                sdata.range           = 750;
                sdata.radius          = 100;
                sdata.fixedRange      = true;
                sdata.spellDelay      = 1000;
                sdata.projectileSpeed = int.MaxValue;
                sdata.dangerlevel     = 3;

                var partner = HeroManager.Enemies.FirstOrDefault(x => x.HasBuff("taricwleashactive"));
                if (partner != null && partner.ChampionName != "Taric")
                {
                    var start     = partner.ServerPosition.To2D();
                    var direction = (args.End.To2D() - start).Normalized();
                    var end       = start + direction * spellData.range;

                    SpellDetector.CreateSpellData(partner, start.To3D(), end.To3D(), sdata);
                }
            }
        }
Ejemplo n.º 9
0
        private static void ProcessSpell_JarvanIVDragonStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "JarvanIVDragonStrike")
            {
                if (SpellDetector.OnProcessSpells.TryGetValue("JarvanIVDragonStrike2", out spellData))
                {
                    foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.ObjTracker)
                    {
                        var info = entry.Value;

                        if (info.Name == "Beacon" || info.Obj.Name == "Beacon")
                        {
                            if (info.UsePosition == false && (info.Obj == null || !info.Obj.IsValid || info.Obj.IsDead))
                            {
                                DelayAction.Add(1, () => ObjectTracker.ObjTracker.Remove(info.Obj.NetworkId));
                                continue;
                            }

                            var objPosition = info.UsePosition ? info.Position.To2D() : info.Obj.Position.To2D();

                            if (args.End.To2D().Distance(objPosition) < 300)
                            {
                                var dir         = (objPosition - args.Start.To2D()).Normalized();
                                var endPosition = objPosition + dir * 110;

                                SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                                specialSpellArgs.NoProcess = true;
                                return;
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        private static void OnCreateObj_FizzMarinerDoom(GameObject obj, EventArgs args, SpellData spellData)
        {
            if (obj.GetType() != typeof(MissileClient) || !((MissileClient)obj).IsValidMissile())
            {
                return;
            }

            MissileClient missile = (MissileClient)obj;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != ObjectManager.Player.Team &&
                missile.SData.Name == "FizzMarinerDoomMissile")
            {
                SpellDetector.CreateSpellData(missile.SpellCaster, missile.StartPosition, missile.EndPosition,
                                              spellData, null, 500, true, SpellType.Circular, false, spellData.SecondaryRadius);

                /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
                 * {
                 *  var spell = entry.Value;
                 *
                 *  if (spell.info.spellName == "FizzMarinerDoom" &&
                 *      spell.spellObject != null && spell.spellObject.NetworkId == missile.NetworkId)
                 *  {
                 *      if (spell.spellType == SpellType.Circular)
                 *      {
                 *          spell.spellObject = null;
                 *      }
                 *  }
                 * }*/
            }
        }
Ejemplo n.º 11
0
        private static void ProcessSpell_AzirSoldier(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "AzirQWrapper")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;
                    if (info.Name == "AzirQSoldier")
                    {
                        foreach (var objEntry in info.objList)
                        {
                            var soldier = objEntry.Value;
                            if (soldier == null || !soldier.IsValid || soldier.IsDead)
                            {
                                continue;
                            }

                            SpellDetector.CreateSpellData(hero, soldier.Position, args.End, spellData);
                        }
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Ejemplo n.º 12
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args,
                                                         SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "GravesQLineSpell")
            {
                var newData = (SpellData)spellData.Clone();
                newData.isPerpendicular = true;
                newData.secondaryRadius = 255f;
                newData.updatePosition  = false;
                newData.extraEndTime    = 1300;

                var end   = args.End;
                var start = args.Start;

                if (end.Distance(start) > newData.range)
                {
                    end = args.Start + (args.End - args.Start).Normalized() * newData.range;
                }

                if (end.Distance(start) < newData.range)
                {
                    end = args.Start + (args.End - args.Start).Normalized() * newData.range;
                }

                var w = EvadeHelper.GetNearWallPoint(start, end);
                if (w != default(Vector3))
                {
                    end = w;
                }

                //SpellDetector.CreateSpellData(hero, hero.ServerPosition, end, spellData);
                SpellDetector.CreateSpellData(hero, hero.ServerPosition, end, newData);
            }
        }
Ejemplo n.º 13
0
        private static void OnCreateObj_jayceshockblast(GameObject obj, EventArgs args, Obj_AI_Hero hero, SpellData spellData)
        {
            if (obj.Type == GameObjectType.obj_GeneralParticleEmitter && obj.Name.Contains("Jayce") && obj.Name.Contains("accel_gate_end") && obj.Name.Contains("RED"))
            {
                foreach (var tracker in ObjectTracker.ObjTracker)
                {
                    var gateObj = tracker.Value;

                    if (gateObj.Name == "AccelGate")
                    {
                        DelayAction.Add(0, () => ObjectTracker.ObjTracker.Remove(tracker.Key));
                    }
                }
            }

            if (obj.Type == GameObjectType.obj_GeneralParticleEmitter && obj.Name.Contains("Jayce") && obj.Name.Contains("accel_gate_start") && obj.Name.Contains("RED"))
            {
                //var particle = obj as Obj_GeneralParticleEmitter;

                /*var dir = obj.Orientation.To2D();
                 * var pos1 = obj.Position.To2D() - dir * 470;
                 * var pos2 = obj.Position.To2D() + dir * 470;
                 *
                 * //Draw.RenderObjects.Add(new Draw.RenderLine(pos1, pos2, 3500));
                 * Draw.RenderObjects.Add(new Draw.RenderCircle(pos1, 3500));*/

                var gateTracker = new ObjectTrackerInfo(obj, "AccelGate");
                //gateTracker.Orientation = dir.To3D();

                ObjectTracker.ObjTracker.Add(obj.NetworkId, gateTracker);

                foreach (var entry in SpellDetector.Spells) //check currently moving skillshot
                {
                    var spell = entry.Value;

                    if (spell.Info.SpellName == "JayceShockBlast")
                    {
                        var tHero = spell.HeroId;

                        Vector2 int1, int2;
                        var     intersection = MathUtils.FindLineCircleIntersections(obj.Position.To2D(), 470, spell.StartPos, spell.EndPos, out int1, out int2);
                        var     projection   = obj.Position.To2D().ProjectOn(spell.StartPos, spell.EndPos);

                        //var intersection = spell.startPos.Intersection(spell.endPos, pos1, pos2);
                        //var projection = intersection.Point.ProjectOn(spell.startPos, spell.endPos);

                        //if (intersection.Intersects && projection.IsOnSegment)
                        if (intersection > 0 && projection.IsOnSegment)
                        {
                            SpellDetector.CreateSpellData(hero, projection.SegmentPoint.To3D(), spell.EndPos.To3D(), spellData, spell.SpellObject);

                            DelayAction.Add(1, () => SpellDetector.DeleteSpell(entry.Key));
                            break;
                        }
                    }
                }

                //SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0);
            }
        }
Ejemplo n.º 14
0
        private static void ProcessSpell_OrianaIzunaCommand(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "OrianaIzunaCommand")
            {
                foreach (var entry in ObjectTracker.ObjTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.UsePosition)
                        {
                            SpellDetector.CreateSpellData(hero, info.Position, args.End, spellData, null, 0, false);
                            SpellDetector.CreateSpellData(hero, info.Position, args.End, spellData, null, 150, true, SpellType.Circular, false, spellData.SecondaryRadius);
                        }
                        else
                        {
                            if (info.Obj != null && info.Obj.IsValid && !info.Obj.IsDead)
                            {
                                SpellDetector.CreateSpellData(hero, info.Obj.Position, args.End, spellData, null, 0, false);
                                SpellDetector.CreateSpellData(hero, info.Obj.Position, args.End, spellData, null, 150, true, SpellType.Circular, false, spellData.SecondaryRadius);
                            }
                        }

                        info.Position    = args.End;
                        info.UsePosition = true;
                    }
                }

                specialSpellArgs.NoProcess = true;
            }

            if (spellData.SpellName == "OrianaDetonateCommand" || spellData.SpellName == "OrianaDissonanceCommand")
            {
                foreach (var entry in ObjectTracker.ObjTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.UsePosition)
                        {
                            var endPos2 = info.Position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData);
                        }
                        else
                        {
                            if (info.Obj != null && info.Obj.IsValid && !info.Obj.IsDead)
                            {
                                var endPos2 = info.Obj.Position;
                                SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData);
                            }
                        }
                    }
                }

                specialSpellArgs.NoProcess = true;
            }
        }
Ejemplo n.º 15
0
        private static void ProcessSpell_HeimerdingerTurretEnergyBlast(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "HeimerdingerTurretEnergyBlast" || spellData.SpellName == "HeimerdingerTurretBigEnergyBlast")
            {
                SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData);

                specialSpellArgs.NoProcess = true;
            }
        }
Ejemplo n.º 16
0
        private static void OnCreateObj_JinxWMissile(GameObject obj, EventArgs args, Obj_AI_Hero hero, SpellData spellData)
        {
            if (hero != null && !hero.IsVisible && obj.IsEnemy && obj.Name.Contains("Jinx") && obj.Name.Contains("W_Cas"))
            {
                var pos1 = hero.Position;
                var dir  = (obj.Position - ObjectManager.GetLocalPlayer().Position).Normalized();
                var pos2 = pos1 + dir * 500;

                SpellDetector.CreateSpellData(hero, pos1, pos2, spellData);
            }
        }
Ejemplo n.º 17
0
        private static void ProcessSpell_ThreeWay(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.IsThreeWay)
            {
                Vector3 endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), spellData.Angle).To3D();
                SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);

                Vector3 endPos3 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), -spellData.Angle).To3D();
                SpellDetector.CreateSpellData(hero, args.Start, endPos3, spellData, null, 0, false);
            }
        }
Ejemplo n.º 18
0
        private static void ProcessSpell_ThreeWay(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args,
                                                  SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.isThreeWay)
            {
                var endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), spellData.angle).To3D();
                SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);

                var endPos3 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), -spellData.angle).To3D();
                SpellDetector.CreateSpellData(hero, args.Start, endPos3, spellData, null, 0, false);
            }
        }
Ejemplo n.º 19
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName.ToLower() == "syndrae")
            {
                var estart = args.Start;
                var eend   = args.Start + (args.End - args.Start).Normalized() * 700;

                foreach (var sphere in _spheres.Where(s => s.IsValid && !s.IsDead))
                {
                    // check if e whill hit the sphere
                    var proj = sphere.Position.To2D().ProjectOn(estart.To2D(), eend.To2D());
                    if (sphere.Position.To2D().Distance(proj.SegmentPoint) <= sphere.BoundingRadius + 110)
                    {
                        var start = sphere.Position;
                        var end   = hero.ServerPosition + (sphere.Position - hero.ServerPosition).Normalized() * spellData.range;
                        var data  = spellData.CopyData();
                        data.spellDelay = sphere.Distance(hero.ServerPosition) / spellData.projectileSpeed * 1000;
                        SpellDetector.CreateSpellData(hero, start, end, data, sphere);
                    }
                }

                foreach (var entry in _qSpots)
                {
                    var spherePosition = entry.Value;

                    // check if e whill hit the sphere
                    var proj = spherePosition.To2D().ProjectOn(estart.To2D(), eend.To2D());
                    if (proj.IsOnSegment && spherePosition.To2D().Distance(proj.SegmentPoint) <= 155)
                    {
                        var start = spherePosition;
                        var end   = hero.ServerPosition + (spherePosition - hero.ServerPosition).Normalized() * spellData.range;
                        var data  = spellData.CopyData();
                        data.spellDelay = spherePosition.Distance(hero.ServerPosition) / spellData.projectileSpeed * 1000;
                        SpellDetector.CreateSpellData(hero, start, end, data, null);
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName == "syndraq")
            {
                var end = args.End;
                if (args.Start.Distance(end) > 800)
                {
                    end = args.Start + (args.End - args.Start).Normalized() * 800;
                }

                _qSpots[Game.Time] = end;

                specialSpellArgs.noProcess = true;
            }
        }
Ejemplo n.º 20
0
        private static void ProcessSpell_FizzPiercingStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "FizzQ")
            {
                if (args.Target != null && args.Target.IsMe)
                {
                    SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData, null, 0);
                }

                specialSpellArgs.noProcess = true;
            }
        }
Ejemplo n.º 21
0
        private static void ProcessSpell_FizzPiercingStrike(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "FizzQ")
            {
                if (args.Target != null && args.Target.IsMe)
                {
                    SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData);
                }

                specialSpellArgs.NoProcess = true;
            }
        }
Ejemplo n.º 22
0
 private static void ProcessSpell_AsheVolley(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.SpellName == "Volley")
     {
         for (var i = -4; i < 5; i++)
         {
             var endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), i * spellData.Angle).To3D();
             if (i != 0)
             {
                 SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);
             }
         }
     }
 }
Ejemplo n.º 23
0
 private static void ProcessSpell_AsheVolley(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "Volley")
     {
         for (int i = -4; i < 5; i++)
         {
             Vector3 endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), i * spellData.angle).To3D();
             if (i != 0)
             {
                 SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);
             }
         }
     }
 }
Ejemplo n.º 24
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "TaricE")
            {
                var partner = GameObjects.Heroes.FirstOrDefault(x => x.ChampionName != "Taric" && x.HasBuff("taricwleashactive"));
                if (partner != null && partner.CheckTeam())
                {
                    var start     = partner.ServerPosition.To2D();
                    var direction = (args.End.To2D() - start).Normalized();
                    var end       = start + direction * spellData.Range;

                    SpellDetector.CreateSpellData(partner, start.To3D(), end.To3D(), spellData);
                }
            }
        }
Ejemplo n.º 25
0
        private void SpellDetector_OnProcessSpecialSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "TaricE")
            {
                var partner = HeroManager.Enemies.FirstOrDefault(x => x.HasBuff("taricwleashactive"));
                if (partner != null && partner.ChampionName != "Taric")
                {
                    var start     = partner.ServerPosition.To2D();
                    var direction = (args.End.To2D() - start).Normalized();
                    var end       = start + direction * spellData.range;

                    SpellDetector.CreateSpellData(partner, start.To3D(), end.To3D(), spellData);
                }
            }
        }
Ejemplo n.º 26
0
        private static void ProcessSpell_XerathArcanopulse2(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "XerathArcanopulseChargeUp")// || spellData.spellName == "xeratharcanopulse2")
            {
                var castTime = -1 * (hero.Spellbook.CastTime - Game.Time) * 1000;

                if (castTime > 0)
                {
                    var dir    = (args.End.To2D() - args.Start.To2D()).Normalized();
                    var endPos = args.Start.To2D() + dir * Math.Min(spellData.range, 750 + castTime / 2);
                    SpellDetector.CreateSpellData(hero, args.Start, endPos.To3D(), spellData);
                }

                specialSpellArgs.noProcess = true;
            }
        }
Ejemplo n.º 27
0
        private void ProcessSpell_TwitchSprayandPrayAttack(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "TwitchSprayandPrayAttack")
            {
                if (args.Target != null)
                {
                    var start = hero.ServerPosition;
                    var end   = hero.ServerPosition + (args.Target.Position - hero.ServerPosition) * spellData.range;

                    var data = spellData.CopyData();
                    data.spellDelay = hero.AttackCastDelay * 1000;

                    SpellDetector.CreateSpellData(hero, start, end, data);
                }
            }
        }
Ejemplo n.º 28
0
        private static void ProcessSpell_jayceshockblast(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args,
                                                         SpellData spellDataOld, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellDataOld.spellName == "jayceshockblast")
            {
                SpellData spellData;

                if (SpellDetector.onProcessSpells.TryGetValue("JayceShockBlastWall", out spellData))
                {
                    foreach (var tracker in ObjectTracker.objTracker)
                    {
                        var gateObj = tracker.Value;

                        if (gateObj.Name == "AccelGate")
                        {
                            if (gateObj.obj == null)
                            {
                                DelayAction.Add(0, () => ObjectTracker.objTracker.Remove(tracker.Key));
                            }
                            else
                            {
                                var startPos = args.Start.To2D();
                                var endPos   = args.End.To2D();
                                var dir      = (endPos - startPos).Normalized();
                                endPos = startPos + dir * spellDataOld.range;

                                var obj = gateObj.obj;

                                Vector2 int1, int2;
                                var     intersection =
                                    MathUtils.FindLineCircleIntersections(obj.Position.To2D(), 470, startPos, endPos,
                                                                          out int1, out int2);
                                var projection = obj.Position.To2D().ProjectOn(startPos, endPos);

                                if (intersection > 0 && projection.IsOnSegment)
                                {
                                    SpellDetector.CreateSpellData(hero, startPos.To3D(), endPos.To3D(), spellData);

                                    specialSpellArgs.noProcess = true;
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 29
0
        private static void ProcessSpell_EkkoR(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "EkkoR")
            {
                foreach (var obj in ObjectManager.Get <Obj_AI_Minion>())
                {
                    if (obj != null && obj.IsValid && !obj.IsDead && obj.Name == "Ekko" && obj.CheckTeam())
                    {
                        var blinkPos = obj.ServerPosition.To2D();

                        SpellDetector.CreateSpellData(hero, args.Start, blinkPos.To3D(), spellData);
                    }
                }

                specialSpellArgs.NoProcess = true;
            }
        }
Ejemplo n.º 30
0
        private static void ProcessSpell_AlZaharCalloftheVoid(Obj_AI_Base hero, Obj_AI_BaseMissileClientDataEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.SpellName == "MalzaharQ")
            {
                var direction   = (args.End.To2D() - args.Start.To2D()).Normalized();
                var pDirection  = direction.Perpendicular();
                var targetPoint = args.End.To2D();

                var pos1 = targetPoint - pDirection * spellData.SideRadius;
                var pos2 = targetPoint + pDirection * spellData.SideRadius;

                SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0, false);
                SpellDetector.CreateSpellData(hero, pos2.To3D(), pos1.To3D(), spellData);

                specialSpellArgs.NoProcess = true;
            }
        }