namespace = PLG

character_event = {
	id = PLG.100
	desc = ""
	picture = GFX_evt_large_army
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			character_event = { id = PLG.101 }
		}
	}
	
	option = {
		name = OK
	}
}

character_event = {
	id = PLG.101
	desc = ""
	picture = GFX_evt_large_army
	is_triggered_only = yes
	hide_window = yes
	
	immediate = {
		if = {
			limit = {liege = {has_character_modifier = plda}}
			
			liege = {letter_event = { id = PLG.102}}
		}
		
		if = {
			limit = {NOT = {liege = {has_character_modifier = plda}}}
			liege = {
				add_character_modifier = {
					name = plda
					duration = 720
					hidden = yes
				}
			}
			liege = {letter_event = { id = PLG.202}}
			
		}
		
		
		set_defacto_liege = THIS
		join_attacker_wars = FROM
		set_defacto_liege = FROM
	}
	option = {
		name = OK

	}
}

letter_event = {
	id = PLG.102
	desc = PLG102
	picture = GFX_evt_large_army
	notification = yes
	
	is_triggered_only = yes
	major = no
	is_friendly = yes
	option = {
		name = EXCELLENT
	}
}

letter_event = {
	id = PLG.104
	desc = PLG104
	picture = GFX_evt_large_army
	notification = yes
	
	
	is_triggered_only = yes
	major = no
	is_friendly = yes
	immediate = {
		FROM = {
			capital_scope = {
				FROM = {
					spawn_unit = {
						province = PREV
						owner = ROOT
						match_character = FROM
						match_mult = 1.0			
						attrition = 1.0
						maintenance_multiplier = 1.0
						disband_on_peace = yes
					}
				}
			}
			any_demesne_province = {
				any_province_holding = {
					limit = {
						holder_scope = {
							character = FROM
						}
					}
					add_holding_modifier = {
						name = plb
						duration = 1
					}
				}
			}
			opinion = {
				modifier = pledge_pact
				who = ROOT
			}
			any_vassal = {
				opinion = {
					modifier = pledge_pact
					who = PREV
				}
			}
		}
		
	}
	option = {
		name = EXCELLENT
	}
}


letter_event = {
	id = PLG.204
	desc = PLG104
	picture = GFX_evt_large_army
	
	is_triggered_only = yes
	major = no
	is_friendly = yes
	immediate = {
		FROM = {
			capital_scope = {
				FROM = {
					spawn_unit = {
						province = PREV
						owner = ROOT
						match_character = FROM
						match_mult = 1.0			
						attrition = 1.0
						maintenance_multiplier = 1.0
						disband_on_peace = yes
					}
				}
			}
			any_demesne_province = {
				any_province_holding = {
					limit = {
						holder_scope = {
							character = FROM
						}
					}
					add_holding_modifier = {
						name = plb
						duration = 1
					}
				}
			}
			opinion = {
				modifier = pledge_pact
				who = ROOT
			}
			any_vassal = {
				opinion = {
					modifier = pledge_pact
					who = PREV
				}
			}
		}
		
	}
	option = {
		name = EXCELLENT
	}
}


letter_event = {
	id = PLG.202
	desc = PLG102
	picture = GFX_evt_large_army

	is_triggered_only = yes
	major = no
	is_friendly = yes
	option = {
		name = EXCELLENT
	}
}