###############################
# Various intrigue events, by Byakhiam
# Reserved ID range 6100-6199
###############################

#####################
# Generic intrigue events
###############################################################
# Rich and powerful vassal of elected king wants promotion, the assassination plot

character_event = {
	id = 6100

	picture = "event_intrigue"

	trigger = {
		condition = { type = is_vassal }
		condition = { type = gold value = 200 }
		condition = { type = or
			condition = { type = trait value = proud }
			condition = { type = trait value = selfish }
			condition = { type = trait value = deceitful }
		}
		condition = { type = not value = { type = trait value = honest } }
		condition = { type = not value = { type = atwar } }
		condition = { type = intrigue value = 6 }
		condition = { type = liege
			condition = { type = has_law value = { elective_law = yes } }
			condition = { type = not value = { type = title value = PAPA } }
			condition = { type = not value = { type = religion value = pagan } }
			condition = { type = not value = { type = atwar } }
			condition = { type = or
				condition = { type = not value = { type = intrigue value = 6 } }
				condition = { type = trait value = trusting }
			}
		}
	}

	mean_time_to_happen = {
		months = 480

		modifier = {
			condition = { type = primary_heir }
			factor = 0.66
		}
		modifier = {
			condition = { type = liege
				condition = { type = not value = { type = ai } }
				condition = { type = difficulty value = 3 }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = liege
				condition = { type = not value = { type = ai } }
				condition = { type = difficulty value = 4 }
			}
			factor = 0.75
		}
		modifier = {
			condition = { type = loyalty value = 0.90 }
			factor = 1.1
		}
		modifier = {
			condition = { type = loyalty value = 0.80 }
			factor = 1.1
		}
		modifier = {
			condition = { type = not value = { type = loyalty value = 0.60 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = loyalty value = 0.50 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = loyalty value = 0.40 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = loyalty value = 0.30 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = loyalty value = 0.20 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = loyalty value = 0.10 } }
			factor = 0.9
		}
		modifier = {
			condition = { type = intrigue value = 8 }
			factor = 0.8
		}
		modifier = {
			condition = { type = intrigue value = 10 }
			factor = 0.8
		}
		modifier = {
			condition = { type = intrigue value = 12 }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = intricate_webweaver }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = illusive_shadow }
			factor = 0.6
		}
		modifier = {
			condition = { type = prestige value = 100 }
			factor = 0.8
		}
		modifier = {
			condition = { type = prestige value = 200 }
			factor = 0.8
		}
		modifier = {
			condition = { type = prestige value = 500 }
			factor = 0.8
		}
		modifier = {
			condition = { type = gold value = 500 }
			factor = 0.8
		}
		modifier = {
			condition = { type = liege
				condition = { type = not value = { type = intrigue value = 3 } }
			}
			factor = 0.8
		}
		modifier = {
			condition = { type = liege
				condition = { type = spymaster_csc
					condition = { type = intrigue value = 9 }
				}
			}
			factor = 1.5
		}
	}

	action_a = {
		ai_chance = 75
		modifier = {
			condition = { type = not value = { type = gold value = 300 } }
			factor = 0.45
		}
		modifier = {
			condition = { type = not value = { type = prestige value = 100 } }
			factor = 0.45
		}
		modifier = {
			condition = { type = not value = { type = piety value = 100 } }
			factor = 0.45
		}
		effect = { type = gold value = -200 }
		effect = { type = random chance = 50
			effect = { type = trigger for = liege value = 6101 }
		}
		effect = { type = random chance = 25
			effect = { type = prestige value = -100 }
			effect = { type = piety value = -100 }
		}
		effect = { type = random chance = 5
			effect = { type = death }
		}
	}
	action_b = {
		ai_chance = 25
		effect = { type = add_trait value = honest }
	}
}

# Reaction event for liege

character_event = {
	id = 6101

	picture = "event_intrigue"

	immidiate = {
		effect = { type = random chance = 50
			effect = { type = death }
		}
		effect = { type = add_trait value = war_invalid }
		effect = { type = prestige value = 50 }
	}
}

