﻿action_upgrade_nomadic_holding_type_to_tribal = {
	combine_into_one = yes
	is_dangerous = yes
	
	check_create_action = {
		if = {
			limit = {
				NOT = { government_has_flag = government_is_nomadic }
				government_has_flag = government_is_tribal
			}
			every_held_title = {
				limit = {
					tier = tier_county
					title_province = {
						has_holding_type = nomad_holding
						barony = {
							is_leased_out = no
							has_wrong_holding_type = yes
						}
					}
				}
				try_create_important_action = {
					important_action_type = action_upgrade_nomadic_holding_type_to_tribal
					actor = root
					landed_title = this
				}
			}
		}
	}

	effect = {
		scope:landed_title.title_province = {
			open_view_data = {
				view = holding_view
			}
		}
	}
}

action_upgrade_nomadic_holding_type_to_feudal = {
	combine_into_one = yes
	is_dangerous = yes
	
	check_create_action = {
		if = {
			limit = {
				NOR = { 
					government_has_flag = government_is_nomadic
					government_has_flag = government_is_tribal
				}
			}
			every_held_title = {
				limit = {
					tier = tier_county
					title_province = {
						has_holding_type = nomad_holding
						barony = {
							is_leased_out = no
							has_wrong_holding_type = yes
						}
					}
				}
				try_create_important_action = {
					important_action_type = action_upgrade_nomadic_holding_type_to_feudal
					actor = root
					landed_title = this
				}
			}
		}
	}

	effect = {
		scope:landed_title.title_province = {
			open_view_data = {
				view = holding_view
			}
		}
	}
}

action_upgrade_herder_holding_type_to_tribal = {
	combine_into_one = yes
	is_dangerous = yes
	
	check_create_action = {
		if = {
			limit = {
				NOT = { government_has_flag = government_is_nomadic }
				government_has_flag = government_is_tribal
			}
			every_held_title = {
				limit = {
					tier = tier_county
					title_province = {
						has_holding_type = herder_holding
						barony = {
							is_leased_out = no
							has_wrong_holding_type = yes
						}
					}
					holder = { NOT = { government_has_flag = government_is_nomadic } }
				}
				try_create_important_action = {
					important_action_type = action_upgrade_herder_holding_type_to_tribal
					actor = root
					landed_title = this
				}
			}
		}
	}

	effect = {
		scope:landed_title.title_province = {
			open_view_data = {
				view = holding_view
			}
		}
	}
}

action_upgrade_herder_holding_type_to_feudal = {
	combine_into_one = yes
	is_dangerous = yes
	
	check_create_action = {
		if = {
			limit = {
				NOR = { 
					government_has_flag = government_is_nomadic
					government_has_flag = government_is_tribal
				}
			}
			every_held_title = {
				limit = {
					tier = tier_county
					title_province = {
						has_holding_type = herder_holding
						barony = {
							is_leased_out = no
							has_wrong_holding_type = yes
						}
					}
					holder = { NOT = { government_has_flag = government_is_nomadic } }
				}
				try_create_important_action = {
					important_action_type = action_upgrade_herder_holding_type_to_feudal
					actor = root
					landed_title = this
				}
			}
		}
	}

	effect = {
		scope:landed_title.title_province = {
			open_view_data = {
				view = holding_view
			}
		}
	}
}