public static void HandleAddCalendarEvent(Packet packet)
        {
            packet.ReadCString("Title");
            packet.ReadCString("Description");
            packet.ReadEnum<CalendarEventType>("Event Type", TypeCode.Byte);
            packet.ReadEnum<CalendarRepeatType>("Repeat Type", TypeCode.Byte);
            packet.ReadInt32("Max Invites");
            packet.ReadEntryWithName<Int32>(StoreNameType.LFGDungeon, "Dungeon ID");
            packet.ReadPackedTime("Event Time");
            packet.ReadPackedTime("Unk PackedTime");

            var flags = packet.ReadEnum<CalendarFlag>("Event Flags", TypeCode.Int32);

            if ((flags & CalendarFlag.GuildAnnouncement) != 0)
                return;

            var count = packet.ReadInt32("Invite Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadPackedGuid("Creator GUID");
                packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
                packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
            }
        }
 public static void HandleAchievementEarned(Packet packet)
 {
     packet.ReadPackedGuid("Player GUID");
     packet.ReadInt32("Achievement");
     packet.ReadPackedTime("Time");
     packet.ReadInt32("Unk Int32");
 }
Example #3
0
 public static void HandleEnchantmentLog(Packet packet)
 {
     packet.ReadPackedGuid("Target");
     packet.ReadPackedGuid("Caster");
     packet.ReadEntryWithName<Int32>(StoreNameType.Item, "Item Entry");
     packet.ReadUInt32("Enchantment ID?");
 }
 public static void HandleChangeSeatsOnControlledVehicle(Packet packet)
 {
     packet.ReadPackedGuid("Vehicle GUID");
     // FIXME: 3.3.3a has some data here
     packet.ReadPackedGuid("Accesory GUID");
     packet.ReadByte("Seat");
 }
        public static void HandleAttackerStateUpdate(Packet packet)
        {
            var hitInfo = packet.ReadInt32E<SpellHitInfo>("HitInfo");
            packet.ReadPackedGuid("AttackerGUID");
            packet.ReadPackedGuid("TargetGUID");
            packet.ReadInt32("Damage");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_3_9183))
                packet.ReadInt32("OverDamage");

            var subDmgCount = packet.ReadByte();
            for (var i = 0; i < subDmgCount; ++i)
            {
                packet.ReadInt32("SchoolMask", i);
                packet.ReadSingle("Float Damage", i);
                packet.ReadInt32("Int Damage", i);

                if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                    hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_ABSORB | SpellHitInfo.HITINFO_FULL_ABSORB))
                    packet.ReadInt32("Damage Absorbed", i);

                if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                    hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_RESIST | SpellHitInfo.HITINFO_FULL_RESIST))
                    packet.ReadInt32("Damage Resisted", i);
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_3_9183))
                packet.ReadByteE<VictimStates>("VictimState");
            else
                packet.ReadInt32E<VictimStates>("VictimState");

            packet.ReadInt32("Unk Attacker State 0");

            packet.ReadInt32<SpellId>("Melee Spell ID ");

            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_BLOCK))
                packet.ReadInt32("Block Amount");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_RAGE_GAIN))
                packet.ReadInt32("Rage Gained");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_UNK0))
            {
                packet.ReadInt32("Unk Attacker State 3 1");
                packet.ReadSingle("Unk Attacker State 3 2");
                packet.ReadSingle("Unk Attacker State 3 3");
                packet.ReadSingle("Unk Attacker State 3 4");
                packet.ReadSingle("Unk Attacker State 3 5");
                packet.ReadSingle("Unk Attacker State 3 6");
                packet.ReadSingle("Unk Attacker State 3 7");
                packet.ReadSingle("Unk Attacker State 3 8");
                packet.ReadSingle("Unk Attacker State 3 9");
                packet.ReadSingle("Unk Attacker State 3 10");
                packet.ReadSingle("Unk Attacker State 3 11");
                packet.ReadInt32("Unk Attacker State 3 12");
                packet.ReadInt32("Unk Attacker State 3 13");
                packet.ReadInt32("Unk Attacker State 3 14");
            }
        }
