﻿
task_promote_culture = {
	position = councillor_steward

	task_type = task_type_county
	county_target = realm
	ai_county_target = realm
	task_progress = task_progress_percentage
	restart_on_finish = yes
	highlight_own_realm = yes

	effect_desc = {
		desc = {
			triggered_desc = {
				trigger = {
					exists = scope:county
					scope:county ?= {
						NOT = { culture = scope:councillor_liege.culture }
					}
				}
				desc = task_promote_culture_effect_desc
			}
			triggered_desc = {
				trigger = {
					scope:councillor_liege = {
						any_vassal = {
							has_vassal_stance = minority
						}
					}
				}
				desc = minority_disapproves_conversion_tooltip
			}
			triggered_desc = {
				trigger = {
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { culture = scope:councillor_liege.culture }
						}
						NOT = {
							scope:councillor_liege.culture = {
								is_hybrid_culture = yes
								any_parent_culture = {
									this = scope:county.culture
								}
							}
						}
					}
					trigger_else = { always = no }
				}
				desc = task_promote_culture_acceptance_effect_desc
			}
			triggered_desc = {
				trigger = {
					exists = scope:county
					scope:county = {
						culture = scope:councillor_liege.culture
						county_has_minority_culture_trigger = yes
					}
				}
				desc = demote_a_minority_desc
			}
			triggered_desc = {
				trigger = {
					exists = scope:county
					scope:county = {
						culture = scope:councillor_liege.culture
						has_county_modifier = RICE_pamir_brahui_tribes
						county_has_specific_small_minority_culture_trigger = { CULTURE = culture:brahui }
					}
				}
				desc = RICE_evicting_brahui
			}
		}
		desc = {
			desc = council_task_possible_side_effects
			triggered_desc = {
				trigger = {
					stewardship > mediocre_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_task_efficient_taxation_modifier }
						}
					}
				}
				desc = task_promote_culture_improve_county_opinion
			}
			triggered_desc = {
				trigger = {
					stewardship > mediocre_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_task_efficient_taxation_modifier }
						}
					}
				}
				desc = task_promote_culture_increased_taxes
			}
			triggered_desc = {
				trigger = {
					stewardship > mediocre_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_task_efficient_taxation_modifier }
						}
					}
				}
				desc = task_promote_culture_increased_levies
			}
			triggered_desc = {
				trigger = {
					stewardship < high_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_settler_resistance_modifier }
						}
					}
				}
				desc = task_promote_culture_resistance_to_settlers
			}
			triggered_desc = {
				trigger = {
					stewardship < high_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_settler_resistance_modifier }
						}
					}
				}
				desc = task_promote_culture_resistance_to_administration
			}
		}
	}

	progress = {
		value = 0
		add = {
			value = steward_promote_culture_base
			desc = STEWARD_PROGRESS_BASE
		}
		add = {
			value = scope:councillor.steward_promote_culture_monthly_increase
			desc = SCALED_COUNCILLOR_STEWARDSHIP_VALUE
		}

		add = steward_promote_culture_contextual_bonuses

		if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values
			limit = {
				exists = scope:county
				scope:county = {
					development_level > 0
				}
			}
			add = {
				value = scope:county.promote_culture_development_penalty
				desc = STEWARD_PROMOTE_CULTURE_DEVELOPMENT_PENALTY
			}
		}

		# Conversion speed game rules
		if = {
			limit = {
				has_game_rule = slower_culture_conversion_speed
			}
			multiply = {
				value = slower_game_rule_value
				desc = GAME_RULE_SLOWER_REASON
			}
		}
		if = {
			limit = {
				has_game_rule = significantly_slower_culture_conversion_speed
			}
			multiply = {
				value = significantly_slower_game_rule_value
				desc = GAME_RULE_SIGNIFICANTLY_SLOWER_REASON
			}
		}
		if = {
			limit = {
				has_game_rule = significantly_faster_culture_conversion_speed
			}
			multiply = {
				value = significantly_faster_game_rule_value
				desc = GAME_RULE_SIGNIFICANTLY_FASTER_REASON
			}
		}
		if = {
			limit = {
				has_game_rule = faster_culture_conversion_speed
			}
			multiply = {
				value = faster_game_rule_value
				desc = GAME_RULE_FASTER_REASON
			}
		}
		# Faster conversion for FP2 Hostility ending, if county is in Iberia and culture was involved
		if = {
			limit = {
				any_in_global_list = {
					variable = fp2_struggle_ending_culture_list
					this = scope:county.culture
				}
				scope:county.title_province = { geographical_region = world_europe_west_iberia }
				scope:councillor.liege.house = {
					OR = {
						has_house_modifier = fp2_struggle_hostility_house_culture_modifier
						has_house_modifier = fp2_struggle_hostility_house_combined_modifier
					}
				}
			}
			multiply = {
				value = fp2_struggle_hostility_conversion_value
				desc = fp2_struggle_hostility_culture_conversion_task_desc
			}
		}
		# Faster conversion for native american cultures if the county has a modifier from
		# the Indigienous Sovereignty ending of the Greenland Struggle
		if = {
			limit = {
				scope:councillor_liege.culture = {
					OR = {
						has_cultural_pillar = heritage_algonquian
						has_cultural_pillar = heritage_iroquoian
						has_cultural_pillar = heritage_paleo_inuit
						has_cultural_pillar = heritage_inuit
					}
				}
				scope:county = {
					OR = {
						has_county_modifier = RICE_greenland_indigenous_social
						has_county_modifier = RICE_greenland_indigenous_political
						has_county_modifier = RICE_greenland_indigenous_military
					}
				}
			}
			multiply = {
				value = fp2_struggle_hostility_conversion_value
				desc = indigenous_sovereignty_ending_conversion_desc
			}
		}

		# Because the task needs to complete 3 times with the minority system
		multiply = 3

		if = {
			limit = { scope:county.culture = scope:councillor_liege.culture }
			multiply = {
				value = 0.5
				desc = converting_minority_desc
			}
		}
		if = {
			limit = {
				scope:councillor_liege = {
					has_character_modifier = devoted_to_tradition_modifier
				}
			}
			multiply = {
				value = 1.25
				desc = bp2_devoted_to_tradition_modifier_conversion_task_desc
			}
		}
		if = {
			limit = {
				scope:councillor_liege = {
					has_title = title:c_byzantion
					title:c_byzantion = { has_county_modifier = pandidakterion_university_modifier }
				}
			}
			multiply = {
				value = 1.25
				desc = pandidakterion_university_modifier
			}
		}
		if = {
			limit = {
				scope:county = { has_county_modifier = improve_promote_culture_modifier }
				scope:councillor_liege = scope:county.holder.top_liege
			}
			multiply = {
				value = 1.20
				desc = improve_promote_culture_modifier
			}
		}
	}

	potential_county = {
		scope:county = {
			### Minority stuff ###
			scope:councillor_liege = { has_realm_law_flag = may_convert_culture }
			trigger_if = {
				limit = { culture = scope:councillor_liege.culture }
				trigger_if = {
					limit = {
						county_has_different_heritage_minority_culture_trigger = { CULTURE = scope:councillor.culture }
					}
					custom_tooltip = {
						text = "not_has_expel_minorities_unlocked"
						scope:councillor_liege = { has_realm_law_flag = unlock_expel_cultural_minorities }
					}
				}
				trigger_else = {
					NOT = { culture = scope:councillor_liege.culture }
				}
			}
			### End Minority stuff ###
			trigger_if = {
				limit = {
					scope:councillor_liege = { has_variable = hold_court_8130_culture_block }
				}
				custom_tooltip = {
					text = hold_court_8130_conversion_tt
					NOT = { culture = scope:councillor_liege.var:hold_court_8130_culture_block }
				}
			}
		}
		trigger_if = {
			limit = {
				scope:councillor_liege = {
					is_ai = yes
					NAND = { # AI Directives override this
						has_character_flag = vassal_directive_convert_culture
						vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
					}
				}
			}
			NAND = { # Princes in the HRE tend to not convert each other's cultures
				exists = title:e_hre.holder
				scope:councillor_liege.top_liege = title:e_hre.holder
				OR = {
					scope:councillor_liege.culture = culture:czech
					scope:councillor_liege.culture = { has_cultural_pillar = heritage_central_germanic }
				}
				OR = {
					scope:county.culture = culture:czech
					scope:county.culture = { has_cultural_pillar = heritage_central_germanic }
				}
			}
			NOT = { # Do not eliminate the Basques
				scope:county.culture = {
					this = culture:basque
					any_culture_county = {
						count <= 5
					}
				}
			}
			scope:councillor_liege = {
				OR = {
					NOT = {
						scope:county.culture = {
							cultural_acceptance = { target = scope:councillor_liege.culture value >= 50 }
						}
					}
					scope:county = {
						this = title:c_maragha
						culture = culture:turkish
					}
					culture = { # All AI's are motivated to spread new Hybrid/Divergent cultures
						OR = {
							is_hybrid_culture = yes
							is_divergent_culture = yes
						}
						NOT = { # Leave the Welsh alone!
							this = culture:anglo_saxon
						}
						any_parent_culture = {
							this = scope:county.culture
						}
					}
					culture = { # Small cultures want to grow a bit
						any_culture_county = {
							count < 10
						}
					}
					scope:county.culture = { # 'dead' small cultures can go away
						OR = {
							is_hybrid_culture = yes
							is_divergent_culture = yes
						}
						any_culture_county = {
							count < 10
						}
						OR = {
							NOT = { exists = culture_head }
							any_culture_county = {
								count < 5
							}
						}
					}
					AND = {
						# Scottish rulers should convert counties of 'old' cultures to the new one.
						culture = culture:scottish
						OR = {
							scope:county.culture = culture:anglo_saxon
							scope:county.culture = culture:gaelic
							scope:county.culture = culture:cumbrian
							scope:county.culture = culture:pictish
						}
					}
					AND = {
						# English rulers should convert counties of 'old' cultures to the new one.
						culture = culture:english
						OR = {
							scope:county.culture = culture:anglo_saxon
							scope:county.culture = culture:norman
						}
					}
					AND = {
						# German rulers want to convert the polabians
						culture = { has_cultural_pillar = heritage_central_germanic }
						scope:county.culture = culture:polabian
						NOT = { scope:councillor_liege.primary_title = title:e_hre }
					}
				}
				OR = {
					is_independent_ruler = yes
					primary_title.tier > tier_county
					culture = { # All AI's are motivated to spread new Hybrid/Divergent cultures
						OR = {
							is_hybrid_culture = yes
							is_divergent_culture = yes
						}
						any_parent_culture = {
							this = scope:county.culture
						}
					}
					culture = { # Small cultures want to grow a bit
						any_culture_county = {
							count < 10
						}
					}
					scope:county.culture = { # 'dead' small cultures can go away
						OR = {
							is_hybrid_culture = yes
							is_divergent_culture = yes
						}
						any_culture_county = {
							count < 10
						}
						OR = {
							NOT = { exists = culture_head }
							any_culture_county = {
								count < 5
							}
						}
					}
					culture = { # Imperious cultures want to grow to a certain size
						culture_head ?= {
							is_independent_ruler = yes
							highest_held_title_tier >= tier_kingdom
							sub_realm_size >= 30
						}
						any_culture_county = {
							count < 35
						}
					}
					AND = {
						# Scottish rulers should convert counties of 'old' cultures to the new one.
						culture = culture:scottish
						OR = {
							scope:county.culture = culture:anglo_saxon
							scope:county.culture = culture:gaelic
							scope:county.culture = culture:cumbrian
							scope:county.culture = culture:pictish
						}
					}
					AND = {
						# English rulers should convert counties of 'old' cultures to the new one.
						culture = culture:english
						OR = {
							scope:county.culture = culture:anglo_saxon
							scope:county.culture = culture:norman
						}
					}
					AND = {
						# German rulers want to convert the polabians
						culture = { has_cultural_pillar = heritage_central_germanic }
						scope:county.culture = culture:polabian
						NOT = { scope:councillor_liege.primary_title = title:e_hre }
					}
				}
			}
			OR = {
				scope:county = {
					any_neighboring_county = {
						culture = scope:councillor_liege.culture # The AI only wants to convert counties bordering their own culture
					}
				}
				AND = { # The English want to convert the Anglo Saxons and Cumbrians
					scope:councillor_liege.culture = culture:english
					OR = {
						scope:county.culture = culture:anglo_saxon
						scope:county.culture = culture:cumbrian
					}
				}
				AND = { # The Scots want to convert the Anglo Saxons, Cumbrians and Gaelic
					scope:councillor_liege.culture = culture:scottish
					OR = {
						scope:county.culture = culture:anglo_saxon
						scope:county.culture = culture:gaelic
						scope:county.culture = culture:cumbrian
						scope:county.culture = culture:pictish
					}
				}
				AND = { # The Gaels want to convert the Picts and Cumbrians
					scope:councillor_liege.culture = culture:gaelic
					OR = {
						scope:county.culture = culture:cumbrian
						scope:county.culture = culture:pictish
					}
				}
				AND = { # The modern scandinavians want to convert the Norse
					OR = {
						scope:councillor_liege.culture = culture:swedish
						scope:councillor_liege.culture = culture:danish
						scope:councillor_liege.culture = culture:norwegian
					}
					scope:county.culture = culture:norse
				}
				AND = { # The Portuguese should want to convert Suebi
					scope:councillor_liege.culture = culture:portuguese
					scope:county.culture = culture:suebi
				}
				AND = { # The Iberians want to convert Visigothic
					scope:councillor_liege.culture = { has_cultural_pillar = heritage_iberian }
					NOT = { scope:councillor_liege.culture = culture:portuguese }
					scope:county.culture = culture:visigothic
				}
				AND = {
					# German rulers want to convert the polabians
					scope:councillor_liege.culture = { has_cultural_pillar = heritage_central_germanic }
					scope:county.culture = culture:polabian
					NOT = { scope:councillor_liege.primary_title = title:e_hre }
				}
			}
		}
		trigger_else_if = { # But AI Directives should still try to look pretty
			limit = {
				scope:councillor_liege = {
					is_ai = yes
					has_character_flag = vassal_directive_convert_culture
					vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
				}
			}
			trigger_if = {
				limit = {
					scope:county = {
						any_neighboring_county = {
							culture = scope:councillor_liege.culture
						}
					}
				}
				scope:county = {
					any_neighboring_county = {
						culture = scope:councillor_liege.culture # The AI only wants to convert counties bordering their own culture
					}
				}
			}
			trigger_else = {
				always = yes
			}
		}
		trigger_else = {
		}
	}

	county_modifier = {
		name = steward_convert_county_modifier
		county_opinion_add = -10
	}

	on_finish_task_county = {
		scope:councillor_liege = {
			if = {
				limit = {
					NOT = {
						culture = {
							is_hybrid_culture = yes
							any_parent_culture = {
								this = scope:county.culture
							}
						}
					}
				}
				if = {
					limit = {
						is_independent_ruler = no
					}
					add_character_flag = {
						flag = no_ai_culture_convert
						years = 20 # down from 60
					}
				}
				else = {
					add_character_flag = {
						flag = no_ai_culture_convert
						years = 10 # down from 30
					}
				}
			}
		}
		scope:county = {
			if = {
				limit = { scope:county.culture = scope:councillor_liege.culture }
				demote_random_culture_minority_effect = yes
			}
			else = {
				if = {
					limit = {
						NOT = {
							scope:councillor_liege.culture = {
								is_hybrid_culture = yes
								any_parent_culture = {
									this = scope:county.culture
								}
							}
						}
					}
					culture = {
						change_cultural_acceptance = {
							target = scope:councillor_liege.culture
							value = culture_conversion_acceptance_impact
							desc = cultural_acceptance_loss_promote_culture
						}
					}
				}

				promote_culture_minority_effect = { CULTURE = scope:councillor_liege.culture }
				if = {
					limit = { scope:county.culture = scope:councillor_liege.culture }
					scope:councillor = { start_default_task = yes }
				}
			}
		}
	}

	monthly_on_action = task_promote_culture_side_effects

	ai_will_do = {
		value = 0
		if = {
			limit = {
				scope:councillor = {
					is_performing_council_task = task_promote_culture
				}
			}
			add = 10000 # Always keep going if this is already chosen
		}
		else_if = {
			limit = {
				scope:councillor_liege.culture = {
					has_innovation = innovation_desert_tactics #Best way to check if the culture is Outremer
				}
				scope:councillor_liege = {
					gold >= steward_convert_culture_value
				}
			}
			add = 500
		}
		else_if = {
			limit = {
				scope:councillor_liege = {
					OR = {
						gold >= steward_convert_culture_value
						AND = {
							gold > 0
							culture = {
								OR = {
									is_hybrid_culture = yes
									is_divergent_culture = yes
								}
							}
							any_realm_county = {
								culture = {
									save_temporary_scope_as = culture_check
									scope:councillor_liege.culture = {
										any_parent_culture = {
											this = scope:culture_check
										}
									}
								}
							}
						}
					}
				}
			}
			add = 200
		}
		if = {
			limit = {
				scope:councillor_liege.culture = {
					has_cultural_parameter = less_likely_to_promote_culture
				}
			}
			add = -250
		}
		if = {
			limit = {
				scope:councillor_liege = {
					culture = {
						OR = {
							is_hybrid_culture = yes
							is_divergent_culture = yes
						}
					}
					any_sub_realm_county = {
						culture = {
							save_temporary_scope_as = culture_check
							scope:councillor_liege.culture = {
								any_parent_culture = {
									this = scope:culture_check
								}
							}
						}
					}
				}
			}
			add = 200
		}
		# Motivate the AI with an escalation agenda to take this task
		if = {
			limit = {
				has_character_flag = agenda_towards_escalation
			}
			add = 500
		}
		else_if = {
			limit = {
				has_character_flag = agenda_towards_deescalation
			}
			add = -250
		}
		if = {
			# Don't do this too often
			limit = {
				scope:councillor_liege = {
					has_character_flag = no_ai_culture_convert
					NAND = { # ignore it if in Hostility with escalation
						has_character_flag = agenda_towards_escalation
						any_character_struggle = {
							involvement = involved
							is_struggle_type = iberian_struggle
							is_struggle_phase = struggle_iberia_phase_hostility
						}
					}
				}
			}
			multiply = 0
		}
		if = {
			# Interrupt this task if you're bankrupt
			limit = {
				scope:councillor_liege = {
					gold < -50
				}
			}
			multiply = 0
		}

		# AI directive
		if = {
			limit = {
				scope:councillor_liege = {
					has_character_flag = vassal_directive_convert_culture
					vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
				}
			}
			add = 50000
		}
	}
}

