convert_whole_realm_to_feudalism_effect = { #TOOLTIP INFO #PLAYER EFFECTS ##Liege has clan? Convert to clan! if = { limit = { is_independent_ruler = no liege = { has_government = clan_government } } change_government = clan_government } ##Liege has feudal? Convert to feudal! else_if = { limit = { is_independent_ruler = no liege = { has_government = feudal_government } } change_government = feudal_government } ##You're an independent Muslim? Convert to clan! else_if = { limit = { faith = { religion_tag = islam_religion } } change_government = clan_government } ##You're an independent anything else? Convert to feudal! else = { change_government = feudal_government } ##General custom_tooltip = all_holding_will_change ##Liege has clan? Convert to clan! if = { limit = { is_independent_ruler = no liege = { has_government = clan_government } } custom_tooltip = clan_liege_vassals_will_convert } #Liege has feudal? Convert to feudal! else_if = { limit = { is_independent_ruler = no liege = { has_government = feudal_government } } custom_tooltip = feudal_liege_vassals_will_convert } ##If I am Islamic, we will become clan. else_if = { limit = { faith = { religion_tag = islam_religion } } custom_tooltip = islamic_vassals_will_convert } ##If I am not Islamic, we will become feudal. else = { custom_tooltip = other_vassals_will_convert } hidden_effect = { #Nuke tribal authorities. if = { limit = { has_realm_law = tribal_authority_0 } remove_realm_law = tribal_authority_0 } if = { limit = { has_realm_law = tribal_authority_1 } remove_realm_law = tribal_authority_1 } if = { limit = { has_realm_law = tribal_authority_2 } remove_realm_law = tribal_authority_2 } if = { limit = { has_realm_law = tribal_authority_3 } remove_realm_law = tribal_authority_3 } #Start off crown authorities. if = { limit = { NOT = { has_realm_law = crown_authority_0 } } add_realm_law_skip_effects = crown_authority_0 } #Also convert every vassal. #Liege has taken clan, so become clan. if = { limit = { has_government = clan_government } every_vassal_or_below = { limit = { has_government = tribal_government } change_government = clan_government #Nuke tribal authorities. if = { limit = { has_realm_law = tribal_authority_0 } remove_realm_law = tribal_authority_0 } if = { limit = { has_realm_law = tribal_authority_1 } remove_realm_law = tribal_authority_1 } if = { limit = { has_realm_law = tribal_authority_2 } remove_realm_law = tribal_authority_2 } if = { limit = { has_realm_law = tribal_authority_3 } remove_realm_law = tribal_authority_3 } if = { limit = { NOT = { has_realm_law = crown_authority_0 } } add_realm_law_skip_effects = crown_authority_0 } } } #Liege is not clan, become feudal. else = { every_vassal_or_below = { limit = { has_government = tribal_government } change_government = feudal_government #Nuke tribal authorities. if = { limit = { has_realm_law = tribal_authority_0 } remove_realm_law = tribal_authority_0 } if = { limit = { has_realm_law = tribal_authority_1 } remove_realm_law = tribal_authority_1 } if = { limit = { has_realm_law = tribal_authority_2 } remove_realm_law = tribal_authority_2 } if = { limit = { has_realm_law = tribal_authority_3 } remove_realm_law = tribal_authority_3 } if = { limit = { NOT = { has_realm_law = crown_authority_0 } } add_realm_law_skip_effects = crown_authority_0 } } } ## Spawn holdings in tribal counties every_sub_realm_county = { # Spawn temples in your holy sites limit = { any_county_province = { has_holding_type = tribal_holding } NOT = { any_county_province = { has_holding_type = church_holding } } any_county_province = { has_holding = no barony = { is_holy_site_of = root.faith } } } random_county_province = { limit = { has_holding = no barony = { is_holy_site_of = root.faith } } set_holding_type = church_holding } } every_sub_realm_county = { # Spawn a City limit = { any_county_province = { has_holding_type = tribal_holding } any_county_province = { has_holding = no } NOT = { any_county_province = { has_holding_type = city_holding } } } random_county_province = { limit = { has_holding = no OR = { terrain = floodplains terrain = oasis terrain = farmlands } is_coastal = yes has_special_building_slot = no } alternative_limit = { has_holding = no OR = { terrain = floodplains terrain = oasis terrain = farmlands } has_special_building_slot = no } alternative_limit = { has_holding = no OR = { terrain = floodplains terrain = oasis terrain = farmlands } } alternative_limit = { has_holding = no } random = { chance = 60 modifier = { add = county.development_level } modifier = { add = 50 this.county = root.capital_county } modifier = { add = 20 OR = { terrain = floodplains terrain = oasis terrain = farmlands } } set_holding_type = city_holding } } } every_sub_realm_county = { # Spawn a Temple limit = { any_county_province = { has_holding_type = tribal_holding } any_county_province = { has_holding = no } NOT = { any_county_province = { has_holding_type = church_holding } } } random_county_province = { limit = { has_holding = no OR = { terrain = floodplains terrain = oasis terrain = farmlands } is_coastal = yes has_special_building_slot = no } alternative_limit = { has_holding = no OR = { terrain = floodplains terrain = oasis terrain = farmlands } has_special_building_slot = no } alternative_limit = { has_holding = no OR = { terrain = floodplains terrain = oasis terrain = farmlands } } alternative_limit = { has_holding = no } random = { chance = 50 modifier = { add = county.development_level } modifier = { add = 50 this.county = root.capital_county } modifier = { add = 20 OR = { terrain = floodplains terrain = oasis terrain = farmlands } } set_holding_type = church_holding } } } ##Sort out new buildings for liege and all vassals every_realm_province = { limit = { has_holding_type = tribal_holding NOT = { is_in_list = feudal_conversion } } add_to_list = feudal_conversion } every_vassal_or_below = { every_realm_province = { limit = { has_holding_type = tribal_holding NOT = { is_in_list = feudal_conversion } } add_to_list = feudal_conversion } } every_in_list = { list = feudal_conversion set_variable = { name = tribal_to_feudal_building_level value = combined_building_level days = 1 } set_holding_type = castle_holding while = { limit = { var:tribal_to_feudal_building_level > 1 } generate_building = yes change_variable = { name = tribal_to_feudal_building_level subtract = 1 } } remove_variable = tribal_to_feudal_building_level remove_from_list = feudal_conversion } } }