﻿master_assassin_task_spread_plague = {
	court_position_types = { 
		master_assassin_court_position
	}
	is_shown = {
	}
	is_valid_showing_failures_only = {
	}
	cost = {
		round = no
		gold = {
			value = 0
			if = {
				limit = {
					scope:liege = {
						has_treasury = no
					}
				}
			}
			add = {
				value = monthly_court_position_task_cost
				multiply = 2
				desc = COURT_POSITION_TASK_COST_BREAKDOWN_BASE
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					scope:liege = {
						has_treasury = yes
					}
				}
				add = {
					value = monthly_court_position_task_cost
					multiply = 2
					desc = COURT_POSITION_TASK_COST_BREAKDOWN_BASE
					format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
				}
			}
		}
	}

	employee_modifier = {
		monthly_prestige = minor_court_position_task_prestige_salary
	}

	# Set Spreading Plague variable on start
	on_start = { 
		scope:liege = {
			set_variable = {
				name = master_assassin_is_spreading_plague
				value = yes
			}
		}
		custom_tooltip = allow_spread_plague_scheme_tt
	}

	# If it's fallen off while still working, reapply when we can; this can happen if say a Liege dies
	on_monthly = {
		if = {
			limit = { scope:liege.var:master_assassin_is_spreading_plague = no }
			set_variable = {
				name = master_assassin_is_spreading_plague
				value = yes
			}
		}
	}

	on_end = { 
		# remove_character_flag = blocked_from_leaving # Removing travel block
		scope:liege = {
			set_variable = {
				name = master_assassin_is_spreading_plague
				value = no
			}
		}
	}

	scaling_employer_modifiers = {
		terrible = {
			epidemic_resistance = 2
		}
		poor = {
			epidemic_resistance = 4
		}
		average = {
			epidemic_resistance = 6
		}
		good = {
			epidemic_resistance = 8
		}
		excellent = {
			epidemic_resistance = 10
		}
	}

	ai_will_do = {
		value = 0
		if = {
			limit = {
				scope:liege = {
					OR = {
						is_at_war = yes
					}
				}
			}
			add = 100
		}
	}
}