namespace = Plus

#reserved: Plus.500 to Plus.599

#######################################
# CK2Plus Specific Realm Events
#######################################

### ENGLAND

# If William the Conqueror wins, change k_england's CoA to k_englandnormans's
character_event = {
	id = Plus.500
	desc = "EVTDESC_Plus_500"
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_500"
		k_england = {
			clr_title_flag = england_is_saxon
			set_title_flag = england_is_norman
			add_law = succ_primogeniture
			any_de_jure_vassal_title = {
				limit = {
					holder_scope = { vassal_of = ROOT }
					has_law = succ_feudal_elective
				}
				add_law = succ_primogeniture
			}
		}
		any_realm_character = {
			limit = {
				culture = saxon
				has_claim = k_england
			}
			if = {
				limit = { has_weak_claim = k_england }
				remove_claim = k_england
			}
			if = {
				limit = { has_strong_claim = k_england }
				remove_claim = k_england
				add_weak_pressed_claim = k_england
			}
		}
        hidden_tooltip = {
			k_england = { set_coa = k_england_norman }
			d_canterbury = { set_coa = d_canterbury_norman }
			d_cornwall = { set_coa = d_cornwall_norman }
			d_gloucester = { set_coa = d_gloucester_norman }
			d_hereford = { set_coa = d_hereford_norman }
			d_lancaster = { set_coa = d_lancaster_norman }
			d_norfolk = { set_coa = d_norfolk_norman }
			d_oxford = { set_coa = d_oxford_norman }
			d_somerset = { set_coa = d_somerset_norman }
			d_york = { set_coa = d_york_norman }
		}
	}
}

# If Harald Hardrada wins, change k_england's CoA to k_englandnorwegian's
character_event = {
	id = Plus.501
	desc = "EVTDESC_Plus_501"
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_500"
		k_england = {
			clr_title_flag = england_is_saxon
			set_title_flag = england_is_norwegian
			add_law = succ_gavelkind
			any_de_jure_vassal_title = {
				limit = {
					holder_scope = { vassal_of = ROOT }
					has_law = succ_feudal_elective
				}
				add_law = succ_gavelkind
			}
		}
		any_realm_character = {
			limit = {
				culture = saxon
				has_claim = k_england
			}
			if = {
				limit = { has_weak_claim = k_england }
				remove_claim = k_england
			}
			if = {
				limit = { has_strong_claim = k_england }
				remove_claim = k_england
				add_weak_pressed_claim = k_england
			}
		}
        hidden_tooltip = {  
			k_england = {
				set_coa = k_englandnorwegian
			}
		}
	}
}

# Danish invasion of England
character_event = {
	id = Plus.543
	desc = "EVTDESC_Plus_543"
	picture = "GFX_evt_crusaders"
	border = GFX_event_normal_frame_war
	
	is_triggered_only = yes
	
	only_independent = yes
	only_rulers = yes
	min_age = 16
	has_character_flag = millenium_england_invasion
	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		has_landed_title = k_denmark
		k_england = { has_holder = yes }
		NOR = {
			has_landed_title = k_england
			religion_group = muslim
			is_pagan_religion = yes
			has_character_flag = millenium_england_invasion_done
		}
	}

	immediate = {
		set_character_flag = millenium_england_invasion_done
		add_claim = k_england
		add_claim = d_bedford
		add_claim = d_norfolk
		add_claim = c_middlesex
		add_claim = c_essex
		add_claim = c_bedford
		add_claim = c_norfolk
		add_claim = c_suffolk
	}

	option = {
		name = "EVTOPTA_Plus_543" #To the longships!
		ai_chance = {
			factor = 1
		}
		wealth = 300
		prestige = 100
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 25
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 33
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 29
		}
		spawn_fleet = {
			province = closest # closest sea zone
			owner = ROOT
			disband_on_peace = yes
			troops = {
				galleys = { 150 150 }
			}
		}
		k_england = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
				ROOT = {
					spawn_unit = {
						province = 266
						home = 266
						owner = THIS
						leader = THIS
						match_character = PREV
						match_mult = 0.2
						match_min = 300
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
					spawn_unit = {
						province = 266
						home = 266
						owner = THIS
						leader = THIS
						match_character = PREV
						match_mult = 0.2
						match_min = 300
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
					spawn_unit = {
						province = 266
						home = 266
						owner = THIS
						leader = THIS
						match_character = PREV
						match_mult = 0.2
						match_min = 300
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
					spawn_unit = {
						province = 266
						home = 266
						owner = THIS
						match_character = PREV
						match_mult = 0.2
						match_min = 300
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
				}
			}
		}
	}
	option = {
		name = "EVTOPTB_Plus_543" #I've changed my mind
		ai_chance = {
			factor = 0
		}
		remove_claim = k_england
		remove_claim = d_bedford
		remove_claim = d_norfolk
		remove_claim = c_middlesex
		remove_claim = c_essex
		remove_claim = c_bedford
		remove_claim = c_norfolk
		remove_claim = c_suffolk
		prestige = -500
		remove_trait = brave
		add_trait = craven
	}
}

# England informed of coming Danish invasion
character_event = {
	id = Plus.544 #formerly 90009021
	desc = "EVTDESC_Plus_544"
	picture = GFX_evt_crusaders
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = CURSES
	}
}

### NORMANDY

# Special event for Neustria to be renamed to Normandy
character_event = {
	id = Plus.503
	title = EVTNAME_Plus_503
	desc = EVTDESC_Plus_503

	picture = GFX_evt_council
	border = GFX_event_normal_frame_diplomacy
	
	is_triggered_only = yes

	only_playable = yes
	only_rulers = yes

	trigger = {
		has_landed_title = d_normandy
		OR = {
			culture = norse
			culture = norman
		}
		NOT = { has_global_flag = neustria_renamed }
	}

	option = {
		name = OK
		set_global_flag = neustria_renamed
		d_normandy = {
			set_name=""
			adjective=""
		}
	}
}

### ITALY / SICILY

# Christians lament the fall of Sicily and pleads for assistance in the peninsula
narrative_event = {
	id = Plus.504 #formerly 1000182648
	title = EVTNAME_Plus_504
	desc = EVTDESC_Plus_504
	picture = GFX_evt_heretic
	border = GFX_event_narrative_frame_religion
	
	is_triggered_only = yes
	
	option = {
		trigger = {
			religion_group = christian
		}
		name = EVTOPTA_Plus_504
	}
	option = {
		trigger = {
			NOT = { religion_group = christian }
		}
		name = EVTOPTA_Plus_504
	}	
}