Example #6
0
        public static void HandleAuraCastLog(Packet packet)
        {
            packet.ReadPackedGuid("Target GUID");
            packet.ReadPackedGuid("Caster GUID");
            packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Spell ID");
            packet.ReadUInt32("Count");

            var aura = packet.ReadEnum<AuraType>("Aura Type", TypeCode.UInt32);
            switch (aura)
            {
                case AuraType.PeriodicDamage:
                case AuraType.PeriodicDamagePercent:
                {
                    packet.ReadUInt32("Damage");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
                        packet.ReadUInt32("Over damage");

                    packet.ReadUInt32("Spell Proto");
                    packet.ReadUInt32("Absorb");
                    packet.ReadUInt32("Resist");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901))
                        packet.ReadByte("Critical");

                    break;
                }
                case AuraType.PeriodicHeal:
                case AuraType.ObsModHealth:
                {
                    packet.ReadUInt32("Damage");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
                        packet.ReadUInt32("Over damage");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685)) // no idea when this was added exactly
                        packet.ReadUInt32("Absorb");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901))
                        packet.ReadByte("Critical");

                    break;
                }
                case AuraType.ObsModPower:
                case AuraType.PeriodicEnergize:
                {
                    packet.ReadEnum<PowerType>("Power type", TypeCode.Int32);
                    packet.ReadUInt32("Amount");
                    break;
                }
                case AuraType.PeriodicManaLeech:
                {
                    packet.ReadEnum<PowerType>("Power type", TypeCode.Int32);
                    packet.ReadUInt32("Amount");
                    packet.ReadSingle("Gain multiplier");
                    break;
                }
            }
        }
Example #7
0
        public static void HandleUpdateObject(Packet packet)
        {
            uint map = MovementHandler.CurrentMapId;
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164))
                map = packet.ReadUInt16("Map");

            var count = packet.ReadUInt32("Count");

            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_2_9056))
                packet.ReadBoolean("Has Transport");

            for (var i = 0; i < count; i++)
            {
                var type = packet.ReadByte();
                var typeString = ClientVersion.AddedInVersion(ClientType.Cataclysm) ? ((UpdateTypeCataclysm)type).ToString() : ((UpdateType)type).ToString();

                packet.WriteLine("[" + i + "] UpdateType: " + typeString);
                switch (typeString)
                {
                    case "Values":
                    {
                        var guid = packet.ReadPackedGuid("GUID", i);

                        WoWObject obj;
                        var updates = ReadValuesUpdateBlock(ref packet, guid.GetObjectType(), i, false);

                        if (Storage.Objects.TryGetValue(guid, out obj))
                        {
                            if (obj.ChangedUpdateFieldsList == null)
                                obj.ChangedUpdateFieldsList = new List<Dictionary<int, UpdateField>>();
                            obj.ChangedUpdateFieldsList.Add(updates);
                        }

                        break;
                    }
                    case "Movement":
                    {
                        var guid = ClientVersion.AddedInVersion(ClientVersionBuild.V3_1_2_9901) ? packet.ReadPackedGuid("GUID", i) : packet.ReadGuid("GUID", i);
                        ReadMovementUpdateBlock(ref packet, guid, i);
                        // Should we update Storage.Object?
                        break;
                    }
                    case "CreateObject1":
                    case "CreateObject2": // Might != CreateObject1 on Cata
                    {
                        var guid = packet.ReadPackedGuid("GUID", i);
                        ReadCreateObjectBlock(ref packet, guid, map, i);
                        break;
                    }
                    case "FarObjects":
                    case "NearObjects":
                    case "DestroyObjects":
                    {
                        ReadObjectsBlock(ref packet, i);
                        break;
                    }
                }
            }
        }
 public static void HandleDestructibleBuildingDamage(Packet packet)
 {
     packet.ReadPackedGuid("GO GUID");
     packet.ReadPackedGuid("Vehicle GUID");
     packet.ReadPackedGuid("Player GUID");
     packet.ReadInt32("Damage");
     packet.ReadInt32<SpellId>("Spell ID");
 }
 public static void HandleDestructibleBuildingDamage(Packet packet)
 {
     packet.ReadPackedGuid("GO GUID");
     packet.ReadPackedGuid("Vehicle GUID:");
     packet.ReadPackedGuid("Player GUID");
     packet.ReadInt32("Damage");
     packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Spell ID");
 }
