Skip to content

Commit

Permalink
Correct 4.4.1 UFs
Browse files Browse the repository at this point in the history
  • Loading branch information
funjoker committed Oct 28, 2024
1 parent cb701f5 commit bd7c8f9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 65 deletions.
111 changes: 50 additions & 61 deletions WowPacketParserModule.V4_4_0_54481/Parsers/UpdateFieldsHandler441.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,8 @@ public override IUnitData ReadCreateUnitData(Packet packet, UpdateFieldFlag flag
data.Health = packet.ReadInt64("Health", indexes);
data.MaxHealth = packet.ReadInt64("MaxHealth", indexes);
data.DisplayID = packet.ReadInt32("DisplayID", indexes);
for (var i = 0; i < 2; ++i)
{
data.NpcFlags[i] = packet.ReadUInt32("NpcFlags", indexes, i);
}
data.NpcFlags = packet.ReadUInt32("NpcFlags", indexes);
data.NpcFlags2 = packet.ReadUInt32("NpcFlags2", indexes);
data.StateSpellVisualID = packet.ReadUInt32("StateSpellVisualID", indexes);
data.StateAnimID = packet.ReadUInt32("StateAnimID", indexes);
data.StateAnimKitID = packet.ReadUInt32("StateAnimKitID", indexes);
Expand Down Expand Up @@ -740,7 +738,7 @@ public override IUnitData ReadCreateUnitData(Packet packet, UpdateFieldFlag flag
data.ComboTarget = packet.ReadPackedGuid128("ComboTarget", indexes);
}
data.Field_2F0 = packet.ReadSingle("Field_2F0", indexes);
data.Field_2F4 = packet.ReadUInt32("Field_2F4", indexes);
data.Field_2F4 = packet.ReadSingle("Field_2F4", indexes);
for (var i = 0; i < data.PassiveSpells.Count; ++i)
{
data.PassiveSpells[i] = ReadCreatePassiveSpellHistory(packet, indexes, "PassiveSpells", i);
Expand Down Expand Up @@ -841,12 +839,13 @@ public override IUnitData ReadUpdateUnitData(Packet packet, params object[] inde
{
data.DisplayID = packet.ReadInt32("DisplayID", indexes);
}
for (var i = 0; i < 2; ++i)
if (changesMask[8])
{
if (changesMask[8 + i])
{
data.NpcFlags[i] = packet.ReadUInt32("NpcFlags", indexes, i);
}
data.NpcFlags = packet.ReadUInt32("NpcFlags", indexes);
}
if (changesMask[9])
{
data.NpcFlags2 = packet.ReadUInt32("NpcFlags2", indexes);
}
if (changesMask[10])
{
Expand Down Expand Up @@ -1247,7 +1246,7 @@ public override IUnitData ReadUpdateUnitData(Packet packet, params object[] inde
}
if (changesMask[110])
{
data.GlideEventSpeedDivisor = packet.ReadUInt32("GlideEventSpeedDivisor", indexes);
data.GlideEventSpeedDivisor = packet.ReadSingle("GlideEventSpeedDivisor", indexes);
}
if (changesMask[111])
{
Expand All @@ -1263,11 +1262,11 @@ public override IUnitData ReadUpdateUnitData(Packet packet, params object[] inde
}
if (changesMask[114])
{
data.Field_2F0 = packet.ReadUInt32("Field_2F0", indexes);
data.Field_2F0 = packet.ReadSingle("Field_2F0", indexes);
}
if (changesMask[115])
{
data.Field_2F4 = packet.ReadUInt32("Field_2F4", indexes);
data.Field_2F4 = packet.ReadSingle("Field_2F4", indexes);
}
}
if (changesMask[116])
Expand Down Expand Up @@ -1498,6 +1497,38 @@ public static IArenaCooldown ReadUpdateArenaCooldown(Packet packet, params objec
return data;
}

public static IZonePlayerForcedReaction ReadCreateZonePlayerForcedReaction(Packet packet, params object[] indexes)
{
var data = new ZonePlayerForcedReaction();
packet.ResetBitReader();
data.FactionID = packet.ReadInt32("FactionID", indexes);
data.Reaction = packet.ReadInt32("Reaction", indexes);
return data;
}

public static IZonePlayerForcedReaction ReadUpdateZonePlayerForcedReaction(Packet packet, params object[] indexes)
{
var data = new ZonePlayerForcedReaction();
packet.ResetBitReader();
var rawChangesMask = new int[1];
rawChangesMask[0] = (int)packet.ReadBits(3);
var changesMask = new BitArray(rawChangesMask);

packet.ResetBitReader();
if (changesMask[0])
{
if (changesMask[1])
{
data.FactionID = packet.ReadInt32("FactionID", indexes);
}
if (changesMask[2])
{
data.Reaction = packet.ReadInt32("Reaction", indexes);
}
}
return data;
}

public static IDeclinedNames ReadCreateDeclinedNames(Packet packet, params object[] indexes)
{
var data = new DeclinedNames();
Expand Down Expand Up @@ -1551,38 +1582,6 @@ public static IDeclinedNames ReadUpdateDeclinedNames(Packet packet, params objec
return data;
}

public static IZonePlayerForcedReaction ReadCreateZonePlayerForcedReaction(Packet packet, params object[] indexes)
{
var data = new ZonePlayerForcedReaction();
packet.ResetBitReader();
data.FactionID = packet.ReadInt32("FactionID", indexes);
data.Reaction = packet.ReadInt32("Reaction", indexes);
return data;
}

public static IZonePlayerForcedReaction ReadUpdateZonePlayerForcedReaction(Packet packet, params object[] indexes)
{
var data = new ZonePlayerForcedReaction();
packet.ResetBitReader();
var rawChangesMask = new int[1];
rawChangesMask[0] = (int)packet.ReadBits(3);
var changesMask = new BitArray(rawChangesMask);

packet.ResetBitReader();
if (changesMask[0])
{
if (changesMask[1])
{
data.FactionID = packet.ReadInt32("FactionID", indexes);
}
if (changesMask[2])
{
data.Reaction = packet.ReadInt32("Reaction", indexes);
}
}
return data;
}

public static ICustomTabardInfo ReadCreateCustomTabardInfo(Packet packet, params object[] indexes)
{
var data = new CustomTabardInfo();
Expand Down Expand Up @@ -1916,11 +1915,8 @@ public override IPlayerData ReadUpdatePlayerData(Packet packet, params object[]
}
if (changesMask[32])
{
if (changesMask[35])
{
hasDeclinedNames = packet.ReadBit("HasDeclinedNames", indexes);
packet.ResetBitReader();
}
hasDeclinedNames = packet.ReadBit("HasDeclinedNames", indexes);
packet.ResetBitReader();
if (changesMask[36])
{
Substructures.MythicPlusHandler.ReadDungeonScoreSummary(packet, indexes, "DungeonScore");
Expand Down Expand Up @@ -3127,7 +3123,7 @@ public override IActivePlayerData ReadCreateActivePlayerData(Packet packet, Upda
data.SortBagsRightToLeft = packet.ReadBit("SortBagsRightToLeft", indexes);
data.InsertItemsLeftToRight = packet.ReadBit("InsertItemsLeftToRight", indexes);
hasPetStable = packet.ReadBit("HasPetStable", indexes);
packet.ResetBitReader();
data.AccountBankTabSettings.Resize(packet.ReadBits(3));
data.ResearchHistory = ReadCreateResearchHistory(packet, indexes, "ResearchHistory");
Substructures.PerksProgramHandler.ReadPerksVendorItem(packet, indexes, "FrozenPerksVendorItem");
for (var i = 0; i < data.CharacterDataElements.Count; ++i)
Expand Down Expand Up @@ -3196,10 +3192,6 @@ public override IActivePlayerData ReadUpdateActivePlayerData(Packet packet, para
data.AccountDataElements.ReadUpdateMask(packet);
}
}
//if (changesMask[20])
//{
// data.BitVectors = ReadUpdateBitVectors(packet, indexes, "BitVectors");
//}
if (changesMask[23])
{
for (var i = 0; i < 1; ++i)
Expand Down Expand Up @@ -3956,14 +3948,11 @@ public override IActivePlayerData ReadUpdateActivePlayerData(Packet packet, para
{
Substructures.PerksProgramHandler.ReadPerksVendorItem(packet, indexes, "FrozenPerksVendorItem");
}
if (changesMask[128])
if (changesMask[129])
{
if (changesMask[129])
if (hasPetStable)
{
if (hasPetStable)
{
data.PetStable = ReadUpdateStableInfo(packet, indexes, "PetStable");
}
data.PetStable = ReadUpdateStableInfo(packet, indexes, "PetStable");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace WowPacketParserModule.V4_4_0_54481.UpdateFields.V4_4_1_57141
{
//[GeneratedCode("UpdateFieldCodeGenerator.Formats.WowPacketParserHandler", "1.0.0.0")]
[GeneratedCode("UpdateFieldCodeGenerator.Formats.WowPacketParserHandler", "1.0.0.0")]
public class ConversationLine : IConversationLine
{
public int ConversationLineID { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace WowPacketParserModule.V4_4_0_54481.UpdateFields.V4_4_1_57141
[GeneratedCode("UpdateFieldCodeGenerator.Formats.WowPacketParserHandler", "1.0.0.0")]
public class ItemMod : IItemMod
{
public int Value { get; set; }
public byte Type { get; set; }
public int Value { get; set; }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public class UnitData : IMutableUnitData
public System.Nullable<long> Health { get; set; }
public System.Nullable<long> MaxHealth { get; set; }
public System.Nullable<int> DisplayID { get; set; }
public System.Nullable<uint>[] NpcFlags { get; } = new System.Nullable<uint>[2];
public System.Nullable<uint> NpcFlags { get; set; }
public System.Nullable<uint> NpcFlags2 { get; set; }
public System.Nullable<uint> StateSpellVisualID { get; set; }
public System.Nullable<uint> StateAnimID { get; set; }
public System.Nullable<uint> StateAnimKitID { get; set; }
Expand Down Expand Up @@ -133,11 +134,13 @@ public class UnitData : IMutableUnitData
public System.Nullable<uint> CurrentAreaID { get; set; }
public WowGuid ComboTarget { get; set; }
public System.Nullable<float> Field_2F0 { get; set; }
public System.Nullable<uint> Field_2F4 { get; set; }
public System.Nullable<float> Field_2F4 { get; set; }
public DynamicUpdateField<IPassiveSpellHistory> PassiveSpells { get; } = new DynamicUpdateField<IPassiveSpellHistory>();
public DynamicUpdateField<System.Nullable<int>> WorldEffects { get; } = new DynamicUpdateField<System.Nullable<int>>();
public DynamicUpdateField<WowGuid> ChannelObjects { get; } = new DynamicUpdateField<WowGuid>();

uint?[] IUnitData.NpcFlags => new[] { NpcFlags, NpcFlags2 };

// dummies required by interface
public int? CreatureFamily { get; set; }
public int? CreatureType { get; set; }
Expand Down

0 comments on commit bd7c8f9

Please sign in to comment.