# The pope has found his champions
character_event = {
	id = Plus.505 #formerly 1000182649
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		if = {
			limit = {
				NOT = { has_global_flag = neustria_renamed }
			}
			random_list = {
				50 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = umbrian
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				40 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = norse
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				3 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = croatian
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				2 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = serbian
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				5 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = greek
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
			}
		}
		if = {
			limit = {
				has_global_flag = neustria_renamed
			}
			random_list = {
				50 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = umbrian
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				40 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = norman
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				3 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = croatian
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				2 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = serbian
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
				5 = {
					create_character = {	
						random_traits = no
						religion = ROOT
						culture = greek
						dynasty = culture
						female = no
						age = 24
						trait = brilliant_strategist
						trait = holy_warrior
						trait = strong
						trait = zealous
						trait = gregarious
						attributes = {
							martial = 8
							diplomacy = 5
							stewardship = 5
							learning = 5
							intrigue = 5
						}
					}
				}
			}			
		}
		new_character = {
			opinion = {
				who = FROM
				modifier = papal_champion
				months = 360
			}
			religion_head = {
				opinion = {
					who = PREV
					modifier = my_champion
					months = 360
				}			
			}
			if = {
				limit = {
					d_benevento = {
						OR = {
							owner = {
								NOT = { religion_group = christian }
							}
							has_holder = no
						}
					}
				}
				add_pressed_claim = "d_benevento"				
			}
			if = {
				limit = {
					d_apulia = {
						OR = {
							owner = {
								NOT = { religion_group = christian }
							}
							has_holder = no
						}
					}
				}
				add_pressed_claim = "d_apulia"				
			}
			if = {
				limit = {
					d_capua = {
						OR = {
							owner = {
								NOT = { religion_group = christian }
							}
							has_holder = no
						}
					}
				}
				add_pressed_claim = "d_capua"				
			}
			b_tivoli = {
				gain_title = PREV # Temporarily give them a castle so they won't go republic or theocracy if they win against one of those
			}
			set_character_flag = duchy_adventurer
			add_character_modifier = {
				name = italian_reconquest
				hidden = yes
				duration = -1
				inherit = yes
			}
			set_defacto_liege = THIS
			create_title = {
				tier = DUKE
				landless = yes
				temporary = yes
				culture = THIS
				name = "CLAIMANT_ADVENTURE"
				holder = THIS
				ruler = "LORD"
				ruler_female = "LADY"
			}
			spawn_unit = {
				province = 333
				home = 333
				owner = THIS
				leader = THIS
				match_character = ROOT
				match_mult = 0.2
				match_min = 4000
				match_max = 5000
				attrition = 0.25
				earmark = claimant_adventure
				cannot_inherit = yes
			}
			character_event = { id = Plus.506 } 
		}
	}
}

# The champions head out
character_event = {
	id = Plus.506 #formerly 1000182650
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {
		ROOT = {
			# Create some decent commander characters
			create_random_soldier = {
				random_traits = yes
				dynasty = culture
				religion = ROOT
				culture = THIS
				female = no
				age = 30
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = culture
				religion = ROOT
				culture = THIS
				female = no
				age = 25
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = culture	
				religion = ROOT
				culture = THIS
				female = no
				age = 33
			}
			create_random_soldier = {
				random_traits = yes
				dynasty = culture
				religion = ROOT
				culture = THIS
				female = no
				age = 29
			}			
			random_claim = {
				holder_scope = {
					reverse_war = {
						target = ROOT
						casus_belli = italian_reconquest
						thirdparty_title = PREV
						infamy = 0
					}
					if = {
						limit = {
							ai = no # Give the Invaders a boost if targetting players, as players are better at handling the invasion
						}
						ROOT = {
							spawn_unit = {
								province = 333
								home = 333
								owner = THIS
								leader = THIS
								match_character = ROOT
								match_mult = 0.2
								match_min = 2000
								match_max = 3000
								attrition = 0.25
								earmark = claimant_adventure
								cannot_inherit = yes
							}						
						}
					}
				}
			}
		}
		any_playable_ruler = {
			if = {
				limit = { religion_group = christian }
				if = {
					limit = { ROOT = { is_italian_trigger = yes } }
					narrative_event = { id = Plus.509 } 
				}
				if = {
					limit = { ROOT = { culture = norse } }
					narrative_event = { id = Plus.511 } 
				}	
				if = {
					limit = { ROOT = { culture = norman } }
					narrative_event = { id = Plus.512 } 
				}
				if = {
					limit = { ROOT = { culture = croatian } }
					narrative_event = { id = Plus.513 } 
				}
				if = {
					limit = { ROOT = { culture = serbian } }
					narrative_event = { id = Plus.514 } 
				}	
				if = {
					limit = { ROOT = { culture = greek } }
					narrative_event = { id = Plus.515 } 
				}
			}
		}
	}
}

# The pope helps on the offensive!
character_event = { 
	id = Plus.507 #formerly 1000182687
	
	is_triggered_only = yes
	hide_window = yes
 
	immediate = {
		religion_head = {
			join_attacker_wars = FROM
		}
	}
}

# The pope helps on the defensive!
character_event = { 
	id = Plus.508 #formerly 1000182688
	
	hide_window = yes
	is_triggered_only = yes
	
	only_playable = yes
	only_men = yes
	min_age = 16
	war = yes
	
	trigger = {
		has_global_flag = italian_reconquest_started
		has_character_modifier = italian_reconquest
		NOR = { 
			has_global_flag = italian_rec_success
			has_global_flag = italian_rec_failure
		}
		OR = {
			is_feudal = yes
			is_tribal = yes
		}
	}
 
	immediate = {
		religion_head = {
			join_defender_wars = ROOT
		}
	}
}

