I posted in another topic a mine from elemental.exe showing us the possible triggers for events, thought I'd say a few things about them here.
Functional triggertypes
CityPopulation - the only one used in vanilla. Reads all your cities and if it finds a city with equal or above population, it can trigger the event. This does not have to be the capital city.
<TriggerType>CityPopulation</TriggerType>
<TriggerData>25</TriggerData>
TotalPopulation - reads the total population of all your cities. If equal or above the triggerdata, it can trigger the event.
<TriggerType>TotalPopulation </TriggerType>
<TriggerData>25</TriggerData>
UnitLevel - Reads the level of a specific unit. If equal (untested: can it trigger if unit is above level?), can trigger the event. Note the very specific unitname here, making this one a bit difficult to use. Player designed units have uniquely generated unitnames, so they can never be the trigger.
One example of an event where this might be useful is if the player starts the game with a pet. If this pet levels up to a certain level, the event could trigger and start a quest where the unit must travel to the capital city. Once it reaches the city, it could be replaced by a stronger unit. In this manner, a unit could potentially be replaced in a chain, leading to an "ultimate evolution". Edit: This is an example of a quest where a pet is changed in power as he levels up. In order for a unit to be destroyable by a quest, it must be spawned by a quest. So, this quest is in two parts: first, spawn the pet. When the pet levels up, send it to your capital to train. When it reaches your capital city, "destroy" the pet and spawn a new one. Note that the quest is actually triggered by a sovereign gaining level 2. It is not possible to trigger a quest from a levelup, and then destroy the unit that triggered the quest.
Another example is a quest that triggers on a certain level for a sovereign, and causes a champion to spawn (a childhood friend perhaps, or why not a spouse?). These would have to be tailored to each sovereign, and would not trigger from custom sovereigns unless they too had quests tailored for them.
Another use could be for example a darkling unit that levels high enough. The player is then prompted with the opportunity to replace the unit with recruit a new, one-time elected shaman. Or it could result in the darklings finally sharing some rare technology with you (maybe simply a map to another darkling village). Or an army of drota, the sworn enemy of darklings, attacking you.
<TriggerType>UnitLevel</TriggerType>
<TriggerStringData>Lady_Irane</TriggerStringData>
<TriggerData>2</TriggerData>
UnknownNonfunctional
ImprovementBuilt - had no luck mixing any <TriggerStringData> and <TriggerData> in.
TechnologyResearched - had no luck <TriggerStringData> and <TriggerData> in, tried techs researched and techs the player had from the start.
SpellResearched - Similarly, no luck after I researched a spell.