public static void ReadSpellCastRequest(Packet packet, params object[] idx)
        {
            packet.ReadByte("CastID", idx);
            packet.ReadInt32 <SpellId>("SpellID", idx);
            packet.ReadInt32("Misc", idx);

            ReadSpellTargetData(packet, idx, "Target");

            ReadMissileTrajectoryRequest(packet, idx, "MissileTrajectory");

            packet.ReadPackedGuid128("Guid", idx);

            packet.ResetBitReader();

            packet.ReadBits("SendCastFlags", 5, idx);
            var hasMoveUpdate = packet.ReadBit("HasMoveUpdate", idx);

            var weightCount = packet.ReadBits("WeightCount", 2, idx);

            if (hasMoveUpdate)
            {
                MovementHandler.ReadMovementStats(packet, idx, "MoveUpdate");
            }

            for (var i = 0; i < weightCount; ++i)
            {
                ReadSpellWeight(packet, idx, "Weight", i);
            }
        }
示例#2
0
        public static uint ReadSpellCastRequest(Packet packet, params object[] idx)
        {
            packet.ReadByte("CastID", idx);

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V6_2_0_20173))
            {
                for (var i = 0; i < 2; i++)
                {
                    packet.ReadInt32("Misc", idx, i);
                }
            }

            uint spellId = packet.ReadUInt32 <SpellId>("SpellID", idx);

            packet.ReadInt32(ClientVersion.AddedInVersion(ClientVersionBuild.V6_2_0_20173) ? "SpellXSpellVisualID" : "Misc", idx);

            ReadSpellTargetData(packet, null, idx, "Target");

            ReadMissileTrajectoryRequest(packet, idx, "MissileTrajectory");

            packet.ReadPackedGuid128("Guid", idx);

            packet.ResetBitReader();

            packet.ReadBits("SendCastFlags", 5, idx);
            var hasMoveUpdate = packet.ReadBit("HasMoveUpdate", idx);

            var weightCount = packet.ReadBits("WeightCount", 2, idx);

            if (hasMoveUpdate)
            {
                MovementHandler.ReadMovementStats(packet, idx, "MoveUpdate");
            }

            for (var i = 0; i < weightCount; ++i)
            {
                ReadSpellWeight(packet, idx, "Weight", i);
            }

            return(spellId);
        }
示例#3
0
        public static void HandleUpdateMissileTrajectory(Packet packet)
        {
            packet.ReadPackedGuid128("Guid");
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V9_1_5_40772))
            {
                packet.ReadPackedGuid128("CastID");
            }
            packet.ReadUInt16("MoveMsgID");
            packet.ReadInt32("SpellID");
            packet.ReadSingle("Pitch");
            packet.ReadSingle("Speed");
            packet.ReadVector3("FirePos");
            packet.ReadVector3("ImpactPos");

            packet.ResetBitReader();
            var hasStatus = packet.ReadBit("HasStatus");

            if (hasStatus)
            {
                MovementHandler.ReadMovementStats(packet, "Status");
            }
        }
示例#4
0
        public static void ReadSpellCastRequest(ref Packet packet)
        {
            packet.ReadByte("CastID");
            packet.ReadUInt32("SpellID");
            packet.ReadUInt32("Misc");

            // SpellTargetData
            packet.ResetBitReader();

            packet.ReadEnum <TargetFlag>("Flags", 21);
            var bit72   = packet.ReadBit("HasSrcLocation");
            var bit112  = packet.ReadBit("HasDstLocation");
            var bit124  = packet.ReadBit("HasOrientation");
            var bits128 = packet.ReadBits(7);

            packet.ReadPackedGuid128("Unit Guid");
            packet.ReadPackedGuid128("Item Guid");

            if (bit72)
            {
                packet.ReadPackedGuid128("SrcLocation Guid");
                packet.ReadVector3("SrcLocation");
            }

            if (bit112)
            {
                packet.ReadPackedGuid128("DstLocation Guid");
                packet.ReadVector3("DstLocation");
            }

            if (bit124)
            {
                packet.ReadSingle("Orientation");
            }

            packet.ReadWoWString("Name", bits128);

            // MissileTrajectoryRequest
            packet.ReadSingle("Pitch");
            packet.ReadSingle("Speed");

            packet.ReadPackedGuid128("Guid");

            packet.ResetBitReader();

            packet.ReadBits("SendCastFlags", 5);
            var bit456 = packet.ReadBit("HasMoveUpdate");         // MoveUpdate

            var bits116 = packet.ReadBits("SpellWeightCount", 2); // SpellWeight

            // MoveUpdate
            if (bit456)
            {
                MovementHandler.ReadMovementStats(ref packet);
            }

            // SpellWeight
            for (var i = 0; i < bits116; ++i)
            {
                packet.ResetBitReader();
                packet.ReadBits("Type", 2, i);
                packet.ReadInt32("ID", i);
                packet.ReadInt32("Quantity", i);
            }
        }