on_yearly_pulse = {
	events = {
		20354 # Remove Spy Network from invalid characters
	}
}

#character
on_bi_yearly_pulse = {
	events = {
		# Maintenance events
		Plus.329 # Norman conquest of England cleanup - Victory: France loses claims
		Plus.330 # Norman conquest of England cleanup - Loss: English provinces (back) to England
	}
}

#character
on_five_year_pulse = {
	random_events = {
		100 = maintPlus.104 # AI spouse finder
		#Maintenance - These events are either flavour or we don't really care when they execute.
		# 10000 = Plus.345 # Removes In Hiding trait from characters who no longer have someone to remove it
		# 10000 = Plus.346 # Removes austerity modifier from non-AI characters
		# 1000 = Plus.339 # Change Scarred trait on females
	}
}

# Losing army owner is ROOT - opponent army owner is FROM
on_battle_lost_owner = {
	events = {
		Plus.362 # Rebel/Adventurer imprisoned after loss
	}
}

# Sent to employers of both spouses - ROOT is employer. FROM is employers "employee". new_character is the other spouse.
on_marriage = {
	events = {
		# Plus.361 # Lowborn marries a Duke or above
 	}
}

#character. Triggers when someone gets imprisoned for any reason. - ROOT is prisoner, FROM is imprisoner
on_become_imprisoned_any_reason = {
	events = {
		# Plus.337 # Clear siege modifiers/hiding trait if imprisoned
		Plus.359 # Remove away_from_court
	}
}

on_death = {
	events = {
		# Plus.321 # Remove Favored Son trait
		Plus.340 # Cleanup "child serving abroad" event chains (Varangian/Celtic Holy Orders) when parent dies
		Plus.348 # Viceroys pass on wealth to a relative
	}
}

# ROOT is the character, FROM is the title, FROMFROM is the old holder
on_new_holder = {
	events = {
		# Plus.351 # Adds province chaos modifier
		# Plus.356 # Removes claims for dead rulers

		Plus.364 # Fix Gender + Succession law when passed over
		# Plus.366 # Restore original name if title with regnal names is inherited by secular ruler
		Plus.368 # Deal with landed Varangians
		PlusMaintenance.105 # Clean up Christian ascetics upon becoming rulers again
	}
}

# ROOT is the character, FROM is the title, FROMFROM is the old holder
on_new_holder_inheritance = {
	events = {
		Plus.341 # Check if overthrown ruler is re-inheriting
		# Plus.356 # Removes claims for dead rulers
		# Plus.360 # Religion head loses all claims as they gain the title
		Plus.368 # Deal with landed Varangians
		# Plus.366 # Restore original name if title with regnal names is inherited by secular ruler
		PlusMaintenance.105 # Clean up Christian ascetics upon becoming rulers again
	}
}

# ROOT is the character, FROM is the title, FROMFROM is the old holder
on_new_holder_usurpation = {
	events = {
		# Plus.351 # Adds province chaos modifier
		Plus.368 # Deal with landed Varangians
		# Plus.366 # Restore original name if title with regnal names is inherited by secular ruler
		PlusMaintenance.105 # Clean up Christian ascetics upon becoming rulers again
	}
}

# From = Attacker, Root = Defender
on_war_ended_victory = {
	events = {
		# Plus.336 # Get rid of siege effects once war is done
		Plus.357 # Manage Away From Court modifier
	}
}

# From = Attacker, Root = Defender
on_war_ended_whitepeace = {
	events = {
		# Plus.336 # Get rid of siege effects once war is done
		Plus.357 # Manage Away From Court modifier
	}
}

# From = Attacker, Root = Defender
on_war_ended_defeat = {
	events = {
		# Plus.336 # Get rid of siege effects once war is done
		Plus.357 # Manage Away From Court modifier
	}
}

# From = Attacker, Root = Defender
on_war_ended_invalid = {
	events = {
		# Plus.336 # Get rid of siege effects once war is done
		Plus.357 # Manage Away From Court modifier
	}
}

# Triggers for all characters in a unit (leading a flank or subunit) when it enters a province
# ROOT is the affected character
on_unit_entering_province = {
	events = {
		Plus.353 # Manage Away From Court modifier
	}
}

# Triggers for character when they are put in command of a flank
# ROOT is the affected character
on_command_unit = {
	events = {
		Plus.354 # Manage Away From Court modifier
	}
}

# Triggers for character when they are put in command of a subunit
# ROOT is the affected character
on_command_sub_unit = {
	events = {
		Plus.354 # Manage Away From Court modifier
	}
}

# FROM is attacker
# ROOT is defender
on_war_started = {
	events = {
		Plus.356 # Manage Away From Court modifier
	}
}

# Character may still be a landless ruler!
# ROOT is unlanded character
on_unlanded = {
	events = {
		Plus.358 # Manage Away From Court modifier
	}
}