﻿add_namespace = GREcrete

#OTO - The Great Cretan Revolution of 1866 (21.08.1866)
country_event = {
	id = GREcrete.1
	title = GREcrete.1.t
	desc = GREcrete.1.d
	picture = GFX_report_event_cretan_revolution

	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		tag = OTO
		182 = { is_owned_and_controlled_by = OTO } #Crete
	}

	immediate = {
		hidden_effect = {
			set_global_flag = cretan_revolution_ongoing_flag
			182 = {
				add_core_of = CET
			}
			1242 = {
				add_core_of = CET
				add_victory_points = {
					province = 4170
					value = 1
				}
				set_province_name = { id = 4170 name = "Sitia"}
			}
			release = CET
			CET = { 
				add_ideas = CET_idea_cretan_spirit
				add_ideas = hidden_idea_never_surrender
				set_cosmetic_tag = CET_Cretan_Rebels
				load_oob = CET_rebellion_1866
				add_manpower = 2500
				add_equipment_to_stockpile = {
					type = infantry_equipment
					amount = 500
					producer = GRE
				}
				add_equipment_to_stockpile = {
					type = uniform_equipment
					amount = 500
					producer = GRE
				}
				182 = {
					add_building_construction = {
						type = bunker
						level = 1
						instant_build = yes
						province = 9940
					}
					add_building_construction = {
						type = bunker
						level = 1
						instant_build = yes
						province = 12058
					}
				}
				1242 = {
					add_building_construction = {
						type = bunker
						level = 1
						instant_build = yes
						province = 4170
					}
				}
				activate_advisor = CET_theorist_gavriel_marinakis
				activate_advisor = CET_mhc_gavriel_marinakis
			}
			declare_war_on = {
				target = CET
				type = wargoal_cretan_revolution
			}
			news_event = { id = GREcrete.2 days = 1 }
		}
	}

	#Declare War on the Rebels
	option = {
		name = GREcrete.1.a
		activate_mission = eoanb_mission_cretan_revolution
		hidden_effect = {
			CET = { activate_mission = eoanb_mission_cretan_revolution }
		}
	}

	#Take Control of the Rebels
	option = {
		name = GREcrete.1.b
		trigger = {
			is_ai = no
		}
		activate_mission = eoanb_mission_cretan_revolution
		CET = {
			activate_mission = eoanb_mission_cretan_revolution
			change_tag_from = ROOT
		}
	}
}

#The Great Cretan Revolution of 1866 (21.08.1866)
news_event = {
	id = GREcrete.2
	title = GREcrete.2.t
	desc = GREcrete.2.d
	picture = GFX_news_event_cretan_revolution

	major = yes
	
	is_triggered_only = yes

	fire_for_sender = no
	
	option = {
		name = GREcrete.2.a
		if = {
			limit = {
				tag = GRE
			}
			unlock_decision_tooltip = GRE_decision_help_the_cretan_rebels
			add_opinion_modifier = { target = CET modifier = GRE_CRETAN_BRETHREN_REL }
			reverse_add_opinion_modifier = { target = CET modifier = GRE_CRETAN_BRETHREN_REL }
		}
	}
}

#The Motherland Supports our Struggle for Freedom
country_event = {
	id = GREcrete.3
	title = GREcrete.3.t
	desc = GREcrete.3.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = GREcrete.3.a
		add_manpower = 1000
		add_war_support = 0.05
	}
}

#Military Officers from Greece Arrive
country_event = {
	id = GREcrete.4
	title = GREcrete.4.t
	desc = GREcrete.4.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = GREcrete.4.a
		add_manpower = 250
		add_war_support = 0.05
		army_experience = 25
		add_tech_bonus = { bonus = 0.5 uses = 2 category = infantry_weapons }
		add_doctrine_cost_reduction = { cost_reduction = 0.5 uses = 2 category = land_doctrine }
	}
}

