#############################
# Marshal events: 7400-7499 #
#                           #
#      Thomas Corriol       #
#############################

#####
# Lustful Marshal: Rape trial

character_event = {
	id = 7400
	
	picture = "event_intrigue"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = trait value = lustful }
	}

	mean_time_to_happen = {
		months = 600
	}

	action_a = {#Fine Marshal
		effect = { type = loyalty value = -0.2 }
		effect = { type = gold value = -100 }
		effect = { type = random
				chance = 10
				effect = { type = remove_trait value = lustful }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_trait value = deceitful }
		}
		effect = { type = random
				chance = 50
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = random
				chance = 50
				effect = { type = add_province_effect for = ruler value = revolt }
		}
	}

	action_b = {#Exile Marshal
		effect = { type = random
				chance = 25
				effect = { type = add_trait for = ruler value = just }
		}
		effect = { type = random
				chance = 25
				effect = { type = add_province_effect for = ruler value = revolt }
		}
		effect = { type = courtier_defect value = random_neighbor }
		effect = { type = loyalty value = 1.0 }
		effect = { type = random
				chance = 10
				effect = { type = remove_trait value = lustful }
		}
	}

	action_c = {#Clean Marshal
		effect = { type = loyalty value = 0.2 }
		effect = { type = random
				chance = 10
				effect = { type = remove_trait value = lustful }
		}
		effect = { type = random
				chance = 75
				effect = { type = add_trait for = ruler value = arbitrary }
		}
		effect = { type = add_province_effect for = ruler value = revolt }
	}

	action_d = {#Execute Marshal
		effect = { type = death }
		effect = { type = random
				chance = 75
				effect = { type = add_trait for = ruler value = just }
		}
	}

}

#####
# Chaste Marshal: Become Martial cleric

character_event = {
	id = 7401
	
	picture = "event_religion"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = age value = 40 }
		condition = { type = piety value = 10 }
		condition = { type = not value = { type = is_married } }
		condition = { type = not value = { type = trait value = heretic } }
		condition = { type = not value = { type = trait value = excommunicated } }
		condition = { type = trait value = chaste }
		condition = { type = or 
			condition = { type = trait value = misguided_warrior }
			condition = { type = trait value = tough_soldier }
			condition = { type = trait value = knowledged_tactician }
			}
	}

	mean_time_to_happen = {
		months = 480

		modifier = {
			condition = { type = or 
				condition = { type = exists value = TEMP }
				condition = { type = exists value = HOSP }
				condition = { type = exists value = TEUT }
			}
			factor = 0.5
		}
		
		modifier = {
			condition = {
				type = capital
				condition = { type = has_improvement value = { templar_house = yes } }
			}
			factor = 0.5
		}

		# Personal traits modifiers:

		modifier = { 
			condition = { type = trait value = zealous }		
			factor = 0.7
		}

		modifier = { 
			condition = { type = trait value = crusader }		
			factor = 0.5
		}

		modifier = { 
			condition = { type = trait value = sceptical }		
			factor = 3
		}

		modifier = { 
			condition = { type = trait value = excommunicated}		
			factor = 5
		}


	}

	action_a = {#Marshal enter one of the fighting Order
		effect = { type = piety value = 25 }
		effect = { type = add_improvement for = ruler value = templar_house }
		effect = { type = remove_trait value = misguided_warrior }
		effect = { type = remove_trait value = tough_soldier }
		effect = { type = remove_trait value = knowledged_tactician }
		effect = { type = add_trait value = martial_cleric }
		effect = { type = martial value = 1 }
	}

}

#####
# Merciful Marshal: Gain enemy defector

character_event = {
	id = 7402
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = combat }
		condition = { type = trait value = merciful }
	}

	mean_time_to_happen = {
		days = 600

		# Personal traits modifiers:

		modifier = { 
			condition = { type = trait value = forgiving }		
			factor = 0.7
		}

		modifier = { 
			condition = { type = trait value = vengeful }		
			factor = 3
		}

		modifier = { 
			condition = { type = trait value = generous }		
			factor = 0.7
		}

	}

	action_a = {#Marshal spare the life of an enemy who proposed to join your court
		effect = { type = piety value = 25 }
		effect = { type = prestige value = 25 }
		effect = { type = trigger for = ruler value = 7403 }
	}

}

character_event = {
	id = 7403
	
	picture = "event_appearance"
	
	action_a = {#Marshal spare the life of an enemy who proposed to join your court
		effect = { type = prestige value = 15 }
		effect = { type = create_courtier value = enemy_defector }
	}

	action_b = {#Exchange him against a ransom
		effect = { type = gold value = 100 }
	}

}

#####
# Cruel Marshal: Unnecessary violence

character_event = {
	id = 7404
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = combat }
		condition = { type = trait value = cruel }
	}

	mean_time_to_happen = {
		days = 600

		modifier = { 
			condition = { type = trait value = vengeful }		
			factor = 0.75
		}

	}

	action_a = {#Marshal shows unecessary cruelty during combat
		effect = { type = piety value = -25 }
		effect = { type = prestige value = -25 }
		effect = { type = trigger for = ruler value = 7405 }
	}

}

