Server Message: Guild

The Guild packet contains data for events like a player logging in or showing the Guild Rank Board.

Start of Guild packet
XX XX || Short, Header XX || Byte, Type

0x01, Guild Creation (begin)
This packet is sent when the party leader has: This packet only contains the type 0x01 and it's sent to the party leader.
 * 1) Enough players in the party (6)
 * 2) Enough mesos to create a guild
 * 3) No players in the party who is in a guild already
 * 4) Every player is on the same map on the same channel

0x03, Guild Contract
This packet is sent to every member of the party when the name was chosen.

Note: The party leader only gets the header and type, not the remaining data. -- If player is not party leader XX XX XX XX || Integer, Party ID XX XX ... || String, Party Leader (thus the creator of the guild) name XX XX ... || String, Name of the Guild being created -- end if

0x05, Guild Invitation
This packet is sent when the Leader or a Jr. Master of a guild invites someone to get in the guild to the victim/invitee. XX XX XX XX || Integer, Guild ID XX XX ... || String, Inviter Name

0x1A, Guild Data
This packet only contains a boolean (true when the player is inside a guild) and all the guild data when this boolean was true. This is only sent when a player logs on and the player joined a guild. XX || Boolean, 00 if the player is not in a guild, 01 otherwise -- If the boolean was 01/true -- Guild Data, see Guild Data Structure -- End if

0x20, Guild Data (sent on guild creation)
This packet is sent when the guild was successfully created and is sent to everyone in the guild. There's nothing else than only the guild data. -- Guild Data, see Guild Data Structure

0x27, New Guild Member
This packet is sent to the guild when a player has accepted a guild invitation. XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Player ID -- Player Data Structure, see Player Data Structure

0x2C, Leaving Guild Member
This packet is sent to everyone in the guild when a player leaves the guild. XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Leaving Player ID XX XX ... || String, Leaving Player Name

0x2F, Expelled Guild Member
This packet is sent to everyone in the guild when a player gets expelled from the guild. XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Leaving Player ID XX XX ... || String, Leaving Player Name

0x32, Guild Disband
This packet is sent when a Guild Leader disbands it's Guild. XX XX XX XX || Integer, Guild ID 01 || Byte, might be some sort of reason.

0x3A, Guild Capacity Update
This packet is sent when the guild leader increases the guild capacity and is sent to everyone in the guild. The guild leader gets an NPC chat box of the Guild Creation NPC saying that the guild capacity has successfully increased, with the new capacity value shown too. XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Guild Capacity

0x3C, Player Stats Update
This packet is sent to everyone in the guild when: XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Player ID XX XX XX XX || Integer, Player Level XX XX XX XX || Integer, Player Job Note: A different packet is sent when the player changes level.
 * A player logs on and the player job and level where unknown
 * A player changes job or level (the player itself doesn't get the packet when this happens)

0x3D, Player Login/off
This packet is sent when a player logs in or off to everyone in the guild, except the player logging in/off. XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Player ID XX || Boolean, Player Online (01 when true, otherwise 00)

0x3E, Guild Rank Titles Update
This packet is sent to everyone in the guild when the leader or a Jr. Member changes the guild rank titles. XX XX XX XX || Integer, Guild ID -- For every guild rank title XX XX ... || String, Guild Rank Title -- End for

0x40, Guild Member Rank Update
This packet is sent to everyone in the guild and shows a message with "[{character name here}] rank has been changed to [{rank name here]". XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Player ID XX || Byte, Rank ID

0x42, Guild Logo Update
This packet is sent when the guild leader changes the guild logo with the Guild Emblem NPC and is sent to everyone in the guild. XX XX XX XX || Integer, Guild ID -- Logo Data, see Logo Structure

0x44, Guild Notice Update
This packet is sent when the leader or Jr. Member changes the guild notice and is sent to everyone in the guild. XX XX XX XX || Integer, Guild ID XX XX ... || String, Guild Notice

0x48, Guild Points Update
This packet is sent to everyone in the guild when the guild receives points. XX XX XX XX || Integer, Guild ID XX XX XX XX || Integer, Guild Points

0x49, Guild Rank Board
This packet is sent to the player requesting the guild rank board with talking to the Honorable Rock NPC in many main towns, like Perion and Orbis.

XX XX XX XX || Integer, NPC ID of the rank board. XX XX XX XX || Integer, Amount of Guilds to show up (max: 50) -- For every guild, ordered by Guild Points (max: 50 XX XX ... || String, Guild Name XX XX XX XX || Integer, Guild Points XX XX XX XX || Integer, Guild Logo Foreground XX XX XX XX || Integer, Guild Logo Foreground Color XX XX XX XX || Integer, Guild Logo Background XX XX XX XX || Integer, Guild Logo Background Color -- End for

Guild Data Structure
This is the structure for the Guild Data. This structure is used in Alliances and a couple Guild packets too. XX XX XX XX || Integer, Guild ID XX XX ... || String, Guild Name -- For every guild rank title XX XX ... || String, Guild Rank Title -- End for XX || Byte, Amount of Guild Members -- For every guild member, where the leader is the first one XX XX XX XX || Integer, Member Player ID -- End for -- For every guild member, where the leader is the first one -- Player Data Structure, see Player Data Structure -- End for XX XX XX XX || Integer, Guild Capacity (max: 100) -- Guild Logo data, see Logo Structure XX XX ... || String, Guild Notice XX XX XX XX || Integer, Guild Points XX XX XX XX || Integer, Alliance ID (0 if not in alliance)

Logo Structure
This logo structure is used everywhere where the logo is used, such as changing the emblem and on the Show Player packet. XX XX || Short, Background XX || Byte, Background color XX XX || Short, Foreground XX || Byte, Foreground color

Player Data Structure
This structure is used wherever player data is needed. XX XX XX XX XX XX XX XX XX XX XX XX XX || String with fixed length of 13, Member Name XX XX XX XX || Integer, Member Job, if unknown: -1 XX XX XX XX || Integer, Member Level, if unknown: -1 XX XX XX XX || Integer, Member Guild Rank XX 00 00 00 || Boolean (integer), Member online (01 for true) XX XX XX XX || Integer, Unknown static value for everyone in the guild. Seems to be different in any other guild. Could be some random number. XX XX XX XX || Integer, Member Alliance Rank (0 if not in alliance)