halt_aging_interaction = {
	category = interaction_category_diplomacy

	desc = halt_aging_interaction_desc

	is_shown = {
		scope:actor = { 
			has_trait = master_of_time
		}
		scope:recipient = {
			NOT = { 
				has_trait = master_of_time
				has_trait = immortal
			}
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 500
		}
	}
	
	ai_will_do = {
		base = 0
	}
	
	auto_accept = yes
	
	on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -500 }
		}
		scope:recipient = {
			add_trait = immortal
		}
	}
}

start_aging_interaction = {
	category = interaction_category_diplomacy

	desc = start_aging_interaction_desc

	is_shown = {
		scope:actor = { 
			has_trait = master_of_time
		}
		scope:recipient = {
			NOT = { 
				has_trait = master_of_time	
			}
			has_trait = immortal
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 500
		}
	}
	
	ai_will_do = {
		base = 0
	}
	
	auto_accept = yes
	
	on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -500 }
		}
		scope:recipient = {
			remove_trait = immortal
		}
	}
}

gain_great_magical_talent = {
	category = interaction_category_diplomacy
	
	desc = gain_great_magical_talent_desc
	
	is_shown = {
		scope:actor = { 
			is_ai = no
		}
		scope:recipient = { 
			NOT = { has_trait = magic_potential }
		}
	}
	
	auto_accept = yes
	
	on_accept = {
		scope:recipient = {
			add_trait = magic_potential_3
		}
	}
}


minor_restoration_interaction = {
	category = interaction_category_diplomacy
	
	desc = minor_restoration_interaction_desc
		
	is_shown = {
		scope:actor = { 
			has_perk = heal_perk
		}
		scope:recipient = {
			OR = { 
				has_trait = sickly
				has_trait = ill
				has_trait = early_great_pox
				has_trait = lovers_pox
				has_trait = wounded_1
				has_trait = infirm
			}
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 50
		}
	}
	
	on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -50 }
		}
		scope:recipient = {
			remove_trait = sickly
			remove_trait = ill
			remove_trait = early_great_pox
			remove_trait = lovers_pox
			remove_trait = wounded_1
			remove_trait = infirm
		}
	}
}

major_restoration_interaction = {
	category = interaction_category_diplomacy
	
	desc = major_restoration_interaction_desc
		
	is_shown = {
		scope:actor = { 
			has_perk = greater_heal_perk
		}
		scope:recipient = {
			OR = { 
				has_trait = pneumonic
				has_trait = great_pox
				has_trait = leper
				has_trait = wounded_2
				has_trait = wounded_3
				has_trait = maimed
				has_trait = gout_ridden
				has_trait = consumption
				has_trait = cancer
				has_trait = typhus
				has_trait = bubonic_plague
			}
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 100
		}
	}
	
		on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -100 }
		}
		scope:recipient = {
			remove_trait = pneumonic
			remove_trait = great_pox
			remove_trait = leper
			remove_trait = wounded_2
			remove_trait = wounded_3
			remove_trait = maimed
			remove_trait = gout_ridden
			remove_trait = consumption
			remove_trait = cancer
			remove_trait = typhus
			remove_trait = bubonic_plague
		}
	}
}

full_restoration_interaction = {
	category = interaction_category_diplomacy
	
	desc = full_restoration_interaction_desc
		
	is_shown = {
		scope:actor = { 
			has_trait = avatar_of_life
		}
		scope:recipient = {
			OR = { 
				has_trait = sickly
				has_trait = ill
				has_trait = early_great_pox
				has_trait = lovers_pox
				has_trait = wounded_1
				has_trait = infirm
				has_trait = pneumonic
				has_trait = great_pox
				has_trait = leper
				has_trait = wounded_2
				has_trait = wounded_3
				has_trait = maimed
				has_trait = incapable
				has_trait = gout_ridden
				has_trait = consumption
				has_trait = cancer
				has_trait = typhus
				has_trait = bubonic_plague
				has_trait = one_eyed
				has_trait = one_legged
				has_trait = disfigured
				has_trait = scarred
				has_trait = eunuch
				has_trait = blind
			}
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 200
		}
	}
	
	on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -200 }
		}
		scope:recipient = {
			remove_trait = sickly
			remove_trait = ill
			remove_trait = early_great_pox
			remove_trait = lovers_pox
			remove_trait = wounded_1
			remove_trait = infirm
			remove_trait = pneumonic
			remove_trait = great_pox
			remove_trait = leper
			remove_trait = wounded_2
			remove_trait = wounded_3
			remove_trait = maimed
			remove_trait = incapable
			remove_trait = gout_ridden
			remove_trait = consumption
			remove_trait = cancer
			remove_trait = typhus
			remove_trait = bubonic_plague
			remove_trait = one_eyed
			remove_trait = one_legged
			remove_trait = disfigured
			remove_trait = scarred
			remove_trait = eunuch
			remove_trait = blind
			add_character_modifier = {
				modifier = full_restoration_modifier
				years = 5
			}
		}
	}
}

haste_interaction = {
	category = interaction_category_diplomacy
	
	desc = haste_interaction_desc
		
	is_shown = {
		scope:actor = { 
			has_perk = mass_celerity_perk
			NOT = { has_modifier = magic_super_haste_modifier }
		}
		scope:recipient = {
			this = scope:actor
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 100
		}
	}
	
	on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -100 }
		}
		scope:recipient = {
			add_character_modifier = {
				modifier = magic_haste_modifier
				months = 6
			}
		}
	}
}

super_haste_interaction = {
	category = interaction_category_diplomacy
	
	desc = super_haste_interaction_desc
		
	is_shown = {
		scope:actor = { 
			has_trait = master_of_time
			NOT = { has_modifier = magic_super_haste_modifier }
		}
		scope:recipient = {
			this = scope:actor
		}
	}
	
	is_valid = {
		scope:actor = { 
			var:mana > 600
		}
	}
	
	on_accept = {
		scope:actor = { 
			change_mana = { VALUE = -600 }
		}
		scope:recipient = {
			add_character_modifier = {
				modifier = magic_super_haste_modifier
				months = 6
			}
		}
	}
}