# The Champions head out, Italian (Narrative event)
narrative_event = { 
	id = Plus.509 #formerly 1000182689
	title = EVTNAME_Plus_509
	desc = EVTDESC_Plus_509
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy	
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The King of Sicily is Crowned
narrative_event = { 
	id = Plus.510 #formerly 1000182690
	title = EVTNAME_Plus_510
	desc = EVTDESC_Plus_510
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy	
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The Champions head out, Norse (Narrative event)
narrative_event = { 
	id = Plus.511 #formerly 1000182691
	title = EVTNAME_Plus_509
	desc = EVTDESC_Plus_511
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy	
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The Champions head out, Norman (Narrative event)
narrative_event = { 
	id = Plus.512 #formerly 1000182692
	title = EVTNAME_Plus_509
	desc = EVTDESC_Plus_512
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy	
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The Champions head out, Croatian (Narrative event)
narrative_event = { 
	id = Plus.513 #formerly 1000182693
	title = EVTNAME_Plus_509
	desc = EVTDESC_Plus_513
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The Champions head out, Serbian (Narrative event)
narrative_event = { 
	id = Plus.514 #formerly 1000182694
	title = EVTNAME_Plus_509
	desc = EVTDESC_Plus_514
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy	
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The Champions head out, Greek (Narrative event)
narrative_event = { 
	id = Plus.515 #formerly 1000182695
	title = EVTNAME_Plus_509
	desc = EVTDESC_Plus_515
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_509
	}
}

# The King of Sicily is Crowned (Recipient)
narrative_event = { 
	id = Plus.516 #formerly 1000182696
	title = EVTNAME_Plus_516
	desc = EVTDESC_Plus_516
	picture = GFX_evt_pope
	border = GFX_event_narrative_frame_diplomacy
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_516
		hidden_tooltip = {
			disband_event_forces = yes
		}
	}
}

# The Invasion Fails
narrative_event = { 
	id = Plus.517 #formerly 1000182697
	title = EVTNAME_Plus_517
	desc = EVTDESC_Plus_517
	picture = GFX_evt_rome_falls
	border = GFX_event_narrative_frame_diplomacy
	
	is_triggered_only = yes
	hide_from = yes
	
	option = {
		trigger = {
			religion_group = christian
		}
		name = EVTOPTA_Plus_517
	}
	option = {
		trigger = {
			NOT = { religion_group = christian }
		}
		name = EVTOPTB_Plus_517
	}
}

# Maintenance Check for Failed Invasion (landless or vassal invaders)
character_event = { 
	id = Plus.518 #formerly 1000182698
	
	hide_window = yes
	is_triggered_only = yes

	has_global_flag = first_war_success	
	min_age = 16
	only_men = yes
	war = no	
	
	trigger = {
		has_global_flag = italian_reconquest_started
		has_character_modifier = italian_reconquest
		NOR = { 
			has_global_flag = italian_rec_success
			has_global_flag = italian_rec_failure
		}
		OR = {
			independent = no
			is_ruler = no
		}
	}

	immediate = {
		remove_character_modifier = italian_reconquest
		religion_head = {
			remove_opinion = {
				who = ROOT
				modifier = my_champion
			}
		}
		set_global_flag = italian_rec_failure
		any_playable_ruler = { narrative_event = { id = Plus.517 } }
	}
}

# Maintenance Check, Start the invasion
character_event = { 
	id = Plus.519 #formerly 1000182699
	
	hide_window = yes

	has_global_flag = italian_reconquest_planning
	religion = catholic
	min_age = 16
	only_men = yes
	
	
	trigger = {
		NOT = { has_global_flag = italian_reconquest_started }
		has_landed_title = k_papal_state
		has_character_modifier = italian_reconquest_pope
		NOR = {
			c_benevento = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_foggia = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_capua = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_napoli = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_apulia = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_bari = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_lecce = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_salerno = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_taranto = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_amalfi = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_consenza = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_reggio = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_palermo = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_messina = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_siracusa = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_agrigento = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_trapani = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}
			c_malta = {
				holder_scope = {
					top_liege = {
						has_character_modifier = holy_truce_timer
					}
				}
			}			
		}
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	immediate = {
		remove_character_modifier = italian_reconquest_pope
		set_global_flag = italian_reconquest_started
		character_event = { id = Plus.505 }
		character_event = { id = Plus.508 }
	}
}

### ALBANIA

# Albanian culture arises
province_event = {
	id = Plus.520 #formerly 1000183181
	
	hide_window = yes
	
	trigger = {
		NOT = { culture = arberian }
		culture_group = byzantine
		OR = {
			province_id = 470
			province_id = 1610
		}
		year = 1000
	}
	
	mean_time_to_happen = {
		months = 550
	}
	
	immediate = {
		culture = arberian
		c_dyrrachion = {
			holder_scope = { character_event = { id = Plus.521 } }
		}
	}
}

# Owner informed of Albanian culture
character_event = {
	id = Plus.521 #formerly 1000183182
	title = EVTNAME_Plus_521
	desc = EVTDESC_Plus_521
	picture = GFX_evt_stone_church
	border = GFX_event_normal_frame_diplomacy
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA_Plus_521"
		prestige = 50
	}
	
	option = {
		name = "EVTOPTB_Plus_521"
		culture = arberian
		prestige = -200
	}
}

# Special event to create Albania -- triggered by decision: create_kingdomofalbania
narrative_event = {
	id = Plus.522 #formerly 1000183183
	title = "EVTNAME_Plus_522"
	desc = "EVTDESC_Plus_522"	
	picture = GFX_evt_albania
	border = GFX_event_narrative_frame_diplomacy
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA_Plus_522"
		k_albania = { grant_title = ROOT }
		d_albania = { de_jure_liege = k_albania }
		c_dyrrachion = { de_jure_liege = d_albania }
		c_valona = { de_jure_liege = d_albania }
		d_dyrrachion = { holder_scope = { add_claim = c_dyrrachion } }
		d_dyrrachion = { holder_scope = { add_claim = c_valona } }
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					NOT = { has_landed_title = k_albania }
					ai = no
				}
				narrative_event = { id = Plus.523 }
			}
		}
	}
}

# Informed about the Creation of Albania
narrative_event = {
	id = Plus.523
	title = "EVTNAME_Plus_523"
	desc = "EVTDESC_Plus_523"	
	picture = GFX_evt_albania
	border = GFX_event_narrative_frame_diplomacy
	
	is_triggered_only = yes
	
	option = {
		name = "EVTOPTA_Plus_523"
	}
}

### BOHEMIA

# Duke of Bohemia responds to Boleslaw conquering Moravia
character_event = {
	id = Plus.524 #formerly 90009009
	desc = "EVTDESC_Plus_524"
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_524"
		set_defacto_liege = e_hre
		pf_liege_change_effect = yes
		prestige = -100
		k_bohemia = {
			de_jure_liege = e_hre
		}
		ai_chance = {
			factor = 70
		}
	}

	option = {
		name = "EVTOPTB_Plus_524"
		prestige = 10
		ai_chance = {
			factor = 30
		}
	}
}

### BYZANTIUM / BULGARIA

# Byzantine Emperor conquers Bulgaria (flag set in history file -- only valid between 998 and 1018 )
character_event = {
	id = Plus.535
	desc = "EVTDESC_Plus_535"
	picture = GFX_evt_throne_room
	
	is_triggered_only = yes

	has_global_flag = byz_bul_prev	
	only_independent = yes
	only_playable = yes

	trigger = {
		has_landed_title = e_byzantium
		has_landed_title = k_bulgaria
		NOR = {
			culture = bulgarian
			has_global_flag = byz_bul
		}
	}
	
	immediate = {
		set_global_flag = byz_bul
	}

	option = {
		name = "EVTOPTA_Plus_535"
		give_nickname = nick_the_bulgar_slayer
		prestige = 100
		k_bulgaria = {
			destroy_landed_title = THIS
		}
	}
}

# Bulgaria is not conquered by the Byzantines (flag set in history file -- only valid between 998 and 1018 )
character_event = {
	id = Plus.536
	desc = "EVTDESC_Plus_536"
	picture = GFX_evt_throne_room
	
	is_triggered_only = yes

	has_global_flag = byz_bul_prev	
	only_independent = yes
	only_playable = yes

	trigger = {
		has_landed_title = k_bulgaria
		NOT = { has_landed_title = e_byzantium }
		war = no
		NOT = { has_global_flag = byz_bul }
	}

	immediate = {
		set_global_flag = byz_bul
	}

	option = {
		name = "EVTOPTA_Plus_536" #Take them down
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0
				NOT = { trait = ambitious }
			}
		}
		give_nickname = nick_the_victorious
		prestige = 300
		add_claim = e_byzantium
		add_claim = d_thrace
		e_byzantium = {
			holder_scope = {
				prestige = -500
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		spawn_unit = {
			province = 507 #Nikopolis
			owner = ROOT
			disband_on_peace = yes
			troops = {
				light_cavalry = { 1000 1000 }
				light_infantry = { 300 300 }
				heavy_infantry = { 200 200 }
			}
		}
		spawn_unit = {
			province = 507 #Nikopolis
			owner = ROOT
			disband_on_peace = yes
			troops = {
				light_cavalry = { 1000 1000 }
				light_infantry = { 300 300 }
				heavy_infantry = { 200 200 }
			}
		}
		spawn_unit = {
			province = 507 #Nikopolis
			owner = ROOT
			disband_on_peace = yes
			troops = {
				knights = { 1000 1000 }
			}
		}
	}
	option = {
		name = "EVTOPTB_Plus_536" #Macedonia will be more than enough
		ai_chance = {
			factor = 30
		}
		add_claim = d_epirus
		add_claim = d_thessalonika
		e_byzantium = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim_all
					thirdparty_title = PREV
				}
			}
		}
		spawn_unit = {
			province = 471 #Ohrid
			owner = ROOT
			disband_on_peace = yes
			troops = {
				light_cavalry = { 1000 1000 }
				light_infantry = { 300 300 }
				heavy_infantry = { 200 200 }
			}
		}
		spawn_unit = {
			province = 471 #Ohrid
			owner = ROOT
			disband_on_peace = yes
			troops = {
				light_cavalry = { 1000 1000 }
				light_infantry = { 300 300 }
				heavy_infantry = { 200 200 }
			}
		}
		spawn_unit = {
			province = 471 #Ohrid
			owner = ROOT
			disband_on_peace = yes
			troops = {
				knights = { 1000 1000 }
			}
		}
	}
	option = {
		name = "EVTOPTC_Plus_536" #We should be grateful for what we have
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				NOT = { trait = ambitious }
			}
		}
		prestige = -100
	}
}

