예제 #1
0
                public static Struct Decoded(byte[] data)
                {
                    var packet = new GamePacket(data);
                    var result = new Struct();

                    packet.Position      = 1;
                    result.UnitNetworkId = packet.ReadInteger();
                    packet.ReadShort();
                    result.MaxHealth     = packet.ReadFloat();
                    result.CurrentHealth = packet.ReadFloat();
                    return(result);
                }
예제 #2
0
        public static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            if (!Config.Item("comboWreset").GetValue<bool>() || args.PacketData[0] != 0x65 || !MasterYi.W.IsReady() ||
                LxOrbwalker.CurrentMode != LxOrbwalker.Mode.Combo)
            {
                return;
            }

            // LogPacket(args);
            var gp = new GamePacket(args.PacketData) {Position = 1};
            var dmg = Packet.S2C.Damage.Decoded(args.PacketData);

            var targetId = gp.ReadInteger();
            int dType = gp.ReadByte();
            int unknown = gp.ReadShort();
            var damageAmount = gp.ReadFloat();
            var targetNetworkIdCopy = gp.ReadInteger();
            var sourceNetworkId = gp.ReadInteger();
            var dmga =
                (float)
                    MasterYi.Player.GetAutoAttackDamage(
                        ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(targetId));
            if (dmga - 10 > damageAmount || dmga + 10 < damageAmount)
            {
                return;
            }

            if (MasterYi.Player.NetworkId != dmg.SourceNetworkId && MasterYi.Player.NetworkId == targetId)
            {
                return;
            }

            var targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(dmg.TargetNetworkId);
            if ((int) dmg.Type != 12 && (int) dmg.Type != 4 && (int) dmg.Type != 3)
            {
                return;
            }

            if (MasterYi.W.IsReady() && LxOrbwalker.InAutoAttackRange(targ))
            {
                MasterYi.W.Cast(targ.Position);
                // LXOrbwalker.ResetAutoAttackTimer();
            }
            // Console.WriteLine("dtyoe: " + dType);
        }