# ID 6102 "Catholic Vassals in Middle East or North Aftrica break free from distant lieges" event moved to the new realm_disruption_events.txt file
# ID 6103 reaction event moved as well

#####################################
# Moslem Mercenaries join the cause #
#####################################

character_event = { #A warlord offers to assist you against the indidel
	id = 6105

	picture = "event_default"

	trigger = {
		condition = { type = ruler }
		condition = { type = atwar }
		condition = { type = difficulty value = 2 }
		condition = { type = not value = { type = title value = ILKH } }
		condition = { type = not value = { type = title value = GOLD } }
		condition = { type = or
			condition = { type = religion value = moslem }
			condition = { type = and
				condition = { type = religion value = pagan }
				condition = { type = or
					condition = { type = culture value = cuman }
					condition = { type = culture value = pecheneg }
					condition = { type = culture value = alan }
				}
			}
		}
		condition = { type = not value = { type = enemy_same_religion } }
	}

	mean_time_to_happen = {
		months = 100

		modifier = {
			condition = { type = difficulty value = 3 }
			factor = 0.75
		}
		modifier = {
			condition = { type = difficulty value = 4 }
			factor = 0.75
		}
		modifier = {
			condition = { type = title value = SELJ }
			factor = 0.2
		}
		modifier = {
			condition = { type = title value = RUMS }
			factor = 0.3
		}
		modifier = {
			condition = { type = title value = OTTO }
			factor = 0.3
		}
		modifier = {
			condition = { type = title value = ALMO }
			factor = 0.5
		}
		modifier = {
			condition = { type = title value = MURA }
			factor = 0.5
		}
		modifier = {
			condition = { type = title value = CUMA }
			factor = 0.5
		}
		modifier = {
			condition = { type = title value = AYYU }
			factor = 0.5
		}
		modifier = {
			condition = { type = title value = MAML }
			factor = 0.5
		}
		modifier = {
			condition = { type = title value = PECH }
			factor = 0.75
		}
		modifier = {
			condition = { type = title value = ABBA }
			factor = 0.75
		}
		modifier = {
			condition = { type = culture value = turkish }
			factor = 0.5
		}
		modifier = {
			condition = { type = duchy }
			condition = { type = not value = { type = kingdom } }
			factor = 5.0
		}
		modifier = {
			condition = { type = county }
			condition = { type = not value = { type = duchy } }
			condition = { type = not value = { type = kingdom } }
			factor = 10.0
		}
		modifier = {
			condition = { type = capital
				condition = { type = or
					condition = { type = region value = asia_minor }
					condition = { type = region value = middle_east }
				}
			}
			factor = 0.25
		}
		modifier = {
			condition = { type = capital
				condition = { type = or
					condition = { type = region value = spain }
					condition = { type = region value = italy }
				}
			}
			factor = 2.0
		}
		modifier = {
			condition = { type = crusade }
			factor = 0.75
		}
		modifier = {
			condition = { type = not value = { type = martial value = 3 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = not value = { type = martial value = 6 } }
			factor = 1.2
		}
		modifier = {
			condition = { type = martial value = 10 }
			factor = 0.8
		}
		modifier = {
			condition = { type = martial value = 13 }
			factor = 0.8
		}
		modifier = {
			condition = { type = trait value = valorous }
			factor = 0.8
		}
		modifier = {
			condition = { type = kingdom }
			condition = { type = capital
				condition = { type = not value = { type = realm_regiments value = 3 } }
			}
			factor = 0.5
		}
		modifier = {
			condition = { type = capital
				condition = { type = not value = { type = realm_regiments value = 1 } }
			}
			factor = 10
		}
	}

	action_a = { #Thanks!
		effect = { type = add_regiment 
			strength = {
				archer_cav = 1000
				light_cav = 1500
			}
		}
		effect = {
			type = random chance = 33
			effect = { type = add_regiment 
				strength = {
					archer_cav = 1000
				}
			}
		}
	}
}

# 6106 moved to provincial_structures_events

# ID free 6104
# Free ID ranges 6107-6156, 6159-6199

# 6157 and 6158 in realm_disruption_events