namespace = dvg_nov

# start event
dvg_nov.1 = {
	type = country_event
	placement = root
	title = dvg_nov.1.t
	desc = dvg_nov.1.d
	flavor = dvg_nov.1.f

	duration = 3

	event_image = {
		video = "gfx/event_pictures/unspecific_factory_closed.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/factory_closed"

	icon = "gfx/interface/icons/event_icons/event_skull.dds"

	trigger = {
	}

	immediate = {
		set_variable = {
			name = nov_var
			value = 0
		}
		set_variable = {
			name = nov_serfdom
			value = 0
		}

		add_journal_entry = {
			type = je_nov_main
		}
	}

	option = {
		name = dvg_nov.1.a

		add_journal_entry = {
			type = je_nov_serfdom
		}

		add_journal_entry = {
			type = je_nov_non_russians
		}

		add_journal_entry = {
			type = je_nov_bureaucracy
		}

		add_journal_entry = {
			type = je_nov_education
		}

		add_journal_entry = {
			type = je_nov_urban_center
		}

		show_as_tooltip = {
			add_modifier = {
				name = neutrality
				months = -1
			}
			add_modifier = {
				name = dvg_unstable_confederation
				months = -1
			}
			add_modifier = {
				name = outmoded_bureaucracy
				months = -1
			}
			add_modifier = {
				name = dvg_yasak
				months = -1
			}	
		}
	}
}

# Success event
dvg_nov.2 = {
	type = country_event
	placement = root
	title = dvg_nov.2.t
	desc = dvg_nov.2.d
	flavor = dvg_nov.2.f

	icon = "gfx/interface/icons/event_icons/event_scales.dds"

	duration = 3

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_london_center.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/london_center"

	trigger = {
	}

	immediate = {
		set_variable = nov_complete
		remove_modifier = neutrality
		remove_modifier = dvg_unstable_confederation
		remove_modifier = outmoded_bureaucracy
		remove_modifier = dvg_yasak
	}

	option = {
		name = dvg_nov.2.a
		default_option = yes

		every_subject_or_below = {
			limit = { 
				is_subject_of = ROOT
				country_has_primary_culture = cu:north_russian
			}
			save_scope_as = subject_to_annex
			ROOT = {
				annex = scope:subject_to_annex
			}
		}

		add_modifier = dvg_urbanization
		add_modifier = dvg_education
	}

	option = {
		name = dvg_nov.2.b
		default_option = yes

		every_subject_or_below = {
			limit = { 
				is_subject_of = ROOT
				country_has_primary_culture = cu:north_russian
			}
			save_scope_as = subject_to_annex
			ROOT = {
				annex = scope:subject_to_annex
			}
		}

		ig:ig_landowners = { 
			remove_ideology = ideology_republican_paternalistic
			add_ideology = ideology_paternalistic
		}
		if = {
			limit = {
				NOT = {
					has_law = law_type:law_monarchy
				}
			}
			activate_law = law_type:law_monarchy
		}

		add_modifier = dvg_urbanization
		add_modifier = dvg_education
	}
}

# fail event
dvg_nov.3 = {
	type = country_event
	placement = root
	title = dvg_nov.3.t
	desc = dvg_nov.3.d
	flavor = dvg_nov.3.f

	icon = "gfx/interface/icons/event_icons/event_scales.dds"

	duration = 3

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_london_center.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/london_center"

	trigger = {
	}

	immediate = {
		set_variable = nov_completes
		set_global_variable = failstate_NOV
		remove_modifier = neutrality
		remove_modifier = dvg_unstable_confederation
		remove_modifier = outmoded_bureaucracy
		remove_modifier = dvg_yasak
	}

	option = {
		name = dvg_nov.3.a
		default_option = yes

		add_radicals = {
			value = large_radicals
		}

		every_subject_or_below = {
			limit = {
				is_subject_of = ROOT
				NOT = {
					is_subject_type = subject_type_customs_union
					is_subject_type = subject_type_personal_union
				}
			}

			make_independent = yes
		}

		if = {
			limit = {
				NOT = { exists = c:UGG }
				exists = s:STATE_GALICH.region_state:NOV
			}

			create_country = {
				tag = UGG
				origin = this
				state = s:STATE_GALICH.region_state:NOV
				on_created = {
					if = {
						limit = {
							NOT = {
								has_law = law_type:law_monarchy
							}
						}
						activate_law = law_type:law_monarchy
					}
				}
			}
		}

		if = {
			limit = {
				NOT = { exists = c:VYA }
				exists = s:STATE_VYATKA.region_state:NOV
			}

			create_country = {
				tag = VYA
				origin = this
				state = s:STATE_VYATKA.region_state:NOV
			}
		}

		if = {
			limit = {
				NOT = { exists = c:PRM }
				exists = s:STATE_PERM.region_state:NOV
			}

			create_country = {
				tag = PRM
				origin = this
				state = s:STATE_PERM.region_state:NOV
			}
		}

		if = {
			limit = { exists = s:STATE_PERM.region_state:NOV }
			s:STATE_PERM.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_URAL.region_state:NOV }
			s:STATE_URAL.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_NENETSIA.region_state:NOV }
			s:STATE_NENETSIA.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_OB.region_state:NOV }
			s:STATE_OB.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_TOBOLSK.region_state:NOV }
			s:STATE_TOBOLSK.region_state:NOV = { set_state_owner = c:PRM }
		}

		ai_chance = {
			base = 0
		}
	}
}