#Military Equipment from Greece Arrives
country_event = {
	id = GREcrete.5
	title = GREcrete.5.t
	desc = GREcrete.5.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = GREcrete.5.a
		add_manpower = 250
		add_war_support = 0.05
		army_experience = 25
		add_tech_bonus = { bonus = 0.5 uses = 2 category = infantry_weapons }
		add_doctrine_cost_reduction = { cost_reduction = 0.5 uses = 2 category = land_doctrine }
	}
}

#A Volunteer Division from Greece Arrives
country_event = {
	id = GREcrete.6
	title = GREcrete.6.t
	desc = GREcrete.6.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = GREcrete.6.a
		add_war_support = 0.05
		army_experience = 10
		182 = {
			create_unit = {
				division = "name = \"Cretan Rebels\" division_template = \"Cretan Rebels\" start_experience_factor = 0.15"
				owner = CET
				prioritize_location = 12058
			}
		}
	}
}

#The Arkadi Explosion
country_event = {
	id = GREcrete.7
	title = GREcrete.7.t
	desc = GREcrete.7.d
	picture = GFX_report_event_arkadi_explosion

	fire_only_once = yes
	
	trigger = {
		tag = CET
		has_active_mission = eoanb_mission_cretan_revolution
		NOT = { controls_province = 1164 }
	}

	option = {
		name = GREcrete.7.a 
		182 = {
			add_manpower = -800
		}
		add_manpower = -250
		add_war_support = -0.05
		hidden_effect = {
			every_country = {
				limit = {
					OR = {
						tag = ENG
						tag = FRA
						tag = RUS
						tag = AUS
						tag = PIE
						tag = USA
						tag = SER
						tag = PRS
						tag = ROM
						tag = MNT 
						tag = GRE 
					}
				}
				news_event = { id = GREcrete.8 days = 1 }
			}
			country_event = { id = GREcrete.10 days = 14 }
		}
	}
}

#The Arkadi Explosion
news_event = {
	id = GREcrete.8
	title = GREcrete.8.t
	desc = GREcrete.8.d
	picture = GFX_news_event_arkadi_explosion

	major = yes
	
	fire_only_once = yes
	
	is_triggered_only = yes

	fire_for_sender = no
	
	#What a tragedy
	option = {
		name = GREcrete.8.a
		ai_chance = {
			base = 80
			modifier = {
				factor = 0
				OR = {
					tag = AUS
					tag = ENG
					tag = RUS
					tag = GRE
				}
			}
		}
	}
	
	#We need to help them
	option = {
		name = GREcrete.8.b
		ai_chance = { base = 20 }
		add_opinion_modifier = { target = CET modifier = GRE_ARKADI_EXPLOSION_REL }
		reverse_add_opinion_modifier = { target = CET modifier = GRE_ARKADI_EXPLOSION_REL }
		if = {
			limit = {
				tag = GRE
			}
			add_war_support = 0.1
			unlock_decision_tooltip = GRE_decision_help_the_cretan_rebels_4
			hidden_effect = {
				set_country_flag = cretan_revolution_greek_intervention_flag
			}
		}
	}
}

#Greece Joins our Struggle for Freedom
country_event = {
	id = GREcrete.9
	title = GREcrete.9.t
	desc = GREcrete.9.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = GREcrete.9.a
		add_manpower = 1500
		add_war_support = 0.15
		army_experience = 10
		add_command_power = 50
	}
}

#More Volunteers Arrive from Christian Countries
country_event = {
	id = GREcrete.10
	title = GREcrete.10.t
	desc = GREcrete.10.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	option = {
		name = GREcrete.10.a
		add_manpower = 500
		add_war_support = 0.03
		army_experience = 5
		add_equipment_to_stockpile = {
			type = infantry_equipment
			amount = 250
		}
		add_equipment_to_stockpile = {
			type = uniform_equipment
			amount = 250
		}
	}
}

#The Cretan Revolution Succeeds
country_event = {
	id = GREcrete.11
	title = GREcrete.11.t
	desc = GREcrete.11.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			drop_cosmetic_tag = yes
			remove_ideas = CET_idea_cretan_spirit
			remove_mission = eoanb_mission_cretan_revolution
			OTO = { remove_mission = eoanb_mission_cretan_revolution }
		}
	}

	option = {
		name = GREcrete.11.a
		increase_ps_by_one = yes
		add_stability = 0.05
		add_war_support = -0.35
		army_experience = 25
		hidden_effect = {
			news_event = { id = GREcrete.12 days = 1 }
			182 = {
				remove_core_of = GRE
			}
			1242 = {
				remove_core_of = GRE
			}
		}
	}
}

