
herdify_mortal = {
	skill = diplomacy
	desc = herdify_mortal_desc_general
	success_desc = "HERDIFY_SUCCESS_DESC"	
	discovery_desc = "GENERIC_DISCOVERY_DESC"
	icon = icon_scheme_herdify
	illustration = "gfx/interface/illustrations/event_scenes/pod_abstract1.dds"
	category = personal
	target_type = character
	is_secret = no
	is_basic = yes
	
	# Parameters
	success_chance_growth_per_skill_point = 0
	speed_per_skill_point = 0
	spymaster_speed_per_skill_point = 0
	target_spymaster_speed_per_skill_point = 0
	tier_speed = 0
	uses_resistance = no
	base_progress_goal = 365
	base_maximum_success = 100
	minimum_success = 100
	#minimum_secrecy = 100
	
	allow = {
		is_vampire_trigger = yes
		is_adult = yes
		scope:target = { 
			is_adult = yes 
			is_vampire_trigger = no
			NOT = {
				has_relation_herd_owner = scope:owner
				# has_opinion_modifier = {
					# target  = scope:owner
					# modifier = POD_herd_opinion
				# }
			}
		}
	}
	
	valid = {
		scope:target = { is_imprisoned = no }
	}

	odds_prediction = {
		add = 100
	}

	base_success_chance = {
		base = 100
	}

	on_phase_completed = {
		scheme_owner = { save_scope_as = owner }
		scope:target = { save_scope_as = target }
		scheme_owner = {
			trigger_event = POD_herdify.1 
		}
	}


	on_invalidated = {
	}

	on_monthly = {
		save_scope_as = scheme
		scheme_owner = { save_scope_as = owner }
		scope:target = { save_scope_as = target }

		#TODO_CD: Lifestyle gain?
	}
}

herdify_vampire = {
	skill = diplomacy
	desc = herdify_vampire_desc_general
	success_desc = "HERDIFY_SUCCESS_DESC"	
	discovery_desc = "GENERIC_DISCOVERY_DESC"
	icon = icon_scheme_herdify
	illustration = "gfx/interface/illustrations/event_scenes/pod_abstract1.dds"
	category = personal
	target_type = character
	is_secret = no

	# Parameters
	speed_per_skill_point = t2_spsp_owner_value
	speed_per_target_skill_point = t2_spsp_target_value
	#base_progress_goal = t2_base_phase_length_value
	base_progress_goal = t3_base_phase_length_value # gotta go fast
	base_maximum_success = t2_base_max_success_value
	phases_per_agent_charge = 1
	success_chance_growth_per_skill_point = t2_scgpsp_value
	#minimum_secrecy = 100
	
	allow = {
		#has_POD_vamp_blood_trigger = yes # complex trigger... and why?
		is_adult = yes
		scope:target = { 
			is_adult = yes 
			is_vampire_trigger = yes
			NOT = {
				has_relation_herd_owner = scope:owner
				# has_opinion_modifier = {
					# target = scope:owner
					# modifier = POD_herd_opinion 
				# }
			}
		}
	}
	
	valid = {
		scope:target = {is_imprisoned = no}
	}

	# Agents
	agent_leave_threshold = -25	
	
	agent_join_chance = {
		base = 0
		
		ai_agent_join_chance_basic_suite_modifier = yes
		ai_agent_join_chance_hostile_grievous_modifier = yes
	}
	agent_groups_owner_perspective = { courtiers guests scripted_relations }
	agent_groups_target_character_perspective = { courtiers vassals }
	valid_agent = { is_valid_agent_standard_trigger = yes }

	odds_prediction = {
		add = hostile_scheme_base_odds_prediction_target_is_char_value
		add = odds_skill_contribution_diplomacy_value
		add = agent_groups_owner_perspective_value
		add = agent_groups_target_character_perspective_value
		min = 0
	}
	
	base_success_chance = {
		base = 10
		scheme_type_skill_success_chance_modifier = { SKILL = DIPLOMACY }
		
		hostile_scheme_base_chance_modifier = yes

		# Countermeasures.
		apply_calculated_scheme_success_chance_adjustments_modifier = yes
	}

	on_start = {
		if = {
			limit = {
				scheme_owner = {
					NOT = { has_variable = agents_added }
				}
			}
			# Same as overthrow_regent, using speed instead of secrecy for the lookout
			add_agent_slot = agent_thug
			add_agent_slot = agent_ambusher
			add_agent_slot = agent_muscle
			add_agent_slot = agent_footpad
			add_agent_slot = agent_lookout_speed
		}
		else = {
			scheme_owner = { remove_variable = agents_added }
		}
	}

	on_hud_click = {
		POD_finish_complex_scheme = {
			SUCCESS_EVENT = POD_herdify.1
			FAILURE_EVENT = POD_herdify.2
		}
	}

	on_phase_completed = {
		# scheme_owner = { save_scope_as = owner }
		# scope:target = { save_scope_as = target }
		# scheme_owner = {
		# 	trigger_event = POD_herdify.1
		# }
	}

	on_invalidated = {
	}

	on_monthly = {
		save_scope_as = scheme
		scheme_owner = { save_scope_as = owner }
		scope:target = { save_scope_as = target }

		#TODO_CD: Lifestyle gain?
	}
}