### SWEDEN

# Sigfrid Arrives to convert norse pagans
character_event = {
	id = Plus.537
	desc = "EVTDESC_Plus_537"
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	
	only_playable = yes
	religion_group = pagan_group
	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		year = 1004
		NOT = { year = 1030 }
		OR = {
			has_landed_title = k_sweden
			AND = {
				k_sweden = { has_holder = no }
				has_landed_title = d_uppland
			}
		}
		NOT = { has_global_flag = sigfrid_arrived }
		NOT = { k_papal_state = { has_title_flag = schism_happened } }
	}

	option = {
		name = "EVTOPTA_Plus_537" #What can I do?
		custom_tooltip = { text = preacher_allowed }
		set_global_flag = sigfrid_arrived
		create_random_priest = {
			random_traits = no
			dynasty = 1000124226
			name = "Siegfried"
			culture = norse
			religion = chalcedonian
			female = no
			age = 30
			attributes = {
				diplomacy = 8
				stewardship = 2
				intrigue = 2
				martial = 1
				learning = 10
			}
			trait = mastermind_theologian
			trait = patient
			trait = zealous
			trait = humble
			trait = just
			trait = monk
		}
		new_character = {
			set_character_flag = sigfrid_of_sweden
		}
	}
}

# Sigfrid tries to convert Olofr
character_event = {
	id = Plus.538
	desc = "EVTDESC_Plus_538"
	picture = GFX_evt_heretic
	border = GFX_event_normal_frame_religion
	
	only_playable = yes
	religion_group = pagan_group
	war = no

	trigger = {
		OR = {
			has_landed_title = k_sweden
			AND = {
				k_sweden = { has_holder = no }
				has_landed_title = d_uppland
			}
		}
		any_courtier = {
			has_character_flag = sigfrid_of_sweden
			religion = chalcedonian
			prisoner = no
			NOT = { trait = incapable }
		}
	}
	
	mean_time_to_happen = {
		months = 40

		modifier = {
			factor = 1.25
			NOT = { learning = 2 }
		}
		modifier = {
			factor = 1.25
			NOT = { learning = 3 }
		}
		modifier = {
			factor = 1.25
			NOT = { learning = 4 }
		}
		modifier = {
			factor = 1.25
			NOT = { learning = 5 }
		}
		modifier = {
			factor = 0.75
			learning = 10
		}
		modifier = {
			factor = 0.75
			learning = 11
		}
		modifier = {
			factor = 0.75
			learning = 12
		}
		modifier = {
			factor = 0.75
			learning = 13
		}
	}

	option = {
		name = "EVTOPTA_Plus_538" #convert
		ai_chance = {
			factor = 50
			modifier = {
				factor = 3
				trait = cynical
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
		}
		piety = -100
		random_courtier = {
			limit = { has_character_flag = sigfrid_of_sweden }
			clr_character_flag = sigfrid_of_sweden
			add_friend = ROOT
		}
		any_courtier = {
			limit = {
				culture = ROOT
				religion = ROOT
				dynasty = ROOT
			}
			religion = chalcedonian
		}
		any_spouse = {
			limit = {
				culture = ROOT
				religion = ROOT
				dynasty = ROOT
				is_consort = no
			}
			religion = chalcedonian
		}
		religion = chalcedonian
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					ROOT = { has_landed_title = k_sweden }
					NOT = { character = ROOT }
					ai = no
				}
				narrative_event = { id = Plus.539 }
			}
		}
	}
	option = {
		name = "EVTOPTB_Plus_538" #We shall bow to no one!
		ai_chance = {
			factor = 50
			modifier = {
				factor = 5
				trait = zealous
			}
			modifier = {
				factor = 5
				OR = {
					controls_religion = yes
					rightful_religious_head = ROOT
					any_vassal = { controls_religion = yes }
					any_vassal = { rightful_religious_head = ROOT }
				}
			}
			modifier = {
				factor = 5
				is_reformed_pagan_religion = yes
			}
		}
		prestige = -100
		random_courtier = {
			limit = { has_character_flag = sigfrid_of_sweden }
			clr_character_flag = sigfrid_of_sweden
			add_rival = ROOT
		}		
		any_courtier = {
			limit = {
				religion = chalcedonian
				prisoner = no
				NOT = { dynasty = ROOT }
				NOT = { is_close_relative = ROOT }
			}
			imprison = ROOT
		}
	}
}

# Informed about the conversion
narrative_event = {
	id = Plus.539
	title = "EVTNAME_Plus_539"
	desc = "EVTDESC_Plus_539"
	picture = GFX_evt_council
	border = GFX_event_narrative_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_539"
	}
}

### NORWAY

