namespace = CIML

# The Great Schism Mended
narrative_event = {
	id = CIML.210
	title = EVTNAMECIML.210
	desc = EVTDESCCIML.210
	
	picture = GFX_evt_virgin_mary_icon
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTACIML.200

		set_global_flag = schism_mended
		give_nickname = nick_the_restorer
		hidden_tooltip = {
			any_playable_ruler = {
				limit = {
					OR = {
						religion = orthodox
						religion = miaphysite
						religion = barlaamite
					}
					controls_religion = no
				}
				narrative_event = { id = CIML.211 }
			}
			any_playable_ruler = {
				limit = {
					NOT = {
						religion = orthodox
						religion = miaphysite
						religion = barlaamite
					}
					controls_religion = no
				}
				narrative_event = { id = CIML.212 }
			}
		}
	}
}

# Convert or Not?
narrative_event = {
	id = CIML.211
	title = EVTNAMECIML.210
	desc = EVTDESCCIML.210
	
	picture = GFX_evt_virgin_mary_icon
	
	is_triggered_only = yes
	
	option = { # Yes
		name = EVTOPTACIML.211
		ai_chance = { factor = 50 }
		religion = FROM
		any_courtier = {
			limit = {
				OR = {
					religion = orthodox
					religion = miaphysite
					religion = barlaamite
					}
				liege = { character = ROOT }
			}
			religion = FROM
		}
		capital_scope = {
			religion = FROM
		}
	}
	option = { # No
		name = EVTOPTBCIML.211
		ai_chance = { factor = 50 }
	}
}

narrative_event = {
	id = CIML.212
	title = EVTNAMECIML.210
	desc = EVTDESCCIML.210
	
	picture = GFX_evt_virgin_mary_icon
	
	is_triggered_only = yes
	
	option = { # Yes
		trigger = {
		religion = catholic
	}
		name = EVTOPTACIML.211
	}
	option = { # No
		trigger = {
			NOT = {
				religion = catholic
				}
	}
		name = EVTOPTCCIML.211
	}
}

### The Great Schism happen events

# Inform Catholics
narrative_event = {
  id = CIML.803
  title = EVTNAMECIML.803
  desc = EVTDESCCIML.803
  
  picture = GFX_evt_great_schism
  
  is_triggered_only = yes
  
  option = {
    name = EVTOPTACIML.803
  }
  
  after = {
  }
  
}

# Inform non-sardinian ortodox and baraalmites
narrative_event = {
  id = CIML.804
  title = EVTNAMECIML.804
  desc = EVTDESCCIML.804
  
  picture = GFX_evt_great_schism
  
  is_triggered_only = yes
  
  option = {
    name = EVTOPTACIML.804
  }
  
  after = {
  }
  
}

# Orthodox and Barlaamite Sardinians may flip to Catholicism, A is going catholic, B is remaining orthodox or barlaamite
narrative_event = {
  id = CIML.805
  title = EVTNAMECIML.805
  desc = EVTDESCCIML.805
  
  picture = GFX_evt_great_schism
  
  is_triggered_only = yes
  
  option = {
    name = EVTOPTACIML.805
	ai_chance = { factor = 70 }
	trigger = {
		OR = {
			ai = no
			independent = yes
			religion_authority < 0.2
			NOT = { top_liege { religion = orthodox } }
			NOT = { top_liege { religion = barlaamite } }
		}
	}
	religion = catholic
	any_courtier = {
		limit = {
			OR = {
				religion = orthodox
				religion = barlaamite
			}
			culture = sardinian
		}
		religion = catholic
	}
	any_demesne_province = {
		limit = {
			OR = {
				religion = orthodox
				religion = barlaamite
			}
			culture = sardinian
		}
		religion = catholic
	}
  }
  
  option = {
    name = EVTOPTBCIML.805
	ai_chance = { factor = 30 }
  }
  
  after = {
  }
  
}

# Inform Iconoclasts
narrative_event = {
  id = CIML.806
  title = EVTNAMECIML.806
  desc = EVTDESCCIML.806
  
  picture = GFX_evt_great_schism
  
  is_triggered_only = yes
  
  option = {
    name = EVTOPTACIML.806
  }

  after = {
  }
  
}

# Inform other christians and everyone else, A is for christians and B is for everyone else
narrative_event = {
  id = CIML.807
  title = EVTNAMECIML.807
  desc = EVTDESCCIML.807
  
  picture = GFX_evt_great_schism
  
  is_triggered_only = yes
  
  option = {
    name = EVTOPTACIML.807
	trigger = {
		religion_group = christian
	}
  }
  
  option = {
    name = EVTOPTBCIML.807
	trigger = {
		NOT = {	
			religion_group = christian
		}
	}
  }
  
  after = {
  }
  
}