示例#1
0
        private static void ObjSpellMissileOnOnCreate(GameObject sender, EventArgs args)
        {
            if (!(sender is Obj_SpellMissile))
            {
                return;
            }

            var missile = (Obj_SpellMissile)sender;

            if (!missile.SpellCaster.IsAlly)
            {
                if (missile.SData.Name == "itemplacementmissile" && !missile.SpellCaster.IsVisible)
                {
                    var sPos = missile.StartPosition;
                    var ePos = missile.EndPosition;
                    Utility.DelayAction.Add(
                        1000, delegate
                    {
                        if (
                            !DetectedWards.Any(
                                w =>
                                w.Position.To2D().Distance(sPos.To2D(), ePos.To2D(), false, false) < 300 &&
                                Math.Abs(w.StartT - Environment.TickCount) < 2000))
                        {
                            var detectedWard = new DetectedWard(
                                PosibleWards[3],
                                new Vector3(ePos.X, ePos.Y, NavMesh.GetHeightForPosition(ePos.X, ePos.Y)),
                                Environment.TickCount, null, true);
                            detectedWard.StartPosition = new Vector3(
                                sPos.X, sPos.Y, NavMesh.GetHeightForPosition(sPos.X, sPos.Y));
                            DetectedWards.Add(detectedWard);
                        }
                    });
                }
            }
        }
示例#2
0
        private static void ObjSpellMissileOnOnCreate(GameObject sender, EventArgs args)
        {
            var missile = sender as MissileClient;

            if (missile == null || !missile.IsValid || !missile.SpellCaster.IsValid <AIHeroClient>() ||
                missile.SpellCaster.IsAlly && !TrackAllies || missile.SpellCaster.IsVisible ||
                missile.SData.Name != "itemplacementmissile")
            {
                return;
            }

            var sPos = missile.StartPosition;
            var ePos = missile.EndPosition;

            LeagueSharp.Common.Utility.DelayAction.Add(
                1000, delegate
            {
                if (
                    DetectedWards.Any(
                        w =>
                        w.Position.To2D().Distance(sPos.To2D(), ePos.To2D(), false, false) < 300 &&
                        Math.Abs(w.StartT - Utils.TickCount) < 2000))
                {
                    return;
                }

                var detectedWard = new DetectedWard(
                    PossibleWards[3], new Vector3(ePos.X, ePos.Y, NavMesh.GetHeightForPosition(ePos.X, ePos.Y)),
                    Utils.TickCount, null, true)
                {
                    StartPosition = new Vector3(sPos.X, sPos.Y, NavMesh.GetHeightForPosition(sPos.X, sPos.Y))
                };

                DetectedWards.Add(detectedWard);
            });
        }
示例#3
0
        private static void ObjSpellMissileOnOnCreate(GameObject sender, EventArgs args)
        {
            if (!(sender is Obj_SpellMissile))
            {
                return;
            }

            var missile = (Obj_SpellMissile) sender;

            if (!missile.SpellCaster.IsAlly)
            {
                if (missile.SData.Name == "itemplacementmissile" && !missile.SpellCaster.IsVisible)
                {
                    var sPos = missile.StartPosition;
                    var ePos = missile.EndPosition;
                    Utility.DelayAction.Add(
                        1000, delegate
                        {
                            if (
                                !DetectedWards.Any(
                                    w =>
                                        w.Position.To2D().Distance(sPos.To2D(), ePos.To2D(), false, false) < 300 &&
                                        Math.Abs(w.StartT - Environment.TickCount) < 2000))
                            {
                                var detectedWard = new DetectedWard(
                                    PosibleWards[3],
                                    new Vector3(ePos.X, ePos.Y, NavMesh.GetHeightForPosition(ePos.X, ePos.Y)),
                                    Environment.TickCount, null, true);
                                detectedWard.StartPosition = new Vector3(
                                    sPos.X, sPos.Y, NavMesh.GetHeightForPosition(sPos.X, sPos.Y));
                                DetectedWards.Add(detectedWard);
                            }
                        });
                }
            }
        }
示例#4
0
        private static void ObjSpellMissileOnOnCreate(GameObject sender, EventArgs args)
        {
            var missile = sender as MissileClient;

            if (missile == null || !missile.IsValid || !missile.SpellCaster.IsValid<AIHeroClient>() ||
                missile.SpellCaster.IsAlly && !TrackAllies || missile.SpellCaster.IsVisible ||
                missile.SData.Name != "itemplacementmissile")
            {
                return;
            }

            var sPos = missile.StartPosition;
            var ePos = missile.EndPosition;
            LeagueSharp.Common.Utility.DelayAction.Add(
                1000, delegate
                {
                    if (
                        DetectedWards.Any(
                            w =>
                                w.Position.LSTo2D().LSDistance(sPos.LSTo2D(), ePos.LSTo2D(), false, false) < 300 &&
                                Math.Abs(w.StartT - Utils.TickCount) < 2000))
                    {
                        return;
                    }

                    var detectedWard = new DetectedWard(
                        PossibleWards[3], new Vector3(ePos.X, ePos.Y, NavMesh.GetHeightForPosition(ePos.X, ePos.Y)),
                        Utils.TickCount, null, true)
                    {
                        StartPosition = new Vector3(sPos.X, sPos.Y, NavMesh.GetHeightForPosition(sPos.X, sPos.Y))
                    };

                    DetectedWards.Add(detectedWard);
                });
        }