﻿deviant_whore_merchants = {
	# Basic Setup
	skill = intrigue
	desc = "deviant_whore_merchants_desc_general"
	success_desc = "DEVIANT_WHORE_MERCHANTS_SUCCESS_DESC"
	discovery_desc = "DEVIANT_WHORE_MERCHANTS_DISCOVERY_DESC"
	icon = icon_deviant_merchant_slut
	illustration = "gfx/interface/illustrations/event_scenes/tavern.dds"
	target_type = character
	is_secret = no
	is_basic = yes
	

	# Parameters
	speed_per_skill_point = t2_spsp_owner_value
	speed_per_target_skill_point = t2_spsp_target_value
	base_progress_goal = 200
	maximum_secrecy = 95
	base_maximum_success = t2_base_max_success_value
	success_chance_growth_per_skill_point = t2_scgpsp_value

	# Core Triggers
	allow = {
		is_adult = yes
		is_imprisoned = no
	}

	valid = {
		scope:target = {
			is_alive = yes
			is_incapable = no
			is_imprisoned = no
			is_in_army = no
			has_trait = deviant_courtesan_slut
		}
	}


	# Base Chances
	base_success_chance = {
		base = 0
		hostile_scheme_base_chance_modifier = yes

		# Countermeasures.
		apply_calculated_scheme_success_chance_adjustments_modifier = yes
		
		# Skill
		scheme_type_skill_success_chance_modifier = { SKILL = INTRIGUE }

		# Diarchs are better at schemes within their liege's realm
		diarch_scheming_within_realm_bonus_modifier = yes


		# House Personal Scheme Success Chance on Cultural Parameter
		
		modifier = { # Smooth Operator perk bonus
			desc = SEDUCE_PERK_BONUS
			scope:owner = { has_perk = smooth_operator_perk }
			always = yes
			add = smooth_operator_perk_bonus
		}
		
		modifier = { # Legacy bonus
			desc = LEGACY_PERK_BONUS
			scope:owner = {
				exists = dynasty
				dynasty = {
					has_dynasty_perk = fp1_adventure_legacy_2
				}
			}
			always = yes
			add = fp1_adventure_legacy_2_success_chance_seduction
		}

		modifier = {
			desc = "SCHEME_SCHEMER_TRAIT"
			scope:owner = { has_trait = seducer }
			add = 25
		}
		
	}

	# On Actions
	on_start = {
	}
	on_monthly = {
		scheme_owner = {
			trigger_event = {
				on_action = whore_merchants_ongoing
			}
		}
	}
	on_phase_completed = {
		scheme_owner = {
			trigger_event = {
				on_action = whore_merchants_ongoing
			}
		}
		suppress_scheme_follow_up_event_till_input_given_effect = yes
	}

	## Invalidation
	on_invalidated = {
		scheme_target_character = {
			save_scope_as = target
		}
		scheme_owner = {
			save_scope_as = owner
		}
		# Invalidation due to death
		scope:owner = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = deviant_whore_merchants_invalidated_title
				left_icon = scope:target
				if = {
					limit = {
						scope:target = { is_alive = no }
						NOT = { block_death_event_trigger = { DEAD = scope:target } }
						scope:owner = { is_alive = yes }
					}
					custom_tooltip = scheme_target_died
				}
			}
		}
	}
}
