#Stronger Early AI Christians, Written by Delinard
namespace = SEAC

character_event = { 
	id = SEAC.1
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		start_date = 769.1.1
		is_save_game = no
		NOT = { has_global_flag = charlemagne_buff }
	}
    immediate = {
		set_global_flag = charlemagne_buff
		c_70012 = { #Aurelio
			limit = { ai = yes }
			wealth = 560
			prestige = 435
			piety = 270
			health = 2
			remove_trait = indulgent_wastrel
			remove_trait = content
			remove_trait = shy
			remove_trait = gluttonous
			remove_trait = slothful
			remove_trait = cynical
			remove_trait = kind
			remove_trait = greedy
			add_trait = brilliant_strategist
			add_trait = holy_warrior
			add_trait = zealous
			add_trait = patient
			add_trait = temperate
			add_trait = charitable
			add_claim = c_zamora
			add_claim = c_valladolid
			add_claim = c_braganza
			add_claim = c_porto
			add_claim = c_soria
			add_claim = c_coimbra
			add_claim = c_castelo_branco
			change_diplomacy = 3
			change_martial = 2
			change_stewardship = 5
			change_learning = 4
			add_artifact = armor_tier_2
			add_artifact = sword_tier_2_new
			add_artifact = the_lily_crown
			military_techpoints = 800
			economy_techpoints = 800
			culture_techpoints = 800
			b_norena = { gain_title = PREV }
			b_sanpedrodeperix = { gain_title = FROM }
			if = { limit = { c_astorga = { holder_scope = { ai = yes } } } c_astorga = { gain_title = PREV } }
			k_asturias = { 
				add_law = revoke_title_law_2 cooldown = no opinion_effect = no 
				add_law = centralization_1 cooldown = no opinion_effect = no 
			}
			c_6392 = { 
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			add_friend = 70118
			add_friend = 200058
			add_friend = 200061
			add_friend = 70013
			c_70118 = { #Coruna Vassal
				limit = { ai = yes }
				remove_trait = thrifty_clerk
				add_trait = midas_touched
				remove_trait = ambitious
				remove_trait = deceitful
				remove_trait = arbitrary
				add_trait = content
				add_trait = honest
				add_trait = just
				change_stewardship = 5
				military_techpoints = 200
				economy_techpoints = 200
				culture_techpoints = 200
				health = 3
			}
			c_200058 = { #Santiago Vassal
				limit = { ai = yes }
				remove_trait = naive_appeaser
				remove_trait = underhanded_rogue
				remove_trait = charismatic_negotiator
				remove_trait = grey_eminence
				remove_trait = misguided_warrior
				remove_trait = tough_soldier
				remove_trait = skilled_tactician
				remove_trait = midas_touched
				remove_trait = indulgent_wastrel
				remove_trait = thrifty_clerk
				remove_trait = fortune_builder
				remove_trait = amateurish_plotter
				remove_trait = flamboyant_schemer 
				remove_trait = intricate_webweaver
				remove_trait = elusive_shadow 
				remove_trait = detached_priest
				remove_trait = martial_cleric
				remove_trait = scholarly_theologian
				remove_trait = mastermind_theologian
				add_trait = brilliant_strategist
				remove_trait = ambitious
				remove_trait = craven
				remove_trait = cynical
				add_trait = brave
				add_trait = zealous
				add_trait = holy_warrior
				add_trait = siege_expert
				change_martial = 5
				military_techpoints = 200
				economy_techpoints = 200
				culture_techpoints = 200
				health = 3
			}
			c_200061 = { #Viscaya Vassal
				limit = { ai = yes }
				remove_trait = naive_appeaser
				remove_trait = underhanded_rogue
				remove_trait = charismatic_negotiator
				remove_trait = brilliant_strategist
				remove_trait = misguided_warrior
				remove_trait = tough_soldier
				remove_trait = skilled_tactician
				remove_trait = midas_touched
				remove_trait = indulgent_wastrel
				remove_trait = thrifty_clerk
				remove_trait = fortune_builder
				remove_trait = amateurish_plotter
				remove_trait = flamboyant_schemer 
				remove_trait = intricate_webweaver
				remove_trait = elusive_shadow 
				remove_trait = detached_priest
				remove_trait = martial_cleric
				remove_trait = scholarly_theologian
				remove_trait = mastermind_theologian
				add_trait = grey_eminence
				remove_trait = shy
				remove_trait = deceitful
				remove_trait = ambitious
				remove_trait = cynical
				remove_trait = slothful
				remove_trait = cruel
				remove_trait = wroth
				add_trait = gregarious
				add_trait = honest
				add_trait = diligent
				add_trait = kind
				add_trait = patient
				change_diplomacy = 5
				military_techpoints = 200
				economy_techpoints = 200
				culture_techpoints = 200
				health = 3
			}
			c_70013 = { #Asturias Heir
				limit = { ai = yes }
				remove_trait = naive_appeaser
				add_trait = midas_touched
				remove_trait = shy
				remove_trait = deceitful
				remove_trait = ambitious
				remove_trait = cynical
				remove_trait = slothful
				remove_trait = gluttonous
				remove_trait = content
				add_trait = gregarious
				add_trait = honest
				add_trait = diligent
				add_trait = zealous
				add_trait = temperate
				change_diplomacy = 5
				military_techpoints = 200
				economy_techpoints = 200
				culture_techpoints = 200
				health = 3
			}
			b_oviedo = {
				add_building = ca_wall_q_2
				add_building = ca_wall_1
				add_building = ca_keep_2
				add_building = ca_militia_barracks_2
				add_building = ca_barracks_2
				add_building = ca_stable_2
				add_building = ca_town_2
			}
			b_norena = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_leon = {
				add_building = ca_wall_q_2
				add_building = ca_wall_1
				add_building = ca_keep_2
				add_building = ca_militia_barracks_2
				add_building = ca_barracks_2
				add_building = ca_stable_2
				add_building = ca_town_2
			}
			b_sanpedrodeperix = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_ponferrada = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_palencia = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_corunna = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_lugo = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_pontevedra = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_castrobarte = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_santillanadelmar = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_irun = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_osma = {
				add_building = ca_wall_q_1
				add_building = ca_wall_1
				add_building = ca_keep_1
				add_building = ca_militia_barracks_1
				add_building = ca_barracks_1
				add_building = ca_stable_1
				add_building = ca_town_2
			}
			b_gijon = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_2
				add_building = ct_barracks_2
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_bembibre = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_villablino = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_2
				add_building = ct_barracks_2
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_burgos = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_santander = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_vitoria = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_villalba = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_vigo = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_orense = {
				add_building = ct_wall_q_1
				add_building = ct_wall_1
				add_building = ct_training_grounds_1
				add_building = ct_barracks_1
				add_building = ct_guard_1
				add_building = ct_marketplace_2
				add_building = ct_port_1
			}
			b_cangasdeonis = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_valenciadecampos = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_astorga = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_saint_antolin = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_mondonedo = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_santiago = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_tuy = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_laredo = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_sansebastian = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_silos = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			b_el_burgo = {
				add_building = tp_wall_q_2
				add_building = tp_wall_1
				add_building = tp_monastery_2
				add_building = tp_barracks_2
				add_building = tp_elite_barracks_2
				add_building = tp_town_2 
			}
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
			create_character = {
				name = "Diego" #Navarra Adventurer
				random_traits = yes
				dynasty = random
				religion = catholic
				culture = basque
				flag = is_diego
				female = no
				age = 26
				attributes = {
					martial = 5
					diplomacy = 5
					stewardship = 5
					intrigue = 5
					learning = 5
				}
				health = 6
				fertility = 1
				trait = midas_touched
				trait = hunter
				trait = defensive_leader 
				trait = adventurer
				trait = kind
				trait = patient
				trait = diligent
				trait = brave
			}
			new_character = {
				set_immune_to_pruning = yes 
				THIS = {
					set_defacto_liege = THIS
					create_title = {
						tier = DUKE
						landless = yes
						temporary = yes
						adventurer = yes
						culture = basque
						name = "CLAIMANT_ADVENTURE"
						holder = THIS
					}
				}
			}
			create_character = {
				name = "Ferran" #Aragon Adventurer
				random_traits = yes
				dynasty = 100204
				religion = catholic
				culture = visigothic
				flag = is_ferran
				female = no
				age = 22
				attributes = {
					martial = 5
					diplomacy = 5
					stewardship = 5
					intrigue = 5
					learning = 5
				}
				health = 6
				fertility = 1
				trait = brilliant_strategist
				trait = heavy_infantry_leader
				trait = adventurer
				trait = ambitious
				trait = diligent
				trait = proud
				trait = greedy
				trait = zealous
			}
			new_character = {
				set_immune_to_pruning = yes 
				THIS = {
					set_defacto_liege = THIS
					create_title = {
						tier = DUKE
						landless = yes
						temporary = yes
						adventurer = yes
						culture = visigothic
						name = "CLAIMANT_ADVENTURE"
						holder = THIS
					}
				}
			}			
		}
		c_73679 = { #Umayyad
			limit = { ai = yes }
			decadence = 25
			wealth = -95
			prestige = -30
			piety = -15
			164 = { religion = catholic }
			167 = { religion = catholic add_province_modifier = { name = highway_robber_band duration duration = -1 } add_province_modifier = { name = smugglers_ring duration = -1 } }
			165 = { religion = catholic add_province_modifier = { name = highway_robber_band duration duration = -1 } add_province_modifier = { name = smugglers_ring duration = -1 } }
			182 = {	religion = catholic add_province_modifier = { name = highway_robber_band duration duration = -1 } add_province_modifier = { name = smugglers_ring duration = -1 } }
			166 = { religion = catholic add_province_modifier = { name = highway_robber_band duration duration = -1 } add_province_modifier = { name = smugglers_ring duration = -1 } }
			162 = { add_province_modifier = { name = highway_robber_band duration = -1 } add_province_modifier = { name = thieves_guild duration = -1 } }
			180 = { add_province_modifier = { name = highway_robber_band duration = -1 } add_province_modifier = { name = thieves_guild duration = -1 } }
			168 = { add_province_modifier = { name = highway_robber_band duration = -1 } add_province_modifier = { name = thieves_guild duration = -1 } }
			186 = { add_province_modifier = { name = highway_robber_band duration = -1 } }
			184 = { add_province_modifier = { name = highway_robber_band duration = -1 } }
			178 = { add_province_modifier = { name = highway_robber_band duration = -1 } }
			1974 = { religion = catholic }
			163 = { religion = catholic }
			2014 = { religion = catholic }
			183 = { religion = catholic }
			c_6392 = { 
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 3 who = PREV }
			}
			c_144999 = { 
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 3 who = PREV }
			}
			c_190347 = { 
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 3 who = PREV }
			}
			religion_authority = { 
				modifier = baptized_king_from
				years = 50 
			}
		}
		c_6392 = { #Charlemagne
			limit = { ai = yes }
			wealth = 1000
			health = 6
			remove_trait = gluttonous
			remove_trait = lustful
			remove_trait = wroth
			add_trait = quick
			add_trait = brilliant_strategist
			add_trait = inspiring_leader
			add_trait = organizer
			add_trait = ambitious
			add_trait = patient
			add_trait = temperate
			change_diplomacy = 35
			change_martial = 10
			change_stewardship = 10
			change_intrigue = 20
			change_learning = 15
			add_artifact = armor_tier_2
			add_artifact = sword_tier_4_vengeance
			add_artifact = noble_scepter 
			add_artifact = the_lily_crown 
			add_artifact = crown_of_thorns
			add_artifact = engraved_sword
			add_artifact = fingerbone_of_saint
			add_artifact = how_to_write_a_letter
			military_techpoints = 1000
			economy_techpoints = 800
			culture_techpoints = 600
			k_france = { add_law = revoke_title_law_2 cooldown = no opinion_effect = no }
			456 = { religion = catholic }
			1696 = { religion = catholic }
			457 = { religion = catholic }
			1692 = { religion = catholic }
			1693 = { religion = catholic }
			1694 = { religion = catholic }
			449 = { religion = catholic }
			1699 = { religion = catholic }
			455	= { religion = catholic }
			1698 = { religion = catholic }
			1697 = { religion = catholic }
			446 = { religion = catholic }
			445 = { religion = catholic }
			450 = { religion = catholic }
			454 = { religion = catholic }
			311 = { religion = catholic }
			85 = { religion = catholic }
			312 = { religion = catholic }
			310 = { religion = catholic }
			819 = { religion = catholic }
			825 = { religion = catholic }
			814 = { religion = catholic }
			1691 = { religion = catholic }
			if = { limit = { d_picardie = { holder_scope = { ai = yes } } } d_picardie = { gain_title = PREV } }
			if = { limit = { c_amiens = { holder_scope = { ai = yes } } } c_amiens = { gain_title = PREV } }
			if = { limit = { c_clermont = { holder_scope = { ai = yes } } } c_clermont = { gain_title = PREV } }
			if = { limit = { c_ponthieu = { holder_scope = { ai = yes } } } c_ponthieu = { gain_title = PREV } }
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
			spawn_unit = {
				province = 113
				owner = THIS
				disband_on_peace = no
					troops =
					{
						light_cavalry = { 500 500 }
						archers = { 500 500 }
						heavy_infantry = { 700 700 }
						pikemen = { 300 300 }
					}
					attrition = 0.0
			}
		}
		c_7864 = { #Pope
			wealth = 15000
			change_martial = 5
			change_stewardship = 5
			change_intrigue = 5
			change_learning = 5
			military_techpoints = 900
			economy_techpoints = 500
			culture_techpoints = 500
		}
		c_190455 = { #Saxony
			limit = { ai = yes }
			remove_trait = ambitious
			remove_trait = greedy
			remove_trait = shy
			remove_trait = wroth
			remove_trait = slothful
			remove_trait = cynical
			add_trait = content
			add_trait = paranoid
			add_trait = patient
			add_trait = diligent
			health = 4
			add_friend = 194004
			add_friend = 194003
			add_friend = 168620
		}
		any_player = { 
			limit = {
				OR = {
					culture = polish
					culture = prussian
					culture = pommeranian
				}
			}
			set_global_flag = polish_player
		}
	}
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.2 #Better Saxon Wars
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_global_flag = better_saxon_wars }
		ai = yes
		has_character_flag = is_charlemagne
		war_with = k_saxony
	}
    immediate = {
		set_global_flag = better_saxon_wars
		wealth = 2000 
		spawn_unit = {
			province = 113
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 4000 4000 }
					light_infantry = { 1500 1500 }
					archers = { 2000 2000 }
					heavy_infantry = { 5000 5000 }
					pikemen = { 1000 1000 }
				}
				 attrition = 0.0
		}
		change_infamy = { value = -300 localisation = key }
		remove_trait = stressed
		remove_trait = depressed
		remove_trait = craven
		c_200223 = { #Mallorca
			limit = {
				ai = yes
				de_jure_liege = e_byzantium
				e_byzantium = { 
					holder_scope = { ai = yes }
				} 
			}
			set_defacto_liege = THIS
		}
	}
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.3 #Faster Saxon Conversion
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_global_flag = faster_saxon_conversion }
		has_character_flag = is_charlemagne
		ai = yes
		has_landed_title = k_saxony
		religion = catholic
	}
    immediate = {
		set_global_flag = faster_saxon_conversion
		b_stade = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_essen = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_gottingen = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_tecklenburg = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_minden = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_oldenburg = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_braunschweig = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_verden = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_luneburg = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_stendal = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_magdeburg = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_brunsbuttel = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_stade = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_travemunde = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_itzehoe = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_kiel = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		b_celle = { add_building = tb_hillfort_3 add_building = tb_market_town_3 }
		848 = { religion = catholic culture = german }
		86 = { religion = catholic culture = german }
		87 = { religion = catholic culture = german }
		88 = { religion = catholic culture = german }
		120 = { religion = catholic culture = german }
		257 = { religion = catholic culture = german }
		1982 = { religion = catholic culture = german }
		1979 = { religion = catholic culture = german }
		1980 = { religion = catholic culture = german }
		1982 = { religion = catholic culture = german }
		258 = { religion = catholic culture = german }
		259 = { religion = catholic culture = german }
		309 = { religion = catholic culture = german }
		261 = { religion = catholic culture = german }
		262 = { religion = catholic culture = german }
		1688 = { religion = catholic culture = german }
		263 = { religion = catholic culture = german }
		d_munster_germany = { de_jure_liege = k_germany }
		d_mecklemburg = { de_jure_liege = k_germany }
		d_angria = { de_jure_liege = k_germany }
		d_bremen = { de_jure_liege = k_germany }
		d_saxony = { de_jure_liege = k_germany }
		d_holstein = { de_jure_liege = k_denmark }
		wealth = 2000
		religion_authority = { 
			modifier = baptized_king_to 
			years = 200 
		}
		add_claim = c_meissen
		add_claim = c_gorlitz
		add_claim = c_anhalt
		add_claim = c_lausitz
		add_claim = c_havelberg
		add_claim = c_brandenburg
		add_claim = d_carinthia
		change_infamy = { value = -300 localisation = key }
		remove_trait = stressed
		remove_trait = depressed
		remove_trait = craven
		c_73679 = { #Umayyad
			limit = { ai = yes }
			decadence = 15
			wealth = -1000
			prestige = -500
			piety = -250
		}
		any_realm_lord = {
			limit = { 
				religion = norse_pagan
				ai = yes
			}
			religion = catholic
			culture = german
		}
	} 
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.4 #Iberian Adventurers
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_global_flag = iberian_adventurers }
		year = 770
		start_date = 769.1.1
	}
    immediate = {
		set_global_flag = iberian_adventurers
		d_barcelona = { de_jure_liege = k_aragon }
		d_aragon = { de_jure_liege = k_aragon }
		any_independent_ruler = {
			limit = {
				has_landed_title = k_andalusia
			}
			save_event_target_as = umayyad_sultan
		}
		any_independent_ruler = {
			limit = { has_character_flag = is_diego }
			wealth = 500
			prestige = 250
			piety = 150
			add_artifact = armor_tier_2
			add_artifact = lance_tier_2_new 
			add_claim = c_najera
			add_claim = c_viscaya
			add_claim = c_navarra
			add_claim = c_alto_aragon
			add_claim = d_navarra
			add_claim = k_navarra
			spawn_unit = {
				province = 149
				owner = THIS
				disband_on_peace = no
					troops =
					{
						light_cavalry = { 200 200 }
						light_infantry = { 100 100 }
						archers = { 100 100 }
						heavy_infantry = { 300 300 }
						pikemen = { 100 100 }
					}
					attrition = 0.0
			}
			c_70012 = { 
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			c_6392 = {
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			any_independent_ruler = { 
				limit = { ai = yes has_character_flag = is_ferran } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = none
				religion = catholic
				culture = basque
				female = no
				age = 25
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = none
				religion = catholic
				culture = basque
				female = no
				age = 27
			}
			war = {
				target = event_target:umayyad_sultan
				casus_belli = claim_all
				thirdparty_title = k_andalusia
			}
			spawn_unit = {
				province = 149
				owner = THIS
				disband_on_peace = yes
					troops =
					{
						light_cavalry = { 2000 2000 }
						light_infantry = { 1500 1500 }
						archers = { 2000 2000 }
						heavy_infantry = { 3000 3000 }
						pikemen = { 1500 1500 }
					}
					attrition = 0.0
			}
			spawn_unit = {
				province = 149
				owner = THIS
				disband_on_peace = yes
					troops =
					{
						light_cavalry = { 2000 2000 }
						light_infantry = { 1500 1500 }
						archers = { 2000 2000 }
						heavy_infantry = { 3000 3000 }
						pikemen = { 1500 1500 }
					}
					attrition = 0.0
			}
		}
		any_independent_ruler = {
			limit = { has_character_flag = is_ferran }
			wealth = 500
			prestige = 250
			piety = 150
			add_artifact = armor_tier_2
			add_artifact = mace_tier_2_new
			add_claim = c_urgell
			add_claim = c_lleida
			add_claim = c_empuries
			add_claim = c_barcelona
			add_claim = d_barcelona
			spawn_unit = {
				province = 212
				owner = THIS
				disband_on_peace = no
					troops =
					{
						light_cavalry = { 200 200 }
						light_infantry = { 100 100 }
						archers = { 100 100 }
						heavy_infantry = { 200 200 }
						pikemen = { 100 100 }
					}
					attrition = 0.0
			}
			c_70012 = { 
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			c_6392 = {
				limit = { ai = yes } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			any_independent_ruler = { 
				limit = { ai = yes has_character_flag = is_diego } 
				opinion = { modifier = in_non_aggression_pact years = 50 who = PREV }
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = none
				religion = catholic
				culture = visigothic
				female = no
				age = 23
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = none
				religion = catholic
				culture = visigothic
				female = no
				age = 25
			}
			war = {
				target = event_target:umayyad_sultan
				casus_belli = claim_all
				thirdparty_title = k_andalusia
			}
			spawn_unit = {
				province = 212
				owner = THIS
				disband_on_peace = yes
					troops =
					{
						light_cavalry = { 3000 3000 }
						light_infantry = { 1000 1000 }
						archers = { 1500 1500 }
						heavy_infantry = { 4000 4000 }
						pikemen = { 500 500 }
					}
					attrition = 0.0
			}
			spawn_unit = {
				province = 212
				owner = THIS
				disband_on_peace = yes
					troops =
					{
						light_cavalry = { 3000 3000 }
						light_infantry = { 1000 1000 }
						archers = { 1500 1500 }
						heavy_infantry = { 4000 4000 }
						pikemen = { 500 500 }
					}
					attrition = 0.0
			}
		}
	}
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.5 #Make sure saxons are ruled by saxon
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { year = 800 }
		has_landed_title = k_saxony
		ai = yes
		NOT = { culture = old_saxon }
		NOT = { religion = catholic }
	}
    immediate = {
		culture = old_saxon
	}
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.6 Anglo-Saxon Buffs
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_global_flag = anglo_saxon_buffs }
		start_date = 769.1.1
	}
    immediate = {
		set_global_flag = anglo_saxon_buffs
		c_shrewsbury = { de_jure_liege = d_hereford }
		c_hereford = { de_jure_liege = d_hereford }
		c_205072 = {
			limit = { ai = yes }
			add_claim = c_shrewsbury
			add_claim = c_hereford
		}
		c_205180 = {
			limit = { ai = yes }
			remove_trait = content
			remove_trait = slothful
			add_trait = ambitious
			add_trait = diligent
			wealth = 400
			prestige = 400
			piety = 200
			add_claim = c_surrey
			add_claim = c_sussex
			add_claim = c_kent
			add_claim = c_gloucester
			add_claim = c_oxford
			add_claim = c_middlesex
			add_claim = c_essex
		}
	}
	option = {
		name = OK
	}
}