Example #10
0
        public static void HandleAttackerStateUpdate(Packet packet)
        {
            var hitInfo = packet.ReadEnum<SpellHitInfo>("HitInfo", TypeCode.Int32);
            packet.ReadPackedGuid("AttackerGUID");
            packet.ReadPackedGuid("TargetGUID");
            packet.ReadInt32("Damage");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_3_9183))
                packet.ReadInt32("OverDamage");

            var subDmgCount = packet.ReadByte();
            for (var i = 0; i < subDmgCount; ++i)
            {
                packet.ReadInt32("SchoolMask", i);
                packet.ReadSingle("Float Damage", i);
                packet.ReadInt32("Int Damage", i);

                if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                    hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_ABSORB | SpellHitInfo.HITINFO_FULL_ABSORB))
                    packet.ReadInt32("Damage Absorbed", i);

                if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                    hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_RESIST | SpellHitInfo.HITINFO_FULL_RESIST))
                    packet.ReadInt32("Damage Resisted", i);
            }

            var victimStateTypeCode = ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_3_9183) ? TypeCode.Byte : TypeCode.Int32;
            packet.ReadEnum<VictimStates>("VictimState", victimStateTypeCode);
            packet.ReadInt32("Unk Attacker State 0");

            packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Melee Spell ID ");

            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V3_0_3_9183) ||
                hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_BLOCK))
                packet.ReadInt32("Block Amount");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_RAGE_GAIN))
                packet.ReadInt32("Rage Gained");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_UNK0))
            {
                packet.ReadInt32("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadSingle("Unk Attacker State 3");
                packet.ReadInt32("Unk Attacker State 3");
                packet.ReadInt32("Unk Attacker State 3");
                packet.ReadInt32("Unk Attacker State 3");
            }
        }
