namespace = ancrel
#reserved: ancrel.4000 - ancrel.5000

#######################################
# KEMETIC EVENTS
# Written by Zeress
#######################################

# Luxor Restoration Part 1
province_event = {
	id = ancrel.4000
	title = "EVTNAME_ancrel_4000"
	desc = "EVTDESC_ancrel_4000"
	picture = "GFX_persepolis_ruin"

	is_triggered_only = yes
	
	immediate = {
		795 = { 
			set_province_flag = reb_luxor_1
			add_province_modifier = { name = reb_mod_luxor_1 duration = 2550 }
		}
	}	

	option = {
		name = "EVTOPTA_ancrel_4000" # Make it the greatest temple there ever was!
	}
}

# Luxor Restoration Part 2 - Add Asyut bonus modifier ~8 years
province_event = {
	id = ancrel.4001
	title = "EVTNAME_ancrel_4001"
	desc = "EVTDESC_ancrel_4001"
	picture = "GFX_evt_luxor"

	has_global_flag = luxor_restoring
	
	trigger = {
		province_id = 795 # Asyut
		NOT = { has_global_flag = luxor_restored }
		had_province_flag = { flag = reb_luxor_1 days = 2555 }
		NOT = { has_province_flag = reb_luxor_2 }
	}

	immediate = {
		set_province_flag = reb_luxor_2
		add_province_modifier = { name = reb_mod_luxor_2 duration = 638 }
	}
	
	mean_time_to_happen = {
		days = 7
	}
	
	option = {
		name = "EVTOPTA_ancrel_4001" # Library
		795 = {
			add_province_modifier = { name = "luxor_library" duration = -1 }
		}
	}
	option = {
		name = "EVTOPTB_ancrel_4001" # Promote Fanaticism
		795 = {
			add_province_modifier = { name = "luxor_fanaticism" duration = -1 }
		}
	}
	option = {
		name = "EVTOPTC_ancrel_4001" # Promote Tax Collection
		795 = {
			add_province_modifier = { name = "luxor_admin" duration = -1 }
		}
	}
}

# Luxor Restoration Part 3 ~2 years

province_event = {
	id = ancrel.4002
	title = "EVTNAME_ancrel_4002"
	desc = "EVTDESC_ancrel_4002"
	picture = "GFX_evt_luxor"

	has_global_flag = luxor_restoring
	
	trigger = {
		province_id = 795 # Asyut
		NOT = { has_global_flag = luxor_restored }
		has_province_flag = reb_luxor_1
		had_province_flag = { flag = reb_luxor_2 days = 638 }		
	}

	mean_time_to_happen = {
		days = 7
	}
	
	immediate = {
		clr_global_flag = luxor_restoring
		set_global_flag = luxor_restored
		clr_province_flag = reb_luxor_1
		clr_province_flag = reb_luxor_2
	}

	option = {
		name = "EVTOPTA_ancrel_4002"
		owner = {
			795 = {
				build_holding = {
				   title = b_luxor
				   type = temple
				   holder = PREV
				}
			}
		}
		owner = {
			prestige = 500
			religion_authority = {
				modifier = luxor_restored
				years = 30
			}
		}
		hidden_tooltip = {
			owner = {
				set_character_flag = event_ancrel.4003
				narrative_event = { id = ancrel.4003 days = 7 }
			}
		}
	}
}

# News spread about Luxor
narrative_event = {
	id = ancrel.4003
	title = "EVTNAME_ancrel_4003"
	desc = "EVTDESC_ancrel_4003"
	picture = "GFX_evt_luxor"
	border = "GFX_event_narrative_frame_religion"
	
	major = yes
	only_rulers = yes
	is_triggered_only = yes
	
	option = {
		trigger = {
			OR = {
				has_character_flag = event_ancrel4003
				religion = egyptian_pagan
				religion = aten_pagan
			}
		}
		if = {
			limit = { has_character_flag = event_ancrel4003 }
			clr_character_flag = event_ancrel4003
		}
		name = "OK"
	}
	
	option = {
		trigger = {
			NOT = { has_character_flag = event_ancrel4003 }
		}
		name = "EVTOPTA_ancrel_4003"
	}
}

