namespace = subjects_expanded_pirate_brotherhood_vassal_events

country_event = {
	id = subjects_expanded_pirate_brotherhood_vassal_events.1
	title = subjects_expanded_pirate_brotherhood_vassal_events.EVTNAME1
	desc = subjects_expanded_pirate_brotherhood_vassal_events.EVTDESC1
	picture = DIPLOMACY_eventPicture

	hidden = yes
	is_triggered_only = yes

	trigger = {
		is_subject_of_type = pirate_brotherhood_vassal
		NOT = { has_reform = pirate_republic_reform }
		NOT = { has_reform = pirate_king_reform }
		NOT = { has_reform = war_against_the_world_doctrine_reform }
		is_revolutionary = no
		NOT = { has_country_flag = executing_subjects_expanded_pirate_brotherhood_vassal_events_1 }
	}

	immediate = {
		hidden_effect = {
			set_country_flag = executing_subjects_expanded_pirate_brotherhood_vassal_events_1
			if = {
				limit = {
					NOT = { has_reform = pirate_republic_reform }
					NOT = { has_reform = pirate_king_reform }
					NOT = { has_reform = war_against_the_world_doctrine_reform }
					is_revolutionary = no
				}
				change_government = republic
				add_government_reform = pirate_republic_reform
			}
		}
	}

	option = {
		name = subjects_expanded_pirate_brotherhood_vassal_events1.EVTOPT1

		ai_chance = { factor = 100 }

		clr_country_flag = executing_subjects_expanded_pirate_brotherhood_vassal_events_1
	}
}

country_event = {
	id = subjects_expanded_pirate_brotherhood_vassal_events.2
	title = subjects_expanded_pirate_brotherhood_vassal_events.EVTNAME2
	desc = subjects_expanded_pirate_brotherhood_vassal_events.EVTDESC2
	picture = SHIP_SAILING_eventPicture

	trigger = {
		has_subject_of_type = pirate_brotherhood_vassal
		NOT = { can_be_overlord = pirate_brotherhood_vassal }
		NOT = { has_country_flag = release_invalid_pirate_brotherhoods }
	}

	immediate = {
		hidden_effect = {
			set_country_flag = release_invalid_pirate_brotherhoods
		}
	}

	option = {
		name = subjects_expanded_pirate_brotherhood_vassal_events2.EVTOPT1

		ai_chance = { factor = 100 }

		add_prestige = -25
		every_subject_country = {
			limit = {
				is_subject_of_type = pirate_brotherhood_vassal
			}
			grant_independence = yes
		}
		clr_country_flag = release_invalid_pirate_brotherhoods
	}
}