예제 #1
0
        private static void OnPing(GamePingEventArgs args)
        {
            foreach (var hero in HeroManager.Allies.Where(x => !x.IsMe))
            {
                if (args.Source.NetworkId != Player.NetworkId) // most likely redundant, keeping it anyways
                {
                    if (args.Source.NetworkId == hero.NetworkId)
                    {
                        if (GetBool("disableall" + hero.ChampionName, typeof (bool)))
                        {
                            args.Process = false;
                        }
                    }
                }
            }

            foreach (var hero in HeroManager.Allies.Where(x => !x.IsMe))
            {
                if (args.Source.NetworkId != Player.NetworkId) // most likely redundant, keeping it anyways
                {
                  
                    foreach (var types in PingCategorys)
                    {
                        if (GetBool("useon" + types + hero.ChampionName, typeof (bool)) &&
                            args.Source.NetworkId == hero.NetworkId && args.PingType == types)
                        {                          
                            args.Process = false;
                        }
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Raises the <see cref="E:Ping" /> event.
        /// </summary>
        /// <param name="args">The <see cref="GamePingEventArgs"/> instance containing the event data.</param>
        private void OnPing(GamePingEventArgs args)
        {
            if (!args.Source.IsMe && ShouldRun() && (args.Source is Obj_AI_Hero))
            {
                var pingType = args.PingType;
                var srcHero = args.Source as Obj_AI_Hero;
                if (pingType == PingCategory.Normal)
                {

                    var textObject = new Render.Text(
                        srcHero.ChampionName,
                        new Vector2(
                            Drawing.WorldToScreen(args.Position.To3D()).X,
                            Drawing.WorldToScreen(args.Position.To3D()).Y + 15), 17, SharpDX.Color.White)
                    {
                        PositionUpdate = () => new Vector2(
                            Drawing.WorldToScreen(args.Position.To3D()).X,
                            Drawing.WorldToScreen(args.Position.To3D()).Y + 30),
                        Centered = true
                    };
                    textObject.Add(0);
                    LeagueSharp.Common.Utility.DelayAction.Add(1000, () =>
                    {
                        textObject.Remove();
                    });
                }
            }
        }
예제 #3
0
        private static void OnPing(GamePingEventArgs args)
        {
            foreach (var hero in HeroManager.Allies.Where(x => !x.IsMe))
            {
                if (args.Source.NetworkId != Player.NetworkId) // most likely redundant, keeping it anyways
                {
                    if (args.Source.NetworkId == hero.NetworkId)
                    {
                        if (GetBool("disableall" + hero.ChampionName, typeof(bool)))
                        {
                            args.Process = false;
                        }
                    }
                }
            }

            foreach (var hero in HeroManager.Allies.Where(x => !x.IsMe))
            {
                if (args.Source.NetworkId != Player.NetworkId) // most likely redundant, keeping it anyways
                {
                    foreach (var types in PingCategorys)
                    {
                        if (GetBool("useon" + types + hero.ChampionName, typeof(bool)) &&
                            args.Source.NetworkId == hero.NetworkId && args.PingType == types)
                        {
                            args.Process = false;
                        }
                    }
                }
            }
        }
예제 #4
0
        void Game_OnPing(GamePingEventArgs args)
        {
            if (!IsActive())
            {
                return;
            }

            Obj_AI_Hero hero = args.Source as Obj_AI_Hero;

            if (hero != null && hero.IsValid)
            {
                PingInfo pingInfoN = new PingInfo(hero.NetworkId, args.Position, Game.Time + 2, args.PingType);
                pingInfo.Add(pingInfoN);
                switch (args.PingType)
                {
                case PingCategory.AssistMe:
                    CreateSprites(pingInfoN);
                    break;

                case PingCategory.Danger:
                    CreateSprites(pingInfoN);
                    break;
                }
            }
        }
예제 #5
0
 /// <summary>
 /// Raises the <see cref="E:Ping" /> event.
 /// </summary>
 /// <param name="args">The <see cref="GamePingEventArgs"/> instance containing the event data.</param>
 private void OnPing(GamePingEventArgs args)
 {
     if (!args.Source.IsMe && ShouldRun() && (args.Source is Obj_AI_Hero))
     {
         var pingType = args.PingType;
         var srcHero  = args.Source as Obj_AI_Hero;
         if (pingType == PingCategory.Normal)
         {
             var textObject = new Render.Text(
                 srcHero.ChampionName,
                 new Vector2(
                     Drawing.WorldToScreen(args.Position.To3D()).X,
                     Drawing.WorldToScreen(args.Position.To3D()).Y + 15), 17, SharpDX.Color.White)
             {
                 PositionUpdate = () => new Vector2(
                     Drawing.WorldToScreen(args.Position.To3D()).X,
                     Drawing.WorldToScreen(args.Position.To3D()).Y + 30),
                 Centered = true
             };
             textObject.Add(0);
             LeagueSharp.Common.Utility.DelayAction.Add(1000, () =>
             {
                 textObject.Remove();
             });
         }
     }
 }
예제 #6
0
 static void Game_OnPing(GamePingEventArgs args)
 {
     if (args.Source is Obj_AI_Hero)
     {
         Obj_AI_Hero sender = args.Source as Obj_AI_Hero;
         if (Menu.SubMenu("Ping").SubMenu("Ping.Ally").Item(sender.CharData.BaseSkinName).GetValue<bool>())
             args.Process = false;
     }
 }
예제 #7
0
        private void Game_OnPing(GamePingEventArgs args)
        {
            try
            {
                    GameObject srcObject = args.Source;
                    Obj_AI_Hero src = srcObject as Obj_AI_Hero;
                    if (src == null)
                    {
                        return;
                    }
                    MenuItem blockItem = _menu.Item(src.Name);
                    if (blockItem != null && blockItem.GetValue<bool>())
                    {
                        args.Process = false;
                        return;
                    }
                    GameObject target = args.Target;
                    if (args.PingType == PingCategory.OnMyWay || !src.IsValid) return;
                    Color c = Color.White;
                    switch (args.PingType)
                    {
                        case PingCategory.Fallback:
                        case PingCategory.EnemyMissing:
                            c = Color.LightYellow;
                            break;
                        case PingCategory.AssistMe:
                            c = Color.LightBlue;
                            break;
                        case PingCategory.Danger:
                            c = new Color(255, 204, 203);
                            break;
                    }

                    int selectedIndex = _menu.Item("print").GetValue<StringList>().SelectedIndex;
                    String name;
                    switch (selectedIndex)
                    {
                        case 0:
                            name = src.ChampionName;
                            break;
                        case 1:
                            name = src.Name;
                            break;
                        default:
                            name = src.Name + " (" + src.ChampionName + ")";
                            break;
                    }
                    _pings.Add(new Ping(name, Game.ClockTime + 2f, args.Position.X, args.Position.Y, target, c));
                }
          
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #8
0
        private static void Game_OnPing(GamePingEventArgs args)
        {
            var unit = args.Source as Obj_AI_Hero;

            if (!Enabled || unit == null || !unit.IsValid || unit.IsMe ||
                !ChampMenus[unit.NetworkId].Item("Ping").IsActive())
            {
                return;
            }

            args.Process = false;
        }
예제 #9
0
        private static void Game_OnPing(GamePingEventArgs args)
        {
            var unit = args.Source as Obj_AI_Hero;

            if (!Enabled || unit == null || !unit.IsValid || unit.IsMe ||
                !ChampMenus[unit.NetworkId].Item("Ping").IsActive())
            {
                return;
            }

            args.Process = false;
        }
예제 #10
0
        void Game_OnPing(GamePingEventArgs args)
        {
            if (!IsActive())
            {
                return;
            }

            Obj_AI_Hero hero = args.Source as Obj_AI_Hero;

            if (hero != null && hero.IsValid)
            {
                //if (hero.IsMe)
                //    return;

                foreach (var info in pingInfo)
                {
                    if (info.NetworkId == hero.NetworkId && info.Time - 2 < Game.Time && info.Type == args.PingType)
                    {
                        return;
                    }
                }
                PingInfo pingInfoN = new PingInfo(hero.NetworkId, args.Position, Game.Time + 4, args.PingType);
                pingInfo.Add(pingInfoN);
                switch (args.PingType)
                {
                case PingCategory.AssistMe:
                    CreateSprites(pingInfoN);
                    break;

                case PingCategory.Danger:
                    CreateSprites(pingInfoN);
                    break;

                case PingCategory.OnMyWay:
                    CreateSprites(pingInfoN);
                    break;

                case PingCategory.EnemyMissing:
                    CreateSprites(pingInfoN);
                    break;

                case PingCategory.Fallback:
                    CreateSprites(pingInfoN);
                    break;
                }
            }
        }
예제 #11
0
 private void OnGamePing(GamePingEventArgs args)
 {
     try
     {
         var hero = args.Source as Obj_AI_Hero;
         if (hero != null && hero.IsValid && args.PingType != PingCategory.OnMyWay)
         {
             _pingItems.Add(
                 new PingItem(
                     hero.ChampionName, Game.Time + (args.PingType == PingCategory.Danger ? 1f : 1.8f),
                     args.Position, args.Target));
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
예제 #12
0
        public static void OnPing(GamePingEventArgs args)
        {
            if (!MenuConfig.WJungler || !Spells.W.IsReady())
            {
                return;
            }

            var allyJungler = args.Source as Obj_AI_Hero;

            if (allyJungler == null 
                || allyJungler.Distance(Player.ServerPosition) <= Spells.W.Range + 550
                || !allyJungler.Spellbook.GetSpell(SpellSlot.Summoner1).Name.ToLower().Contains("smite")
                || !allyJungler.Spellbook.GetSpell(SpellSlot.Summoner2).Name.ToLower().Contains("smite")
                || args.PingType != PingCategory.Fallback 
                || args.PingType != PingCategory.Danger)
            {
                return;
            }

            Utility.DelayAction.Add(330, () => Spells.W.Cast(args.Position.To3D()));   
        }
예제 #13
0
        void Game_OnPing(GamePingEventArgs args)
        {
            //if jungler pings OnMyWay
            //give him lantern for easy gank
            if (!Config.Item("autoW5", true).GetValue <bool>())
            {
                return;
            }
            var jungler = args.Source as Obj_AI_Hero;

            if (jungler != null && jungler.Distance(Player.Position) <= W.Range + 500)
            {
                if (jungler.Spellbook.GetSpell(SpellSlot.Summoner1).Name.ToLower().Contains("smite") ||
                    jungler.Spellbook.GetSpell(SpellSlot.Summoner2).Name.ToLower().Contains("smite"))
                {
                    if (args.PingType == PingCategory.OnMyWay)
                    {
                        int random = new Random().Next(350, 750); // so it wont happen too fast
                        Utility.DelayAction.Add(random, () => CastW(args.Position.To3D()));
                    }
                }
            }
        }
예제 #14
0
파일: RageBlock.cs 프로젝트: awmv/rageblock
        /// <summary>
        /// Subscribe to the GameOnPing event.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        private static void GameOnPing(GamePingEventArgs args)
        {
            var hero = (Obj_AI_Hero)args.Source;

            if (!m.Item("Status").GetValue <bool>() ||
                !m.Item("Ping").GetValue <bool>() ||
                hero == null ||
                !hero.IsValid ||
                hero.IsMe ||
                !HeroCount.ContainsKey(hero.NetworkId))
            {
                return;
            }

            HeroCount[hero.NetworkId].Value++;

            if (HeroCount[hero.NetworkId].Value < 3)
            {
                return;
            }

            args.Process = false;
        }
예제 #15
0
 private static void Game_OnPing(GamePingEventArgs args)
 {
     args.Process = PingBlocker.Item(args.Source.Name).GetValue <bool>();
 }
예제 #16
0
        public static void OnPing(GamePingEventArgs args)
        {
            if (args.Source.Name != Core.Carry.Name)
                return;

            Console.WriteLine(args.PingType);
            if (args.PingType == PingCategory.Normal)
            {
                PingManager.WardLocation = null;
                PingManager.SweepLocation = null;

                if (args.Target != null)
                    Console.WriteLine(args.Target.Name);
                Obj_AI_Base newTarget = args.Target as Obj_AI_Base;
                if (newTarget != null)
                {
                    Target = newTarget;
                    Mode = BehaviourMode.AGGRO;
                }
                else
                {
                    Location = args.Position.To3D();
                    Mode = BehaviourMode.PASSIVE;
                }
            }
            else if (args.PingType == PingCategory.Fallback)
            {
                Mode = BehaviourMode.PASSIVE;
                Location = null;
                Target = null;
                PingManager.WardLocation = null;
                PingManager.SweepLocation = null;
                RecallManager.UserRecallRequest = false;
            }
            else if (args.PingType == PingCategory.Danger)
            {
                WardLocation = args.Position.To3D();
                Console.WriteLine("WardLocation " + WardLocation);
            }
            else if (args.PingType == PingCategory.EnemyMissing)
            {
                SweepLocation = args.Position.To3D();
                Console.WriteLine("SweepLocation " + SweepLocation);
            }
            else if (args.PingType == PingCategory.AssistMe)
            {
                var deltaX = args.Position.X - Core.Carry.Position.X;
                var deltaY = args.Position.Y - Core.Carry.Position.Y;
                var angle = Math.Atan2(deltaY, deltaX);

                Positioning? newPositioning = null;

                if (checkAngle(Math.PI/2.0, angle))
                    newPositioning = Positioning.N;
                if (checkAngle(Math.PI/4.0, angle))
                    newPositioning = Positioning.NE;
                if (checkAngle(0, angle))
                    newPositioning = Positioning.E;
                if (checkAngle(7.0*Math.PI/4.0 - 2.0 * Math.PI, angle))
                    newPositioning = Positioning.SE;
                if (checkAngle(3.0*Math.PI/ 2.0 - 2.0 * Math.PI, angle))
                    newPositioning = Positioning.S;
                if (checkAngle(5.0*Math.PI/ 4.0 - 2.0 * Math.PI, angle))
                    newPositioning = Positioning.SW;
                if (checkAngle(Math.PI - 2.0 * Math.PI, angle))
                    newPositioning = Positioning.W;
                if (checkAngle(Math.PI, angle))
                    newPositioning = Positioning.W;
                if (checkAngle(3.0*Math.PI/4.0, angle))
                    newPositioning = Positioning.NW;

                if (newPositioning != null)
                {
                    HeatMap.Pos = newPositioning.Value;
                    Console.WriteLine("POSITIONING " + newPositioning  + " angle " + angle);
                }
                else
                {
                    Console.WriteLine("POSITIONING NULL angle " + angle);
                }

                Mode = BehaviourMode.PASSIVE;
                Location = null;
                PingManager.WardLocation = null;
                PingManager.SweepLocation = null;

                int distance = (int)Core.Carry.Position.Distance(args.Position.To3D());
                Core.MaxDistanceFromCarry = distance;
                Console.WriteLine(distance);
            }
        }
예제 #17
0
        void Game_OnPing(GamePingEventArgs args)
        {
            if (!IsActive())
                return;

            Obj_AI_Hero hero = args.Source as Obj_AI_Hero;
            if (hero != null && hero.IsValid)
            {
                foreach (var ally in ObjectManager.Get<Obj_AI_Hero>())
                {
                    if (ally.Name.Equals(hero.Name))
                        args.Process = false;
                }
                pingInfo.Add(new PingInfo(hero.ChampionName, args.Position, Game.Time + 2));
            }
        }
예제 #18
0
        private void Game_OnPing(GamePingEventArgs args)
        {
            try
            {
                GameObject  srcObject = args.Source;
                Obj_AI_Hero src       = srcObject as Obj_AI_Hero;
                if (src == null)
                {
                    return;
                }
                MenuItem blockItem = _menu.Item(src.Name);
                if (blockItem != null && blockItem.GetValue <bool>())
                {
                    args.Process = false;
                    return;
                }
                GameObject target = args.Target;
                if (args.PingType == PingCategory.OnMyWay || !src.IsValid)
                {
                    return;
                }
                Color c = Color.White;
                switch (args.PingType)
                {
                case PingCategory.Fallback:
                case PingCategory.EnemyMissing:
                    c = Color.LightYellow;
                    break;

                case PingCategory.AssistMe:
                    c = Color.LightBlue;
                    break;

                case PingCategory.Danger:
                    c = new Color(255, 204, 203);
                    break;
                }

                int    selectedIndex = _menu.Item("print").GetValue <StringList>().SelectedIndex;
                String name;
                switch (selectedIndex)
                {
                case 0:
                    name = src.ChampionName;
                    break;

                case 1:
                    name = src.Name;
                    break;

                default:
                    name = src.Name + " (" + src.ChampionName + ")";
                    break;
                }
                _pings.Add(new Ping(name, Game.ClockTime + 2f, args.Position.X, args.Position.Y, target, c));
            }

            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #19
0
        void Game_OnPing(GamePingEventArgs args)
        {
            if (!IsActive())
                return;

            Obj_AI_Hero hero = args.Source as Obj_AI_Hero;
            if (hero != null && hero.IsValid)
            {
                PingInfo pingInfoN = new PingInfo(hero.NetworkId, args.Position, Game.Time + 2, args.PingType);
                pingInfo.Add(pingInfoN);
                switch (args.PingType)
                {
                    case PingCategory.AssistMe:
                        CreateSprites(pingInfoN);
                        break;

                    case PingCategory.Danger:
                        CreateSprites(pingInfoN);
                        break;
                }
            }
        }
예제 #20
0
        void Game_OnPing(GamePingEventArgs args)
        {
            //if jungler pings OnMyWay
            //give him lantern for easy gank
            if(!Config.Item("autoW5",true).GetValue<bool>())return;
            var jungler = args.Source as Obj_AI_Hero;
            if (jungler != null && jungler.Distance(Player.Position)<=W.Range+500)
            {
                if (jungler.Spellbook.GetSpell(SpellSlot.Summoner1).Name.ToLower().Contains("smite") ||
                    jungler.Spellbook.GetSpell(SpellSlot.Summoner2).Name.ToLower().Contains("smite"))
                {
                    if (args.PingType == PingCategory.OnMyWay)
                    {
                        int random = new Random().Next(350, 750); // so it wont happen too fast
                        Utility.DelayAction.Add(random,() => CastW(args.Position.To3D()));
                    }

                }
            }
        }