public static byte[] GuildSetTitle2(int guildid, int charid, string title)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_GUILD_SET_TITLE2);
     Writer.Byte(1);
     Writer.DWord(guildid);
     Writer.DWord(charid);
     Writer.Word(title.Length);
     Writer.String(title);
     return Writer.GetBytes();
 }
        public static byte[] StallBuyItem2(string charname, byte stallslot, List<WorldMgr.stall.stallItem> ItemList)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(OperationCode.SERVER_STALL_PLAYERUPDATE);
            Writer.Byte(3);
            Writer.Byte(stallslot);
            Writer.Word(charname.Length);
            Writer.String(charname);
            StallItemPacket(ItemList, Writer);

            return Writer.GetBytes();
        }
        public static byte[] PartyRequest(byte Type, int id, byte type)
        {
            //Create new packet writer
            PacketWriter Writer = new PacketWriter();
            //Add opcode
            Writer.Create(OperationCode.SERVER_PARTY_REQUEST);
            //Write type byte
            Writer.Byte(Type);
            //Create switch on type
            switch (Type)
            {
                case 6:
                    //Union invite
                    Writer.DWord(id);
                    break;
                case 5:
                    //Guild invitation
                    Writer.DWord(id);
                    PlayerMgr InvitedPlayer = Helpers.GetInformation.GetPlayer(id);
                    Writer.Word(InvitedPlayer.Character.Information.Name.Length);
                    Writer.String(InvitedPlayer.Character.Information.Name);
                    Writer.Word(InvitedPlayer.Character.Network.Guild.Name.Length);
                    Writer.String(InvitedPlayer.Character.Network.Guild.Name);
                    break;
                case 2:
                    //Party invite
                    Writer.DWord(id);
                    Writer.Byte(type);
                    break;
                case 1:
                    //Exchange invite
                    Writer.DWord(id);
                    break;
            }

            return Writer.GetBytes();
        }
 public static byte[] SendGuildInfo(WorldMgr.guild guildGlobal)
 {
     PacketWriter Writer = new PacketWriter();
     /////////////////////////////////////////////////////////////////////////
     //Opcode information
     /////////////////////////////////////////////////////////////////////////
     Writer.Create(OperationCode.SERVER_GUILD_INFO_LOAD);
     /////////////////////////////////////////////////////////////////////////
     //Packet Structure
     /////////////////////////////////////////////////////////////////////////
     //Writer.Byte(1); // Guild update
     Writer.DWord(guildGlobal.Guildid);              // Unique Guild ID
     Writer.Text(guildGlobal.Name);                  // Guild Name
     Writer.Byte(guildGlobal.Level);                 // Guild level
     Writer.DWord(guildGlobal.PointsTotal);          // Guild GP
     Writer.Word(guildGlobal.NewsTitle.Length);      // Guild Message Title Lenght
     Writer.String(guildGlobal.NewsTitle);           // Guild Message Title
     Writer.Word(guildGlobal.NewsMessage.Length);    // Guild Message Lenght
     Writer.String(guildGlobal.NewsMessage);         // Guild Message
     Writer.DWord(0);                                // War on guild id
     Writer.Byte(0);                                 // War status?
     /////////////////////////////////////////////////////////////////////////
     // Write Guild Member information for each excisting member.
     /////////////////////////////////////////////////////////////////////////
     Guild_ListPlayersInfo(guildGlobal.MembersInfo, Writer);
     Writer.Byte(0);
     return Writer.GetBytes();
 }