# Olafr den Helige begins adventure claim for Norway
character_event = {
	id = Plus.545

	hide_window = yes
	
	culture = norse
	min_age = 16
	capable_only = yes
	has_character_flag = olafr_den_helige
	prisoner = no

	trigger = {
		is_ruler = no
		in_command_trigger = no
		k_norway = {
			has_holder = yes
			holder_scope = {
				NOT = { has_character_flag = sveinn_forkbeard }
			}
		}
		NOT = { has_global_flag = yngling_reconquest }
	}

	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 0.5
			trait = envious
		}
		modifier = {
			factor = 0.5
			has_character_flag = flag_denied_title
		}
		modifier = {
			factor = 0.75
			diplomacy = 12
		}
		modifier = {
			factor = 0.75
			trait = brave
		}
		modifier = {
			factor = 0.85
			trait = proud
		}
		modifier = {
			factor = 1.5
			trait = slothful
		}
		modifier = {
			factor = 1.5
			trait = humble
		}
		modifier = {
			factor = 2.0
			trait = kind
		}
	}

	immediate = {
		set_global_flag = yngling_reconquest
		wealth = 500
		prestige = 300
		create_title = {
			tier = DUKE
			landless = yes
			temporary = yes
			culture = ROOT
			name = "CLAIMANT_ADVENTURE"
			holder = ROOT
			ruler = "LORD"
			ruler_female = "LADY"
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 30
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 25
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 33
		}
		create_random_soldier = {
			random_traits = yes
			dynasty = none
			religion = ROOT
			culture = ROOT
			female = no
			age = 29
		}
		k_norway = {
			holder_scope = {
				reverse_war = {
					target = ROOT
					casus_belli = claim
					thirdparty_title = PREV
					infamy = 0
				}
				ROOT = {
					spawn_unit = {
						province = 43
						home = 43
						owner = THIS
						leader = THIS
						match_character = PREV
						match_mult = 0.7
						match_min = 1500
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
					spawn_unit = {
						province = 43
						home = 43
						owner = THIS
						leader = THIS
						match_character = PREV
						match_mult = 0.7
						match_min = 1500
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
					spawn_unit = {
						province = 43
						home = 43
						owner = THIS
						leader = THIS
						match_character = PREV
						match_mult = 0.7
						match_min = 1500
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
					spawn_unit = {
						province = 43
						home = 43
						owner = THIS
						match_character = PREV
						match_mult = 0.7
						match_min = 1500
						match_max = 5000
						attrition = 0.25
						disband_on_peace = yes
					}
				}
				hidden_tooltip = {
					character_event = { id = Plus.546 days = 1 }
				}
			}
		}
		spawn_fleet = {
			province = closest # closest sea zone
			owner = ROOT
			disband_on_peace = yes
			troops = {
				galleys = { 150 150 }
			}
		}
	}
}

# Informed of impending Olafr den Helige invasion
character_event = {
	id = Plus.546
	desc = "EVTDESC_Plus_545"
	picture = GFX_evt_crusaders
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = CURSES
	}
}

### PAPAL EVENTS

# Rightful religion head is declared war upon by a member of their own religion
character_event = {
	id = Plus.548
	
	hide_window = yes
	is_triggered_only = yes
	
	only_playable = yes
	religion_group = christian
	
	trigger = {
		OR = {
			controls_religion = yes
			rightful_religious_head = ROOT
		}
		is_theocracy = yes
		can_excommunicate_trigger = yes
		is_primary_war_defender = yes
		any_current_enemy = {
			religion = ROOT
			is_primary_war_attacker = yes
			rightful_religious_head = ROOT
			NOT = { trait = excommunicated }
		}
	}

	immediate = {
		random_current_enemy = {
			limit = {
				religion = ROOT
				is_primary_war_attacker = yes
				rightful_religious_head = ROOT
				NOT = { trait = excommunicated }
			}
			add_trait = excommunicated
			character_event = { id = Plus.549 }
		}
	}
}

# Ruler attacking religious head is excommunicated
character_event = {
	id = Plus.549
	desc = EVTDESC_Plus_549
	picture = GFX_evt_pope
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_549
		tooltip = { add_trait = excommunicated }
		add_rival = FROM
		any_vassal = {
			limit = {
				religion = FROM
				rightful_religious_head = FROM
				is_adult = yes
				NOT = { trait = cynical }
				NOT = { trait = incapable }
				OR = {
					trait = zealous
					opinion_diff = { first = FROM second = ROOT value = 25 }
				}
			}
			opinion = { who = ROOT modifier = opinion_outraged years = 5 }
		}
	}
}

