﻿task_vizier_default = {
	default_task = yes
	position = councillor_vizier

	effect_desc = task_vizier_default_effect_desc

	task_type = task_type_general
	task_progress = task_progress_infinite

	council_owner_modifier = {
		name = task_vizier_default_diplomacy_modifier
		diplomacy = 1
		scale = vizier_default_task_diplomacy_scale
	}

	council_owner_modifier = {
		name = task_vizier_default_martial_modifier
		martial = 1
		scale = vizier_default_task_martial_scale
	}

	council_owner_modifier = {
		name = task_vizier_default_stewardship_modifier
		stewardship = 1
		scale = vizier_default_task_stewardship_scale
	}

	council_owner_modifier = {
		name = task_vizier_default_intrigue_modifier
		intrigue = 1
		scale = vizier_default_task_intrigue_scale
	}

	council_owner_modifier = {
		name = task_vizier_default_learning_modifier
		learning = 1
		scale = vizier_default_task_learning_scale
	}

	monthly_on_action = spouse_councillor_default_on_action

	ai_will_do = {
		value = 1 # Always a good backup
	}
}

task_vizier_court_politics = {
	position = councillor_vizier

	skill = diplomacy
	task_type = task_type_general
	task_progress = task_progress_infinite

	effect_desc = task_court_politics_effect_desc

	council_owner_modifier = {
		name = task_vizier_court_politics_modifier
		diplomacy = 1
		scale = vizier_task_court_politics_scale
	}

	monthly_on_action = court_politics_setup

	ai_will_do = {
		value = 0
		if = {
			limit = {
				diplomacy >  very_high_skill_rating
			}
			add = 1
		}
		else_if = {
			limit = {
				diplomacy >  high_skill_rating
			}
			add =  0.5
		}

		if = { # Keep doing it once it is started
			limit = {
				is_performing_council_task = task_court_politics
			}
			add = 1000
		}

		scope:councillor_liege = {
			if = {
				limit = {
					diplomacy <  decent_skill_rating
				}
				multiply = 3
			}
			else_if = {
				limit = {
					diplomacy <  medium_skill_rating
				}
				multiply =  2
			}
		}
	}
}

task_vizier_chivalry = {
	position = councillor_vizier

	skill = martial
	task_type = task_type_general
	task_progress = task_progress_infinite

	effect_desc = task_chivalry_effect_desc

	council_owner_modifier = {
		name = task_vizier_chivalry_modifier
		martial = 1
		scale = vizier_task_chivalry_scale
	}

	monthly_on_action = chivalry_setup

	ai_will_do = {
		value = 0
		if = {
			limit = {
				martial >  very_high_skill_rating
			}
			add = 1
		}
		else_if = {
			limit = {
				martial >  high_skill_rating
			}
			add =  0.5
		}

		if = { # Keep doing it once it is started
			limit = {
				is_performing_council_task = task_chivalry
			}
			add = 1000
		}

		scope:councillor_liege = {
			if = {
				limit = {
					martial <  decent_skill_rating
				}
				multiply = 3
			}
			else_if = {
				limit = {
					martial <  medium_skill_rating
				}
				multiply =  2
			}
		}
	}
}

task_vizier_manage_domain = {
	position = councillor_vizier

	skill = stewardship
	task_type = task_type_general
	task_progress = task_progress_infinite

	effect_desc = task_manage_domain_effect_desc

	council_owner_modifier = {
		name = task_vizier_manage_domain_modifier
		stewardship = 1
		scale = vizier_task_manage_domain_scale
	}

	monthly_on_action = manage_domain_setup

	ai_will_do = {
		value = 0
		if = {
			limit = {
				stewardship >  very_high_skill_rating
			}
			add = 1
		}
		else_if = {
			limit = {
				stewardship >  high_skill_rating
			}
			add =  0.5
		}

		if = { # Keep doing it once it is started
			limit = {
				is_performing_council_task = task_manage_domain
			}
			add = 1000
		}

		scope:councillor_liege = {
			if = {
				limit = {
					stewardship <  decent_skill_rating
				}
				multiply = 3
			}
			else_if = {
				limit = {
					stewardship <  medium_skill_rating
				}
				multiply =  2
			}
		}
	}
}

task_vizier_court_intrigue = {
	position = councillor_vizier

	skill = intrigue
	task_type = task_type_general
	task_progress = task_progress_infinite

	effect_desc = task_court_intrigue_effect_desc

	council_owner_modifier = {
		name = task_vizier_court_intrigue_modifier
		intrigue = 1
		scale = vizier_task_court_intrigue_scale
	}

	monthly_on_action = court_intrigue_setup

	ai_will_do = {
		value = 0
		if = {
			limit = {
				intrigue >  very_high_skill_rating
			}
			add = 1
		}
		else_if = {
			limit = {
				intrigue >  high_skill_rating
			}
			add =  0.5
		}

		if = { # Keep doing it once it is started
			limit = {
				is_performing_council_task = task_court_intrigue
			}
			add = 1000
		}

		scope:councillor_liege = {
			if = {
				limit = {
					intrigue <  decent_skill_rating
				}
				multiply = 3
			}
			else_if = {
				limit = {
					intrigue <  medium_skill_rating
				}
				multiply =  2
			}
		}
	}
}

task_vizier_patronage = {
	position = councillor_vizier

	skill = learning
	task_type = task_type_general
	task_progress = task_progress_infinite

	effect_desc = task_patronage_effect_desc

	council_owner_modifier = {
		name = task_vizier_patronage_modifier
		learning = 1
		scale = vizier_task_patronage_scale
	}

	monthly_on_action = patronage_setup

	ai_will_do = {
		value = 0
		if = {
			limit = {
				learning >  very_high_skill_rating
			}
			add = 1
		}
		else_if = {
			limit = {
				learning >  high_skill_rating
			}
			add =  0.5
		}

		if = { # Keep doing it once it is started
			limit = {
				is_performing_council_task = task_patronage
			}
			add = 1000
		}

		scope:councillor_liege = {
			if = {
				limit = {
					learning <  decent_skill_rating
				}
				multiply = 3
			}
			else_if = {
				limit = {
					learning <  medium_skill_rating
				}
				multiply =  2
			}
		}
	}
}