#The Cretan Revolution Succeeds
news_event = {
	id = GREcrete.12
	title = GREcrete.12.t
	desc = GREcrete.12.d
	picture = GFX_news_event_cretan_revolution

	major = yes
	
	is_triggered_only = yes

	fire_for_sender = no
	
	#The Ottomans are weaker than we thought
	option = {
		name = GREcrete.12.a
		ai_chance = { base = 100 }
		trigger = {
			NOT = {
				OR = {
					tag = GRE
					tag = OTO
				}
			}
		}
	}
	
	#GRE - A heroic struggle
	option = {
		name = GREcrete.12.b
		ai_chance = { base = 100 }
		trigger = {
			tag = GRE
		}
		#unlock_decision_tooltip = GRE_decision_integrate
	}

	#OTO - A humiliating defeat
	option = {
		name = GREcrete.12.c
		ai_chance = { base = 100 }
		trigger = {
			tag = OTO
		}
		decrease_ps_by_one = yes
		OTO_sicker_man_of_europe = yes
	}
}

#The Cretan Revolution Fails
country_event = {
	id = GREcrete.13
	title = GREcrete.13.t
	desc = GREcrete.13.d
	picture = GFX_report_event_cretan_revolution
	
	fire_only_once = yes
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			remove_mission = eoanb_mission_cretan_revolution
			CET = { remove_mission = eoanb_mission_cretan_revolution }
		}
	}

	option = {
		name = GREcrete.13.a
		increase_ps_by_one = yes
		add_stability = 0.05
		add_war_support = -0.15
		army_experience = 10
		set_temp_variable = { eoanb_prestige_change = 3 }
		eoanb_change_prestige_score = yes
		hidden_effect = {
			news_event = { id = GREcrete.14 days = 1 }
		}
	}
}

#The Cretan Revolution Fails
news_event = {
	id = GREcrete.14
	title = GREcrete.14.t
	desc = GREcrete.14.d
	picture = GFX_news_event_cretan_revolution

	major = yes
	
	is_triggered_only = yes

	fire_for_sender = no
	
	#The rebels have fought honorably
	option = {
		name = GREcrete.14.a
		ai_chance = { base = 100 }
		trigger = {
			NOT = {
				OR = {
					tag = GRE
					tag = MNT
					tag = ROM
					tag = SER
				}
			}
		}
	}
	
	#GRE/MNT/ROM/SER - This won't be the last time...
	option = {
		name = GREcrete.14.b
		ai_chance = { base = 100 }
		trigger = {
			OR = {
				tag = GRE
				tag = MNT
				tag = ROM
				tag = SER
			}
		}
		add_stability = -0.05
		add_war_support = 0.05
		set_temp_variable = { eoanb_prestige_change = -1 }
		eoanb_change_prestige_score = yes
	}
}

country_event = {#If Crete won Annex into Greece 
	id = GREcrete.17
	title = GREcrete.17.t
	desc = GREcrete.17.d
	#picture = 

	is_triggered_only = yes

	option = {
		name = greek_events.17.a #integrate into greece
		GRE = {
			annex_country = {
				target = ROOT
				transfer_troops = yes
			}
		}
		182 = {
				remove_dynamic_modifier = {
					modifier = dynmod_OTO_crete_revolt
				}
			}
		1242 = {
				remove_dynamic_modifier = {
					modifier = dynmod_OTO_crete_revolt
				}
			}
	}
	option = {
		name = greek_events.17.b #refuse
		set_country_flag = CET_independant_sprit
		182 = {
				remove_dynamic_modifier = {
					modifier = dynmod_OTO_crete_revolt
				}
			}
		1242 = {
				remove_dynamic_modifier = {
					modifier = dynmod_OTO_crete_revolt
			}
		}
	}
}