# Other rulers respond to the attack on the religion head
character_event = {
	id = Plus.550
	desc = EVTDESC_Plus_550
	picture = GFX_evt_emissary
	border = GFX_event_normal_frame_war
	
	only_playable = yes
	religion_group = christian
	min_age = 16
	capable_only = yes
	prisoner = no
	war = no
	
	trigger = {
		demesne_size = 1
		OR = {
			independent = yes
			liege = { war = no }
		}
		rightful_religious_head_scope = {
			war = yes
			is_primary_war_defender = yes	
			OR = {
				controls_religion = yes
				ROOT = { NOT = { religion_head = { always = yes } } }
			}
			NOR = {
				is_liege_of = ROOT
				has_opinion_modifier = { who = ROOT modifier = opinion_disappointed }
				character = ROOT
				reverse_has_truce = ROOT
				is_foe = ROOT
			}
			any_war = {
				war_score = 0
				defender = { character = PREVPREV }
				attacker = {
					NOR = {
						is_liege_or_above = ROOT
						has_non_aggression_pact_with = ROOT
						is_allied_with = ROOT
						is_friend = ROOT
						reverse_has_truce = ROOT
					}
				}
				OR = {
					using_cb = claim_all
					using_cb = claim
					using_cb = other_claim
					using_cb = tribal_invasion
					using_cb = overthrow_ruler
					using_cb = coastal_republic
					using_cb = viking_invasion
					using_cb = peasant_revolt
					using_cb = heretic_revolt
					using_cb = religious_revolt
					using_cb = liberation_revolt
					using_cb = duchy_adventure
					using_cb = pagan_county_conquest
					using_cb = dejure_county_claim
					using_cb = dejure_barony_claim
					using_cb = other_dejure_county_claim
					using_cb = tributary_cb
					using_cb = dejure_duchy_claim
					using_cb = cb_faction_overthrow_ruler
					attacker = { rightful_religious_head = PREVPREV }
				}
			}
		}
		NOR = {
			controls_religion = yes
			rightful_religious_head = ROOT
			trait = cynical
			is_inaccessible_trigger = yes
		}
		OR = {
			NOT = { has_character_flag = helped_religious_head }
			had_character_flag = { flag = helped_religious_head days = 1825 }
		}
	}
	
	mean_time_to_happen = {
		months = 3
		modifier = {
			factor = 0.5
			trait = zealous
		}
		modifier = {
			factor = 0.5
			trait = excommunicated
		}
		modifier = {
			factor = 1.5
			trait = slothful
		}
		modifier = {
			factor = 1.5
			trait = greedy
		}
		modifier = {
			factor = 0.5
			rightful_religious_head_scope = {
				any_war = {
					defender = { character = PREVPREV }
					war_score = 15
				}
			}
		}
		modifier = {
			factor = 2.0
			NOT = {
				rightful_religious_head_scope = {
					any_war = {
						defender = { character = PREVPREV }
						war_score = 1
					}
				}
			}
		}
		modifier = {
			factor = 0.5
			rightful_religious_head_scope = {
				OR = {
					is_allied_with = ROOT
					is_friend = ROOT
				}
			}
		}
		modifier = {
			factor = 0.5
			event_target:relhead_enemy = { is_foe = ROOT }
		}
		modifier = {
			factor = 0.5
			rightful_religious_head_scope = {
				capital_scope = {
					ROOT = { capital_scope = { NOT = { distance = { where = PREVPREV value = 75 } } } }
				}
			}
		}
		modifier = {
			factor = 2
			rightful_religious_head_scope = {
				capital_scope = {
					ROOT = { capital_scope = { distance = { where = PREVPREV value = 200 } } }
				}
			}
		}
		modifier = {
			factor = 2
			rightful_religious_head_scope = {
				capital_scope = {
					ROOT = { capital_scope = { distance = { where = PREVPREV value = 300 } } }
				}
			}
		}
		modifier = {
			factor = 2
			rightful_religious_head_scope = {
				capital_scope = {
					ROOT = { capital_scope = { distance = { where = PREVPREV value = 400 } } }
				}
			}
		}
	}
	
	immediate = {
		set_character_flag = helped_religious_head
		rightful_religious_head_scope = {
			save_event_target_as = rightful_relhead
			random_current_enemy = {
				limit = {
					is_primary_war_attacker = yes
					NOR = {
						is_liege_or_above = ROOT
						has_non_aggression_pact_with = ROOT
						is_allied_with = ROOT
						is_friend = ROOT
						reverse_has_truce = ROOT
					}
					any_war = {
						war_score = 0
						defender = { character = PREVPREVPREV }
						attacker = { character = PREVPREV }
						OR = {
							using_cb = claim_all
							using_cb = claim
							using_cb = other_claim
							using_cb = tribal_invasion
							using_cb = overthrow_ruler
							using_cb = coastal_republic
							using_cb = viking_invasion
							using_cb = peasant_revolt
							using_cb = heretic_revolt
							using_cb = religious_revolt
							using_cb = liberation_revolt
							using_cb = duchy_adventure
							using_cb = pagan_county_conquest
							using_cb = dejure_county_claim
							using_cb = dejure_barony_claim
							using_cb = other_dejure_county_claim
							using_cb = tributary_cb
							using_cb = dejure_duchy_claim
							using_cb = cb_faction_overthrow_ruler
							attacker = { rightful_religious_head = PREVPREVPREV }
						}
					}
				}
				save_event_target_as = relhead_enemy
			}
		}
	}
	
	option = {
		name = EVTOPTA_Plus_550 #We will defend the Pope
		trigger = {
			event_target:relhead_enemy = {
				NOR	= {
					is_liege_or_above = ROOT
					is_vassal_or_below = ROOT
				}
			}
		}
		ai_chance = {
			factor = 20
			modifier = {
				factor = 2
				trait = excommunicated
			}
			modifier = {
				factor = 2
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = cynical
			}
			modifier = {
				factor = 0.5
				trait = craven
			}
			modifier = {
				factor = 1.5
				trait = just
			}
			modifier = {
				factor = 1.5
				trait = content
			}
			modifier = {
				factor = 1.5
				trait = honest
			}
			modifier = {
				factor = 1.1
				trait = chaste
			}
			modifier = {
				factor = 1.1
				trait = humble
			}
			modifier = {
				factor = 1.1
				trait = temperate
			}
			modifier = {
				factor = 1.1
				trait = charitable
			}
			modifier = {
				factor = 1.25
				piety = 500
			}
			modifier = {
				factor = 0.75
				rightful_religious_head_scope = {
					NOR = {
						has_landed_title = k_papal_state
						has_landed_title = k_papal_chalcedon
					}
				}
			}
			modifier = {
				factor = 0
				event_target:relhead_enemy = {
					capital_scope = {
						ROOT = { capital_scope = { distance = { where = PREVPREV value = 200 } } }
					}
				}
				rightful_religious_head_scope = {
					capital_scope = {
						ROOT = { capital_scope = { distance = { where = PREVPREV value = 200 } } }
					}
				}
			}
			modifier = {
				factor = 0.5
				event_target:relhead_enemy = {
					capital_scope = {
						ROOT = { capital_scope = { distance = { where = PREVPREV value = 150 } } }
					}
				}
				rightful_religious_head_scope = {
					capital_scope = {
						ROOT = { capital_scope = { distance = { where = PREVPREV value = 150 } } }
					}
				}
			}
			modifier = {
				factor = 0.5
				event_target:relhead_enemy = {
					capital_scope = {
						ROOT = { capital_scope = { distance = { where = PREVPREV value = 100 } } }
					}
				}
				rightful_religious_head_scope = {
					capital_scope = {
						ROOT = { capital_scope = { distance = { where = PREVPREV value = 100 } } }
					}
				}
			}
			modifier = {
				factor = 0
				NOT = { trait = excommunicated }
				NOT = { trait = zealous }
				NOT = { rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 0 } } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 25 } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 50 } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 75 } }
			}
			modifier = {
				factor = 1.25
				NOT = { event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = -50 } } }
			}
			modifier = {
				factor = 1.25
				NOT = { event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = -75 } } }
			}
			modifier = {
				factor = 0.66
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 25 } }
			}
			modifier = {
				factor = 0.66
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 50 } }
			}
			modifier = {
				factor = 0.66
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 75 } }
			}
		}
		if = {
			limit = { trait = excommunicated }
			remove_trait = excommunicated
		}
		piety = 50
		event_target:rightful_relhead = {
			ROOT = { join_defender_wars = PREV }
		}
		event_target:rightful_relhead = {
			if = {
				limit = { is_friend = ROOT }
				opinion = { who = ROOT modifier = opinion_grateful years = 20 }
			}
			if = {
				limit = { NOT = { is_friend = ROOT } }
				add_friend = ROOT
			}
		}
		event_target:relhead_enemy = {
			opinion = { who = ROOT modifier = opinion_outraged years = 10 }
		}
	}
	option = {
		name = EVTOPTB_Plus_550 #We will send volunteers and donations
		trigger = {
			OR = {
				NOT = {
					event_target:relhead_enemy = {
						capital_scope = {
							ROOT = { capital_scope = { distance = { where = PREVPREV value = 250 } } }
						}
					}
				}
				NOT = {
					rightful_religious_head_scope = {
						capital_scope = {
							ROOT = { capital_scope = { distance = { where = PREVPREV value = 250 } } }
						}
					}
				}
			}
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0.25
				trait = zealous
			}
			modifier = {
				factor = 1.5
				trait = craven
			}
			modifier = {
				factor = 1.25
				trait = just
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = deceitful
			}
			modifier = {
				factor = 1.1
				trait = chaste
			}
			modifier = {
				factor = 1.1
				trait = humble
			}
			modifier = {
				factor = 1.1
				trait = temperate
			}
			modifier = {
				factor = 1.1
				trait = charitable
			}
			modifier = {
				factor = 1.25
				piety = 250
			}
			modifier = {
				factor = 0.5
				OR = {
					NOT = { scaled_wealth = 0.5 }
					has_character_modifier = ai_austerity
				}
			}
			modifier = {
				factor = 1.25
				is_merchant_republic = yes
			}
			modifier = {
				factor = 0.75
				rightful_religious_head_scope = {
					NOR = {
						has_landed_title = k_papal_state
						has_landed_title = k_papal_chalcedon
					}
				}
			}
			modifier = {
				factor = 0.1
				NOT = { trait = excommunicated }
				NOT = { trait = zealous }
				NOT = { rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = -25 } } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 0 } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 25 } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 50 } }
			}
			modifier = {
				factor = 0.5
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 75 } }
			}
			modifier = {
				factor = 0.75
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 25 } }
			}
			modifier = {
				factor = 0.75
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 50 } }
			}
			modifier = {
				factor = 0.75
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 75 } }
			}
		}
		piety = 25
		event_target:rightful_relhead = {
			opinion = { who = ROOT modifier = opinion_grateful years = 10 }
			ROOT = { transfer_scaled_wealth = { to = PREV value = 0.5 } }
		}
		hidden_tooltip = {
			capital_scope = {
				ROOT = {
					rightful_religious_head_scope = {
						spawn_unit =  {
							province = PREVPREV
							home = PREVPREV
							owner = THIS
							match_character = PREV
							match_mult = 0.1
							match_max = 2000
							disband_on_peace = yes
							maintenance_multiplier = 0
						}
					}
				}
			}
		}
		any_realm_province = {
			limit = { owner = { character = ROOT } }
			add_province_modifier = {
				name = adventurer_recruited
				duration = 1000
			}
		}
		event_target:relhead_enemy = {
			opinion = { who = ROOT modifier = opinion_furious years = 5 }
		}
	}
	option = {
		name = EVTOPTD_Plus_550 #We will send donations
		trigger = {
			event_target:relhead_enemy = {
				capital_scope = {
					ROOT = { capital_scope = { distance = { where = PREVPREV value = 250 } } }
				}
			}
			rightful_religious_head_scope = {
				capital_scope = {
					ROOT = { capital_scope = { distance = { where = PREVPREV value = 250 } } }
				}
			}
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0.25
				trait = zealous
			}
			modifier = {
				factor = 1.5
				trait = craven
			}
			modifier = {
				factor = 1.25
				trait = just
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 1.25
				trait = deceitful
			}
			modifier = {
				factor = 1.1
				trait = chaste
			}
			modifier = {
				factor = 1.1
				trait = humble
			}
			modifier = {
				factor = 1.1
				trait = temperate
			}
			modifier = {
				factor = 1.1
				trait = charitable
			}
			modifier = {
				factor = 1.25
				piety = 250
			}
			modifier = {
				factor = 0.5
				OR = {
					NOT = { scaled_wealth = 0.5 }
					has_character_modifier = ai_austerity
				}
			}
			modifier = {
				factor = 1.25
				is_merchant_republic = yes
			}
			modifier = {
				factor = 0.75
				rightful_religious_head_scope = {
					NOR = {
						has_landed_title = k_papal_state
						has_landed_title = k_papal_chalcedon
					}
				}
			}
			modifier = {
				factor = 0.1
				NOT = { trait = excommunicated }
				NOT = { trait = zealous }
				NOT = { rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = -25 } } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 0 } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 25 } }
			}
			modifier = {
				factor = 1.25
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 50 } }
			}
			modifier = {
				factor = 0.5
				rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = 75 } }
			}
			modifier = {
				factor = 0.75
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 25 } }
			}
			modifier = {
				factor = 0.75
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 50 } }
			}
			modifier = {
				factor = 0.75
				event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = 75 } }
			}
		}
		piety = 25
		event_target:rightful_relhead = {
			opinion = { who = ROOT modifier = opinion_grateful years = 10 }
			ROOT = { transfer_scaled_wealth = { to = PREV value = 0.5 } }
		}
		event_target:relhead_enemy = {
			opinion = { who = ROOT modifier = opinion_furious years = 5 }
		}
	}
	option = {
		name = EVTOPTC_Plus_550 #This is not our concern
		ai_chance = {
			factor = 40
			modifier = {
				factor = 0.5
				trait = zealous
			}
			modifier = {
				factor = 0.5
				trait = excommunicated
			}
			modifier = {
				factor = 1.5
				trait = craven
			}
			modifier = {
				factor = 1.25
				trait = arbitrary
			}
			modifier = {
				factor = 1.25
				trait = content
			}
			modifier = {
				factor = 1.1
				trait = lustful
			}
			modifier = {
				factor = 1.1
				trait = proud
			}
			modifier = {
				factor = 1.1
				trait = gluttonous
			}
			modifier = {
				factor = 1.5
				trait = slothful
			}
			modifier = {
				factor = 0.25
				is_theocracy = yes
			}
			modifier = {
				factor = 2
				is_tribal = yes
			}
			modifier = {
				factor = 1.25
				NOT = { rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = -25 } } }
			}
			modifier = {
				factor = 1.25
				NOT = { rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = -50 } } }
			}
			modifier = {
				factor = 1.25
				NOT = { rightful_religious_head_scope = { reverse_opinion = { who = ROOT value = -75 } } }
			}
			modifier = {
				factor = 0.75
				NOT = { event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = -25 } } }
			}
			modifier = {
				factor = 0.75
				NOT = { event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = -50 } } }
			}
			modifier = {
				factor = 0.75
				NOT = { event_target:relhead_enemy = { reverse_opinion = { who = ROOT value = -75 } } }
			}		
		}
		piety = -25
		event_target:rightful_relhead = {
			opinion = { modifier = opinion_disappointed who = ROOT multiplier = 2 years = 10 }
		}
	}
}