Example #11
0
        public static void HandleAttackerStateUpdate406(Packet packet)
        {
            var hitInfo = packet.ReadEnum<SpellHitInfo>("HitInfo", TypeCode.Int32);
            packet.ReadPackedGuid("AttackerGUID");
            packet.ReadPackedGuid("TargetGUID");
            packet.ReadInt32("Damage");
            packet.ReadInt32("OverDamage");

            var subDmgCount = packet.ReadByte("Count");
            for (var i = 0; i < subDmgCount; ++i)
            {
                packet.ReadInt32("SchoolMask", i);
                packet.ReadSingle("Float Damage", i);
                packet.ReadInt32("Int Damage", i);
            }

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_ABSORB | SpellHitInfo.HITINFO_FULL_ABSORB))
                for (var i = 0; i < subDmgCount; ++i)
                    packet.ReadInt32("Damage Absorbed", i);

                if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_PARTIAL_RESIST | SpellHitInfo.HITINFO_FULL_RESIST))
                    for (var i = 0; i < subDmgCount; ++i)
                        packet.ReadInt32("Damage Resisted", i);

            packet.ReadEnum<VictimStates>("VictimState", TypeCode.Byte);
            packet.ReadInt32("Unk Attacker State 0");

            packet.ReadEntryWithName<Int32>(StoreNameType.Spell, "Melee Spell ID ");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_BLOCK))
                packet.ReadInt32("Block Amount");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_RAGE_GAIN))
                packet.ReadInt32("Rage Gained");

            if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_UNK0))
            {
                packet.ReadInt32("Unk Attacker State 3 1");
                packet.ReadSingle("Unk Attacker State 3 2");
                packet.ReadSingle("Unk Attacker State 3 3");
                packet.ReadSingle("Unk Attacker State 3 4");
                packet.ReadSingle("Unk Attacker State 3 5");
                packet.ReadSingle("Unk Attacker State 3 6");
                packet.ReadSingle("Unk Attacker State 3 7");
                packet.ReadSingle("Unk Attacker State 3 8");
                packet.ReadSingle("Unk Attacker State 3 9");
                packet.ReadSingle("Unk Attacker State 3 10");
                packet.ReadSingle("Unk Attacker State 3 11");
                packet.ReadInt32("Unk Attacker State 3 12");
                packet.ReadInt32("Unk Attacker State 3 13");
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
                if (hitInfo.HasAnyFlag(SpellHitInfo.HITINFO_BLOCK | SpellHitInfo.HITINFO_UNK12))
                    packet.ReadSingle("Unk Float");
        }
        public static void HandleChangeSeatsOnControlledVehicle(Packet packet)
        {
            var guid = packet.ReadPackedGuid("Vehicle GUID");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
                MovementHandler.ReadMovementInfo(ref packet, guid);

            packet.ReadPackedGuid("Accessory GUID");
            packet.ReadByte("Seat");
        }
        public static void ReadSetInfo(Packet packet)
        {
            packet.ReadPackedGuid("Set ID");
            packet.ReadInt32("Index");
            packet.ReadCString("Set Name");
            packet.ReadCString("Set Icon");

            for (var j = 0; j < NumSlots; j++)
                packet.ReadPackedGuid("Item GUID " + j);
        }
        public static void HandleInspectResultsUpdate(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_3_4_15595)) // confirmed for 4.3.4
                packet.ReadPackedGuid("GUID");
            else if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                packet.ReadGuid("GUID");
            else
                packet.ReadPackedGuid("GUID");

            ReadInspectPart(ref packet);
        }
        public static void HandleCriteriaUpdate(Packet packet)
        {
            packet.ReadInt32("Criteria ID");
            packet.ReadPackedGuid("Criteria Counter");
            packet.ReadPackedGuid("Player GUID");
            packet.ReadInt32("Unk Int32");
            packet.ReadPackedTime("Time");

            for (var i = 0; i < 2; i++)
                packet.ReadInt32("Timer " + i);
        }
Example #16
0
        public static void HandleInspectTalent(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                packet.ReadGuid("GUID");
            else
                packet.ReadPackedGuid("GUID");

            if (packet.Opcode == Opcodes.GetOpcode(Opcode.SMSG_INSPECT_TALENT))
                ReadTalentInfo(ref packet);

            var slotMask = packet.ReadUInt32("Slot Mask");
            var slot = 0;
            while (slotMask > 0)
            {
                if ((slotMask & 0x1) > 0)
                {
                    var name = "[" + (EquipmentSlotType)slot + "] ";
                    packet.ReadEntryWithName<UInt32>(StoreNameType.Item, name + "Item Entry");
                    var enchantMask = packet.ReadUInt16();
                    if (enchantMask > 0)
                    {
                        var enchantName = name + "Item Enchantments: ";
                        while (enchantMask > 0)
                        {
                            if ((enchantMask & 0x1) > 0)
                            {
                                enchantName += packet.ReadUInt16();
                                if (enchantMask > 1)
                                        enchantName += ", ";
                            }
                            enchantMask >>= 1;
                        }
                        packet.WriteLine(enchantName);
                    }
                    packet.ReadUInt16(name + "Unk Uint16");
                    packet.ReadPackedGuid(name + "Creator GUID");
                    packet.ReadUInt32(name + "Unk Uint32");
                }
                ++slot;
                slotMask >>= 1;
            }

            if (packet.Opcode == Opcodes.GetOpcode(Opcode.SMSG_INSPECT_TALENT)
                && packet.CanRead()) // otherwise it would fail for players without a guild
            {
                packet.ReadGuid("Guild GUID");
                packet.ReadUInt32("Guild Level");
                packet.ReadUInt64("Guild Xp");
                packet.ReadUInt32("Guild Members");
            }
        }
 public static void HandleCalendarEventInviteAlert(Packet packet)
 {
     packet.ReadInt64("Event ID");
     packet.ReadCString("Title");
     packet.ReadPackedTime("Time");
     packet.ReadEnum<CalendarFlag>("Event Flags", TypeCode.Int32);
     packet.ReadEnum<CalendarEventType>("Type", TypeCode.Int32);
     packet.ReadEntryWithName<Int32>(StoreNameType.LFGDungeon, "Dungeon ID");
     packet.ReadInt64("Invite ID");
     packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
     packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
     packet.ReadPackedGuid("Creator GUID");
     packet.ReadPackedGuid("Sender GUID");
 }
