CK3 DatabaseCrusader Kings III · 1.21.0 “Florin” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →Merch→

Scripted effect · Silk and Silver files

burgher_win_self_rule_effect

burgher_win_self_rule_effect = { COUNTY = … LEADER = … }

game/common/scripted_effects/gdp_burgher_scripted_effects.txt, line 940 (162 lines). Parameters: $COUNTY$, $LEADER$.

burgher_win_self_rule_effect is a scripted effect in Crusader Kings III, in the Silk and Silver files, written at line 940 of its file. A call passes 2 parameters: COUNTY and LEADER. The game's script calls it in 3 places, among them War for Civic Liberty (casus belli), gdp_burgher.0010 (event) and burgher_free_member_county_effect (scripted effect). Its body carries 1 text of the game's own for the player. Patch 1.21.0, from game/common/scripted_effects/gdp_burgher_scripted_effects.txt.

What it does

  • clear_saved_scope = burgher_new_capital
  • If

    • $COUNTY$ = { exists = holder }

    Then

    • ep3_become_landed_save_liege_effect = { TITLE_GIVER = scope:former_holder ALWAYS_INDEPENDENT = no TITLE_LIST = burgher_won_titles }
    • scope:freed_county: Gains the … Title (burgher ruler)
    • If

      • One of these

        • scope:new_liege = scope:former_holder
        • or

          All of these

          • exists = scope:former_holder.liege
          • scope:new_liege = scope:former_holder.liege

      Then

      • scope:burgher_ruler:
        • change_liege = { liege = scope:new_liege change = scope:burgher_change }
    • scope:burgher_new_capital:
      • If

        • NOT = { holder ?= scope:burgher_ruler }

        Then

        • Gains the … Title (burgher ruler)
      • The new Republic takes … as its Capital
    • If

      • scope:burgher_new_capital:
        • holder ?= scope:burgher_ruler

      Then

      • scope:burgher_new_capital:
        • set_capital_barony = yes

      Else if

      • scope:freed_county.title_province:
        • has_holding_type = church_holding

      Then

      • scope:freed_county.title_province:
        • set_holding_type = city_holding
    • burgher_found_city_republic_effect = { RULER = scope:burgher_ruler }
    • scope:freed_county.title_province › If has “temple to city building level” (a variable the game's script sets):
      • while = { … }
    • burgher_grant_city_charter_effect = { RULER = scope:burgher_ruler LIEGE = scope:new_liege }
    • scope:burgher_ruler: Gain +350 Prestige

• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists

“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.

The script as written (120 lines of game script)
burgher_win_self_rule_effect = {
	$LEADER$ = { save_scope_as = burgher_ruler }
	$COUNTY$ = { save_scope_as = freed_county }
	clear_saved_scope = burgher_new_capital

	if = {
		limit = { $COUNTY$ = { exists = holder } }

		$COUNTY$.holder = { save_scope_as = former_holder }

		scope:freed_county = { add_to_list = burgher_won_titles }

		ep3_become_landed_save_liege_effect = {
			TITLE_GIVER = scope:former_holder
			ALWAYS_INDEPENDENT = no
			TITLE_LIST = burgher_won_titles
		}

		create_title_and_vassal_change = {
			type = conquest
			save_scope_as = burgher_change
			add_claim_on_loss = yes
		}

		scope:freed_county = {
			change_title_holder = {
				holder = scope:burgher_ruler
				change = scope:burgher_change
			}

			if = {
				limit = {
					title_province = {
						NOT = { has_holding_type = city_holding }
					}
					any_county_province = { has_holding_type = city_holding }
				}
				ordered_county_province = {
					limit = { has_holding_type = city_holding }
					order_by = province_size_level
					barony = { save_scope_as = burgher_new_capital }
				}
			}
			else_if = {
				limit = {
					title_province = {
						NOR = {
							has_holding_type = city_holding
							has_holding_type = castle_holding
							has_holding_type = church_holding
						}
					}
					any_county_province = { has_holding_type = castle_holding }
				}
				ordered_county_province = {
					limit = { has_holding_type = castle_holding }
					order_by = province_size_level
					barony = { save_scope_as = burgher_new_capital }
				}
			}
		}

		if = {
			limit = {
				exists = scope:new_liege
				OR = {
					scope:new_liege = scope:former_holder
					AND = {
						exists = scope:former_holder.liege
						scope:new_liege = scope:former_holder.liege
					}
				}
			}
			scope:burgher_ruler = {
				change_liege = {
					liege = scope:new_liege
					change = scope:burgher_change
				}
			}
		}

		resolve_title_and_vassal_change = scope:burgher_change

		scope:burgher_new_capital ?= {
			if = {
				limit = {
					NOT = { holder ?= scope:burgher_ruler }
				}
				create_title_and_vassal_change = {
					type = granted
					save_scope_as = burgher_capital_change
					add_claim_on_loss = yes
				}
				change_title_holder = {
					holder = scope:burgher_ruler
					change = scope:burgher_capital_change
				}
				resolve_title_and_vassal_change = scope:burgher_capital_change
			}
			custom_tooltip = burgher_self_rule_new_capital_tt
		}

		if = {
			limit = {
				scope:burgher_new_capital ?= { holder ?= scope:burgher_ruler }
			}
			scope:burgher_new_capital = { set_capital_barony = yes }
		}
		else_if = {
			limit = {
				NOT = { exists = scope:burgher_new_capital }
				scope:freed_county.title_province = { has_holding_type = church_holding }
			}
			scope:freed_county.title_province = {
				set_variable = {
					name = temple_to_city_building_level
					value = combined_building_level
					days = 1
				}
				set_holding_type = city_holding

As written in game/common/scripted_effects/gdp_burgher_scripted_effects.txt.

The first 120 of its 162 lines; the rest is in game/common/scripted_effects/gdp_burgher_scripted_effects.txt from line 940.

Where it is used

Every place in common/, events/ and history/ that calls burgher_win_self_rule_effect.

Source: game/common/scripted_effects/gdp_burgher_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.21.0.

Spotted a mistake on this page, or have an idea for the site?