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

Scripted effect

grant_ilkhanate_effect

grant_ilkhanate_effect = yes

game/common/scripted_effects/00_mongol_invasion_effects.txt, line 2445 (153 lines). No parameters.

grant_ilkhanate_effect is a scripted effect in Crusader Kings III, written at line 2445 of its file. It takes no parameters: grant_ilkhanate_effect = yes. The game's script calls it in 1 place, among them grant_suitable_title_to_candidate_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/00_mongol_invasion_effects.txt.

What it does

  • If

    • None of these

      • Any held title:
        • Title tier exactly County
        • is_landless_type_title = no
        • Their province: Is in the special mongol empire ilkhanate region region

    Then

    • scope:county_to_transfer: Gains the … Title (candidate)
  • Ilkhanate: Gains the … Title (candidate)
  • If

    • scope:old_mongol_emperor › Any sub realm county:
      • duchy = title:e_ilkhanate.title_capital_county.duchy
      • None of these

        • holder = scope:candidate
        • Their holder: Is played by a person
        • Their holder › Any liege or above: Is played by a person

    Then

    • Every in list: Gains the … Title (candidate)
  • Every character war:
    • end_war = white_peace
  • If holds e ilkhanate.title capital county: e ilkhanate.title capital county becomes the realm capital
  • Else, if all of these hold:
    • Conditions:
      • None of these

        • Their capital county’s province: Is in the special mongol empire ilkhanate region region
      • Any held title:
        • Title tier exactly County
        • is_landless_type_title = no
        • Their province: Is in the special mongol empire ilkhanate region region
    • Then › One random held title:
      • Where:
        • is_landless_type_title = no
        • Their province: Is in the special mongol empire ilkhanate region region
      • title_tier = county
      • scope:candidate: The realm capital moves
  • spawn_mongol_successor_state_troops_effect = yes
  • They gets +1,000
  • Dread +100
  • Starts the story “Conqueror”
  • grant_mongol_successor_nomadic_bonuses_effect = yes

• 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)
grant_ilkhanate_effect = {
	# If the character doesn't hold any titles in the relevant
	if = {
		limit = {
			NOT = {
				any_held_title = {
					title_tier = county
					is_landless_type_title = no
					title_province = {
						geographical_region = special_mongol_empire_ilkhanate_region
					}
				}
			}
		}
		scope:old_mongol_emperor = {
			random_sub_realm_county = {
				limit = {
					is_landless_type_title = no
					title_province = {
						geographical_region = special_mongol_empire_ilkhanate_region
					}
				}
				save_scope_as = county_to_transfer
			}
		}
		create_title_and_vassal_change = {
			type = granted
			save_scope_as = title_change
			add_claim_on_loss = no
		}
		scope:county_to_transfer = {
			change_title_holder = {
				holder = scope:candidate
				change = scope:title_change
			}
		}
		resolve_title_and_vassal_change = scope:title_change
	}
	create_title_and_vassal_change = {
		type = created
		save_scope_as = title_change
		add_claim_on_loss = no
	}
	title:e_ilkhanate = {
		change_title_holder = {
			holder = scope:candidate
			change = scope:title_change
		}
	}
	resolve_title_and_vassal_change = scope:title_change

	scope:candidate = {
		save_scope_as = ilkhanate_ruler
	}
	set_global_variable = {
		name = ilkhanate_handed_out
		value = yes
	}

	# Give the character the appropriate capital area, if possible
	if = {
		limit = {
			scope:old_mongol_emperor = {
				any_sub_realm_county = {
					duchy = title:e_ilkhanate.title_capital_county.duchy
					NOR = {
						holder = scope:candidate
						holder = { # Don't steal the player's lands
							is_ai = no
						}
						holder = {
							any_liege_or_above = { is_ai = no }
						}
					}
				}
			}
		}
		scope:old_mongol_emperor = {
			every_sub_realm_county = {
				limit = {
					duchy = title:e_ilkhanate.title_capital_county.duchy
					NOR = {
						holder = scope:candidate
						holder = { # Don't steal the player's lands
							is_ai = no
						}
						holder = {
							any_liege_or_above = { is_ai = no }
						}
					}
				}
				add_to_list = titles_taken
			}
		}
		create_title_and_vassal_change = {
			type = granted
			save_scope_as = title_change
			add_claim_on_loss = no
		}
		every_in_list = {
			list = titles_taken
			change_title_holder = {
				holder = scope:candidate
				change = scope:title_change
				take_baronies = yes
			}
		}
		resolve_title_and_vassal_change = scope:title_change
	}
	
	every_character_war = {
		end_war = white_peace
	}
	if = {
		limit = {
			has_title = title:e_ilkhanate.title_capital_county
		}
		set_realm_capital = title:e_ilkhanate.title_capital_county
	}
	else_if = {

As written in game/common/scripted_effects/00_mongol_invasion_effects.txt.

The first 120 of its 153 lines; the rest is in game/common/scripted_effects/00_mongol_invasion_effects.txt from line 2445.

Where it is used

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

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

Spotted a mistake on this page?