Example #18
0
        public static void HandleAuraUpdate(Packet packet)
        {
            var guid = packet.ReadPackedGuid("GUID");

            var auras = new List<Aura>();
            while (packet.CanRead())
            {
                var aura = ReadAuraUpdateBlock(ref packet);
                auras.Add(aura);
            }

            // This only works if the parser saw UPDATE_OBJECT before this packet
            if (Storage.Objects.ContainsKey(guid))
            {
                var unit = Storage.Objects[guid] as Unit;
                if (unit != null)
                {
                    // If this is the first packet that sends auras
                    // (hopefully at spawn time) add it to the "Auras" field,
                    // if not create another row of auras in AddedAuras
                    // (similar to ChangedUpdateFields)

                    if (unit.Auras == null)
                        unit.Auras = auras;
                    else if (unit.AddedAuras == null)
                        unit.AddedAuras = new List<List<Aura>> { auras };
                    else
                        unit.AddedAuras.Add(auras);
                }
            }
        }
Example #19
0
 public static void HandleCoded(Packet packet)
 {
     packet.AsHex();
     var select = packet.ReadInt32("select");
     switch(select)
     {
         case 2:
         case 3:
         case 4:
             packet.ReadPackedGuid("Guid");
             packet.ReadByte("unk");
             break;
         case 1:
         case 9:
         case 10:
             break;
         case 7:
             packet.ReadByte("unk1");
             packet.ReadByte("unk2");
             break;
         case 0:
         case 5:
         case 6:
         case 8:
             packet.ReadByte("unk");
             break;
     }
 }
Example #20
0
        public static void HandleAuraUpdate(Packet packet)
        {
            var guid = packet.ReadPackedGuid("GUID");
            var i = 0;
            var auras = new List<Aura>();
            while (packet.CanRead())
            {
                Aura aura;
                if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_0_5_16048))
                    aura = ReadAuraUpdateBlock505(packet, i++);
                else
                    aura = ReadAuraUpdateBlock(packet, i++);

                if (aura != null)
                    auras.Add(aura);
            }

            // This only works if the parser saw UPDATE_OBJECT before this packet
            if (Storage.Objects.ContainsKey(guid))
            {
                var unit = Storage.Objects[guid].Item1 as Unit;
                if (unit != null)
                {
                    // If this is the first packet that sends auras
                    // (hopefully at spawn time) add it to the "Auras" field,
                    // if not create another row of auras in AddedAuras
                    // (similar to ChangedUpdateFields)

                    if (unit.Auras == null)
                        unit.Auras = auras;
                    else
                        unit.AddedAuras.Add(auras);
                }
            }
        }
