Skip to content

Commit

Permalink
Add 4.4.0 SMSG_FACTION_BONUS_INFO, SMSG_INITIALIZE_FACTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
funjoker committed Jun 1, 2024
1 parent c5bbdb4 commit b4b6151
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
17 changes: 17 additions & 0 deletions WowPacketParser/Enums/FactionFlag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,21 @@ public enum FactionFlag
Inactive = 0x20,
Rival = 0x40
}

[Flags]
public enum ReputationFlags
{
None = 0x0000,
Visible = 0x0001, // makes visible in client (set or can be set at interaction with target of this faction)
AtWar = 0x0002, // enable AtWar-button in client. player controlled (except opposition team always war state), Flag only set on initial creation
Hidden = 0x0004, // hidden faction from reputation pane in client (player can gain reputation, but this update not sent to client)
Header = 0x0008, // Display as header in UI
Peaceful = 0x0010,
Inactive = 0x0020, // player controlled (CMSG_SET_FACTION_INACTIVE)
ShowPropagated = 0x0040,
HeaderShowsBar = 0x0080, // Header has its own reputation bar
CapitalCityForRaceChange = 0x0100,
Guild = 0x0200,
GarrisonInvasion = 0x0400
};
}
31 changes: 31 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/ReputationHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using WowPacketParser.Enums;
using WowPacketParser.Misc;
using WowPacketParser.Parsing;

namespace WowPacketParserModule.V4_4_0_54481.Parsers
{
public static class ReputationHandler
{
public const int FactionCount = 1000;

[Parser(Opcode.SMSG_FACTION_BONUS_INFO)]
public static void HandleFactionBonusInfo(Packet packet)
{
for (var i = 0; i < FactionCount; i++)
packet.ReadBit("FactionHasBonus", i);
}

[Parser(Opcode.SMSG_INITIALIZE_FACTIONS)]
public static void HandleInitializeFactions(Packet packet)
{
for (var i = 0; i < FactionCount; i++)
{
packet.ReadUInt16E<ReputationFlags>("ReputationFlags", i);
packet.ReadUInt32E<ReputationRank>("FactionStandings", i);
}

for (var i = 0; i < FactionCount; i++)
packet.ReadBit("FactionHasBonus", i);
}
}
}

0 comments on commit b4b6151

Please sign in to comment.