character_event = {
	id = 7405
	
	picture = "event_battle"
	
	action_a = {#That's the cruelty of war
		effect = { type = prestige value = -15 }
	}

	action_b = {#Disapprove his conduct
		effect = { type = prestige value = -5 }
		effect = { type = loyalty for = marshal value = -0.3 }
	}

	action_c = {#He's right, we should terrorise our ennemy
		effect = { type = prestige value = -25 }
		effect = { type = loyalty for = marshal value = 0.2 }
		effect = { type = random
			chance = 25
			effect = { type = add_trait value = cruel }
		}
	}

}

#####
# Wise Marshal: Tech advance

character_event = {
	id = 7406
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = marshal }
		condition = { type = combat }
		condition = { type = trait value = wise }
		condition = { type = or 
			condition = { type = trait value = knowledged_tactician }
			condition = { type = trait value = brilliant_strategist }
			}
	}

	mean_time_to_happen = {
		days = 600

		modifier = { 
			condition = { type = trait value = brilliant_strategist }		
			factor = 0.66
		}

	}

	action_a = {#Marshal uses innovative tactics on the battlefield
		effect = { type = prestige value = 10 }
		effect = { type = random
			chance = 25
			effect = { type = add_next_advance value = defensive_terrain }
		}
	}

}

character_event = {
	id = 7407
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = marshal }
		condition = { type = combat }
		condition = { type = trait value = wise }
		condition = { type = or 
			condition = { type = trait value = knowledged_tactician }
			condition = { type = trait value = brilliant_strategist }
			}
	}

	mean_time_to_happen = {
		days = 600

		modifier = { 
			condition = { type = trait value = brilliant_strategist }		
			factor = 0.66
		}

	}

	action_a = {#Marshal uses innovative tactics on the battlefield
		effect = { type = prestige value = 10 }
		effect = { type = random
			chance = 25
			effect = { type = add_next_advance value = offensive_terrain }
		}
	}

}

character_event = {
	id = 7408
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = marshal }
		condition = { type = siege }
		condition = { type = trait value = wise }
		condition = { type = or 
			condition = { type = trait value = knowledged_tactician }
			condition = { type = trait value = brilliant_strategist }
			}
	}

	mean_time_to_happen = {
		days = 600

		modifier = { 
			condition = { type = trait value = brilliant_strategist }		
			factor = 0.66
		}

	}

	action_a = {#Marshal uses innovative tactics on the battlefield
		effect = { type = prestige value = 10 }
		effect = { type = random
			chance = 25
			effect = { type = add_next_advance value = siege_towers }
		}
	}

}

character_event = {
	id = 7409
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = marshal }
		condition = { type = siege }
		condition = { type = trait value = wise }
		condition = { type = or 
			condition = { type = trait value = knowledged_tactician }
			condition = { type = trait value = brilliant_strategist }
			}
	}

	mean_time_to_happen = {
		days = 600

		modifier = { 
			condition = { type = trait value = brilliant_strategist }		
			factor = 0.66
		}

	}

	action_a = {#Marshal uses innovative tactics on the battlefield
		effect = { type = prestige value = 10 }
		effect = { type = random
			chance = 25
			effect = { type = add_next_advance value = hill_fort }
		}
	}

}

#####
# Trusting Marshal: Assassination

character_event = {
	id = 7410
	
	picture = "event_crime"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = trait value = trusting }
		condition = { type = command }
		condition = {
			type = liege
			condition = { type = atwar }
		}
	}

	mean_time_to_happen = {
		months = 480

		modifier = {
			condition = { type = not value = { type = intrigue value = 3 } }
			factor = 0.5
		}

# Base value is for this range, but we don't calculate x 1 multiplier to save CPU
#
#		modifier = {
#			condition = { type = intrigue value =  3 }
#			condition = { type = not value = { type = intrigue value = 7 } }
#			factor = 1
#		}

		modifier = {
			condition = { type = intrigue value =  7 }
			condition = { type = not value = { type = intrigue value = 12 } }
			factor = 1.5
		}

		modifier = {
			condition = { type = intrigue value =  12 }
			factor = 2
		}
	}

	action_a = {#Marshal is assassinated by an enemy spy !
		effect = { type = death }
	}

}

#####
# Vengeful & disloyal: Swap to enemy during war

character_event = {
	id = 7411
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = trait value = vengeful }
		condition = { type = combat }
		condition = { type = not value = { type = loyalty value = 0.4 } }
	}

	mean_time_to_happen = {
		days = 480

		modifier = { 
			condition = { type = trait value = deceitful }		
			factor = 0.5
		}

	}

	action_a = {#Our disloyal marshal betrays us for enemy !
		effect = { type = courtier_defect value = random_enemy }
	}

}

#####
# Selfish Marshal: Pillaging enemy

character_event = {
	id = 7412
	
	picture = "event_battle"
	
	trigger = {
		condition = { type = not value = { type = ai } }
		condition = { type = marshal }
		condition = { type = siege }
		condition = { type = trait value = selfish }
		condition = {
			type = location
			condition = { type = not value = { type = has_province_effect value = { looted = yes } } }
			}
	}

	mean_time_to_happen = {
		days = 480

		modifier = { 
			condition = { type = trait value = cruel }		
			factor = 0.75
		}

		modifier = { 
			condition = { type = trait value = vengeful }		
			factor = 0.75
		}

	}

	action_a = {#Marshal looted and pillage the province for his personal gold chest.
		effect = { type = gold value = 100 }
		effect = { type = piety value = -25 }
		effect = { type = prestige value = -15 }
		effect = { type = trigger for = ruler value = 7405 }
	}

}