decisions = {

	destroy_castamere_castle = {
		is_high_prio = yes
		potential = {
			187 = {
				controlled_by = ROOT
				NOT = { has_province_modifier = castamere_ruined }
				holder_scope = {
					war_with = ROOT
				}
			}
			NOT = { year = 8262 }
			b_castamere = {
				has_building = ca_castamere
			}
		}
		allow = {
			dynasty = 190
			OR = {
				has_landed_title = e_westerlands
				has_landed_title = k_westerlands
			}
		}
		effect = {
			character_event = { id = castamere_events.10 }
		}
		ai_will_do = {
			factor = 100
		}
	}

	build_castamere_castle = {
		is_high_prio = yes
		potential = {
			OR = {
				has_landed_title = d_castamere
				has_landed_title = k_redlion
			}
			has_landed_title = c_castamere
				187 = {
					NOR = {
						has_province_modifier = castamere_debris
						has_province_modifier = castamere_build
						has_province_modifier = castamere_complete
					}
				}
			NOT = {
				b_castamere = {
					has_building = ca_castamere
				}
			}
		}
		allow = {
			age = 16
			prisoner = no
			wealth = 1000
		}
		effect = {
			character_event = { id = castamere_events.0 }
			
		}
		ai_will_do = {
			factor = 0
		}
	}

	form_redlion = {
		is_high_prio = yes
		potential = {
			ai = no
			not = { higher_tier_than = duke }
			has_landed_title = d_castamere
			has_landed_title = d_the_crag
			has_landed_title = d_ashemark
			has_landed_title = d_golden_tooth
			k_redlion = { has_holder = no }
			independent = yes
		}
		allow = {
			age = 16
			prisoner = no
		}
		effect = {
			hidden_tooltip = { activate_title = { status = yes title = k_redlion } }
			k_redlion = { gain_title = ROOT }
			d_castamere = { de_jure_liege = k_redlion }
			d_the_crag = { de_jure_liege = k_redlion }
			d_ashemark = { de_jure_liege = k_redlion }
			d_golden_tooth = { de_jure_liege = k_redlion }
			k_westerlands = {
				holder_scope = {
					IF = {
						limit = {
							NOT = {
								character = ROOT
							}
						}
						opinion = { modifier = opinion_furious who = ROOT years = 20 }
					}
				}
				any_claimant = {
					IF = {
						limit = {
							NOT = {
								character = ROOT
							}
						}
						opinion = { modifier = opinion_furious who = ROOT years = 20 }
					}
				}
			}
		}
		ai_will_do = {
			factor = 0
		}
	}

	form_redlion_vassal = {
		is_high_prio = yes
		potential = {
			ai = no
			not = { higher_tier_than = duke }
			has_landed_title = d_castamere
			has_landed_title = d_the_crag
			has_landed_title = d_ashemark
			has_landed_title = d_golden_tooth
			k_redlion = { has_holder = no }
			any_liege = { has_landed_title = e_iron_throne }
			independent = no
		}
		allow = {
			age = 16
			prisoner = no
		}
		effect = {
			hidden_tooltip = { activate_title = { status = yes title = k_redlion } }
			k_redlion = {
				gain_title = ROOT
				de_jure_liege = e_iron_throne
				set_title_flag = lord_paramount
				succession = primogeniture
			}
			e_iron_throne = {
				holder_scope = {
					ROOT = { set_defacto_liege = PREV }
				}
			}
			set_government_type = feudal_government_LP
			d_castamere = { de_jure_liege = k_redlion }
			d_the_crag = { de_jure_liege = k_redlion }
			d_ashemark = { de_jure_liege = k_redlion }
			d_golden_tooth = { de_jure_liege = k_redlion }
			k_westerlands = {
				holder_scope = {
					IF = {
						limit = {
							NOT = {
								character = ROOT
							}
						}
						opinion = { modifier = opinion_furious who = ROOT years = 20 }
					}
				}
				any_claimant = {
					IF = {
						limit = {
							NOT = {
								character = ROOT
							}
						}
						opinion = { modifier = opinion_furious who = ROOT years = 20 }
					}
				}
			}
		}
		ai_will_do = {
			factor = 0
		}
	}

	destroy_redlion = {
		is_high_prio = yes
		potential = {
			OR = {
				has_landed_title = e_westerlands
				has_landed_title = k_westerlands
			}
			has_landed_title = k_redlion
		}
		allow = {
			age = 16
			prisoner = no
		}
		effect = {
			k_redlion = { destroy_landed_title = ROOT }
			hidden_tooltip = { activate_title = { status = no title = k_redlion } }
			d_castamere = { de_jure_liege = k_westerlands }
			d_the_crag = { de_jure_liege = k_westerlands }
			d_ashemark = { de_jure_liege = k_westerlands }
			d_golden_tooth = { de_jure_liege = k_westerlands }
		}
		ai_will_do = {
			factor = 100
		}
	}

}