### NORSE HOLY ORDERS

# The Br��ralag founded
narrative_event = {
	id = Plus.553 #formerly 1000182569
	title = EVTNAME_Plus_553
	desc = EVTDESC_Plus_553
	picture = GFX_evt_blood_eagle
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	hide_from = yes
	
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					ai = no
					NOT = { character = ROOT }
				}
				narrative_event = { id = Plus.554 }
			}
		}
	}
}

# The player is informed of the Br��ralag
narrative_event = {
	id = Plus.554
	title = EVTNAME_Plus_554
	desc = EVTDESC_Plus_554
	picture = GFX_evt_blood_eagle
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_554
		trigger = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_554
		trigger = {
			NOR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
		}
	}
}

# The Jomsvikings founded
narrative_event = {
	id = Plus.555 #formerly 1000182571
	title = EVTNAME_Plus_555
	desc = EVTDESC_Plus_555
	picture = GFX_evt_blood_eagle
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	hide_from = yes
	
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					ai = no
					NOT = { character = ROOT }
				}
				narrative_event = { id = Plus.556 }
			}
		}
	}
}

# The player is informed of the Jomsvikings
narrative_event = {
	id = Plus.556
	title = EVTNAME_Plus_556
	desc = EVTDESC_Plus_556
	picture = GFX_evt_blood_eagle
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_554
		trigger = {
			OR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
		}
	}
	
	option = {
		name = EVTOPTB_Plus_554
		trigger = {
			NOR = {
				religion = norse_pagan
				religion = norse_pagan_reformed
			}
		}
	}
}

### NEVARRA

# Special event for Pamplona to be renamed to Navarra
character_event = {
	id = Plus.557
	title = EVTNAME_Plus_557
	desc = EVTDESC_Plus_557
	picture = GFX_evt_council
	border = GFX_event_normal_frame_diplomacy
	
	is_triggered_only = yes

	only_playable = yes

	trigger = {
		has_landed_title = k_navarra
		# If the title is being held by a non-basque ruler this will trigger. Alternatively, if the title is
		# not being held as a primary title and not by an emperor, this event will also trigger.
		OR = {
			NOT = { culture = basque }
			AND = {
				tier = KING			
				primary_title = {
					NOT = { title = k_navarra }
				}
			}
		}
		NOT = { has_global_flag = pamplona_renamed }
	}

	option = {
		name = OK
		set_global_flag = pamplona_renamed
		k_navarra = {
			set_name=""
			adjective=""
		}
		hidden_tooltip = { # The tooltip for these two just says the same thing as k_navarra = { ... }
			d_navarra = {
				set_name=""
				adjective=""
			}
			c_navarra = {
				set_name=""
				adjective=""
			}
			152 = {
				set_name=""
			}			
		}		
	}
}

### HARII FORMATION

