示例#1
0
        /// <summary>
        ///     Detects the spells that have missile and are casted from fow.
        /// </summary>
        public static void GameOnOnGameProcessPacket(GamePacketEventArgs args)
        {
            //Gets received when a projectile is created.
            if (args.PacketData[0] == 0x3B)
            {
                var packet = new GamePacket(args.PacketData);

                packet.Position = 1;

                packet.ReadFloat(); //Missile network ID

                var missilePosition = new Vector3(packet.ReadFloat(), packet.ReadFloat(), packet.ReadFloat());
                var unitPosition = new Vector3(packet.ReadFloat(), packet.ReadFloat(), packet.ReadFloat());

                packet.Position = packet.Size() - 119;
                var missileSpeed = packet.ReadFloat();

                packet.Position = 65;
                var endPos = new Vector3(packet.ReadFloat(), packet.ReadFloat(), packet.ReadFloat());

                packet.Position = 112;
                var id = packet.ReadByte();

                packet.Position = packet.Size() - 83;

                var unit = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(packet.ReadInteger());
                if ((!unit.IsValid || unit.Team == ObjectManager.Player.Team))
                {
                    return;
                }

                var spellData = SpellDatabase.GetBySpeed(unit.ChampionName, (int)missileSpeed, id);

                if (spellData == null)
                {
                    return;
                }
                if (spellData.SpellName != "Laser")
                {
                    return;
                }
                var castTime = Environment.TickCount - Game.Ping / 2 - spellData.Delay
                               - (int)
                                 (1000 * missilePosition.SwitchYZ().To2D().Distance(unitPosition.SwitchYZ())
                                  / spellData.MissileSpeed);

                //Trigger the skillshot detection callbacks.
                TriggerOnDetectSkillshot(
                    DetectionType.RecvPacket,
                    spellData,
                    castTime,
                    unitPosition.SwitchYZ().To2D(),
                    endPos.SwitchYZ().To2D(),
                    unit);
            }
        }
示例#2
0
 private static void LogGamePacket(GamePacket result, String file = null, String prefix = null)
 {
     byte[] b = new byte[result.Size()];
     long size = result.Size();
     int cur = 0;
     while (cur < size - 1)
     {
         b[cur] = result.ReadByte(cur);
         cur++;
     }
     LogPacket(b, file, prefix);
 }
示例#3
0
 static void Game_OnGameProcessPacket(GamePacketEventArgs args)
 {
     if (args.PacketData[0] == 0xFE && Config.Item("AntiCamLock").GetValue<bool>())
     {
         var p = new GamePacket(args.PacketData);
         if (p.ReadInteger(1) == ObjectManager.Player.NetworkId && p.Size() > 9)
         {
             args.Process = false;
         }
     }
 }
示例#4
0
 private static void AddTo(this DataGridView view, GamePacket p)
 {
     view.Rows.Add(
         new object[] { p.Header.ToHexString(), p.Size().ToString(), p.Channel.ToString(), p.Flags.ToString(), (Environment.TickCount - TickCount)/1000 });
 }
示例#5
0
        public static void OnGameProcessPacket(GamePacketEventArgs args)
        {
            return;
            try
            {

                if (isComboing())
                {
                    if (args.PacketData[0] == 35 && Riven.Q.IsReady())
                    {
                        Console.WriteLine("Gott");
                        GamePacket gp = new GamePacket(args.PacketData);
                        gp.Position = 2;
                        int netId = gp.ReadInteger();
                        if (LXOrbwalker.GetPossibleTarget() == null || LXOrbwalker.GetPossibleTarget().NetworkId != netId)
                            return;
                        if (!LXOrbwalker.CanAttack())
                            Riven.Q.Cast(LXOrbwalker.GetPossibleTarget().Position);
                    }

                    if (args.PacketData[0] == 0x17)
                    {
                        Console.WriteLine("cancel");

                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 2;
                        int sourceId = packet.ReadInteger();
                        if (sourceId == Riven.Player.NetworkId)
                        {
                            Console.WriteLine("cancel wawf");
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Send();
                            if (LXOrbwalker.GetPossibleTarget() != null)
                            {
                                Riven.moveTo(LXOrbwalker.GetPossibleTarget().Position);
                                //Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(LXOrbwalker.GetPossibleTarget().Position.X, LXOrbwalker.GetPossibleTarget().Position.Y)).Send();

                                // LXOrbwalker.ResetAutoAttackTimer();
                                Riven.cancelAnim(true);
                            }
                        }
                    }

                    if (args.PacketData[0] == 0xDF && false)
                    {

                        Console.WriteLine("cancel");

                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 2;
                        int sourceId = packet.ReadInteger();
                        if (sourceId == Riven.Player.NetworkId)
                        {
                            Console.WriteLine("cancel wawf");
                            Riven.moveTo(Game.CursorPos);
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Send();
                            LXOrbwalker.ResetAutoAttackTimer();
                            Riven.cancelAnim();
                        }
                    }

                    if (args.PacketData[0] == 0x61) //move
                    {
                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 12;
                        int sourceId = packet.ReadInteger();
                        if (sourceId == Riven.Player.NetworkId)
                        {
                            if (LXOrbwalker.GetPossibleTarget() != null)
                            {
                            //    Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(LXOrbwalker.GetPossibleTarget().Position.X, LXOrbwalker.GetPossibleTarget().Position.Y)).Send();
                                LXOrbwalker.ResetAutoAttackTimer();
                            }
                        }
                    }
                    else if (args.PacketData[0] == 0x38) //animation2
                    {
                        GamePacket packet = new GamePacket(args.PacketData);
                        packet.Position = 1;
                        int sourceId = packet.ReadInteger();
                        if (packet.Size() == 9 && sourceId == Riven.Player.NetworkId)
                        {
                            Riven.moveTo(Game.CursorPos);
                            Packet.C2S.Move.Encoded(new Packet.C2S.Move.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Send();
                            LXOrbwalker.ResetAutoAttackTimer();
                            Riven.cancelAnim();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }