﻿pickpocket_interaction = {
	category = interaction_category_hostile
	common_interaction = yes
	desc = pickpocket_interaction.desc
	interface_priority = 80
	auto_accept = yes
	
	ai_frequency = 0
	
	cooldown = { days = 30 }
	
	is_shown = {
	    scope:actor = {
	    is_ai = no
		has_character_modifier = thief_modifier
		is_ruler = no
		}
		NOT = { scope:actor = scope:recipient }	
	}
	
	can_send = {
		scope:actor = {
			is_ruler = no
			is_imprisoned = no
		}
	}
	
	is_valid_showing_failures_only = { 
	   custom_tooltip = { # Only if in the same court or actors liege
	    text = pickpocket_interaction.tt
	    OR = { 
		scope:recipient = { is_in_the_same_court_as_or_guest = scope:actor }
		scope:actor.liege_or_court_owner = scope:recipient 
		}
	   }
	   scope:recipient = { gold >= 10 }
	   
	   custom_tooltip = { 
	   text = pickpocket_interaction_cc.tt
	   }
	}
	
	on_accept = {
	scope:actor = {
	duel = {
		skill = intrigue
		value = 10
		55 = { 
			desc = pickpocket_interaction.success  
			send_interface_toast = {
					title = pickpocket_interaction.success
					desc = pickpocket_interaction.success.tt
					left_icon = scope:actor
				}
			add_gold = { value = 10 } # Success
		}
		45 = { 
			desc = pickpocket_interaction.failure  # Adjusted to your localization key
			
			scope:actor.liege_or_court_owner = { 
				imprison = { target = scope:actor type = dungeon } 
				add_opinion = { modifier = theft_opinion years = 4 target = scope:actor } 
			} # Caught stealing
			scope:actor = {
			add_trait = gallowsbait
			add_trait_xp = {
				trait = gallowsbait
			    track = thief
					value = {
		             integer_range = {
	                  min = medium_lifestyle_random_xp_low
				      max = medium_lifestyle_random_xp_high
												    }
					}
			}
		}
		
	}
	}
}

}
}
