Event extraction is an important but challenging task. Many existing techniques decompose it into event and argument detection/classification subtasks, which are complex structured prediction problems. Generation-based extraction techniques lessen the complexity of the problem formulation and are able to leverage the reasoning capabilities of large pretrained language models. However, they still suffer from poor zero-shot generalizability and are ineffective in handling long contexts such as documents. We propose a generative event extraction model, TC-GEE, that addresses these limitations. A key contribution of TC-GEE is a novel knowledge-based conditioning technique that injects the schema of candidate event types as the prefix into each layer of an encoder-decoder language model, thus enabling effective zero-shot learning and improving supervised learning. Our experiments on two benchmark datasets demonstrate the strong performance of our TC-GEE model. It achieves especially strong performance in the challenging document-level extraction task and in the zero-shot learning setting, outperforming state-of-the-art models by up to 27.7 absolute F1 points.