Example #21
0
        public static void HandleUpdateObject(Packet packet)
        {
            uint map = packet.ReadUInt16("Map");
            var count = packet.ReadUInt32("Count");

            for (var i = 0; i < count; i++)
            {
                var type = packet.ReadByte();
                var typeString = ((UpdateTypeCataclysm)type).ToString();

                packet.AddValue("UpdateType", typeString, i);
                switch (typeString)
                {
                    case "Values":
                        {
                            var guid = packet.ReadPackedGuid("GUID", i);

                            WoWObject obj;
                            var updates = CoreParsers.UpdateHandler.ReadValuesUpdateBlock(packet, guid.GetObjectType(), i, false);

                            if (Storage.Objects.TryGetValue(guid, out obj))
                            {
                                if (obj.ChangedUpdateFieldsList == null)
                                    obj.ChangedUpdateFieldsList = new List<Dictionary<int, UpdateField>>();
                                obj.ChangedUpdateFieldsList.Add(updates);
                            }

                            break;
                        }
                    case "CreateObject1":
                    case "CreateObject2": // Might != CreateObject1 on Cata
                        {
                            var guid = packet.ReadPackedGuid("GUID", i);
                            ReadCreateObjectBlock(packet, guid, map, i);
                            break;
                        }
                    case "DestroyObjects":
                        {
                            CoreParsers.UpdateHandler.ReadObjectsBlock(packet, i);
                            break;
                        }
                }
            }
        }
Example #22
0
        public static void HandleAuraUpdate(Packet packet)
        {
            packet.ReadPackedGuid("GUID");

            /*var aura = new Aura(); */
            while (packet.CanRead())
                /*aura =*/
                ReadAuraUpdateBlock(ref packet);
            // TODO: Add this aura to a list of objects (searching by guid)
        }
        public static void HandleInspectTalent(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545))
                packet.ReadGuid("GUID");
            else
                packet.ReadPackedGuid("GUID");

            if (packet.Opcode == Opcodes.GetOpcode(Opcode.SMSG_INSPECT_TALENT))
                ReadTalentInfo(ref packet);

            var slotMask = packet.ReadUInt32("Slot Mask");
            var slot = 0;
            while (slotMask > 0)
            {
                if ((slotMask & 0x1) > 0)
                {
                    var name = "[" + (EquipmentSlotType)slot + "] ";
                    packet.ReadEntryWithName<UInt32>(StoreNameType.Item, name + "Item Entry");
                    var enchantMask = packet.ReadUInt16();
                    if (enchantMask > 0)
                    {
                        var enchantName = name + "Item Enchantments: ";
                        while (enchantMask > 0)
                        {
                            if ((enchantMask & 0x1) > 0)
                            {
                                enchantName += packet.ReadUInt16();
                                if (enchantMask > 1)
                                        enchantName += ", ";
                            }
                            enchantMask >>= 1;
                        }
                        packet.WriteLine(enchantName);
                    }
                    packet.ReadUInt16(name + "Unk Uint16");
                    packet.ReadPackedGuid(name + "Creator GUID");
                    packet.ReadUInt32(name + "Unk Uint32");
                }
                ++slot;
                slotMask >>= 1;
            }
        }
        public static void HandleEquipmentSetUse(Packet packet)
        {
            for (var i = 0; i < NumSlots; i++)
            {
                packet.ReadPackedGuid("Item GUID ", i);

                packet.ReadByte("Source Bag", i);

                packet.ReadByte("Source Slot", i);
            }
        }
Example #25
0
        public static void HandleCollisionMovements(Packet packet)
        {
            var guid = packet.ReadPackedGuid("Guid");

            if (packet.Opcode != Opcodes.GetOpcode(Opcode.MSG_MOVE_SET_COLLISION_HGT))
                packet.ReadInt32("Movement Counter");

            if (packet.Opcode != Opcodes.GetOpcode(Opcode.SMSG_MOVE_SET_COLLISION_HGT))
                ReadMovementInfo(ref packet, guid);

            packet.ReadSingle("Collision Height");
        }
        public static void HandleCollisionMovements(Packet packet)
        {
            var guid = packet.ReadPackedGuid("Guid");

            if (packet.Opcode != Opcodes.GetOpcode(Opcode.MSG_MOVE_SET_COLLISION_HEIGHT, Direction.Bidirectional))
                packet.ReadInt32("Movement Counter");

            if (packet.Opcode != Opcodes.GetOpcode(Opcode.SMSG_MOVE_SET_COLLISION_HEIGHT, Direction.ServerToClient))
                ReadMovementInfo(packet, guid);

            packet.ReadSingle("Collision Height");
        }