character_event = { 
	id = SEAC.7 #Create Piast
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { year = 825 }
		year = 805
		ai = yes
		has_global_flag = no_polish_players
		NOT = { has_global_flag = piast_created }
	}
    immediate = {
		set_global_flag = piast_created
		create_character = {
			name = "Piast"
			dynasty = 699
			religion = slavic_pagan
			culture = polish
			flag = is_piast
			female = no
			age = 16
			attributes = {
				martial = 10
				diplomacy = 10
				stewardship = 10
				intrigue = 10
				learning = 10
			}
			health = 7
			fertility = 2
			trait = quick
			trait = brilliant_strategist
			trait = flat_terrain_leader
			trait = adventurer
			trait = diligent
			trait = lustful
			trait = patient
			trait = cynical
		}
		new_character = {
			character_event = { id = SEAC.8 days = 1 }
			set_immune_to_pruning = yes 
		}
	}
	option = {
		name = OK
	}
}

character_event = { 
	id = SEAC.8 #Piast Invasion
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		has_character_flag = is_piast
	}
    immediate = {
		ROOT = {
			set_defacto_liege = ROOT
			create_title = {
				tier = DUKE
				landless = yes
				temporary = yes
				adventurer = yes
				culture = ROOT
				name = "CLAIMANT_ADVENTURE"
				holder = ROOT
			}
		}
		wealth = 500
		piety = 400
		add_artifact = armor_tier_1
		add_artifact = mace_tier_1_new
		spawn_unit = {
			province = 431
			owner = ROOT
			disband_on_peace = no
				troops =
				{
					light_cavalry = { 600 600 }
					light_infantry = { 100 100 }
					heavy_infantry = { 200 200 }
					archers = { 100 100 }
				}
				attrition = 0.0
		}
		add_claim = c_gnieznienskie
		add_claim = c_poznanskie
		add_claim = c_kaliskie
		add_claim = c_dobrzynska
		add_claim = c_kujawy
		add_claim = c_sieradzka
		add_claim = c_wielunska
		add_claim = c_plock
		add_claim = c_lomzynska
		add_claim = c_sieradzko-leczyckie
		add_claim = c_czersk
		add_claim = c_lower_silesia
		add_claim = c_upper_silesia
		add_claim = c_opole
		add_claim = c_cieszyn
		add_claim = c_krakowskie
		add_claim = c_sandomierskie
		add_claim = c_stezycka
		add_claim = c_lubelska
		add_claim = c_sacz
		add_claim = c_lubusz
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 20
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 22
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 24
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 26
		}
		c_poznanskie = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_plock = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_sandomierskie = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_krakowskie = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_sieradzka = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_lower_silesia = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_lomzynska = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_kujawy = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		c_upper_silesia = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		spawn_unit = {
			province = 431
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 1000 1000 }
					light_infantry = { 5000 5000 }
					archers = { 2500 2500 }
					heavy_infantry = { 1000 1000 }
				}
				attrition = 0.0
		}
		spawn_unit = {
			province = 431
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 1000 1000 }
					light_infantry = { 5000 5000 }
					archers = { 2500 2500 }
					heavy_infantry = { 1000 1000 }
				}
				attrition = 0.0
		}
		spawn_unit = {
			province = 431
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 1000 1000 }
					light_infantry = { 5000 5000 }
					archers = { 2500 2500 }
					heavy_infantry = { 1000 1000 }
				}
				attrition = 0.0
		}
		spawn_unit = {
			province = 431
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 1000 1000 }
					light_infantry = { 5000 5000 }
					archers = { 2500 2500 }
					heavy_infantry = { 1000 1000 }
				}
				attrition = 0.0
		}
	}
	option = {
		name = OK
	}
}
character_event = { 
	id = SEAC.9 #Poland Converts
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { year = 840 }
		ai = yes
		NOT = { has_global_flag = piast_converts }
		culture = polish
		dynasty = 699
		has_landed_title = k_poland
		war = no
	}
    immediate = {
		set_global_flag = piast_converts
		religion_authority = { 
				modifier = baptized_king_from
				years = 150 
		}
		religion_authority = { 
				modifier = baptized_king_from
				years = 150 
		}
		wealth = 7000
		prestige = -1000
		religion = catholic
		any_realm_province = {
			religion = catholic
		}
		any_realm_character = {
			religion = catholic
		}
		remove_trait = ambitious
		remove_trait = adventurer
		remove_trait = cynical
		remove_trait = brilliant_strategist
		add_trait = content
		add_trait = midas_touched
		k_poland = { add_law = tribal_organization_3 cooldown = no opinion_effect = no }
		religion_authority = { 
			modifier = baptized_king_to
			years = 150 
		}
		religion_authority = { 
			modifier = baptized_king_to
			years = 150 
		}
	}
	option = {
		name = OK
	}
}
character_event = { 
	id = SEAC.10 #Pictish Changes to Scottish
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { year = 825 }
		year = 800
		ai = yes
		NOT = { has_global_flag = pictish_changes }
		culture = pictish
		has_landed_title = k_scotland
	}
    immediate = {
		set_global_flag = pictish_changes
		culture = scottish
		any_realm_province = {
			limit = {
				culture = pictish
			}	
			culture = scottish
		}
		any_realm_character = {
			limit = {
				culture = pictish
				ai = yes
			}	
			culture = scottish
		}

	}
	option = {
		name = OK
	}
}
character_event = { 
	id = SEAC.11 #Bohemia Converts
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { year = 830 }
		year = 800
		NOT = { has_global_flag = bohemia_converts }
		ai = yes
		culture_group = west_slavic
		religion = slavic_pagan
		OR = {
			has_landed_title = k_bohemia
			has_landed_title = d_bohemia
		}
		war = no
		independent = yes
	}
    immediate = {
		set_global_flag = bohemia_converts
		religion_authority = { 
				modifier = baptized_king_from
				years = 150 
		}
		wealth = 2000
		religion = catholic
		any_realm_province = {
			religion = catholic
		}
		any_realm_character = {
			religion = catholic
			ai = yes
		}
		remove_trait = cynical
		add_trait = zealous
		religion_authority = { 
			modifier = baptized_king_to
			years = 150 
		}
		spawn_unit = {
			province = 437
			owner = ROOT
			disband_on_peace = no
				troops =
				{
					light_cavalry = { 400 400 }
					light_infantry = { 100 100 }
					heavy_infantry = { 300 300 }
					pikemen = { 100 100 }
					archers = { 100 100 }
				}
				attrition = 0.0
		}
	}
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.12 #Force charlemagne to attack lombardy and bavaria
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		NOT = { has_global_flag = force_charlemagne }
		NOT = { year = 820 }
		year = 774
		has_character_flag = is_charlemagne
		ai = yes
		has_landed_title = k_saxony
		has_landed_title = k_france
		has_landed_title = k_lotharingia
		NOT = { has_landed_title = k_italy }
		religion = catholic
	}
    immediate = {
		set_global_flag = force_charlemagne
		wealth = 1000
		remove_trait = stressed
		remove_trait = depressed
		remove_trait = craven
		add_claim = k_italy
		k_italy = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim
					thirdparty_title = PREV
					infamy = 0
				}
			}
		}
		if = {
			limit = { 
				NOT = { has_landed_title = k_bavaria }
			}
			add_claim = k_bavaria
			k_bavaria = {
				holder_scope = {
					reverse_war = {
						target = ROOT
						casus_belli = claim
						thirdparty_title = PREV
						infamy = 0
					}
				}
			}
		}
		spawn_unit = {
			province = 113
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 1500 1500 }
					light_infantry = { 500 500 }
					archers = { 500 500 }
					heavy_infantry = { 2000 2000 }
					pikemen = { 500 500 }
				}
				attrition = 0.0
		}
		spawn_unit = {
			province = 113
			owner = ROOT
			disband_on_peace = yes
				troops =
				{
					light_cavalry = { 1500 1500 }
					light_infantry = { 500 500 }
					archers = { 500 500 }
					heavy_infantry = { 2000 2000 }
					pikemen = { 500 500 }
				}
				attrition = 0.0
		}
	} 
	option = {
		name = OK
	}
}
character_event = {
	id = SEAC.13 #Viking Age Startdate Buffs
	hide_window = yes
	is_triggered_only = yes
	
	trigger = {
		start_date = 867.1.1
		is_save_game = no
		NOT = { has_global_flag = viking_age_buff }
	}
    immediate = {
		set_global_flag = viking_age_buff
		c_7908 = { #Duke Otto
			limit = { 
				ai = yes
			}
			wealth = 2500
			prestige = 1000
			piety = 500
			spawn_unit = {
				province = 258
				owner = THIS
				disband_on_peace = no
					troops =
					{
						light_cavalry = { 700 700 }
						light_infantry = { 300 300 }
						archers = { 300 300 }
						heavy_infantry = { 800 800 }
						pikemen = { 500 500 }
					}
					attrition = 0.0
			}
			remove_trait = content
			remove_trait = slothful
			remove_trait = shy
			add_trait = ambitious
			add_trait = diligent
			add_trait = gregarious
			add_trait = duelist
			remove_trait = tough_soldier
			add_trait = brilliant_strategist
			add_trait = flanker
			add_claim = c_altmark
			add_claim = c_magdeburg
			add_claim = c_verden
			add_claim = c_braunschweig
			add_claim = c_lubeck
			add_claim = c_ostfriesland
			add_claim = k_germany
			change_diplomacy = 10
			change_martial = 5
			change_stewardship = 6
			change_intrigue = 10
			change_learning = 6
			military_techpoints = 200
			economy_techpoints = 200
			culture_techpoints = 200
			health = 1
			add_friend = 90105
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}			
		}
		c_70019 = { #Asturias
			limit = { 
				ai = yes
			}
			wealth = 5000
			prestige = 500
			piety = 250
			d_saxony = { add_law = revoke_title_law_2 cooldown = no opinion_effect = no }
			spawn_unit = {
				province = 156
				owner = THIS
				disband_on_peace = no
					troops =
					{
						light_cavalry = { 500 500 }
						light_infantry = { 350 350 }
						archers = { 350 350 }
						heavy_infantry = { 700 700 }
						pikemen = { 300 300 }
					}
					attrition = 0.0
			}
			remove_trait = cynical
			add_trait = zealous
			change_martial = 4
			change_stewardship = 3
			change_learning = 3
			military_techpoints = 200
			economy_techpoints = 200
			culture_techpoints = 200
			add_claim = c_valladolid
			add_claim = c_castelo_branco
			add_claim = c_coimbra
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
		}
		c_7627 = { #Alfred
			limit = { 
				ai = yes
			}
			wealth = 1000
			prestige = 1200
			piety = 800
			spawn_unit = {
				province = 27
				owner = THIS
				disband_on_peace = no
					troops =
					{
						light_cavalry = { 75 75 }
						light_infantry = { 50 50 }
						archers = { 100 100 }
						heavy_infantry = { 200 200 }
						pikemen = { 75 75 }
					}
					attrition = 0.0
			}
			remove_trait = cynical
			remove_trait = content
			add_trait = zealous
			add_trait = ambitious
			add_trait = organizer
			remove_trait = wroth
			add_trait = patient
			change_diplomacy = 5
			change_martial = 4
			change_stewardship = 3
			change_intrigue = 3
			change_learning = 3
			military_techpoints = 200
			economy_techpoints = 200
			culture_techpoints = 200
			health = 2
			add_claim = c_gloucester
			add_claim = c_wiltshire
			add_claim = c_oxford
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
		}
		c_7853 = { #Pope
			limit = { 
				ai = yes
			}
			wealth = 5000
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
		}
		c_163103 = { #Aella
			limit = { 
				ai = yes
			}
			prestige = 250
			piety = 500
			change_diplomacy = 5
			change_martial = 4
			change_stewardship = 5
			change_intrigue = 2
			change_learning = 5
			remove_trait = cynical
			add_trait = zealous
			add_trait = holy_warrior
			spawn_unit = {
				province = 53
				owner = THIS
				disband_on_peace = yes
					troops =
					{
						light_cavalry = { 600 600 }
						light_infantry = { 400 400 }
						archers = { 400 400 }
						heavy_infantry = { 800 800 }
						pikemen = { 200 200 }
					}
					attrition = 0.0
			}
			add_claim = c_york
			add_claim = c_yoredale
			add_claim = c_leeds
			add_claim = c_hull
			religion_authority = { 
				modifier = baptized_king_to
				years = 200 
			}
		c_73683 = { #Ummayad
			limit = { 
				ai = yes
			}
			decadence = 15
			wealth = -80
			prestige = -20
			piety = -10
		}
	} 
	option = {
		name = OK
	}
}