###########################
#      PAGAN EVENTS       #
###########################

#
# some flavour events to help balance pagans
#
# reserved ID range 5900-5999
#

##############################################
# Pagan society flourishes on regional trade #
##############################################

province_event = { #Pagan society flourishes on regional trade

	id = 5900
	picture = "event_default"

	trigger = {
		condition = { type = religion value = pagan }
		condition = { type = ruler_religion value = pagan }
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
	}
	
	mean_time_to_happen = {
		months = 1200

		modifier = {
			condition = { type = not value = { type = year value = 1090 } }
			factor = 0.2
		}
		modifier = {
			condition = { type = has_improvement value = { hill_fort = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_improvement value = { small_castle = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_improvement value = { medium_castle = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_improvement value = { roadnet = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_improvement value = { extensive_roadnet = yes } }
			factor = 0.8
		}

		modifier = {
			condition = { type = has_improvement value = { fishing_wharf= yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_improvement value = { civilian_harbour = yes } }
			factor = 0.8
		}
	}

	action_a = { #That's nice!
		ai_chance = 50
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0
		}
		effect = { type = prosperity value = 1 }
	}
	action_b = { #That's nice!
		ai_chance = 50
		effect = { type = ruler_gold scale = 0.5 }
		effect = { type = ruler_prestige value = 50 }
	}
}

################################################
# Your Pagan subjects resist their subjugation #
################################################

province_event = { #Pagan subjects resist their sujugation

	id = 5901
	picture = "event_default"

	trigger = {
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
		condition = { type = not value = { type = ruler_religion value = pagan } }
		condition = { type = not value = { type = has_province_effect value = { struggling = yes } } }
		condition = { type = not value = { type = has_province_effect value = { revolt = yes } } }
	}

	mean_time_to_happen = {
		months = 200

		modifier = {
			condition = {
				type = owner
				condition = { type = title value = TEUT }
			}
			factor = 10
		}
		modifier = {
			condition = { type = exists value = TEUT  }
			factor = 2
		}
		modifier = {
			condition = { type = has_improvement value = { templar_house = yes } }
			factor = 2
		}
		modifier = {
			condition = { type = has_law value = { traditional_custom_law = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = peasant_power value = 0.5 }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.25 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.15 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.07 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.7 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.4 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7.5 }
			factor = 1.15
		}
		modifier = {
			condition = { type = ruler_stewardship value = 10 }
			factor = 1.15
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3.5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 2 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
	}

	action_a = { # I will buy their happiness
		effect = { type = ruler_gold scale = -0.25 }
		effect = {
			type = random
			chance = 25
			effect = { type = peasant_loyalty value = 0.1 }
		}
	}
	action_b = { # I will give them more power
		effect = { type = peasant_power value = 0.2 }
		effect = {
			type = random
			chance = 50
			effect = { type = ruler_piety value = -25 }
		}
		effect = {
			type = random
			chance = 20
			effect = { type = prosperity value = -1 }
		}
	}
	action_c = { # Damn them to Hell!
		effect = { type = ruler_piety value = 25 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = {
			type = random
			chance = 50
			effect = { type = prosperity value = -2 }
		}
		effect = {
			type = random
			chance = 10
			effect = { type = add_province_effect value = revolt }
		}
	}
}

###########################################################
# Pagan subjects object to you defiling their holy ground #
###########################################################

province_event = { #Pagan subjects object to you defiling their holy ground!

	id = 5902
	picture = "event_default"

	trigger = {
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = ruler_religion value = pagan } }
		condition = { type = not value = { type = has_province_effect value = { revolt = yes } } }
	}
	
	mean_time_to_happen = {
		months = 200

		modifier = {
			condition = {
				type = owner
				condition = { type = title value = TEUT }
			}
			factor = 10
		}
		modifier = {
			condition = { type = has_improvement value = { templar_house = yes } }
			factor = 1.5
		}
		modifier = {
			condition = { type = has_improvement value = { monastery = yes } }
			factor = 0.9
		}
		modifier = {
			condition = { type = has_improvement value = { church = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_improvement value = { large_church = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_law value = { traditional_custom_law = yes } }
			factor = 3
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = peasant_power value = 0.5 }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.25 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.15 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.07 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = clergy_power value = 0.25 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.35 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.45 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = clergy_power value = 0.1 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.7 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.4 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7.5 }
			factor = 1.15
		}
		modifier = {
			condition = { type = ruler_stewardship value = 10 }
			factor = 1.15
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3.5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 2 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
	}

	action_a = { # What do I care?
		effect = { type = ruler_piety value = 10 }
		effect = { type = prosperity value = -1 }
		effect = { type = clergy_power value = 0.2 }
		effect = { type = clergy_loyalty value = 0.2 }
		effect = { type = peasant_power value = -0.2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = {
			type = random
			chance = 35
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_b = { # I will honour their pagan shrines
		effect = { type = peasant_power value = 0.2 }
		effect = { type = peasant_loyalty value = 0.1 }
		effect = { type = clergy_power value = -0.2 }
		effect = { type = clergy_loyalty value = -0.5 }
		effect = { type = ruler_piety value = -25 }
		effect = { type = ruler_prestige value = -50 }
		effect = {
			type = random
			chance = 10
			effect = { type = clergy_loyalty value = -0.5 }
		}
	}
}

##############################################################
# Your Pagan subjects want to celebrate their holy feast day #
##############################################################

province_event = { #Your Pagan subjects want to celebrate their holy feast day

	id = 5903
	picture = "event_default"

	trigger = {
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = ruler_religion value = pagan } }
		condition = { type = not value = { type = has_province_effect value = { struggling = yes } } }
		condition = { type = not value = { type = has_province_effect value = { revolt = yes } } }
	}
	
	mean_time_to_happen = {
		months = 200

		modifier = {
			condition = {
				type = owner
				condition = { type = title value = TEUT }
			}
			factor = 10
		}
		modifier = {
			condition = { type = has_improvement value = { templar_house = yes } }
			factor = 2
		}
		modifier = {
			condition = { type = has_law value = { traditional_custom_law = yes } }
			factor = 5
		}
		modifier = {
			condition = { type = has_law value = { feudal_contract_law = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = peasant_power value = 0.5 }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.25 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.15 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_power value = 0.07 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.7 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.4 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = not value = { type = peasant_loyalty value = 0.2 } }
			factor = 0.8
		}
		modifier = {
			condition = { type = clergy_power value = 0.25 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.35 }
			factor = 0.9
		}
		modifier = {
			condition = { type = clergy_power value = 0.45 }
			factor = 0.9
		}
		modifier = {
			condition = { type = not value = { type = clergy_power value = 0.1 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 0.8
		}
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 0.5
		}
		modifier = {
			condition = { type = ruler_stewardship value = 7.5 }
			factor = 1.15
		}
		modifier = {
			condition = { type = ruler_stewardship value = 10 }
			factor = 1.15
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 3.5 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = not value = { type = ruler_stewardship value = 2 } }
			factor = 0.85
		}
		modifier = {
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
	}

	action_a = { # I forbid it!
		effect = { type = ruler_piety value = 20 }
		effect = { type = clergy_power value = 0.2 }
		effect = { type = clergy_loyalty value = 0.2 }
		effect = { type = peasant_power value = -0.2 }
		effect = { type = peasant_loyalty value = -0.5 }
		effect = {
			type = random
			chance = 25
			effect = { type = add_province_effect value = revolt }
		}
	}
	action_b = { # I supposed that's okay
		effect = { type = prosperity value = -1 }
		effect = { type = peasant_power value = 0.1 }
		effect = { type = peasant_loyalty value = 0.1 }
		effect = { type = clergy_power value = -0.1 }
		effect = { type = clergy_loyalty value = -0.25 }
		effect = { type = ruler_piety value = -15 }
		effect = { type = ruler_prestige value = -25 }
		effect = {
			type = random
			chance = 10
			effect = { type = clergy_loyalty value = -0.5 }
		}
	}
}

##################################################
# Your Pagan subjects are fed up with your rule! #
##################################################

province_event = { # Your pagan subjects see you as the cause of all their troubles

	id = 5904
	picture = "event_crime"

	trigger = {
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = ruler_religion value = pagan } }
		condition = { type = has_province_effect value = { struggling = yes } }
		condition = { type = not value = { type = has_province_effect value = { revolt = yes } } }
	}

	mean_time_to_happen = {
		days = 1000

		modifier = {
			condition = { type = regiment_mobilized }
			factor = 0.5
		}
		modifier = {
			condition = {
				type = owner
				condition = { type = title value = TEUT }
			}
			factor = 10
		}
	}

	action_a = { # Oh dear!
		effect = { type = add_province_effect value = revolt }
	}
}

#########################################################
# The pagan shamen have seen an evil omen in the skies! #
#########################################################

province_event = { # The pagan druids have seen an evil omen in the skies!

	id = 5905
	picture = "event_agriculture2"

	trigger = {
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = ruler_religion value = pagan } }
		condition = { type = not value = { type = has_province_effect value = { revolt = yes } } }
	}

	mean_time_to_happen = {
		months = 120

		modifier = {
			condition = {
				type = owner
				condition = { type = title value = TEUT }
			}
			factor = 10
		}
	}

	action_a = { #That's just silly superstition!
		effect = { type = peasant_loyalty value = -0.2 }
		effect = {
			type = random
			chance = 15
			effect = { type = add_province_effect value = revolt }
		}
	}

	action_b = { #Let them sacrifice some sheep or something!
		effect = { type = ruler_piety value = -10 }
		effect = { type = peasant_loyalty value = 0.1 }
		effect = { type = clergy_loyalty value = -0.2 }
		effect = { type = prosperity value = -1 }
	}
}

################################
# The pagan Gods demand Blood! #
################################

province_event = { #The Pagan Gods demand blood...and it's yours!

	id = 5906
	picture = "event_crime"

	trigger = {
		condition = { type = not value = { type = demesne value = GOLD } }
		condition = { type = not value = { type = demesne value = ILKH } }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = ruler_religion value = pagan } }
		condition = { type = not value = { type = has_province_effect value = { revolt = yes } } }
	}

	mean_time_to_happen = {
		months = 240

		modifier = {
			condition = {
				type = owner
				condition = { type = title value = TEUT }
			}
			factor = 10
		}
		modifier = {
			condition = { type = peasant_loyalty value = 0.8 }
			factor = 1.15
		}
		modifier = {
			condition = { type = peasant_loyalty value = 0.9 }
			factor = 1.15
		}
		modifier = {
			condition = { type = peasant_loyalty value = 1.0 }
			factor = 1.15
		}
	}

	action_a = { # Oh dear!
		effect = { type = add_province_effect value = revolt }
	}
}

##############################################
# Our lands are being invaded by foreigners! #
##############################################

character_event = { # Our lands are being invaded by foreigners!

	id = 5907
	picture = "event_default"

	trigger = {
		condition = { type = ruler }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = title value = GOLD } }
		condition = { type = not value = { type = title value = ILKH } }
		condition = { type = atwar }
	}

	mean_time_to_happen = {
		months = 90

		modifier = {
			condition = {
				type = capital
				condition = { type = not value = { type = realm_regiments value = 3 } }
			}
			factor = 0.4 
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = not value = { type = realm_regiments value = 2 } }
			}
			factor = 0.25 
		}
		modifier = {
			condition = {
				type = capital
				condition = { type = not value = { type = realm_regiments value = 1 } }
			}
			factor = 10 #if all regiments are destroyed then they are defeated and are less able to create a new regiment 
		}
		modifier = {
			condition = { type = has_province_effect value = { rich = yes } }
			factor = 0.75
		}
		modifier = {
			condition = { type = has_province_effect value = { prosperous = yes } }
			factor = 0.85
		}
		modifier = {
			condition = { type = has_province_effect value = { poor = yes } }
			factor = 1.25
		}
		modifier = {
			condition = { type = has_province_effect value = { struggling = yes } }
			factor = 1.5
		}
		modifier = {
			condition = { type = has_province_effect value = { looted = yes } }
			factor = 0.1 #you'd be annoyed if someone had looted your capital too!
		}
	}

	action_a = { # We must save ourselves!
		effect = {
			type = add_regiment
			strength = {
				militia = 500
			}
		}
		effect = { #wOOt!
			type = random
			chance = 25
			effect = {
				type = add_regiment
				strength = {
					light_cav = 100
					archers = 100
					pikemen = 150
				}
			}
		}
	}
}

#######################
# Our lands are safe! #
#######################

character_event = { # Our lands are safe again!

	id = 5908
	picture = "event_default"

	trigger = {
		condition = { type = not value = { type = title value = GOLD } }
		condition = { type = not value = { type = title value = ILKH } }
		condition = { type = ruler }
		condition = { type = religion value = pagan }
		condition = { type = not value = { type = atwar } }
		condition = { type = capital
			condition = { type = realm_regiments value = 1 }
		}
	}

	mean_time_to_happen = {
		days = 60
	}

	action_a = { # Now we can return to our villages
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
	}
}
