namespace = visit_brothel
character_event = {
	id = visit_brothel.0
	desc = EVTDESCvisit_brothel.0
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAvisit_brothel.0
		ai_chance = {
			factor = 0.9
		}
		FROMFROM = { character_event = { id = visit_brothel.1 } }
	}
	option = {
		name = EVTOPTBvisit_brothel.0
		ai_chance = {
			factor = 0.1
		}
		FROMFROM = { character_event = { id = visit_brothel.2 } }
	}
	option = {
		name = EVTOPTCvisit_brothel.0
		ai_chance = {
			factor = 0
		}
		set_character_flag = brothel_DND
		FROMFROM = { character_event = { id = visit_brothel.1 } }
	}
}
character_event = {
	id = visit_brothel.1
	desc = EVTDESCvisit_brothel.1
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	immediate = {
		FROM = {
			random_courtier = {
				limit = {
					is_female = yes
					trait = prostitute
					NOR = {
						has_character_flag = female_prostitute_1
						has_character_flag = female_prostitute_2
					}
				}
				set_character_flag = female_prostitute_1
				save_event_target_as = female_prostitute_1
			}
			random_courtier = {
				limit = {
					is_female = yes
					trait = prostitute
					NOR = {
						has_character_flag = female_prostitute_1
						has_character_flag = female_prostitute_2
					}
				}
				set_character_flag = female_prostitute_2
				save_event_target_as = female_prostitute_2
			}
			random_courtier = {
				limit = {
					is_female = no
					trait = prostitute
					NOR = {
						has_character_flag = male_prostitute_1
						has_character_flag = male_prostitute_2
					}
				}
				set_character_flag = male_prostitute_1
				save_event_target_as = male_prostitute_1
			}
			random_courtier = {
				limit = {
					is_female = no
					trait = prostitute
					NOR = {
						has_character_flag = male_prostitute_1
						has_character_flag = male_prostitute_2
					}
				}
				set_character_flag = male_prostitute_2
				save_event_target_as = male_prostitute_2
			}
		}
		add_character_modifier = { modifier = visited_brothel duration = 60 }
	}

	option = {
		name = EVTOPTAvisit_brothel.1
		trigger = {
			FROM = {
				any_courtier = {
					has_character_flag = female_prostitute_1
				}
			}
		}
		event_target:female_prostitute_1 = {
			wealth = 10
			clr_character_flag = female_prostitute_1
			hidden_tooltip = {
				character_event = { id = visit_brothel.3 }
			}
		}
		FROM = {
			wealth = 10
		}
		wealth = -20
		hidden_tooltip = {
			FROM = {
				random_courtier = {
					limit = { has_character_flag = female_prostitute_1 }
					clr_character_flag = female_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = female_prostitute_2 }
					clr_character_flag = female_prostitute_2
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_1 }
					clr_character_flag = male_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_2 }
					clr_character_flag = male_prostitute_2
				}
			}
		}
	}
	option = {
		name = EVTOPTBvisit_brothel.1
		trigger = {
			FROM = {
				any_courtier = {
					has_character_flag = female_prostitute_2
				}
			}
		}
		event_target:female_prostitute_2 = {
			wealth = 10
			clr_character_flag = female_prostitute_2
			hidden_tooltip = {
				character_event = { id = visit_brothel.3 }
			}
		}
		FROM = {
			wealth = 10
		}
		wealth = -20
		hidden_tooltip = {
			FROM = {
				random_courtier = {
					limit = { has_character_flag = female_prostitute_1 }
					clr_character_flag = female_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = female_prostitute_2 }
					clr_character_flag = female_prostitute_2
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_1 }
					clr_character_flag = male_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_2 }
					clr_character_flag = male_prostitute_2
				}
			}
		}
	}
	option = {
		name = EVTOPTCvisit_brothel.1
		trigger = {
			FROM = {
				any_courtier = {
					has_character_flag = male_prostitute_1
				}
			}
		}
		event_target:male_prostitute_1 = {
			wealth = 10
			clr_character_flag = male_prostitute_1
			hidden_tooltip = {
				character_event = { id = visit_brothel.3 }
			}
		}
		FROM = {
			wealth = 10
		}
		wealth = -20
		hidden_tooltip = {
			FROM = {
				random_courtier = {
					limit = { has_character_flag = female_prostitute_1 }
					clr_character_flag = female_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = female_prostitute_2 }
					clr_character_flag = female_prostitute_2
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_1 }
					clr_character_flag = male_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_2 }
					clr_character_flag = male_prostitute_2
				}
			}
		}
	}
	option = {
		name = EVTOPTDvisit_brothel.1
		trigger = {
			FROM = {
				any_courtier = {
					has_character_flag = male_prostitute_2
				}
			}
		}
		event_target:male_prostitute_2 = {
			wealth = 10
			clr_character_flag = male_prostitute_2
			hidden_tooltip = {
				character_event = { id = visit_brothel.3 }
			}
		}
		FROM = {
			wealth = 10
		}
		wealth = -20
		hidden_tooltip = {
			FROM = {
				random_courtier = {
					limit = { has_character_flag = female_prostitute_1 }
					clr_character_flag = female_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = female_prostitute_2 }
					clr_character_flag = female_prostitute_2
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_1 }
					clr_character_flag = male_prostitute_1
				}
				random_courtier = {
					limit = { has_character_flag = male_prostitute_2 }
					clr_character_flag = male_prostitute_2
				}
			}
		}
	}
}
character_event = {
	id = visit_brothel.2
	desc = EVTDESCvisit_brothel.2
	picture = GFX_evt_castle_construction
	is_triggered_only = yes

	option = {
		name = EVTOPTAvisit_brothel.2
	}
}
character_event = {
	id = visit_brothel.3
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		IF = {
			limit = {
				is_female = no
				fertility = 0.1
				FROM = {
					is_female = yes
					is_pregnant = no
					fertility = 0.1
				}
			}
			random = {
				chance = 10
				impregnate = FROM
			}
		}
		IF = {
			limit = {
				is_female = yes
				is_pregnant = no
				fertility = 0.1
				FROM = {
					is_female = no
					fertility = 0.1
				}
			}
			random = {
				chance = 10
				FROM = { impregnate = ROOT }
			}
		}
	}
}