For the first error, just look where you have bool usematerials;
and replace with
bool usematerial = Utility.RandomBool();
In XmlSpawnerGump replace these lines :this.AddTextEntry(35, 275, 200, 21, 0, 1, null);
by this :this.AddTextEntry(35, 275, 200, 21, 0, 1, (string)null);
In XMLQuestGump...