scripted_diplomatic_actions = {

	
	

	surrender_self = {
		icon = 14

		selectable = {
			FROM = {
				is_subject = no
				OR = {
					is_in_faction = no
					is_faction_leader = yes
				}
			}
		}
		
		visible = {
			FROM = {
				has_war_with = ROOT
			}
		}

		accept_title = SURRENDER_SELF_ACCEPT
		accept_description = SURRENDER_SELF_ACCEPT_DESC
		reject_title = SURRENDER_SELF_REJECT
		reject_description = SURRENDER_SELF_REJECT_DESC
		send_description = SURRENDER_SELF_SEND_DESC
		receive_description = SURRENDER_SELF_RECEIVE_DESC
		
		requires_acceptance = yes
		show_acceptance_on_action_button = yes 
		
		can_be_sent = {
			always = yes
		}

		
		
		complete_effect = {
			log = "L|[ROOT.GetTag] surrendered individually to [FROM.GetTag]"
			ROOT = {
				leave_faction = yes
			}
			start_peace_conference = {
				tag = ROOT
				score_factor = 1
				loser_scope = LIMITED
				winner_scope = ALL
			}
		}

		ai_acceptance = {
			defense_treaty_ai_condition = {
				base = -100
			}
		}
	}

	surrender_faction = {
		icon = 14

		selectable = {
			FROM = {
				is_subject = no
				OR = {
					is_in_faction = no
					is_faction_leader = yes
				}
			}
		}
		
		visible = {
			FROM = {
				has_war_with = ROOT
			}
			ROOT = {
				is_faction_leader = yes
			}
		}

		accept_title = SURRENDER_FACTION_ACCEPT
		accept_description = SURRENDER_FACTION_ACCEPT_DESC
		reject_title = SURRENDER_FACTION_REJECT
		reject_description = SURRENDER_FACTION_REJECT_DESC
		send_description = SURRENDER_FACTION_SEND_DESC
		receive_description = SURRENDER_FACTION_RECEIVE_DESC
		
		requires_acceptance = yes
		show_acceptance_on_action_button = yes 
		
		can_be_sent = {
			always = yes
		}

		
		
		complete_effect = {
			log = "L|[ROOT.GetTag]'s faction surrendered to [FROM.GetTag]"
			start_peace_conference = {
				tag = ROOT
				score_factor = 1
				winner_scope = ALL
			}
		}

		ai_acceptance = {
			defense_treaty_ai_condition = {
				base = -100
			}
		}
	}

	defense_treaty1 = {
		cost = 30
		icon = 2

		selectable = {
			ROOT = {
				has_war = no
				is_in_faction = no
				is_subject = no
			}
			PREV = {
				has_war = no
				is_in_faction = no
				is_subject = no
			}
		}
		
		visible = {
			ROOT = {
				NOT = { has_country_flag = nideas_defense_agreement_cost_reduced_cflag }
				NOT = {
					has_dynamic_modifier = {
						modifier = rt56rp_merc_modifier
					}
				}
				NOT = {
					has_relation_modifier = {
						target = PREV
						modifier = defense_treaty2_opmod
					}
					has_war_with = PREV
				}
				is_ai = no
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = DEFENSE_TREATY1_ACCEPT
		accept_description = DEFENSE_TREATY1_ACCEPT_DESC
		reject_title = DEFENSE_TREATY1_REJECT
		reject_description = DEFENSE_TREATY1_REJECT_DESC
		send_description = DEFENSE_TREATY1_SEND_DESC
		receive_description = DEFENSE_TREATY1_RECEIVE_DESC
		
		requires_acceptance = yes
		show_acceptance_on_action_button = yes 
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}
		
		complete_effect = {
			log = "L|[ROOT.GetTag] signed defence treaty with [PREV.GetTag]"
			ROOT = {
				add_relation_modifier = {
					target = PREV
					modifier = defense_treaty2_opmod
				}
				add_opinion_modifier = {
					target = PREV
					modifier = defense_treaty1_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = defense_treaty_break1_opmod
				}
				diplomatic_relation = {
					country = PREV
					relation = non_aggression_pact
					active = yes
				}
				diplomatic_relation = {
					country = PREV
					relation = military_access
					active = yes
				}
				diplomatic_relation = {
					country = PREV
					relation = guarantee
					active = yes
				}
			}
			PREV = {
				add_relation_modifier = {
					target = ROOT
					modifier = defense_treaty2_opmod
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = defense_treaty1_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = defense_treaty_break1_opmod
				}
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = yes
				}
				diplomatic_relation = {
					country = ROOT
					relation = military_access
					active = yes
				}
				diplomatic_relation = {
					country = ROOT
					relation = guarantee
					active = yes
				}
			}
		}

		ai_acceptance = {
			defense_treaty_ai_condition = {
				base = -100
			}
		}
	}
	
	defense_treaty2 = {
		cost = 15
		icon = 2

		selectable = {
			ROOT = {
				has_war = no
				is_in_faction = no
				is_subject = no
			}
			PREV = {
				has_war = no
				is_in_faction = no
				is_subject = no
			}
		}
		
		visible = {
			ROOT = {
				has_country_flag = nideas_defense_agreement_cost_reduced_cflag
				NOT = {
					has_dynamic_modifier = {
						modifier = rt56rp_merc_modifier
					}
				}
				NOT = {
					has_relation_modifier = {
						target = PREV
						modifier = defense_treaty2_opmod
					}
					has_war_with = PREV
				}
				is_ai = no
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = DEFENSE_TREATY2_ACCEPT
		accept_description = DEFENSE_TREATY2_ACCEPT_DESC
		reject_title = DEFENSE_TREATY2_REJECT
		reject_description = DEFENSE_TREATY2_REJECT_DESC
		send_description = DEFENSE_TREATY2_SEND_DESC
		receive_description = DEFENSE_TREATY2_RECEIVE_DESC
		
		requires_acceptance = yes
		show_acceptance_on_action_button = yes 
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}
		
		complete_effect = {
			log = "L|[ROOT.GetTag] signed defence treaty with [PREV.GetTag]"
			ROOT = {
				add_relation_modifier = {
					target = PREV
					modifier = defense_treaty2_opmod
				}
				add_opinion_modifier = {
					target = PREV
					modifier = defense_treaty1_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = defense_treaty_break1_opmod
				}
				diplomatic_relation = {
					country = PREV
					relation = non_aggression_pact
					active = yes
				}
				diplomatic_relation = {
					country = PREV
					relation = military_access
					active = yes
				}
				diplomatic_relation = {
					country = PREV
					relation = guarantee
					active = yes
				}
			}
			PREV = {
				add_relation_modifier = {
					target = ROOT
					modifier = defense_treaty2_opmod
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = defense_treaty1_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = defense_treaty_break1_opmod
				}
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = yes
				}
				diplomatic_relation = {
					country = ROOT
					relation = military_access
					active = yes
				}
				diplomatic_relation = {
					country = ROOT
					relation = guarantee
					active = yes
				}
			}
		}

		ai_acceptance = {
			defense_treaty_ai_condition = {
				base = -100
			}
		}
	}
	
	defense_treaty_break = {
		cost = 10
		icon = 2
		
		selectable = {
		}

		visible = {
			ROOT = {
				has_relation_modifier = {
					target = PREV
					modifier = defense_treaty2_opmod
				}
				NOT = { has_war_with = PREV }
				is_ai = no
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		send_description = DEFENSE_TREATY_BREAK_SEND_DESC
		receive_description = DEFENSE_TREATY_BREAK_RECEIVE_DESC
		
		requires_acceptance = no
		show_acceptance_on_action_button = no
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}
		
		complete_effect = {
			log = "L|[ROOT.GetTag] broke defence treaty with [PREV.GetTag]"
			ROOT = {
				remove_relation_modifier = {
					target = PREV
					modifier = defense_treaty2_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = defense_treaty1_opmod
				}
				add_opinion_modifier = {
					target = PREV
					modifier = defense_treaty_break1_opmod
				}
				diplomatic_relation = {
					country = PREV
					relation = non_aggression_pact
					active = no
				}
				diplomatic_relation = {
					country = PREV
					relation = military_access
					active = no
				}
				diplomatic_relation = {
					country = PREV
					relation = guarantee
					active = no
				}
			}
			PREV = {
				remove_relation_modifier = {
					target = ROOT
					modifier = defense_treaty2_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = defense_treaty1_opmod
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = defense_treaty_break1_opmod
				}
				diplomatic_relation = {
					country = ROOT
					relation = non_aggression_pact
					active = no
				}
				diplomatic_relation = {
					country = ROOT
					relation = military_access
					active = no
				}
				diplomatic_relation = {
					country = ROOT
					relation = guarantee
					active = no
				}
			}
		}
	}

	trade_agreement1 = {
		cost = 10
		icon = 2

		selectable = {
			PREV = {
				NOT = {
					is_subject_of = ROOT
				}
			}
		}

		visible = {
			ROOT = {
				NOT = { has_country_flag = nideas_trade_agreement_cost_reduced_cflag }
				NOT = {
					has_relation_modifier = {
						target = PREV
						modifier = trade_agreement3_opmod
					}
					has_war_with = PREV
				}
				is_ai = no
			}
			NOT = {
				is_in_array = {
					array = ROOT.embargoed_countries
					value = FROM.id
				}			
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = TRADE_AGREEMENT1_ACCEPT
		accept_description = TRADE_AGREEMENT1_ACCEPT_DESC
		reject_title = TRADE_AGREEMENT1_REJECT
		reject_description = TRADE_AGREEMENT1_REJECT_DESC
		send_description = TRADE_AGREEMENT1_SEND_DESC
		receive_description = TRADE_AGREEMENT1_RECEIVE_DESC
		
		requires_acceptance = yes
		show_acceptance_on_action_button = yes 
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}

		complete_effect = {
			log = "L|[ROOT.GetTag] signed a trade agreement with [PREV.GetTag]"
			ROOT = {
				add_relation_modifier = {
					target = PREV
					modifier = trade_agreement3_opmod	#this is to check when to hide diplo action
				}
				add_opinion_modifier = {
					target = PREV
					modifier = trade_agreement1_opmod
				}
				add_opinion_modifier = {
					target = PREV
					modifier = trade_agreement2_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = trade_agreement_break1_opmod
				}
			}
			PREV = {
				add_relation_modifier = {
					target = ROOT
					modifier = trade_agreement3_opmod	#this is to check when to hide diplo action
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement1_opmod
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement2_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement_break1_opmod
				}
			}
		}

		ai_acceptance = {
			trade_agreement_ai_condition = {
				base = -50
				modifier = {
					ROOT = {
						has_war_together_with = PREV
					}
					add = 30
				}
				modifier = {
					ROOT = {
						is_guaranteed_by = PREV
					}
					add = 30
				}
				modifier = {
					ROOT = {
						is_ally_with = PREV
					}
					add = 50
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 10
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 20
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 30
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 40
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 50
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 60
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 70
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 80
						}
					}
					add = 10
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 90
						}
					}
					add = 10
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 100
						}
					}
					add = 10
				}
			}
		}
	}

	trade_agreement2 = {
		cost = 6
		icon = 2

		selectable = {
			PREV = {
				NOT = {
					is_subject_of = ROOT
				}
			}
		}

		visible = {
			ROOT = {
				has_country_flag = nideas_trade_agreement_cost_reduced_cflag
				NOT = {
					has_relation_modifier = {
						target = PREV
						modifier = trade_agreement3_opmod
					}
					has_war_with = PREV
				}
				is_ai = no
			}
			NOT = {
				is_in_array = {
					array = ROOT.embargoed_countries
					value = FROM.id
				}			
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = TRADE_AGREEMENT2_ACCEPT
		accept_description = TRADE_AGREEMENT2_ACCEPT_DESC
		reject_title = TRADE_AGREEMENT2_REJECT
		reject_description = TRADE_AGREEMENT2_REJECT_DESC
		send_description = TRADE_AGREEMENT2_SEND_DESC
		receive_description = TRADE_AGREEMENT2_RECEIVE_DESC
		
		requires_acceptance = yes
		show_acceptance_on_action_button = yes 
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}

		complete_effect = {
			log = "L|[ROOT.GetTag] signed a trade agreement with [PREV.GetTag]"
			ROOT = {
				add_relation_modifier = {
					target = PREV
					modifier = trade_agreement3_opmod	#this is to check when to hide diplo action
				}
				add_opinion_modifier = {
					target = PREV
					modifier = trade_agreement1_opmod
				}
				add_opinion_modifier = {
					target = PREV
					modifier = trade_agreement2_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = trade_agreement_break1_opmod
				}
			}
			PREV = {
				add_relation_modifier = {
					target = ROOT
					modifier = trade_agreement3_opmod	#this is to check when to hide diplo action
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement1_opmod
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement2_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement_break1_opmod
				}
			}
		}

		ai_acceptance = {
			trade_agreement_ai_condition = {
				base = -50
				modifier = {
					ROOT = {
						has_war_together_with = PREV
					}
					add = 30
				}
				modifier = {
					ROOT = {
						is_guaranteed_by = PREV
					}
					add = 30
				}
				modifier = {
					ROOT = {
						is_ally_with = PREV
					}
					add = 50
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 10
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 20
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 30
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 40
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 50
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 60
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 70
						}
					}
					add = 5
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 80
						}
					}
					add = 10
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 90
						}
					}
					add = 10
				}
				modifier = {
					PREV = {
						has_opinion = {
							target = ROOT
							value > 100
						}
					}
					add = 10
				}
			}
		}
	}

	trade_agreement_break = {
		cost = 5
		icon = 2

		selectable = {
			PREV = {
				NOT = {
					is_subject_of = ROOT
				}
			}
		}

		visible = {
			ROOT = {
				has_relation_modifier = {
					target = PREV
					modifier = trade_agreement3_opmod
				}
				NOT = { has_war_with = PREV }
				is_ai = no
			}
			NOT = {
				is_in_array = {
					array = ROOT.embargoed_countries
					value = FROM.id
				}			
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		send_description = TRADE_AGREEMENT_BREAK_SEND_DESC
		receive_description = TRADE_AGREEMENT_BREAK_RECEIVE_DESC

		requires_acceptance = no
		show_acceptance_on_action_button = no 
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}
		
		complete_effect = {
			log = "L|[ROOT.GetTag] broke a trade agreement with [PREV.GetTag]"
			ROOT = {
				remove_relation_modifier = {
					target = PREV
					modifier = trade_agreement3_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = trade_agreement1_opmod
				}
				remove_opinion_modifier = {
					target = PREV
					modifier = trade_agreement2_opmod
				}
				add_opinion_modifier = {
					target = PREV
					modifier = trade_agreement_break1_opmod
				}
			}
			PREV = {
				remove_relation_modifier = {
					target = ROOT
					modifier = trade_agreement3_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement1_opmod
				}
				remove_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement2_opmod
				}
				add_opinion_modifier = {
					target = ROOT
					modifier = trade_agreement_break1_opmod
				}
			}
		}
	}

	offer_protection = {
		cost = 50
		icon = 1

		selectable = {
			PREV = { is_in_faction_with = ROOT }
		}

		visible = {
			is_ai = no
			is_subject = no
			ROOT = {
				NOT = { has_war_with = PREV }
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = OFFER_PROTECTION_ACCEPT
		accept_description = OFFER_PROTECTION_ACCEPT_DESC
		reject_title = OFFER_PROTECTION_REJECT
		reject_description = OFFER_PROTECTION_REJECT_DESC
		send_description = OFFER_PROTECTION_SEND_DESC
		receive_description = OFFER_PROTECTION_RECEIVE_DESC

		requires_acceptance = yes
		show_acceptance_on_action_button = no
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}

		complete_effect = {
			log = "L|[ROOT.GetTag] gave protection to [PREV.GetTag]"
			hidden_effect = {
				PREV = {
					set_variable = { PREV_democratic_popularity = PREV.party_popularity_100@democratic }
					clamp_variable = { var = PREV_democratic_popularity   min = 0   max = 100 }
					
					set_variable = { PREV_communism_popularity = PREV.party_popularity_100@communism }
					clamp_variable = { var = PREV_communism_popularity   min = 0   max = 100 }
					
					set_variable = { PREV_neutrality_popularity = PREV.party_popularity_100@neutrality }
					clamp_variable = { var = PREV_neutrality_popularity   min = 0   max = 100 }
					
					set_variable = { PREV_fascism_popularity = PREV.party_popularity_100@fascism }
					clamp_variable = { var = PREV_fascism_popularity   min = 0   max = 100 }
					
					if = {
						limit = { has_government = democratic }
						set_country_flag = PREV_is_democratic_flag
					}
					
					if = {
						limit = { has_government = neutrality }
						set_country_flag = PREV_is_neutral_flag
					}
					
					if = {
						limit = { has_government = communism }
						set_country_flag = PREV_is_communistic_flag
					}
					
					if = { 
						limit = { has_government = fascism }
						set_country_flag = PREV_is_fascist_flag
					}
					
					if = { 
						limit = { has_wargoal_against = ROOT }
						remove_wargoal = { type = all   target = ROOT }
					}
				}
			}

			ROOT = {
				set_autonomy = {
					target = PREV
					autonomous_state = autonomy_protected_government
					end_wars = no
					end_civil_wars = no
				}
			}

			hidden_effect = {
				PREV = {
					hidden_effect = {
						set_popularities = {
							democratic = PREV_democratic_popularity
							fascism = PREV_fascism_popularity
							communism = PREV_communism_popularity
							neutrality = PREV_neutrality_popularity
						}
						if = {
							limit = { has_country_flag = PREV_is_democratic_flag }
							set_politics = { ruling_party = democratic }
							clr_country_flag = PREV_is_democratic_flag
						}
						if = {
							limit = { has_country_flag = PREV_is_neutral_flag }
							set_politics = { ruling_party = neutrality }
							clr_country_flag = PREV_is_neutral_flag
						}
						if = {
							limit = { has_country_flag = PREV_is_communistic_flag }
							set_politics = { ruling_party = communism }
							clr_country_flag = PREV_is_communistic_flag
						}
						if = {
							limit = { has_country_flag = PREV_is_fascist_flag }
							set_politics = { ruling_party = fascism }
							clr_country_flag = PREV_is_fascist_flag
						}
					}
				}
			}

			ROOT = {				
				# flag changes
				if = {
					limit = {
						FROM = { tag = MAL }
						tag = GER
					}
					FROM = { set_cosmetic_tag = MAL_GER }
				}
			}
		}
	}

	offer_overlordship = {
		cost = 50
		icon = 1

		selectable = {
			PREV = {
				is_in_faction_with = ROOT
			}
		}

		visible = {
			is_ai = no
			is_subject = no
			ROOT = {
				NOT = { has_war_with = PREV }
			}
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = OFFER_OVERLORDSHIP_ACCEPT
		accept_description = OFFER_OVERLORDSHIP_ACCEPT_DESC
		reject_title = OFFER_OVERLORDSHIP_REJECT
		reject_description = OFFER_OVERLORDSHIP_REJECT_DESC
		send_description = OFFER_OVERLORDSHIP_SEND_DESC
		receive_description = OFFER_OVERLORDSHIP_RECEIVE_DESC

		requires_acceptance = yes
		show_acceptance_on_action_button = no
		
		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}

		complete_effect = {
			log = "L|[ROOT.GetTag] gave overlordship to [PREV.GetTag]"
			ROOT = {
				set_autonomy = {
					target = PREV
					autonomy_state = autonomy_dominion
					end_wars = no
					end_civil_wars = no
				}
				if = { # flag changes
					limit = {
						PREV = {
							tag = MAL
						}
						tag = GER
					}
					PREV = {
						set_cosmetic_tag = MAL_GER
					}
				}
			}
		}
	}

	offer_independence = {
		cost = 50
		icon = 1

		selectable = {
			ROOT = { has_war = no }
		}

		visible = {
			is_subject_of = ROOT
			is_ai = no
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		accept_title = OFFER_INDEPENDENCE_ACCEPT
		accept_description = OFFER_INDEPENDENCE_ACCEPT_DESC
		reject_title = OFFER_INDEPENDENCE_REJECT
		reject_description = OFFER_INDEPENDENCE_REJECT_DESC
		send_description = OFFER_INDEPENDENCE_SEND_DESC
		receive_description = OFFER_INDEPENDENCE_RECEIVE_DESC

		requires_acceptance = yes
		show_acceptance_on_action_button = no

		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}

		complete_effect = {
			log = "L|[ROOT.GetTag] gave independence to [PREV.GetTag]"
			ROOT = {
				end_puppet = PREV
			}
			PREV = {
				drop_cosmetic_tag = yes
			}
		}
	}

	rt56rp_30_day_warning = {
		cost = 0
		icon = 1

		selectable = {
			OR = {
				FROM = {
					NOT = { OR = { has_idea = rt56rp_war_declared   has_idea = rt56rp_war_attacker } }
				}
				any_country = {
					is_ally_with = ROOT
					has_war_with = FROM
				}
			}
		}

		visible = {
			is_ai = no
			NOT = { has_war_with = ROOT }
			NOT = { is_ally_with = ROOT }
			NOT = { has_global_flag = rt56rp_gr_historical_gflag }
		}

		send_description = RT56RP_30_DAY_WARNING_SEND_DESC
		receive_description = RT56RP_30_DAY_WARNING_RECEIVE_DESC

		requires_acceptance = no
		show_acceptance_on_action_button = no

		can_be_sent = {
			always = yes
		}

		on_sent_effect = {
			ROOT = {
				set_country_flag = { 
					flag = diplomatic_action_cooldown
					value = 1
					days = 30
				}
			}
		}

		complete_effect = {
			log = "L|[ROOT.GetTag] gave 30 day warning to [FROM.GetTag]"
			add_timed_idea = {
				idea = rt56rp_30_day_warning_received
				days = 30
			}
			if = {
				every_country = {
					limit = {
						is_ally_with = FROM
					}
					add_timed_idea = {
						idea = rt56rp_30_day_warning_received
						days = 30
					}
				}
			}	
		}
	}

	TS_recall_diplo = {
		icon = 1
		allowed = { #The country making the diplomatic request
			always = yes
		}
		visible = { #The target country
			THIS = {
				has_volunteers_amount_from = {
					tag = ROOT
					count > 0
				}
			}
		}
		selectable = {
			THIS = {
				has_volunteers_amount_from = {
					tag = ROOT
					count > 0
				}
			}
			ROOT = { is_ai = no }
		}
#		show_acceptance_on_action_button = yes # set to no if acceptance shouldn't be displayed on the action button
		can_be_accepted = { always = yes }
		can_be_sent = { always = yes }
		#for effects/triggers/variables, ROOT is the sender and THIS is receiver
#		send_description = TS_recall_volunteers_LOC
#		accept_title = TS_recall_volunteers_TITLE
#		accept_description = TS_recall_volunteers_ACTION_DESC
		accept_description = loc_key_accept_desc
		reject_title = loc_key_reject
		reject_description = loc_key_reject_desc
		cost = 50
		command_power = 0 # cp cost, can be zero
		requires_acceptance = no
		on_sent_effect = {}
		complete_effect = {
			log = "L|[ROOT.GetTag] recalled volunteers from [PREV.GetTag]"
			ROOT = {
				recall_volunteers_from = PREV
			}
		}
		ai_desire = {}
	}
}