﻿@refortify_danubian_limes = "gfx/interface/illustrations/great_projects/refortify_danubian_limes.dds"
@combat_map_icon = "gfx/interface/icons/icon_holding_castle.dds"
@learning_map_icon = "gfx/interface/icons/icon_skill_learning.dds"
@aurelian_walls = "gfx/interface/illustrations/great_projects/aurelian_walls.dds"
@knossos_palace = "gfx/interface/illustrations/great_projects/knossos_palace.dds"
@neoplatonic_academy = "gfx/interface/illustrations/great_projects/neoplatonic_academy.dds"

aurelian_walls_maintenance = {
	icon = {
		reference = @combat_map_icon
	}
	illustration = {
		reference = @aurelian_walls
	}
	name = {
		desc = great_project_type_aurelian_walls_maintenance
	}
	cost = {
		treasury_or_gold = {
			if = {
				limit = { has_game_rule = difficulty_bgp_harsh }
				value = great_project_base_contribution_cost
				multiply = 2
			}
			else_if = {
				limit = { has_game_rule = difficulty_bgp_unfair }
				value = great_project_base_contribution_cost
				multiply = 4
			}
			else = {
				value = great_project_base_contribution_cost
			}
		}
	}
	ai_will_do = {
		value = 10
	}
	construction_time = { value = 730 }
	invite_interaction = request_great_project_contribution_interaction
	province_filter = geographical_region
	province_filter_target = city_of_rome
	is_shown = {
		title:c_roma = {
			holder.top_liege = root.top_liege
		}
		NOT = { is_planning_great_project = aurelian_walls_maintenance }
		NOT = { has_global_variable = aurelian_walls_maintenance_cooldown }
		is_ruler = yes
	}
	can_start_planning = {
		is_at_war = no
		custom_tooltip = {
			text = "ROME_LOCATION_1_TOOLTIP"
			title:c_roma = { holder.top_liege = root.top_liege }
		}
	}
	is_valid = {
		title:c_roma.holder = { top_liege = scope:owner.top_liege }
	}
	on_cancel = {
		scope:owner = {
			add_prestige = -500 
			add_stress = 40
			add_character_modifier = { modifier = abandoned_project_modifier years = 10 }
			trigger_event = aurelian_walls_maintenance.0007
		}
	}
	on_start_build = { 
		scope:owner = {
			add_legitimacy_effect = { LEGITIMACY = minor_legitimacy_gain }
		}
		scope:great_project = {
			every_contribution = {
				limit = {
					contribution_is_funded = yes
				}
				contributor = {
					add_prestige = minor_prestige_value 
				}	
			}
		}
	}
	on_complete = {
		great_project_notify_completion = { CHARACTER = scope:owner }
		scope:owner = {
			trigger_event = aurelian_walls_maintenance.0006
			trigger_event = {
				id = aurelian_walls_maintenance.0008
				years = 101
			}
			}
		set_global_variable = { name = aurelian_walls_maintenance_cooldown months = 1200 }
		title:c_roma = {
			remove_county_modifier = aurelian_walls_neglected_modifier 
			add_county_modifier = { modifier = aurelian_walls_maintained_modifier months = 1200 } 
		}
	}
	project_contributions = {
		towers = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 5
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 7
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 1.5
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				}
			} 
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = aurelian_walls_maintenance.0001
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }	
			ai_will_do = {
				value = 10
			}
		}
		gates = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 2
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else = {
						value = great_project_base_contribution_cost
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = aurelian_walls_maintenance.0002
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}	
		}	
		urban_cohorts = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = aurelian_walls_maintenance.0003
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
		granaries = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 2
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else = {
						value = great_project_base_contribution_cost
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = {
				if = {
					limit = { is_alive = yes }
					trigger_event = aurelian_walls_maintenance.0004
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
		prefect = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = aurelian_walls_maintenance.0005
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
	}
}

restore_knossos_palace = {
	icon = {
		reference = @combat_map_icon
	}
	illustration = {
		reference = @knossos_palace
	}
	name = {
		desc = great_project_type_restore_knossos_palace
	}
	cost = {
		treasury_or_gold = {
			if = {
				limit = { has_game_rule = difficulty_bgp_harsh }
				value = great_project_base_contribution_cost
				multiply = 2
			}
			else_if = {
				limit = { has_game_rule = difficulty_bgp_unfair }
				value = great_project_base_contribution_cost
				multiply = 4
			}
			else = {
				value = great_project_base_contribution_cost
			}
		}
	}
	ai_will_do = {
		value = 10
	}
	construction_time = { value = 730 }
	invite_interaction = request_great_project_contribution_interaction
	province_filter = geographical_region
	province_filter_target = chandax
	is_shown = {
		has_game_rule = bgp_knossos_on
		title:c_chandax = {
			holder.top_liege = root.top_liege
		}
		NOT = { is_planning_great_project = restore_knossos_palace }
		NOT = { has_global_variable = restore_knossos_palace_cooldown }
		is_ruler = yes
		OR = {
			title:e_byzantium = { holder.top_liege = root.top_liege }
			title:h_roman_empire = { holder.top_liege = root.top_liege }
			title:h_eastern_roman_empire = { holder.top_liege = root.top_liege }	
			AND = {
				has_game_rule = empire_requirements_bgp_pretenders
				OR = {
					title:e_hre = { holder.top_liege = root.top_liege }
					title:e_latin_empire = { holder.top_liege = root.top_liege }
					title:e_byzantium = { holder.top_liege = root.top_liege }
				}
			}
			has_game_rule = empire_requirements_bgp_everyone
		}
		OR = {
			has_game_rule = bgp_anyone
			culture = { has_cultural_pillar = heritage_byzantine }
			culture = { has_cultural_pillar = heritage_ancient_greek }
		}
	}
	can_start_planning = {
		is_at_war = no
		custom_tooltip = {
			text = "CHANDAX_LOCATION_1_TOOLTIP"
			title:c_chandax = { holder.top_liege = root.top_liege }
		}
	}
	is_valid = {
		title:c_chandax.holder = { top_liege = scope:owner.top_liege }
		has_game_rule = bgp_knossos_on
	}
	on_cancel = {
		scope:owner = {
			add_prestige = -500 
			add_stress = 40
			add_character_modifier = { modifier = abandoned_project_modifier years = 10 }
			trigger_event = restore_knossos_palace.0007
		}
	}
	on_start_build = { 
		scope:owner = {
			add_legitimacy_effect = { LEGITIMACY = minor_legitimacy_gain }
		}
		scope:great_project = {
			every_contribution = {
				limit = {
					contribution_is_funded = yes
				}
				contributor = {
					add_prestige = minor_prestige_value 
				}	
			}
		}
	}
	on_complete = {
		great_project_notify_completion = { CHARACTER = scope:owner }
		scope:owner = {
			trigger_event = restore_knossos_palace.0006
		}
		title:b_iraklio.title_province = { add_special_building = bgp_knossos_palace }
		set_global_variable = { name = restore_knossos_palace_cooldown months = -1 }
	}
	project_contributions = {
		port = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 5
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 7
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 1.5
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				}
			} 
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0001
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }	
			ai_will_do = {
				value = 10
			}
		}
		survey = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 2
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else = {
						value = great_project_base_contribution_cost
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0002
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}	
		}	
		palace = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0003
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
		frescoes = {
			cost = {
				piety = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = {
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0004
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
	}
}

restore_knossos_palace_alt = {
	icon = {
		reference = @combat_map_icon
	}
	illustration = {
		reference = @knossos_palace
	}
	name = {
		desc = great_project_type_restore_knossos_palace
	}
	cost = {
		treasury_or_gold = {
			if = {
				limit = { has_game_rule = difficulty_bgp_harsh }
				value = great_project_base_contribution_cost
				multiply = 2
			}
			else_if = {
				limit = { has_game_rule = difficulty_bgp_unfair }
				value = great_project_base_contribution_cost
				multiply = 4
			}
			else = {
				value = great_project_base_contribution_cost
			}
		}
	}
	ai_will_do = {
		value = 10
	}
	construction_time = { value = 730 }
	invite_interaction = request_great_project_contribution_interaction
	province_filter = geographical_region
	province_filter_target = chandax
	is_shown = {
		has_game_rule = bgp_knossos_on_alt
		title:c_chandax = {
			holder.top_liege = root.top_liege
		}
		NOT = { is_planning_great_project = restore_knossos_palace_alt }
		NOT = { has_global_variable = restore_knossos_palace_alt_cooldown }
		is_ruler = yes
		OR = {
			title:e_byzantium = { holder.top_liege = root.top_liege }
			title:h_roman_empire = { holder.top_liege = root.top_liege }
			title:h_eastern_roman_empire = { holder.top_liege = root.top_liege }	
			AND = {
				has_game_rule = empire_requirements_bgp_pretenders
				OR = {
					title:e_hre = { holder.top_liege = root.top_liege }
					title:e_latin_empire = { holder.top_liege = root.top_liege }
					title:e_byzantium = { holder.top_liege = root.top_liege }
				}
			}
			has_game_rule = empire_requirements_bgp_everyone
		}
		OR = {
			has_game_rule = bgp_anyone
			culture = { has_cultural_pillar = heritage_byzantine }
			culture = { has_cultural_pillar = heritage_ancient_greek }
		}
	}
	can_start_planning = {
		custom_tooltip = {
			text = "CHANDAX_LOCATION_1_TOOLTIP"
			title:c_chandax = { holder.top_liege = root.top_liege }
		}
	}
	is_valid = {
		has_game_rule = bgp_knossos_on_alt
		title:c_chandax.holder = { top_liege = scope:owner.top_liege }
	}
	on_cancel = {
		scope:owner = {
			add_prestige = -500 
			add_stress = 40
			add_character_modifier = { modifier = abandoned_project_modifier years = 10 }
			trigger_event = restore_knossos_palace.0007
		}
	}
	on_start_build = { 
		scope:owner = {
			add_legitimacy_effect = { LEGITIMACY = minor_legitimacy_gain }
		}
		scope:great_project = {
			every_contribution = {
				limit = {
					contribution_is_funded = yes
				}
				contributor = {
					add_prestige = minor_prestige_value 
				}	
			}
		}
	}
	on_complete = {
		great_project_notify_completion = { CHARACTER = scope:owner }
		title:b_iraklio.title_province = { add_special_building = bgp_knossos_palace }
		scope:owner = {
			trigger_event = restore_knossos_palace.0008
		}
		set_global_variable = { name = restore_knossos_palace_alt_cooldown months = -1 }
	}
	project_contributions = {
		port = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 5
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 7
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 1.5
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				}
			} 
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0001
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }	
			ai_will_do = {
				value = 10
			}
		}
		survey = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 2
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else = {
						value = great_project_base_contribution_cost
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0002
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}	
		}	
		palace = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0003
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
		frescoes = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = {
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0004
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
		labyrinth = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 12
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 4
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = no
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = {
				if = {
					limit = { is_alive = yes }
					trigger_event = restore_knossos_palace.0005
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
	}
}

reestablish_neoplatonic_academy = {
	icon = {
		reference = @learning_map_icon
	}
	illustration = {
		reference = @neoplatonic_academy
	}
	name = {
		desc = great_project_type_reestablish_neoplatonic_academy
	}
	cost = {
		treasury_or_gold = {
			if = {
				limit = { has_game_rule = difficulty_bgp_harsh }
				value = great_project_base_contribution_cost
				multiply = 4
			}
			else_if = {
				limit = { has_game_rule = difficulty_bgp_unfair }
				value = great_project_base_contribution_cost
				multiply = 8
			}
			else = {
				value = great_project_base_contribution_cost
				multiply = 2
			}
		}
	}
	ai_will_do = {
		value = 10
	}
	construction_time = { value = 730 }
	invite_interaction = request_great_project_contribution_interaction
	province_filter = geographical_region
	province_filter_target = athens
	is_shown = {
		title:c_attica = {
			holder.top_liege = root.top_liege
		}
		NOT = { is_planning_great_project = reestablish_neoplatonic_academy }
		NOT = { has_global_variable = reestablish_neoplatonic_academy_cooldown }
		is_ruler = yes
		OR = {
			title:e_byzantium = { holder.top_liege = root.top_liege }
			title:h_roman_empire = { holder.top_liege = root.top_liege }
			title:h_eastern_roman_empire = { holder.top_liege = root.top_liege }	
			AND = {
				has_game_rule = empire_requirements_bgp_pretenders
				OR = {
					title:e_hre = { holder.top_liege = root.top_liege }
					title:e_latin_empire = { holder.top_liege = root.top_liege }
					title:e_byzantium = { holder.top_liege = root.top_liege }
				}
			}
			has_game_rule = empire_requirements_bgp_everyone
		}
		OR = {
			has_game_rule = bgp_anyone
			culture = { has_cultural_pillar = heritage_byzantine }
			culture = { has_cultural_pillar = heritage_ancient_greek }
		}
	}
	can_start_planning = {
		custom_tooltip = {
			text = "ATTICA_LOCATION_1_TOOLTIP"
			title:c_attica = { holder.top_liege = root.top_liege }
		}
	}
	is_valid = {
		title:c_attica.holder = { top_liege = scope:owner.top_liege }
	}
	on_cancel = {
		scope:owner = {
			add_prestige = -500 
			add_stress = 40
			add_character_modifier = { modifier = abandoned_project_modifier years = 10 }
			trigger_event = reestablish_neoplatonic_academy.0005
		}
	}
	on_start_build = { 
		scope:owner = {
			add_legitimacy_effect = { LEGITIMACY = minor_legitimacy_gain }
		}
		scope:great_project = {
			every_contribution = {
				limit = {
					contribution_is_funded = yes
				}
				contributor = {
					add_prestige = minor_prestige_value 
				}	
			}
		}
	}
	on_complete = {
		great_project_notify_completion = { CHARACTER = scope:owner }
		scope:owner = {
			trigger_event = reestablish_neoplatonic_academy.0006
		}
		set_global_variable = { name = reestablish_neoplatonic_academy_cooldown months = -1 }
		title:c_attica = {
			add_county_modifier = { modifier = academy_of_athens_modifier months = -1 } 
		}
		title:b_athens = {
			set_variable = special_university
			set_variable = travel_point_of_interest_learning
		}
	}
	project_contributions = {
		rebuild_academy_grove = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				}
			} 
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = reestablish_neoplatonic_academy.0001
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }	
			ai_will_do = {
				value = 10
			}
		}
		recover_academy_texts = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = reestablish_neoplatonic_academy.0002
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}	
		}	
		recall_academy_philosophers = {
			cost = {
				piety = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 6
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 9
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 3
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = { 
				if = {
					limit = { is_alive = yes }
					trigger_event = reestablish_neoplatonic_academy.0003
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
		establish_academy_charter = {
			cost = {
				treasury_or_gold = {
					if = {
						limit = { has_game_rule = difficulty_bgp_harsh }
						value = great_project_base_contribution_cost
						multiply = 4
					}
					else_if = {
						limit = { has_game_rule = difficulty_bgp_unfair }
						value = great_project_base_contribution_cost
						multiply = 8
					}
					else = {
						value = great_project_base_contribution_cost
						multiply = 2
					}
				}
			}
			contributor_is_valid = { 
				OR = {
					this = scope:owner 
					is_vassal_or_below_of = scope:owner 
					is_tributary_of = scope:owner 
				} 	
			}
			is_required = yes
			on_contribution_funded = {
				great_project_notify_contribution = yes
				great_project_contribution_catalyst_effect = yes
			}
			contributor_cooldown = individual_contribution_cooldown_value
			on_complete = {
				if = {
					limit = { is_alive = yes }
					trigger_event = reestablish_neoplatonic_academy.0004
				}
			}
			ai_check_interval_by_tier = { barony = 0 county = 12 duchy = 9 kingdom = 6 empire = 6 hegemony = 6 }
			ai_will_do = {
				value = 10
			}
		}
	}
}