add_namespace = lar_spain
#Demanda Gibraltar#

country_event = {
	id = lar_spain.93
	title = "Spain Demands Gibraltar"
	desc = "Give it back you thief."
	picture = GFX_report_event_generic_parliament

	is_triggered_only = yes

	option = { # Accept
		name = "Do the right thing"
		ai_chance = {
			base = 99
			modifier = {

			}
		}
		effect_tooltip = {
			FROM = {
				transfer_state = 118

			}
		}
		hidden_effect = {

			FROM = {
				country_event = { id = lar_spain.94 hours = 18 random_hours = 6 }
			}
			news_event = { id = lar_news.93 days = 2 }
		}
	}



	option = { # Decline
		name = "What are you looking at? go up"
		ai_chance = {
			base = 1
			modifier = {

			}


		}
		effect_tooltip = {
			FROM = {
				add_state_claim = 118

				create_wargoal = {
					type = take_state_focus
					target = ROOT
					generator = { 118 }
					expire = 0
				}
			}
		}
		hidden_effect = {
			FROM = {
				country_event = { id = lar_spain.95 hours = 18 random_hours = 6 }
			}
		}
	}
}

#Spain gets Gibraltar
country_event = {
	id = lar_spain.94
	title = lar_spain.94.t
	desc = lar_spain.94.d
	picture = GFX_report_event_generic_sign_treaty

	is_triggered_only = yes
	trigger = {
	}

	option = { #yes
		name = lar_spain.94.a

		set_state_owner = 118
		set_state_controller = 118
		add_state_core = 118
	}
}

#Spain doesnt get their demands
country_event = {
	id = lar_spain.95
	title = lar_spain.95.t
	desc = lar_spain.95.d
	picture = GFX_report_event_generic_sign_treaty

	is_triggered_only = yes
	trigger = {
	}

	option = { #shit
		name = lar_spain.95.a
		add_war_support = 0.05
	}
}


# Demanda Malta

country_event = {
	id = lar_spain.110
	title = "The Spanish Empire RIGHTFULLY demands Malta!"
	desc = "Spain is demanding what is rightfully theirs."


	picture = GFX_report_event_generic_parliament
	is_triggered_only = yes

	option = { # Accept
		name = "Give it back you thief, Spain has such a strong claim on it"
		ai_chance = {
			base = 99
		}
		effect_tooltip = {
			FROM = {
				add_state_core = 116
			}
		}
		hidden_effect = {
			FROM = {
				country_event = { id = lar_spain.97.a hours = 18 random_hours = 6 }
			}
			news_event = { id = lar.news.110 days = 2 }
		}
	}

	option = { # Decline
		name = "Incorrect option."
		ai_chance = {
			base = 1
		}
		effect_tooltip = {
			FROM = {
				add_state_claim = 116
				create_wargoal = {
					type = take_state_focus
					target = ROOT
					generator = { 116 }
					expire = 0
				}
			}
		}
	}
}

# Spain gets Malta
country_event = {
	id = lar_spain.97
	title = "Spanish flag in Malta."
	desc = "Under mounting diplomatic pressure and with its global empire waning, the British government has chosen to yield control of Malta to Spain. Once a bastion of Catholic 	resilience in the Mediterranean, the island now returns to Iberian hands."


	picture = GFX_report_event_generic_sign_treaty
	is_triggered_only = yes

	option = {
		name = lar_spain.97.a
		set_state_owner = 116
		set_state_controller = 116
		
	}
}

# Malta refused
country_event = {
	id = lar_spain.98
	title = "How dare they"
	desc = lar_spain.98.d
	picture = GFX_report_event_generic_sign_treaty
	is_triggered_only = yes

	option = {
		name = lar_spain.98.a
		add_war_support = 0.05
	}
}



country_event = {
    id = lar_spain.2000
    title = "The Spanish Empire demands subjugation!"
    desc = "The Spanish Empire wants this country to yield as part of their imperialist agenda."
    picture = GFX_report_event_generic_diplomatic

    is_triggered_only = yes

    option = {
        name = "Accept"  # Accept
        add_opinion_modifier = {
            target = ROOT
		    ai_chance = {
        factor = 100
    	}
        }
        add_political_power = 25
        add_stability = 0.05
        # Optionally: set_country_flag = accepted_spanish_initiative
		
		 SPR= { 
        set_autonomy = {
            target = ROOT
            autonomous_state = autonomy_reichsprotectorate
            end_wars = no
            end_civil_wars = no
        }
    }
    }
    option = {
        name = "Refuse"  # Refuse

		ai_chance = {
        factor = 0
    	}
        add_opinion_modifier = {
            target = ROOT
            modifier = negative_response_to_spanish_diplomacy
        }
        add_political_power = -15
        add_stability = -0.05
    }
}