task_promote_minority = {
	position = councillor_steward

	task_type = task_type_county
	county_target = realm
	ai_county_target = realm
	task_progress = task_progress_percentage
	restart_on_finish = yes
	highlight_own_realm = yes

	effect_desc = {
		triggered_desc = {
			trigger = { exists = scope:county.var:faith_to_convert }
			desc = task_promote_minority_effect_desc_faith
		}
		triggered_desc = {
			trigger = { exists = scope:county.var:culture_to_convert }
			desc = task_promote_minority_effect_desc_culture
		}
		triggered_desc = {
			trigger = {
				NOT = {
					exists = scope:county.var:culture_to_convert
					exists = scope:county.var:faith_to_convert
				}
			}
			desc = task_promote_minority_effect_desc
		}
		desc = {
			desc = council_task_possible_side_effects
			triggered_desc = {
				trigger = {
					stewardship > mediocre_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_task_efficient_taxation_modifier }
						}
					}
				}
				desc = task_promote_culture_improve_county_opinion
			}
			triggered_desc = {
				trigger = {
					stewardship > mediocre_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_task_efficient_taxation_modifier }
						}
					}
				}
				desc = task_promote_culture_increased_taxes
			}
			triggered_desc = {
				trigger = {
					stewardship > mediocre_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_task_efficient_taxation_modifier }
						}
					}
				}
				desc = task_promote_culture_increased_levies
			}
			triggered_desc = {
				trigger = {
					stewardship < high_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_settler_resistance_modifier }
						}
					}
				}
				desc = task_promote_culture_resistance_to_settlers
			}
			triggered_desc = {
				trigger = {
					stewardship < high_skill_rating
					trigger_if = {
						limit = { exists = scope:county }
						scope:county = {
							NOT = { has_county_modifier = steward_settler_resistance_modifier }
						}
					}
				}
				desc = task_promote_culture_resistance_to_administration
			}
		}
	}

	progress = {
		value = 0
		add = {
			value = steward_promote_culture_base
			desc = STEWARD_PROGRESS_BASE
		}
		add = {
			value = scope:councillor.steward_promote_culture_monthly_increase
			desc = SCALED_COUNCILLOR_STEWARDSHIP_VALUE
		}

		add = steward_promote_culture_contextual_bonuses

		if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values
			limit = {
				exists = scope:county
				scope:county = {
					development_level > 0
				}
			}
			add = {
				value = scope:county.promote_culture_development_penalty
				desc = STEWARD_PROMOTE_CULTURE_DEVELOPMENT_PENALTY
			}
		}

		# Conversion speed game rules
		if = {
			limit = {
				has_game_rule = slower_culture_conversion_speed
			}
			multiply = {
				value = slower_game_rule_value
				desc = GAME_RULE_SLOWER_REASON
			}
		}
		if = {
			limit = {
				has_game_rule = significantly_slower_culture_conversion_speed
			}
			multiply = {
				value = significantly_slower_game_rule_value
				desc = GAME_RULE_SIGNIFICANTLY_SLOWER_REASON
			}
		}
		if = {
			limit = {
				has_game_rule = significantly_faster_culture_conversion_speed
			}
			multiply = {
				value = significantly_faster_game_rule_value
				desc = GAME_RULE_SIGNIFICANTLY_FASTER_REASON
			}
		}
		if = {
			limit = {
				has_game_rule = faster_culture_conversion_speed
			}
			multiply = {
				value = faster_game_rule_value
				desc = GAME_RULE_FASTER_REASON
			}
		}

		# Because the task needs to complete 3 times with the minority system
		multiply = 3
	}

	potential_county = {
		scope:county = {
			### Minority stuff ###
			scope:councillor_liege = {
				OR = {
					# Need to at least tolerate some minorities
					has_realm_law = cultural_minority_status_1
					has_realm_law = cultural_minority_status_2
					has_realm_law = religious_minority_status_1
					has_realm_law = religious_minority_status_2
				}
			}
			custom_tooltip = {
				text = must_have_different_faith_or_culture_to_promote_tt

				OR = {
					# Has minorities that aren't your own faith
					AND = {
						county_has_minority_faith_trigger = yes
						OR = {
							any_in_list = {
								variable = faith_minorities_large
								NOT = { THIS = scope:councillor_liege.faith }
							}
							any_in_list = {
								variable = faith_minorities_small
								NOT = { THIS = scope:councillor_liege.faith }
							}
						}
					}

					#...Or aren't your own culture
					AND = {
						county_has_minority_culture_trigger = yes
						OR = {
							any_in_list = {
								variable = culture_minorities_large
								NOT = { THIS = scope:councillor_liege.culture }
							}
							any_in_list = {
								variable = culture_minorities_small
								NOT = { THIS = scope:councillor_liege.culture }
							}
						}
					}
				}
			}
			### End Minority stuff ###
		}
	}

	county_modifier = {
		name = steward_convert_county_modifier
		county_opinion_add = -10
	}

	monthly_on_action = task_promote_culture_side_effects

	on_start_task_county = {
		scope:councillor_liege = {
			trigger_event = minorities.2001
		}
	}
	on_finish_task_county = {
		scope:county = {
			if = {
				limit = { exists = scope:county.var:faith_to_convert }
				promote_faith_minority_effect = { FAITH = scope:county.var:faith_to_convert }
			}
			else_if = {
				limit = { exists = scope:county.var:culture_to_convert }
				promote_culture_minority_effect = { CULTURE = scope:county.var:culture_to_convert }
				scope:county.var:culture_to_convert = {
					change_cultural_acceptance = {
						target = scope:councillor_liege.culture
						value = {
							value = 0.1
							multiply = scope:county.development_level
							if = {
								limit = {
									OR = {
										scope:county.culture = { has_cultural_parameter = cheaper_to_hybridize }
										scope:councillor_liege.culture = { has_cultural_parameter = cheaper_to_hybridize }
									}
								}
								multiply = 2
							}
							if = {
								limit = {
									OR = {
										scope:county.culture = { has_cultural_parameter = harder_to_hybridize }
										scope:councillor_liege.culture = { has_cultural_parameter = harder_to_hybridize }
									}
								}
								divide = 2
							}
						}
						desc = cultural_acceptance_loss_promote_culture
					}
				}
				if = {
					limit = {
						scope:councillor_liege.culture = {
							has_cultural_tradition = tradition_ruling_caste
						}
					}
					add_prestige = minor_prestige_gain
				}
			}
			remove_variable = faith_to_convert
			remove_variable = culture_to_convert
		}
		scope:councillor = {
			start_default_task = yes
		}
	}

	on_cancel_task_county = {
		remove_variable = faith_to_convert
		remove_variable = culture_to_convert
	}
}