# The Harii founded
narrative_event = {
	id = Plus.560
	title = EVTNAME_Plus_560
	desc = EVTDESC_Plus_560
	picture = GFX_evt_blood_eagle
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	hide_from = yes
	
	option = {
		name = EXCELLENT
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					ai = no
					NOT = { character = ROOT }
				}
				narrative_event = { id = Plus.561 }
			}
		}
	}
}

# The player is informed of the Harii
narrative_event = {
	id = Plus.561
	title = EVTNAME_Plus_561
	desc = EVTDESC_Plus_561
	picture = GFX_evt_blood_eagle
	border = GFX_event_narrative_frame_war
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_Plus_561
		trigger = {
			OR = {
				religion = german_pagan
				religion = german_pagan_reformed
			}
		}
	}
	
	option = {
		name = EVTOPTB_Plus_554
		trigger = {
			NOR = {
				religion = german_pagan
				religion = german_pagan_reformed
			}
		}
	}
}

### MUSLIM CALIPHATES

# A Muslim dynasty head with low decadence claims the caliphate title
character_event = {
	id = Plus.562
	desc = EVTDESC_Plus_562
	picture = GFX_evt_imam
	border = GFX_event_normal_frame_religion
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			character = FROM
			character = ROOT
			religion = ROOT
			same_realm = ROOT
			same_realm = FROM
		}
	}
	
	option = {
		name = EVTOPTA_Plus_562 # How dare he!
		trigger = { character = ROOT }
		reverse_opinion = { who = FROM modifier = opinion_condemned_decadence multiplier = 2 years = 20 }
	}
	option = {
		name = EVTOPTB_Plus_562 # So must it be
		trigger = { character = FROM }
		reverse_opinion = { who = ROOT modifier = opinion_angry multiplier = 2 years = 20 }
	}
	option = {
		name = EVTOPTC_Plus_562 # He is absolutely right!
		trigger = {
			NOR = {
				character = ROOT
				character = FROM
			}
			religion = ROOT
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 2
				likes_better_than = { who = FROM than = ROOT }
			}
			modifier = {
				factor = 0.5
				likes_better_than = { who = ROOT than = FROM }
			}
			modifier = {
				factor = 4.0
				dynasty = FROM
			}
			modifier = {
				factor = 0.25
				dynasty = ROOT
			}
			modifier = {
				factor = 2.0
				NOT = { dynasty = FROM }
				OR = {
					is_allied_with = FROM
					is_close_relative = FROM
				}
			}
			modifier = {
				factor = 0.5
				NOT = { dynasty = ROOT }
				OR = {
					is_allied_with = ROOT
					is_close_relative = ROOT
				}
			}
			modifier = {
				factor = 0.1
				OR = {
					trait = decadent
					trait = dynasty_decadence_high
				}
			}
			modifier = {
				factor = 0.5
				NOT = { trait = dynasty_decadence_high }
				trait = dynasty_decadence_med
			}
			modifier = {
				factor = 0.25
				trait = humble
			}
			modifier = {
				factor = 0.25
				trait = cynical
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
			modifier = {
				factor = 0.5
				trait = patient
			}
			modifier = {
				factor = 1.5
				trait = diligent
			}
			modifier = {
				factor = 1.5
				trait = wroth
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 2.0
				trait = zealous
			}
		}
		reverse_remove_opinion = { who = ROOT modifier = appreciates_support }
		reverse_remove_opinion = { who = FROM modifier = opinion_disappointed }
		reverse_opinion = { who = ROOT modifier = opinion_angry years = 5 }
		reverse_opinion = { who = FROM modifier = appreciates_support years = 5 }
		hidden_tooltip = {
			opinion = { who = ROOT modifier = opinion_condemned_decadence years = 10 }
		}
	}
	option = {
		name = EVTOPTD_Plus_562 # No, I support the Caliph
		trigger = {
			NOR = {
				character = ROOT
				character = FROM
			}
			religion = ROOT
		}
		ai_chance = {
			factor = 50
		}
		reverse_opinion = { who = ROOT modifier = appreciates_support years = 5 }
		reverse_opinion = { who = FROM modifier = opinion_disappointed years = 5 }
	}
	option = {
		name = EVTOPTE_Plus_562 # This is none of my concern
		trigger = {
			NOR = {
				character = ROOT
				character = FROM
				religion = ROOT
			}
		}
	}
}

### IRELAND

# An Irish duke claims the High King title
character_event = {
	id = Plus.563
	desc = EVTDESC_Plus_563
	picture = GFX_evt_throne_room
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			has_landed_title = k_ireland
			capital_scope = { region = custom_ireland }
		}
		NOT = { character = FROM }
	}
	
	option = {
		name = EVTOPTA_Plus_563
		trigger = { has_landed_title = k_ireland }
		opinion = { who = FROM modifier = opinion_outraged years = 10 }
	}
	option = {
		name = I_SEE
		trigger = { NOT = { has_landed_title = k_ireland } }
	}
}

### ALTAIC TRIBALS

# An Altaic tribal decides to become a nomad
narrative_event = {
	id = Plus.564
	title = EVTNAME_Plus_564
	desc = EVTDESC_Plus_564
	picture = GFX_evt_steppe_mercenaries
	
	is_triggered_only = yes
	major = yes
	
	major_trigger = {
		OR = {
			character = ROOT
			same_realm = ROOT
			AND = {
				ROOT = { independent = yes }
				is_within_diplo_range = ROOT
			}
		}
	}
	
	option = {
		name = EVTOPTA_Plus_564
		trigger = { character = ROOT }
	}
	option = {
		name = I_SEE
		trigger = { NOT = { character = ROOT } }
	}
}

### POLAND

# Determine the name and CoA for polish kingdom
character_event = {
	id = Plus.565

	is_triggered_only = yes
	hide_window = yes
	
	trigger = {
		has_landed_title = k_poland
		NOT = { has_global_flag = poland_formed }
	}
	
	immediate = {
		set_global_flag = poland_formed
		#Reset duchy names
		d_kuyavia = {
			set_name=""
			adjective=""
		}
		d_silesia = {
			set_name=""
			adjective=""
		}
		d_mazovia = {
			set_name=""
			adjective=""
		}
		d_lesser_poland = {
			set_name=""
			adjective=""
		}
		d_greater_poland = {
			set_name=""
			adjective=""
		}
		#Set kingdom name and CoA
		if = {
			limit = {
				capital_scope = {
					duchy = {
						title = d_kuyavia
					}
				}
			}
			k_poland = {
				set_name="Kuyavia"
				adjective="Kuyavian"
				set_coa=d_kuyavia
			}
		}
		if = {
			limit = {
				capital_scope = {
					duchy = {
						title = d_silesia
					}
				}
			}
			k_poland = {
				set_name="Silesia"
				adjective="Silesian"
				set_coa=d_silesia
			}
		}
		if = {
			limit = {
				capital_scope = {
					duchy = {
						title = d_mazovia
					}
				}
			}
			k_poland = {
				set_name="Mazovia"
				adjective="Mazovian"
				set_coa=d_mazovia
			}
		}
		#Keep the name but change CoA
		if = {
			limit = {
				capital_scope = {
					duchy = {
						title = d_lesser_poland
					}
				}
			}
			k_poland = {
				set_coa=d_lesser_poland
			}
		}
	}
}