# Pharaoh wants to build a Pyramid
character_event = {
	id = ancrel.4004
	desc = "EVTDESC_ancrel_4004"
	picture = "GFX_evt_boatcoast"

	is_triggered_only = yes
	
	immediate = {
		capital_scope = { 
			set_province_flag = pyramid_building_prov
			add_province_modifier = { name = pyramid_building_mod_prov }
			province_event = { id = ancrel.4005 days = 4871 random = 365 }
		}
	}	

	option = {
		name = "EVTOPTA_ancrel_4004" # Make it the greatest pyramid there ever was!
		wealth = -600
	}
}

# The Pyramid is done!
province_event = {
	id = ancrel.4005
	desc = "EVTDESC_ancrel_4005"
	picture = "GFX_evt_pyramid"
	
	is_triggered_only = yes

	trigger = {
		had_province_flag = { flag = pyramid_building_prov days = 4871 }
		owner = { 
			NOT = { has_character_flag = pyramid_built}
		}
	}

	immediate = {
		clr_province_flag = pyramid_building_prov
		remove_province_modifier = pyramid_building_mod_prov
	}
	
	option = {
		name = "EVTOPTA_ancrel_4005" # My pyramid is done!

		trigger = { owner = { has_character_flag = pyramid_building_char} }
		owner = {
			clr_character_flag = pyramid_building_char
			set_character_flag = pyramid_built
			prestige = 500
		}
	}
	option = {
		name = "EVTOPTB_ancrel_4005" # My predecessor's pyramid is done

		trigger = { 
			owner = {
				NOT = { 
					has_character_flag = pyramid_building_char
				}
				OR = {
					religion = egyptian_pagan
					religion = aten_pagan
				}
			}
		}
		owner = {
			prestige = 100
		}
	}
	option = {
		name = "EVTOPTC_ancrel_4005" # Pagan Garbage!

		trigger = { 
			owner = {
				NOR = {
					has_character_flag = pyramid_building_char
					OR = {
						religion = egyptian_pagan
						religion = aten_pagan
					}	
				}
			}
		}		
	}	
}

# The Priesthood Restored
narrative_event = {
	id = ancrel.4006
	title = EVTNAME_ancrel_4006
	desc = EVTDESC_ancrel_4006
	picture = GFX_evt_bishop_muslim
	border = GFX_event_narrative_frame_religion
	
	major = yes
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_ancrel_4006
		trigger = {
			OR = {
				religion = egyptian_pagan
				religion = aten_pagan
			}
		}
	}
	option = {
		name = EVTOPTB_ancrel_4006
		trigger = {
			NOR = {
				religion = egyptian_pagan
				religion = aten_pagan
			}
		}
	}
}

# Anubis Guard founded
narrative_event = {
	id = ancrel.4007
	title = "EVTNAME_ancrel_4007"
	desc = "EVTDESC_ancrel_4007"
	picture = "GFX_evt_anubis"
	border = "GFX_event_narrative_frame_religion"
	
	major = yes
	only_rulers = yes
	is_triggered_only = yes
	
	option = {
		trigger = {
			has_character_flag = event_ancrel4007
		}
		clr_character_flag = event_ancrel4007
		name = "OK"
	}
	
	option = {
		trigger = {
			NOT = { has_character_flag = event_ancrel.4007 }
		}
		name = "EVTOPTA_ancrel_4007"
	}
}

# Horusian Guard Founded
narrative_event = {
	id = ancrel.4008
	title = "EVTNAME_ancrel_4008"
	desc = "EVTDESC_ancrel_4008"
	picture = "GFX_evt_horus"
	border = "GFX_event_narrative_frame_religion"
	
	major = yes
	only_rulers = yes
	is_triggered_only = yes
	
	option = {
		trigger = {
			has_character_flag = event_ancrel4008
		}
		clr_character_flag = event_ancrel4008
		name = "OK"
	}
	
	option = {
		trigger = {
			NOT = { has_character_flag = event_ancrel4008 }
		}
		name = "EVTOPTA_ancrel_4008"
	}
}