예제 #3
0
        public static void OnGameProcessPacket(GamePacketEventArgs args)
        {
            try
            {
                if (Talon.orbwalker.ActiveMode.ToString() == "Combo" || Config.Item("harHard").GetValue<KeyBind>().Active)
                {
                    if (args.PacketData[0] == 101 && Talon.Q.IsReady())
                    {
                        Packet.S2C.Damage.Struct dmg = Packet.S2C.Damage.Decoded(args.PacketData);
                        // LogPacket(args);
                        GamePacket gp = new GamePacket(args.PacketData);
                        gp.Position = 1;

                        int targetID = gp.ReadInteger();
                        int dType = (int)gp.ReadByte();
                        int Unknown = gp.ReadShort();
                        float DamageAmount = gp.ReadFloat();
                        int TargetNetworkIdCopy = gp.ReadInteger();
                        int SourceNetworkId = gp.ReadInteger();
                        if (Talon.Player.NetworkId != dmg.SourceNetworkId)
                            return;
                        Obj_AI_Hero targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(targetID);
                        if (targ != null)
                        {
                            Talon.sumItems.cast(SummonerItems.ItemIds.Ghostblade);
                            Talon.Q.Cast();
                            useQ = true;
                            Orbwalking.ResetAutoAttackTimer();

                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
예제 #4
0
                public static Struct Decoded(byte[] data)
                {
                    var packet = new GamePacket(data);
                    var result = new Struct();

                    packet.Position = 1;
                    result.UnitNetworkId = packet.ReadInteger();
                    packet.ReadShort();
                    result.MaxHealth = packet.ReadFloat();
                    result.CurrentHealth = packet.ReadFloat();
                    return result;
                }
예제 #5
0
        static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            if (args.PacketData[0] == Packet.S2C.EmptyJungleCamp.Header)
            {
                Packet.S2C.EmptyJungleCamp.Struct camp = Packet.S2C.EmptyJungleCamp.Decoded(args.PacketData);
                Console.WriteLine("disable camp: "+camp.CampId);
                jTimer.disableCamp((byte)camp.CampId);
            }

            if (args.PacketData[0] == 0xE9)
            {
                GamePacket gp = new GamePacket(args.PacketData);
                gp.Position = 21;
                byte campID = gp.ReadByte();
                Console.WriteLine("Enable camp: "+campID);
                jTimer.enableCamp(campID);

            }

            //AfterAttack
            if (args.PacketData[0] == 0x65 && Config.Item("doJungle").GetValue<KeyBind>().Active)
            {
                GamePacket gp = new GamePacket(args.PacketData);
                gp.Position = 1;
                Packet.S2C.Damage.Struct dmg = Packet.S2C.Damage.Decoded(args.PacketData);

                int targetID = gp.ReadInteger();
                int dType = (int)gp.ReadByte();
                int Unknown = gp.ReadShort();
                float DamageAmount = gp.ReadFloat();
                int TargetNetworkIdCopy = gp.ReadInteger();
                int SourceNetworkId = gp.ReadInteger();
                float dmga = (float)player.GetAutoAttackDamage(ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(targetID));
                if (dmga - 10 > DamageAmount || dmga + 10 < DamageAmount)
                    return;
                if (player.NetworkId != dmg.SourceNetworkId || player.NetworkId == targetID || player.NetworkId == TargetNetworkIdCopy)
                    return;
                Obj_AI_Base targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(dmg.TargetNetworkId);
                if ((int) dmg.Type == 12 || (int) dmg.Type == 4 || (int) dmg.Type == 3)
                {
                    Console.WriteLine("dmg: " + DamageAmount + " : " + dmga);

                    JungleClearer.jungler.doAfterAttack(targ);
                }

            }
        }
예제 #6
0
                /// <summary>
                /// Decodes the specified data.
                /// </summary>
                /// <param name="data">The data.</param>
                /// <returns>Struct.</returns>
                public static Struct Decoded(byte[] data)
                {
                    var packet = new GamePacket(data);
                    var result = new Struct();

                    result.NetworkId = packet.ReadInteger(1);
                    result.Item = new Items.Item(packet.ReadShort(), 0);
                    packet.Position += 2;
                    result.InventorySlot = packet.ReadByte();
                    result.SpellSlot = (SpellSlot) (result.InventorySlot + (byte) SpellSlot.Item1);
                    result.Stack = packet.ReadByte();
                    result.Charge = packet.ReadByte();
                    result.ReplaceItem = packet.ReadByte();

                    return result;
                }
예제 #7
0
                /// <summary>
                /// Decodes the specified data.
                /// </summary>
                /// <param name="data">The data.</param>
                /// <returns>Struct.</returns>
                public static Struct Decoded(byte[] data)
                {
                    var packet = new GamePacket(data);
                    var result = new Struct();

                    packet.Position = 2;
                    result.TargetNetworkId = packet.ReadInteger();
                    result.TargetNetworkIdCopy = packet.ReadInteger();
                    result.SourceNetworkId = packet.ReadInteger();
                    //wrong:
                    result.Type = (DamageTypePacket) packet.ReadByte();
                    result.Unknown = packet.ReadShort();
                    result.DamageAmount = packet.ReadFloat();
                    return result;
                }
예제 #8
0
                /// <summary>
                /// Decodes the specified data.
                /// </summary>
                /// <param name="data">The data.</param>
                /// <returns>Struct.</returns>
                public static Struct Decoded(byte[] data)
                {
                    var packet = new GamePacket(data);
                    var result = new Struct();

                    result.SourceNetworkId = packet.ReadInteger(1);
                    result.SourceUnit = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(result.SourceNetworkId);


                    result.SpellFlag = packet.ReadShort(10);
                    result.SpellHash = packet.ReadInteger();
                    result.SpellNetworkId = packet.ReadInteger();

                    packet.ReadByte(); //this always used to be 0, maybe flag now
                    packet.ReadFloat(); // always 1
                    packet.ReadFloat(); // always player nID
                    packet.ReadFloat(); // always player nID

                    result.MissileHash = packet.ReadInteger();
                    result.MissileNetworkId = packet.ReadInteger();

                    var p = packet.Position + 8;
                    result.ToPosition = new Vector2(packet.ReadFloat(), packet.ReadFloat(p));
                    packet.Position += 4;

                    var c = packet.ReadByte(65);
                    if (c > 0) //hopefully c is 1 always
                    {
                        result.TargetNetworkId = packet.ReadInteger();
                        result.TargetUnit = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(result.TargetNetworkId);
                        packet.ReadByte(); // for 0
                    }
                    result.ChannelTime = packet.ReadFloat();
                    result.Delay = packet.ReadFloat();
                    result.Visible = packet.ReadFloat();
                    result.IsVisible = result.Visible > 0;
                    result.Cooldown = packet.ReadFloat();

                    packet.ReadInteger();
                    packet.ReadByte();

                    result.SpellSlot = (SpellSlot) packet.ReadByte();
                    result.SpellFlag2 = packet.ReadByte();
                    result.ManaCost = packet.ReadFloat();

                    p = packet.Position + 8;
                    result.FromPosition = new Vector2(packet.ReadFloat(), packet.ReadFloat(p));

                    return result;
                }
예제 #9
0
        public static void OnGameProcessPacket(GamePacketEventArgs args)
        {
            return;

            if (Config.Item("comboWreset").GetValue<bool>() && args.PacketData[0] == 0x65 && MasterYi.W.IsReady() && LXOrbwalker.CurrentMode == LXOrbwalker.Mode.Combo)
            {

                // LogPacket(args);
                GamePacket gp = new GamePacket(args.PacketData);
                gp.Position = 1;
                Packet.S2C.Damage.Struct dmg = Packet.S2C.Damage.Decoded(args.PacketData);

                int targetID = gp.ReadInteger();
                int dType = (int) gp.ReadByte();
                int Unknown = gp.ReadShort();
                float DamageAmount = gp.ReadFloat();
                int TargetNetworkIdCopy = gp.ReadInteger();
                int SourceNetworkId = gp.ReadInteger();
                float dmga =
                    (float)
                        MasterYi.player.GetAutoAttackDamage(
                            ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(targetID));
                if (dmga - 10 > DamageAmount || dmga + 10 < DamageAmount)
                    return;
                if (MasterYi.player.NetworkId != dmg.SourceNetworkId && MasterYi.player.NetworkId == targetID)
                    return;
                Obj_AI_Base targ = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(dmg.TargetNetworkId);
                if ((int) dmg.Type == 12 || (int) dmg.Type == 4 || (int) dmg.Type == 3 )
                {
                    if (MasterYi.W.IsReady() && LXOrbwalker.InAutoAttackRange(targ))
                    {
                        MasterYi.W.Cast(targ.Position);
                       // LXOrbwalker.ResetAutoAttackTimer();
                    }
                }
                   // Console.WriteLine("dtyoe: " + dType);
            }
        }