#############################################
#
# Maintainence events to give spawned couriters wives
#
# ordepmarriage.9000-9999 is reserved
# Gujurati Indians: VIETnam.121
# Swahili: VIETnam.124
#
#############################################
namespace = ordepmarriage

#############################################

#gujurati Indians
character_event = {
	id = VIETnam.121
	desc = "EVTDESC1000109201"
	picture = GFX_evt_indian_market
	
	prisoner = no
	only_rulers = yes
	capable_only = yes
	
	trigger = {
		OR = {
			is_republic = yes
			is_patrician = yes
		}
		NOT = {
			any_courtier = {
				OR = {
				religion_group = indian_group
					culture_group = indo_aryan_group
					culture_group = dravidian_group
				}
				has_character_flag = VIET_spawned_courtier
			}
		}
		NOT = {
			any_courtier = {
				religion_group = indian_group
			}
		}
		NOT = {
			any_courtier = {
				culture_group = indo_aryan_group
			}
		}
		NOT = {
			any_courtier = {
				culture_group = dravidian_group
			}
		}
		OR = {
			religion_group = muslim
			religion_group = zoroastrian_group
			religion = tengri_pagan
			culture_group = south_semitic
			culture_group = east_semitic
			culture_group = northwest_semitic
			culture_group = central_semitic
			culture_group = iranian
			culture_group = east_african
			culture_group = altaic
		}
		capital_scope = {
			OR = {
				culture_group = south_semitic
				culture_group = east_semitic
				culture_group = northwest_semitic
				culture_group = central_semitic
				culture_group = iranian
				culture_group = east_african
				culture = turkish
			}
		}
		top_liege = {
			OR = {
				is_republic = yes
				is_patrician = yes
			}
			OR = {
				religion_group = muslim
				religion_group = zoroastrian_group
				religion = tengri_pagan
				culture_group = south_semitic
				culture_group = east_semitic
				culture_group = northwest_semitic
				culture_group = central_semitic
				culture_group = iranian
				culture_group = east_african
				culture_group = altaic
			}
			capital_scope = {
				OR = {
					culture_group = south_semitic
					culture_group = east_semitic
					culture_group = northwest_semitic
					culture_group = central_semitic
					culture_group = iranian
					culture_group = east_african
					culture = turkish
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 1100

		modifier = {
			factor = 4
			is_patrician = yes
		}
		
		modifier = {
			factor = 4
			trait = zealous
		}
		
		modifier = {
			factor = 2
			trait = cruel
		}

		modifier = {
			factor = 1.5
			trait = envious
		}
		
		modifier = {
			factor = 1.5
			trait = arbitrary
		}
		
		modifier = {
			factor = 0.9
			trait = cynical
		}
		
		modifier = {
			factor = 0.9
			trait = kind
		}
		
		modifier = {
			factor = 0.9
			trait = diligent
		}
		
		modifier = {
			factor = 0.9
			trait = scholar
		}
		
		modifier = {
			factor = 0.9
			trait = ambitious
		}
		
		modifier = {
			factor = 0.9
			trait = charitable
		}
		
		modifier = {
			factor = 0.9
			trait = trusting
		}
		
		modifier = {
			factor = 0.9
			trait = greedy
		}
		
	}
	
	option = {
		name = "EVTOPTA1000109201"

		create_character = {
			random_traits = yes
			dynasty = random
			religion = hindu
			culture = gujurati
			attributes = {
				diplomacy = 3
				martial = 3
				stewardship = 3
				intrigue = 3
				learning = 3
			}
		}
		new_character = {
			set_character_flag = VIET_spawned_courtier
			opinion = {
				modifier = opinion_patron
				who = ROOT
				years = 20
			}
			reverse_opinion = {
				modifier = opinion_new_courtier
				who = ROOT
				years = 5
			}
		}
		create_character = {
			random_traits = yes
			dynasty = random
			religion = hindu
			culture = gujurati
			attributes = {
				diplomacy = 5
				martial = 5
				stewardship = 5
				intrigue = 5
				learning = 5
			}
		}
		new_character = {
			set_character_flag = VIET_spawned_courtier
			opinion = {
				modifier = opinion_patron
				who = ROOT
				years = 20
			}
			reverse_opinion = {
				modifier = opinion_new_courtier
				who = ROOT
				years = 5
			}
		}
		random_list = {
			30 = { }
			70 = {
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = gujurati
					attributes = {
						diplomacy = 7
						martial = 7
						stewardship = 7
						intrigue = 7
						learning = 7
					}
				}
				new_character = {
					set_character_flag = VIET_spawned_courtier
					opinion = {
						modifier = opinion_patron
						who = ROOT
						years = 20
					}
					reverse_opinion = {
						modifier = opinion_new_courtier
						who = ROOT
						years = 5
					}
				}
			}
		}
		random_list = {
			70 = { }
			30 = {
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = gujurati
					attributes = {
						diplomacy = 8
						martial = 8
						stewardship = 8
						intrigue = 8
						learning = 8
					}
				}
				new_character = {
					set_character_flag = VIET_spawned_courtier
					opinion = {
						modifier = opinion_patron
						who = ROOT
						years = 20
					}
					reverse_opinion = {
						modifier = opinion_new_courtier
						who = ROOT
						years = 5
					}
				}
			}
		}
		random_list = {
			95 = { }
			5 = {
				create_character = {
					random_traits = yes
					dynasty = random
					religion = hindu
					culture = gujurati
					attributes = {
						diplomacy = 10
						martial = 10
						stewardship = 10
						intrigue = 10
						learning = 10
					}
				}
				new_character = {
					set_character_flag = VIET_spawned_courtier
					opinion = {
						modifier = opinion_patron
						who = ROOT
						years = 20
					}
					reverse_opinion = {
						modifier = opinion_new_courtier
						who = ROOT
						years = 5
					}
				}
			}
		}
	}
	
	option = {
		name = "reject.VIET.courtiers"
	}
	
}

#Swahili
character_event = {
	id = VIETnam.124
	desc = "EVTDESC1000109207"
	picture = GFX_evt_african_savanna
	
	prisoner = no
	only_rulers = yes
	capable_only = yes
	
	trigger = {
		OR = {
			is_republic = yes
			is_patrician = yes
			AND = {
				culture_group = east_african
				NOT = { culture = swahili }
				any_demesne_province = {
					port = yes
				}
			}
		}
		NOT = {
			any_courtier = {
				culture = swahili
				has_character_flag = VIET_spawned_courtier
			}
		}
		NOT = {
			any_courtier = {
				culture = swahili
			}
		}
		OR = {
			religion_group = muslim
			religion_group = zoroastrian_group
			culture_group = south_semitic
			culture_group = east_semitic
			culture_group = northwest_semitic
			culture_group = central_semitic
			culture_group = iranian
			culture_group = east_african
		}
		capital_scope = {
			OR = {
				culture_group = south_semitic
				culture_group = east_semitic
				culture_group = northwest_semitic
				culture_group = central_semitic
				culture_group = iranian
				culture_group = east_african
				culture = turkish
			}
		}
		top_liege = {
			OR = {
				is_republic = yes
				is_patrician = yes
			}
			AND = {
				culture_group = east_african
				NOT = { culture = swahili }
				any_demesne_province = {
					port = yes
				}
			}
			OR = {
				religion_group = muslim
				religion_group = zoroastrian_group
				culture_group = south_semitic
				culture_group = east_semitic
				culture_group = northwest_semitic
				culture_group = central_semitic
				culture_group = iranian
				culture_group = east_african
			}
			capital_scope = {
				OR = {
					culture_group = south_semitic
					culture_group = east_semitic
					culture_group = northwest_semitic
					culture_group = central_semitic
					culture_group = iranian
					culture_group = east_african
					culture = turkish
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 1300

		modifier = {
			factor = 4
			is_patrician = yes
		}
		
		modifier = {
			factor = 2
			trait = cruel
		}

		modifier = {
			factor = 1.5
			trait = envious
		}
		
		modifier = {
			factor = 1.5
			trait = arbitrary
		}
		
		modifier = {
			factor = 0.9
			trait = cynical
		}
		
		modifier = {
			factor = 0.9
			trait = kind
		}
		
		modifier = {
			factor = 0.9
			trait = diligent
		}
		
		modifier = {
			factor = 0.9
			trait = scholar
		}
		
		modifier = {
			factor = 0.9
			trait = ambitious
		}
		
		modifier = {
			factor = 0.9
			trait = charitable
		}
		
		modifier = {
			factor = 0.9
			trait = trusting
		}
		
		modifier = {
			factor = 0.9
			trait = greedy
		}
		
	}
	
	option = {
		name = "EVTOPTA1000109207"

		create_character = {
			random_traits = yes
			dynasty = random
			religion = sunni
			culture = swahili
			attributes = {
				diplomacy = 3
				martial = 3
				stewardship = 3
				intrigue = 3
				learning = 3
			}
		}
		new_character = {
			set_character_flag = VIET_spawned_courtier
			opinion = {
				modifier = opinion_patron
				who = ROOT
				years = 20
			}
			reverse_opinion = {
				modifier = opinion_new_courtier
				who = ROOT
				years = 5
			}
		}
		create_character = {
			random_traits = yes
			dynasty = random
			religion = sunni
			culture = swahili
			attributes = {
				diplomacy = 5
				martial = 5
				stewardship = 5
				intrigue = 5
				learning = 5
			}
		}
		new_character = {
			set_character_flag = VIET_spawned_courtier
			opinion = {
				modifier = opinion_patron
				who = ROOT
				years = 20
			}
			reverse_opinion = {
				modifier = opinion_new_courtier
				who = ROOT
				years = 5
			}
		}
		random_list = {
			30 = { }
			70 = {
				create_character = {
					random_traits = yes
					dynasty = random
					religion = sunni
					culture = swahili
					attributes = {
						diplomacy = 7
						martial = 7
						stewardship = 7
						intrigue = 7
						learning = 7
					}
				}
				new_character = {
					set_character_flag = VIET_spawned_courtier
					opinion = {
						modifier = opinion_patron
						who = ROOT
						years = 20
					}
					reverse_opinion = {
						modifier = opinion_new_courtier
						who = ROOT
						years = 5
					}
				}
			}
		}
		random_list = {
			70 = { }
			30 = {
				create_character = {
					random_traits = yes
					dynasty = random
					religion = sunni
					culture = swahili
					attributes = {
						diplomacy = 8
						martial = 8
						stewardship = 8
						intrigue = 8
						learning = 8
					}
				}
				new_character = {
					opinion = {
						modifier = opinion_patron
						who = ROOT
						years = 20
					}
					reverse_opinion = {
						modifier = opinion_new_courtier
						who = ROOT
						years = 5
					}
				}
			}
		}
		random_list = {
			95 = { }
			5 = {
				create_character = {
					random_traits = yes
					dynasty = random
					religion = sunni
					culture = swahili
					attributes = {
						diplomacy = 10
						martial = 10
						stewardship = 10
						intrigue = 10
						learning = 10
					}
				}
				new_character = {
					set_character_flag = VIET_spawned_courtier
					opinion = {
						modifier = opinion_patron
						who = ROOT
						years = 20
					}
					reverse_opinion = {
						modifier = opinion_new_courtier
						who = ROOT
						years = 5
					}
				}
			}
		}
	}
	
	option = {
		name = "reject.VIET.courtiers"
	}
	
}

#Courtier about to get married
character_event = {
	id = ordepmarriage.9000
	desc = ordepmarriage.9000.desc
	picture = GFX_evt_marriage
	
	min_age = 16
	max_age = 60
	capable_only = yes
	prisoner = no
	only_men = yes
	is_married = no
	has_character_flag = VIET_spawned_courtier
	
	trigger = {
		is_adult = yes
		is_ruler = no
		NOT = {
			liege = { culture = ROOT }
		}
	}

	mean_time_to_happen = {
		years = 20
		
		modifier = {
			factor = 0.7
			ROOT = {
				age = 16
				NOT = { age = 25 }
			}
		}
		
		modifier = {
			factor = 0.8
			ROOT = {
				age = 25
				NOT = { age = 32 }
			}
		}
		
		modifier = {
			factor = 1.2
			ROOT = {
				age = 32
				NOT = { age = 40 }
			}
		}
		
		modifier = {
			factor = 1.5
			ROOT = {
				age = 40
			}
		}
		
		modifier = {
			factor = 10
			ROOT = { trait = celibate }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = lustful }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = fair }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = genius }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = quick }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = zealous }
		}

		modifier = {
			factor = 0.9
			ROOT = { trait = charitable }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = greedy }
		}
		
		modifier = {
			factor = 0.9
			ROOT = { trait = gregarious }
		}
		
		modifier = {
			factor = 1.1
			ROOT = { trait = cynical }
		}
		
		modifier = {
			factor = 1.1
			ROOT = { trait = ugly }
		}
		
		modifier = {
			factor = 1.1
			ROOT = { trait = chaste }
		}
				
		modifier = {
			factor = 1.1
			ROOT = { trait = homosexual }
		}
		
		modifier = {
			factor = 1.1
			ROOT = { trait = shy }
		}
	}
	
	option = {
		name = ordepmarriage.9000.a # inform liege
		liege = {
			character_event = { id = ordepmarriage.9001 }
		}
	}
	
}

#liege informed of courtier's marriage
character_event = {
	id = ordepmarriage.9001
	desc = ordepmarriage.9001.desc
	picture = GFX_evt_marriage
	
	is_triggered_only = yes
	
	option = {
		name = ordepmarriage.9001.a
		create_character = {
			female = yes
			random_traits = yes
			dynasty = random
			religion = FROM
			culture = FROM
		}
		new_character = {
			add_spouse = FROM
		}
		FROM = {
			prestige = 10
			piety = 10
		}
	}
}