# fail event government principle change
dvg_nov.4 = {
	type = country_event
	placement = root
	title = dvg_nov.4.t
	desc = dvg_nov.4.d
	flavor = dvg_nov.4.f

	icon = "gfx/interface/icons/event_icons/event_scales.dds"

	duration = 3

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_london_center.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/london_center"

	trigger = {
	}

	immediate = {
		set_variable = nov_complete
		set_global_variable = failstate_NOV
		remove_modifier = neutrality
		remove_modifier = dvg_unstable_confederation
		remove_modifier = outmoded_bureaucracy
		remove_modifier = dvg_yasak
	}

	option = {
		name = dvg_nov.4.a
		default_option = yes

		add_radicals = {
			value = large_radicals
		}

		every_subject_or_below = {
			limit = {
				is_subject_of = ROOT
				NOT = {
					is_subject_type = subject_type_customs_union
					is_subject_type = subject_type_personal_union
				}
			}

			make_independent = yes
		}

		if = {
			limit = {
				NOT = { exists = c:UGG }
				exists = s:STATE_GALICH.region_state:NOV
			}

			create_country = {
				tag = UGG
				origin = this
				state = s:STATE_GALICH.region_state:NOV
				on_created = {
					if = {
						limit = {
							NOT = {
								has_law = law_type:law_monarchy
							}
						}
						activate_law = law_type:law_monarchy
					}
				}
			}
		}

		if = {
			limit = {
				NOT = { exists = c:VYA }
				exists = s:STATE_VYATKA.region_state:NOV
			}

			create_country = {
				tag = VYA
				origin = this
				state = s:STATE_VYATKA.region_state:NOV
			}
		}

		if = {
			limit = {
				NOT = { exists = c:PRM }
				exists = s:STATE_PERM.region_state:NOV
			}

			create_country = {
				tag = PRM
				origin = this
				state = s:STATE_PERM.region_state:NOV
			}
		}

		if = {
			limit = { exists = s:STATE_PERM.region_state:NOV }
			s:STATE_PERM.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_URAL.region_state:NOV }
			s:STATE_URAL.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_NENETSIA.region_state:NOV }
			s:STATE_NENETSIA.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_OB.region_state:NOV }
			s:STATE_OB.region_state:NOV = { set_state_owner = c:PRM }
		}
		if = {
			limit = { exists = s:STATE_TOBOLSK.region_state:NOV }
			s:STATE_TOBOLSK.region_state:NOV = { set_state_owner = c:PRM }
		}
	}
}
