namespace = sin_progress
character_event = {#where to travel to?
	id = sin_progress.0
	desc = EVTDESCsin_progress.0
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		trigger = {
			any_vassal = { has_landed_title = k_north }
		}
		name = EVTOPTAsin_progress.0
		wealth = -400
		random_vassal = {
			limit = { has_landed_title = k_north }
			character_event = { id = sin_progress.2 }
		}
	}

	option = {
		trigger = {
			any_vassal = { has_landed_title = k_westerlands }
		}
		name = EVTOPTBsin_progress.0
		wealth = -400
		random_vassal = {
			limit = { has_landed_title = k_westerlands }
			character_event = { id = sin_progress.2 }
		}
	}

	option = {
		trigger = {
			any_vassal = { has_landed_title = k_vale }
		}
		name = EVTOPTCsin_progress.0
		wealth = -400
		random_vassal = {
			limit = { has_landed_title = k_vale }
			character_event = { id = sin_progress.2 }
		}
	}

	option = {#More Options
		name = EVTOPTDsin_progress.0
		character_event = { id = sin_progress.1 }
	}
}
character_event = {
	id = sin_progress.1
	desc = EVTDESCsin_progress.1
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		trigger = {
			any_vassal = { has_landed_title = k_reach }
		}
		name = EVTOPTAsin_progress.1
		wealth = -400
		random_vassal = {
			limit = { has_landed_title = k_reach }
			character_event = { id = sin_progress.2 }
		}
	}

	option = {
		trigger = {
			any_vassal = { has_landed_title = k_dorne }
		}
		name = EVTOPTBsin_progress.1
		wealth = -400
		random_vassal = {
			limit = { has_landed_title = k_dorne }
			character_event = { id = sin_progress.2 }
		}
	}

	option = {#Cancel the progress
		name = EVTOPTCsin_progress.1
		clr_character_flag = setting_up_royal_progress
	}

	option = {#More Options
		name = EVTOPTDsin_progress.1
		character_event = { id = sin_progress.0 }
	}
}
character_event = {#Should I allow the King to visit?
	id = sin_progress.2
	desc = EVTDESCsin_progress.2
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {#Yes
		name = EVTOPTAsin_progress.2
		ai_chance = {
			factor = 0.8
		}
		FROM = {
			character_event = { id = sin_progress.3 }
			hidden_tooltip = {
				ROOT = {
					IF = {
						limit = { primary_title = { title = k_north } }
						FROM = { set_character_flag = RP_North }
					}
					IF = {
						limit = { primary_title = { title = k_vale } }
						FROM = { set_character_flag = RP_Vale }
					}
					IF = {
						limit = { primary_title = { title = k_westerlands } }
						FROM = { set_character_flag = RP_Westerlands }
					}
					IF = {
						limit = { primary_title = { title = k_reach } }
						FROM = { set_character_flag = RP_Reach }
					}
					IF = {
						limit = { primary_title = { title = k_dorne } }
						FROM = { set_character_flag = RP_Dorne }
					}
				}
			}
		}
	}

	option = {#No
		name = EVTOPTBsin_progress.2
		ai_chance = {
			factor = 0.2
		}
		FROM = {
			character_event = { id = sin_progress.4 }
		}
	}
}
character_event = {
	id = sin_progress.3
	desc = EVTDESCsin_progress.3
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.3
		IF = {#If friends then increase opinion
			limit = {
				any_friend = { character = FROM }
			}
			opinion = { modifier = opinion_grateful who = FROM years = 15 }
		}
		IF = {#If not friends then make friends
			limit = {
				NOT = {
					any_friend = { character = FROM }
				}
			}
			add_friend = FROM
		}
		any_courtier = {#Should courtiers join?
			IF = {
				limit = {
					is_councillor = no
					prisoner = no
					NOR = {
						trait = incapable
						trait = infirm
						trait = crippled
						trait = dragon
						culture = dragon
						religion = dragon_rel
						culture_group = winter_group
						culture_group = old_races
						culture_group = unoccupied_group
					}
				}
				character_event = { id = sin_progress.30 }
			}
		}
		kingsguard = {
			IF = {
				limit = {
					is_alive = yes
					prisoner = no
					NOT = { has_any_opinion_modifier = loan_kingsguard }
				}
				character_event = { id = sin_progress.30 }
			}
		}
		character_event = { id = sin_progress.5 days = 7 }
	}
}
character_event = {#Will I join the Progress?
	id = sin_progress.30
	desc = EVTDESCsin_progress.30
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {#Yes
		name = EVTOPTAsin_progress.30
		ai_chance = {
			factor = 0.8
		}
		FROM = {
			character_event = { id = sin_progress.31 days = 2 random = 2 }
		}
		set_character_flag = joining_royal_progress
	}

	option = {#No
		name = EVTOPTBsin_progress.30
		ai_chance = {
			factor = 0.2
			modifier = {
				factor = 0
				trait = kingsguard
			}
		}
		FROM = {
			character_event = { id = sin_progress.32 days = 2 random = 2 }
		}
	}
}
character_event = {#Courtier is Joining
	id = sin_progress.31
	desc = EVTDESCsin_progress.31
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.31
	}
}
character_event = {#Courtier Refused
	id = sin_progress.32
	desc = EVTDESCsin_progress.32
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.32
		opinion = { modifier = opinion_mildly_disappointed who = FROM years = 2 }
	}
}
character_event = {#Paramount Rejected your Progress
	id = sin_progress.4
	desc = EVTDESCsin_progress.4
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.4
		wealth = 400
		opinion = { modifier = opinion_furious who = FROM years = 10 }
	}
}
character_event = {#Set out on Progress
	id = sin_progress.5
	desc = EVTDESCsin_progress.5
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	immediate = { clr_character_flag = royal_progress }

	option = {
		name = EVTOPTAsin_progress.5
		set_character_flag = royal_progress
		clr_character_flag = setting_up_royal_progress
		add_trait = sin_progress
		any_courtier = {
			IF = {
				limit = { has_character_flag = joining_royal_progress  }
				add_trait = sin_progress
			}
		}
		kingsguard = {
			IF = {
				limit = { has_character_flag = joining_royal_progress  }
				add_trait = sin_progress
			}
		}
		character_event = { id = sin_progress.6 days = 60 random = 10 }
	}
}
character_event = {#Reach your destination
	id = sin_progress.6
	desc = EVTDESCsin_progress.6
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.6
		character_event = { id = sin_progress.7 days = 7 random = 7 }
	}
}
character_event = {#Bandits Flavor Event
	id = sin_progress.60
	desc = EVTDESCsin_progress.60
	picture = GFX_evt_castle_construction

	trigger = {
		prisoner = no
		any_demesne_province = {
			OR = {
				has_province_modifier = thieves_guild
				has_province_modifier = smugglers_ring
				has_province_modifier = highway_robber_band
			}
		}
		top_liege = {
			OR = {
				AND = {
					had_character_flag = { flag = royal_progress days = 20 }
					NOT = { had_character_flag = { flag = royal_progress days = 50 } }
				}
				AND = {
					had_character_flag = { flag = royal_progress days = 70 }
					NOT = { had_character_flag = { flag = royal_progress days = 120 } }
				}
			}
			NOT = { reverse_has_opinion_modifier = { modifier = resentful_of_my_behaviour who = ROOT } }
		}
		OR = {
			AND = {
				top_liege = { has_character_flag = RP_North }
				any_liege = {
					OR = {
						has_landed_title = k_north
						has_landed_title = k_riverlands
					}
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Vale }
				any_liege = {
					OR = {
						has_landed_title = k_vale
						has_landed_title = k_riverlands
					}
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Westerlands }
				any_liege = {
					has_landed_title = k_westerlands
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Reach }
				any_liege = {
					has_landed_title = k_reach
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Dorne }
				any_liege = {
					OR = {
						has_landed_title = k_dorne
						has_landed_title = k_reach
					}
				}
			}
		}
	}
	mean_time_to_happen = {
		days = 7
	}

	option = {
		name = EVTOPTAsin_progress.60
		top_liege = {
			character_event = { id = sin_progress.600 }
		}
	}
}
character_event = {#Courtier asked to deal with Bandits
	id = sin_progress.600
	desc = EVTDESCsin_progress.600
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.600
		FROM = {
			opinion = { modifier = resentful_of_my_behaviour who = ROOT years = 1 }
		}
	}
	option = {
		name = EVTOPTBsin_progress.600
		trigger = {
			trait = kind
		}
		wealth = -100
		FROM = {
			opinion = { modifier = opinion_grateful who = ROOT years = 15 }
			random_demesne_province = {
				limit = {
					OR = {
						has_province_modifier = thieves_guild
						has_province_modifier = smugglers_ring
						has_province_modifier = highway_robber_band
					}
				}
				random = {
					chance = 20
					remove_province_modifier = thieves_guild
					remove_province_modifier = smugglers_ring
					remove_province_modifier = highway_robber_band
				}
			}
		}
	}
	option = {
		name = EVTOPTCsin_progress.600
		trigger = {
			OR = {
				trait = cruel
				trait = ruthless
			}
		}
		FROM = {
			liege = {
				opinion = { modifier = resentful_of_my_behaviour who = ROOT years = 15 }
				any_realm_lord = {
					opinion = { modifier = resentful_of_my_behaviour who = ROOT years = 15 }
				}
			}
			random_demesne_province = {
				limit = {
					OR = {
						has_province_modifier = thieves_guild
						has_province_modifier = smugglers_ring
						has_province_modifier = highway_robber_band
					}
				}
				random = {
					chance = 20
					remove_province_modifier = thieves_guild
					remove_province_modifier = smugglers_ring
					remove_province_modifier = highway_robber_band
				}
			}
		}
	}
	option = {
		name = EVTOPTDsin_progress.600
		trigger = {
			any_courtier = {
				has_character_flag = joining_royal_progress
				NOR = {
					trait = wounded
					trait = maimed
					trait = infirm
					trait = incapable
				}
				OR = {
					trait = trained_warrior
					trait = skilled_warrior
					trait = master_warrior
					diplomacy = 10
					stewardship = 10
					martial = 10
				}
			}
		}
		random_courtier = {
			limit = {
				has_character_flag = joining_royal_progress
				NOR = {
					trait = wounded
					trait = maimed
					trait = infirm
					trait = incapable
				}
				OR = {
					trait = trained_warrior
					trait = skilled_warrior
					trait = master_warrior
					diplomacy = 10
					stewardship = 10
					martial = 10
				}
			}
			random_list = {
				60 = {}
				20 = {
					add_trait = wounded
					hidden_tooltip = {
						character_event = { id = sin_progress.601 }
					}
				}
				10 = {
					add_trait = maimed
					hidden_tooltip = {
						character_event = { id = sin_progress.601 }
					}
				}
				10 = {
					hidden_tooltip = {
						remove_trait = sin_progress
					}
					death = { death_reason = death_rabble }
				}
			}
		}
		FROM = {
			opinion = { modifier = opinion_grateful who = ROOT years = 15 }
			random_demesne_province = {
				limit = {
					OR = {
						has_province_modifier = thieves_guild
						has_province_modifier = smugglers_ring
						has_province_modifier = highway_robber_band
					}
				}
				random = {
					chance = 80
					remove_province_modifier = thieves_guild
					remove_province_modifier = smugglers_ring
					remove_province_modifier = highway_robber_band
				}
			}
		}
	}
	option = {
		name = EVTOPTEsin_progress.600
		random_list = {
			60 = {}
			20 = { add_trait = wounded }
			10 = { add_trait = maimed }
			10 = { death = { death_reason = death_rabble } }
		}
		FROM = {
			opinion = { modifier = opinion_grateful who = ROOT years = 15 }
			random_demesne_province = {
				limit = {
					OR = {
						has_province_modifier = thieves_guild
						has_province_modifier = smugglers_ring
						has_province_modifier = highway_robber_band
					}
				}
				random = {
					chance = 80
					remove_province_modifier = thieves_guild
					remove_province_modifier = smugglers_ring
					remove_province_modifier = highway_robber_band
				}
			}
		}
	}
}
character_event = {#Injured while dealing with Bandits
	id = sin_progress.601
	desc = EVTDESCsin_progress.601
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.601
		trigger = { trait = maimed }
		remove_trait = sin_progress
		clr_character_flag = joining_royal_progress
		top_liege = { opinion = { modifier = opinion_betrayed who = ROOT years = 10 } }
	}
	option = {
		name = EVTOPTAsin_progress.601
		trigger = { NOT = { trait = maimed } }
		top_liege = { opinion = { modifier = opinion_betrayed who = ROOT years = 2 } }
	}
}
character_event = {#Vassal Greeting Flavor Event
	id = sin_progress.602
	desc = EVTDESCsin_progress.602
	picture = GFX_evt_castle_construction

	trigger = {
		prisoner = no
		higher_real_tier_than = BARON
		NOT = {
			has_character_flag = sinvited_liege
		}
		liege = {
			NOT = { has_landed_title = e_iron_throne }
		}
		top_liege = {
			OR = {
				AND = {
					had_character_flag = { flag = royal_progress days = 20 }
					NOT = { had_character_flag = { flag = royal_progress days = 50 } }
				}
				AND = {
					had_character_flag = { flag = royal_progress days = 70 }
					NOT = { had_character_flag = { flag = royal_progress days = 120 } }
				}
			}
			NOR = {
				reverse_has_opinion_modifier = { modifier = resentful_of_my_behaviour who = ROOT }
				reverse_has_opinion_modifier = { modifier = opinion_stayed_at_keep who = ROOT }
				reverse_has_opinion_modifier = { modifier = raped_my_family_member who = ROOT }
			}
			reverse_opinion = { value = 0 who = ROOT }
		}
		OR = {
			AND = {
				top_liege = { has_character_flag = RP_North }
				any_liege = {
					OR = {
						has_landed_title = k_north
						has_landed_title = k_riverlands
					}
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Vale }
				any_liege = {
					OR = {
						has_landed_title = k_vale
						has_landed_title = k_riverlands
					}
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Westerlands }
				any_liege = {
					has_landed_title = k_westerlands
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Reach }
				any_liege = {
					has_landed_title = k_reach
				}
			}
			AND = {
				top_liege = { has_character_flag = RP_Dorne }
				any_liege = {
					OR = {
						has_landed_title = k_dorne
						has_landed_title = k_reach
					}
				}
			}
		}
	}
	mean_time_to_happen = {
		days = 20
	}
	immediate = { set_character_flag = sinvited_liege }
	option = {
		name = EVTOPTAsin_progress.602
		top_liege = {
			character_event = { id = sin_progress.603 }
		}
	}
	option = {
		name = EVTOPTBsin_progress.602
	}
}
character_event = {#Vassal sends greetings
	id = sin_progress.603
	desc = EVTDESCsin_progress.603
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.603
		opinion = { who = FROM modifier = opinion_grateful years = 1 }
		reverse_opinion = { who = FROM modifier = opinion_stayed_at_keep years = 1 }
		FROM = { clr_character_flag = sinvited_liege }
	}
	option = {
		name = EVTOPTBsin_progress.603
		trigger = {
			OR = {
				trait = lustful
				is_married = no
			}
			OR = {
				is_female = no
				trait = homosexual
				AND = {
					is_female = yes
					any_lover = { is_female = yes }
				}
			}
			FROM = {
				any_child = {
					age = 14
					is_ill = no
					is_female = yes
					is_married = no
					prisoner = no
					at_location = FROM
				}
			}
		}
		FROM = {
			random_child = {
				limit = {
					age = 14
					is_ill = no
					is_female = yes
					is_married = no
					prisoner = no
					at_location = FROM
				}
				character_event = { id = sin_progress.604 }
			}
		}
		reverse_opinion = { who = FROM modifier = opinion_stayed_at_keep years = 1 }
		FROM = { clr_character_flag = sinvited_liege }
	}
	option = {
		name = EVTOPTCsin_progress.603
		trigger = {
			OR = {
				trait = lustful
				is_married = no
			}
			OR = {
				is_female = yes
				trait = homosexual
				AND = {
					is_female = no
					any_lover = { is_female = no }
				}
			}
			FROM = {
				any_child = {
					age = 14
					is_ill = no
					is_female = no
					is_married = no
					prisoner = no
					at_location = FROM
				}
			}
		}
		FROM = {
			random_child = {
				limit = {
					age = 14
					is_ill = no
					is_female = no
					is_married = no
					prisoner = no
					at_location = FROM
				}
				character_event = { id = sin_progress.604 }
			}
		}
		reverse_opinion = { who = FROM modifier = opinion_stayed_at_keep years = 1 }
		FROM = { clr_character_flag = sinvited_liege }
	}
	option = {
		name = EVTOPTDsin_progress.603
		reverse_opinion = { who = FROM modifier = resentful_of_my_behaviour years = 2 }
		FROM = { clr_character_flag = sinvited_liege }
	}
}
character_event = {#The King pays a visit to your chambers
	id = sin_progress.604
	desc = EVTDESCsin_progress.604
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.604
		FROM = {
			character_event = { id = sin_progress.605 }
		}
	}
	option = {
		name = EVTOPTAsin_progress.604
		FROM = {
			character_event = { id = sin_progress.606 }
		}
	}
}
character_event = {#From agrees to your advances
	id = sin_progress.605
	desc = EVTDESCsin_progress.605
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	immediate = {
		IF = {
			limit = {
				ROOT = {
					is_female = no
					NOT = { trait = eunuch }
				}
				FROM = {
					is_female = yes
					is_pregnant = no
					NOT = { age = 40 }
				}
			}
			random = {
				chance = 100
				modifier = {
					factor = 0
					ROOT = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0
					FROM = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0.05
					ROOT = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.05
					FROM = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.10
					ROOT = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.10
					FROM = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.20
					ROOT = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.20
					FROM = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.30
					ROOT = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.30
					FROM = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.40
					ROOT = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.40
					FROM = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.50
					ROOT = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.50
					FROM = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.60
					ROOT = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.60
					FROM = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.70
					ROOT = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.70
					FROM = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.80
					ROOT = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.80
					FROM = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.90
					ROOT = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				modifier = {
					factor = 0.90
					FROM = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				impregnate = FROM
			}
		}
		IF = {
			limit = {
				ROOT = {
					is_female = yes
					is_pregnant = no
					NOT = { age = 40 }
				}
				FROM = {
					is_female = no
					NOT = { trait = eunuch }
				}
			}
			random = {
				chance = 100
				modifier = {
					factor = 0
					ROOT = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0
					FROM = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0.05
					ROOT = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.05
					FROM = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.10
					ROOT = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.10
					FROM = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.20
					ROOT = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.20
					FROM = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.30
					ROOT = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.30
					FROM = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.40
					ROOT = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.40
					FROM = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.50
					ROOT = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.50
					FROM = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.60
					ROOT = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.60
					FROM = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.70
					ROOT = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.70
					FROM = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.80
					ROOT = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.80
					FROM = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.90
					ROOT = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				modifier = {
					factor = 0.90
					FROM = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				FROM = { impregnate = ROOT }
			}
		}
	}
	option = {
		name = EVTOPTAsin_progress.605
		opinion = { modifier = opinion_grateful who = FROM years = 2 }
		reverse_opinion = { modifier = opinion_grateful who = FROM years = 2 }
	}
	option = {
		name = EVTOPTAsin_progress.605
		add_lover = FROM
		opinion = { modifier = opinion_grateful who = FROM years = 2 }
		reverse_opinion = { modifier = opinion_grateful who = FROM years = 2 }
	}
}
character_event = {#From rejected you
	id = sin_progress.606
	desc = EVTDESCsin_progress.606
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.606
	}
	option = {
		name = EVTOPTBsin_progress.606
		trigger = {
			OR = {
				trait = wroth
				trait = cruel
				trait = ruthless
			}
		}
		hidden_tooltip = {
			FROM = {
				character_event = { id = sin_progress.607 }
			}
			FROMFROMFROM = {
				character_event = { id = sin_progress.608 days = 1 }
			}
		}
	}
	option = {
		name = EVTOPTBsin_progress.606
		trigger = {
			OR = {
				trait = wroth
				trait = cruel
				trait = ruthless
			}
		}
		FROM = {
			death = {
				death_reason = death_murder
				killer = ROOT
			}
		}
	}
}
character_event = {#Raped chance of pregnancy
	id = sin_progress.607
	desc = EVTDESCsin_progress.607
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	immediate = {
		IF = {
			limit = {
				ROOT = {
					is_female = no
					NOT = { trait = eunuch }
				}
				FROM = {
					is_female = yes
					is_pregnant = no
					NOT = { age = 40 }
				}
			}
			random = {
				chance = 100
				modifier = {
					factor = 0
					ROOT = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0
					FROM = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0.05
					ROOT = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.05
					FROM = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.10
					ROOT = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.10
					FROM = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.20
					ROOT = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.20
					FROM = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.30
					ROOT = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.30
					FROM = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.40
					ROOT = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.40
					FROM = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.50
					ROOT = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.50
					FROM = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.60
					ROOT = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.60
					FROM = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.70
					ROOT = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.70
					FROM = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.80
					ROOT = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.80
					FROM = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.90
					ROOT = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				modifier = {
					factor = 0.90
					FROM = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				impregnate = FROM
			}
		}
		IF = {
			limit = {
				ROOT = {
					is_female = yes
					is_pregnant = no
					NOT = { age = 40 }
				}
				FROM = {
					is_female = no
					NOT = { trait = eunuch }
				}
			}
			random = {
				chance = 100
				modifier = {
					factor = 0
					ROOT = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0
					FROM = {
						NOT = { fertility = 0 }
					}
				}
				modifier = {
					factor = 0.05
					ROOT = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.05
					FROM = {
						fertility = 0
						NOT = { fertility = 0.10 }
					}
				}
				modifier = {
					factor = 0.10
					ROOT = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.10
					FROM = {
						fertility = 0.10
						NOT = { fertility = 0.20 }
					}
				}
				modifier = {
					factor = 0.20
					ROOT = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.20
					FROM = {
						fertility = 0.20
						NOT = { fertility = 0.30 }
					}
				}
				modifier = {
					factor = 0.30
					ROOT = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.30
					FROM = {
						fertility = 0.30
						NOT = { fertility = 0.40 }
					}
				}
				modifier = {
					factor = 0.40
					ROOT = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.40
					FROM = {
						fertility = 0.40
						NOT = { fertility = 0.50 }
					}
				}
				modifier = {
					factor = 0.50
					ROOT = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.50
					FROM = {
						fertility = 0.50
						NOT = { fertility = 0.60 }
					}
				}
				modifier = {
					factor = 0.60
					ROOT = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.60
					FROM = {
						fertility = 0.60
						NOT = { fertility = 0.70 }
					}
				}
				modifier = {
					factor = 0.70
					ROOT = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.70
					FROM = {
						fertility = 0.70
						NOT = { fertility = 0.80 }
					}
				}
				modifier = {
					factor = 0.80
					ROOT = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.80
					FROM = {
						fertility = 0.80
						NOT = { fertility = 0.90 }
					}
				}
				modifier = {
					factor = 0.90
					ROOT = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				modifier = {
					factor = 0.90
					FROM = {
						fertility = 0.90
						NOT = { fertility = 1 }
					}
				}
				FROM = { impregnate = ROOT }
			}
		}
	}
	option = {
		name = EVTOPTAsin_progress.607
		opinion = { who = FROM modifier = opinion_raped_me years = 100 }
	}
}
character_event = {#From rejected you
	id = sin_progress.608
	desc = EVTDESCsin_progress.608
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.608
		opinion = { modifier = raped_my_family_member who = FROM years = 100 }
	}
	option = {
		name = EVTOPTBsin_progress.608
		trigger = {
			OR = {
				trait = wroth
				trait = cruel
				trait = ruthless
			}
		}
		FROM = {
			death = {
				death_reason = death_murder
				killer = ROOT
			}
		}
	}
}
character_event = {#Harrenhal Flavor Event
	id = sin_progress.61
	desc = EVTDESCsin_progress.61
	picture = GFX_evt_castle_construction

	trigger = {
		trait = sin_progress
		NOT = { has_character_modifier = sin_visited_harrenhal }
		b_kingharren1 = { has_building = ca_harrenhal_ruins }
		OR = {
			AND = {
				had_character_flag = { flag = royal_progress days = 10 }
				NOT = { had_character_flag = { flag = royal_progress days = 50 } }
			}
			AND = {
				had_character_flag = { flag = royal_progress days = 70 }
				NOT = { had_character_flag = { flag = royal_progress days = 120 } }
			}
		}
		NOT = {
			any_courtier = {
				trait = sin_progress
				reverse_has_opinion_modifier = { modifier = opinion_rejected_progress who = ROOT }
			}
		}
		OR = {
			has_character_flag = RP_North
			has_character_flag = RP_Vale
			has_character_flag = RP_Westerlands
		}
	}
	mean_time_to_happen = {
		days = 10
	}

	option = {
		name = EVTOPTAsin_progress.61
		character_event = { id = sin_progress.611 days = 5 random = 2 }
		random_courtier = {
			limit = { trait = sin_progress }
			reverse_opinion = { modifier = opinion_grateful who = ROOT years = 1 }
		}
		hidden_tooltip = {
			any_courtier = {
				IF = {
					limit = { trait = sin_progress }
					character_event = { id = sin_progress.610 }
				}
			}
		}
	}
	option = {
		name = EVTOPTBsin_progress.61
		random_courtier = {
			limit = { trait = sin_progress }
			opinion = { modifier = opinion_rejected_progress who = ROOT years = 1 }
		}
	}
}
character_event = {#Liege requests company
	id = sin_progress.610
	desc = EVTDESCsin_progress.610
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.610
		ai_chance = {
			factor = 0.8
		}
		character_event = { id = sin_progress.611 days = 5 random = 2 }
	}
	option = {
		name = EVTOPTBsin_progress.610
		ai_chance = {
			factor = 0.2
		}
	}
}
character_event = {#See Harrenhal
	id = sin_progress.611
	desc = EVTDESCsin_progress.611
	picture = GFX_fallofharrenhal
	is_triggered_only = yes

	immediate = {
		add_character_modifier = { modifier = sin_visited_harrenhal years = 2 }
		set_character_flag = dragon_intel_harrenhal
	}

	option = {
		name = EVTOPTAsin_progress.611
		trigger = {
			has_landed_title = e_iron_throne
			NOT = { trait = lunatic }
		}
		hidden_tooltip = {
			c_harrenhal = {
				holder_scope = {
					IF = {
						limit = {
							at_location = 107
							has_regent = no
						}
						character_event = { id = sin_progress.613 }
					}
				}
			}
		}
		prestige = 50
	}
	option = {
		name = EVTOPTBsin_progress.611
		trigger = {
			has_landed_title = e_iron_throne
			trait = lunatic
			NOR = {
				trait = fire_obsessed
				trait = dragon_rider
			}
		}
		set_character_flag = sin_progress_sacrifice
		prestige = 50
		random_courtier = {
			limit = {
				NOR = {
					father = { character = ROOT }
					mother = { character = ROOT }
					any_dynasty_member = { character = ROOT }
				}
			}
			character_event = { id = sin_progress.612 }
		}
	}
	option = {
		name = EVTOPTCsin_progress.611
		trigger = {
			has_landed_title = e_iron_throne
			trait = lunatic
			trait = fire_obsessed
		}
		set_character_flag = sin_progress_fire
		prestige = 50
		random_courtier = {
			limit = {
				NOR = {
					father = { character = ROOT }
					mother = { character = ROOT }
					any_dynasty_member = { character = ROOT }
				}
			}
			character_event = { id = sin_progress.612 }
		}
	}
	option = {
		name = EVTOPTDsin_progress.611
		trigger = {
			has_landed_title = e_iron_throne
			trait = lunatic
			trait = dragon_rider
		}
		set_character_flag = sin_progress_dragon
		prestige = 50
		random_courtier = {
			limit = {
				NOR = {
					father = { character = ROOT }
					mother = { character = ROOT }
					any_dynasty_member = { character = ROOT }
				}
			}
			character_event = { id = sin_progress.612 }
		}
	}
	option = {
		name = EVTOPTEsin_progress.611
		trigger = {
			NOT = { has_landed_title = e_iron_throne }
		}
		top_liege = {
			reverse_opinion = { modifier = opinion_grateful who = ROOT years = 2 }
		}
	}
}
character_event = {#The Crazies want a sacrifice
	id = sin_progress.612
	desc = EVTDESCsin_progress.612
	picture = GFX_fallofharrenhal
	is_triggered_only = yes

	immediate = {
		any_child = {
			opinion = { modifier = executed_kin who = FROM years = 50 }
		}
		any_dynasty_member = {
			opinion = { modifier = executed_kin who = FROM years = 20 }
		}
		FROM = {
			any_vassal = {
				opinion = { modifier = killed_vassal who = FROM years = 10 }
			}
		}
	}

	option = {
		name = EVTOPTAsin_progress.612
		trigger = {
			FROM = { has_character_flag = sin_progress_sacrifice }
		}
		FROM = { clr_character_flag = sin_progress_sacrifice }
		death = {
			death_reason = death_sacrificed
			killer = FROM
		}
	}
	option = {
		name = EVTOPTAsin_progress.612
		trigger = {
			FROM = { has_character_flag = sin_progress_fire }
		}
		FROM = { clr_character_flag = sin_progress_fire }
		death = {
			death_reason = death_sacrificed
			killer = FROM
		}
		add_trait = burned_alive
	}
	option = {
		name = EVTOPTAsin_progress.612
		trigger = {
			FROM = { has_character_flag = sin_progress_dragon }
		}
		FROM = { clr_character_flag = sin_progress_dragon }
		death = {
			death_reason = death_sacrificed
			killer = FROM
		}
		add_trait = fed_to_dragon
	}
}
character_event = {#Inform Harrenhal holder
	id = sin_progress.613
	desc = EVTDESCsin_progress.613
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.613
		FROM = {
			character_event = { id = sin_progress.614 }
		}
	}

	option = {
		name = EVTOPTAsin_progress.613
		FROM = {
			character_event = { id = sin_progress.615 }
		}
	}
}
character_event = {#Welcomed into Harrenhal
	id = sin_progress.614
	desc = EVTDESCsin_progress.614
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.614
		opinion = { modifier = opinion_grateful who = FROM years = 2 }
		random = {
			chance = 20
			add_friend = FROM
		}
	}
}
character_event = {#Rejected from Harrenhal
	id = sin_progress.615
	desc = EVTDESCsin_progress.615
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.615
		trigger = {
			OR = {
				trait = wroth
				trait = cruel
				trait = ruthless
			}
		}
		opinion = { modifier = opinion_furious who = FROM years = 2 }
		FROM = {
			random_list = {
				60 = { add_trait = wounded }
				30 = { add_trait = maimed }
				10 = {
					death = {
						death_reason = death_execution
						killer = ROOT
					}
				}
			}
			opinion = { modifier = opinion_furious who = ROOT years = 25 }
		}
	}
	option = {
		name = EVTOPTBsin_progress.615
		trigger = {
			OR = {
				trait = wroth
				trait = cruel
				trait = ruthless
			}
		}
		FROM = { imprison = ROOT }
		opinion = { modifier = opinion_furious who = FROM years = 2 }
	}
	option = {
		name = EVTOPTCsin_progress.615
		opinion = { modifier = opinion_mildly_disappointed who = FROM years = 2 }
	}
}

character_event = {#Bloody Gate Flavor
	id = sin_progress.62
	hide_window = yes

	trigger = {
		trait = sin_progress
		NOT = { has_character_modifier = sin_approached_gate }
		had_character_flag = { flag = royal_progress days = 40 }
		NOT = { had_character_flag = { flag = royal_progress days = 50 } }
		has_character_flag = RP_Vale
	}
	mean_time_to_happen = {
		days = 1
	}

	immediate = {
		c_bloody_gate = {
			holder_scope = {
				character_event = { id = sin_progress.621 }
			}
		}
	}
}
character_event = {#Who Approaches the Bloody Gate
	id = sin_progress.621
	desc = EVTDESCsin_progress.621
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.621
		FROM = {
			character_event = { id = sin_progress.622 }
		}
	}
}
character_event = {#IT Calls
	id = sin_progress.622
	desc = EVTDESCsin_progress.622
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.622
		FROM = {
			character_event = { id = sin_progress.623 }
		}
	}
}
character_event = {#Bloody Gate Holder Opens Gate
	id = sin_progress.623
	desc = EVTDESCsin_progress.623
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.623
		FROM = {
			character_event = { id = sin_progress.624 }
			add_character_modifier = { modifier = sin_approached_gate years = 2 }
			any_courtier = {
				IF = {
					limit = { trait = sin_progress }
					character_event = { id = sin_progress.624 }
				}
			}
		}
	}
}
character_event = {#Bloody Gate Opens
	id = sin_progress.624
	desc = EVTDESCsin_progress.624
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.624
	}
}
character_event = {#Start Back
	id = sin_progress.7
	desc = EVTDESCsin_progress.7
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.7
		character_event = { id = sin_progress.8 days = 60 random = 10 }
	}
}
character_event = {#Return from Progress
	id = sin_progress.8
	desc = EVTDESCsin_progress.8
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.8
		remove_trait = sin_progress
		any_courtier = {
			IF = {
				limit = { has_character_flag = joining_royal_progress }
				remove_trait = sin_progress
				reverse_opinion = { modifier = opinion_very_grateful who = ROOT years = 2  }
				clr_character_flag = joining_royal_progress
			}
		}
	}
}
character_event = {#Death of the King
	id = sin_progress.9
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		trait = sin_progress
	}

	immediate = {
		remove_trait = sin_progress
		hidden_tooltip = {
			IF = {
				limit = { has_landed_title = e_iron_throne }
				any_courtier = {
					IF = {
						limit = { has_character_flag = joining_royal_progress }
						remove_trait = sin_progress
						reverse_opinion = { modifier = opinion_very_grateful who = ROOT years = 2  }
						clr_character_flag = joining_royal_progress
						character_event = { id = sin_progress.90 }
					}
				}
				kingsguard = {
					IF = {
						limit = { has_character_flag = joining_royal_progress }
						remove_trait = sin_progress
						reverse_opinion = { modifier = opinion_very_grateful who = ROOT years = 2  }
						clr_character_flag = joining_royal_progress
						character_event = { id = sin_progress.90 }
					}
				}
			}
		}
	}
}
character_event = {#The King has died
	id = sin_progress.90
	desc = EVTDESCsin_progress.90
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAsin_progress.90
	}
}