je_prepare_for_independence_war_morocco = {
	icon = "gfx/interface/icons/event_icons/event_military.dds"
	complete = {
		custom_tooltip = {
			text = dvg_prepare_for_independence_war_morocco
			year > 1840
		}
	}
	
	fail = {
		OR = {
			c:SPA = {
				has_diplomatic_pact = {
					who = c:QUI
					type = puppet
					is_initiator = yes
				}
			}
			c:SPA = {
				has_diplomatic_pact = {
					who = c:QUI
					type = dominion
					is_initiator = yes
				}
			}
			c:SPA = {
				is_at_war = no
			}
		}
	}

    on_complete = {
		trigger_event = { id = dvg_morocco.2 }
		c:SPA = {
			trigger_event = { id = dvg_spain.10 }
		}
	}
	
    on_fail = {
		trigger_event = { id = dvg_morocco.3 }
	}
	
	weight = 100
	should_be_pinned_by_default = yes
}

je_independence_war_morocco = {
	icon = "gfx/interface/icons/event_icons/event_military.dds"
	complete = {
		is_subject = no
		is_at_war = no
	}
	
	fail = { #actually you will just be dead, but this gets point across
		is_subject = yes
		is_at_war = no
	}

    on_complete = {
		trigger_event = { id = dvg_morocco.4 }
	}
	
    on_fail = {
	}
	
	weight = 100
	should_be_pinned_by_default = yes
}