Example #27
0
        public static void HandleInspectTalent(Packet packet)
        {
            packet.ReadPackedGuid("GUID");
            ReadTalentInfo(ref packet);

            var slotMask = packet.ReadUInt32("Slot Mask");
            var slot = 0;
            while (slotMask > 0)
            {
                if ((slotMask & 0x1) > 0)
                {
                    var name = "[" + (EquipmentSlotType)slot + "] ";
                    packet.ReadEntryWithName<UInt32>(StoreNameType.Item, name + "Item Entry");
                    var enchantMask = packet.ReadUInt16();
                    if (enchantMask > 0)
                    {
                        var enchantName = name + "Item Enchantments: ";
                        while (enchantMask > 0)
                        {
                            if ((enchantMask & 0x1) > 0)
                            {
                                enchantName += packet.ReadUInt16();
                                if (enchantMask > 1)
                                        enchantName += ", ";
                            }
                            enchantMask >>= 1;
                        }
                        packet.Writer.WriteLine(enchantName);
                    }
                    packet.ReadUInt16(name + "Unk Uint16");
                    packet.ReadPackedGuid(name + "Creator GUID");
                    packet.ReadUInt32(name + "Unk Uint32");
                }
                ++slot;
                slotMask >>= 1;
            }
        }
        public static void HandleCollisionMovements(Packet packet)
        {
            var guid = packet.ReadPackedGuid();
            packet.Writer.WriteLine("GUID: " + guid);

            if (packet.Opcode != Opcodes.GetOpcode(Opcode.MSG_MOVE_SET_COLLISION_HGT))
            {
                var counter = packet.ReadInt32();
                packet.Writer.WriteLine("Movement Counter: " + counter);
            }

            if (packet.Opcode != Opcodes.GetOpcode(Opcode.SMSG_MOVE_SET_COLLISION_HGT))
                ReadMovementInfo(ref packet, guid);

            var unk = packet.ReadSingle();
            packet.Writer.WriteLine("Collision Height: " + unk);
        }
        public static void HandleInspectTalent(Packet packet)
        {
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6a_13623))
                packet.ReadGuid("GUID");
            else
                packet.ReadPackedGuid("GUID");

            ReadTalentInfo(ref packet);
            ReadInspectPart(ref packet);

            if (packet.CanRead()) // otherwise it would fail for players without a guild
            {
                packet.ReadGuid("Guild GUID");
                packet.ReadUInt32("Guild Level");
                packet.ReadUInt64("Guild Xp");
                packet.ReadUInt32("Guild Members");
            }
        }
Example #30
0
        public static void HandleAuraUpdate(Packet packet)
        {
            Guid guid = packet.ReadPackedGuid("GUID");

            /*Aura aura = null; */
            while (packet.CanRead())
            {
                /*aura =*/
                Aura aura = ReadAuraUpdateBlock(ref packet);

                if (aura != null && guid.HasEntry() && guid.GetObjectType() == ObjectType.Unit)
                {
                    if (packet.SniffFileInfo.Stuffing.auraPackets.ContainsKey(guid))
                        packet.SniffFileInfo.Stuffing.auraPackets[guid].auraPackets.Enqueue(new AuraPacket(packet.Time, packet.Number, aura));
                    else
                        packet.SniffFileInfo.Stuffing.auraPackets.TryAdd(guid, new AuraPackets(new AuraPacket(packet.Time, packet.Number, aura)));
                }
                // TODO: Add this aura to a list of objects (searching by guid)
            }
        }