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

Scripted effect · Khans of the Steppe files

mpo_find_powerful_opponent_for_gurkhan_effect

mpo_find_powerful_opponent_for_gurkhan_effect = yes

game/common/scripted_effects/09_mpo_greatest_of_khans_effects.txt, line 999 (171 lines). No parameters.

mpo_find_powerful_opponent_for_gurkhan_effect is a scripted effect in Crusader Kings III, in the Khans of the Steppe files, written at line 999 of its file. It takes no parameters: mpo_find_powerful_opponent_for_gurkhan_effect = yes. The game's script calls it in 1 place, among them Become the Greatest of All Khans (decision). Patch 1.20.1.2, from game/common/scripted_effects/09_mpo_greatest_of_khans_effects.txt.

What it does

Every line of it is script with no tooltip text: the script is below.

The script as written (120 lines of game script)
mpo_find_powerful_opponent_for_gurkhan_effect = {
	#Ok we're going to save all the valid options to a list and then pick the strongest of them
	#Neighbors
	every_land_neighboring_realm_with_tributaries_owner = {
		limit = {
			mpo_gok_coalition_member_trigger = yes
		}
		add_to_list = potential_gok_opponents
	}
	#All valid suzerains of neighbors
	every_land_neighboring_realm_with_tributaries_owner = {
		limit = {
			is_tributary = yes
			top_suzerain = {
				mpo_gok_coalition_member_trigger = yes
			}
		}
		top_suzerain = {
			add_to_list = potential_gok_opponents
		}
	}
	#People who hate you
	every_relation = {
		type = rival
		limit = {
			is_ruler = yes
			mpo_gok_coalition_member_trigger = yes
		}
		add_to_list = potential_gok_opponents
	}
	#Those within same de jure empire
	capital_county ?= {
		empire = {
			every_de_jure_county = {
				limit = {
					holder.top_Liege = {
						mpo_gok_coalition_member_trigger = yes
					}
				}
				holder.top_liege = {
					add_to_list = potential_gok_opponents
				}
			}
			every_de_jure_county = {
				limit = {
					holder.top_suzerain = {
						mpo_gok_coalition_member_trigger = yes
					}
				}
				holder.top_suzerain = {
					add_to_list = potential_gok_opponents
				}
			}
		}
	}
	#Those with capital within range
	#Have to do a fallback in case everyone's military strength hasn't been calc'd yet
	if = {
		limit = {
			any_independent_ruler = {
				current_military_strength > 0
			}
		}
		every_independent_ruler = {
			limit = {
				highest_held_title_tier >= tier_duchy
				exists = root.capital_county
				realm_to_title_distance_squared = {
					target = root.capital_county
					value <= squared_distance_almost_massive
				}

				mpo_gok_coalition_member_trigger = yes
			}
			add_to_list = potential_gok_opponents
		}
	}
	else = {
		every_independent_ruler = {
			limit = {
				highest_held_title_tier >= tier_duchy
				exists = root.capital_county
				realm_to_title_distance_squared = {
					target = root.capital_county
					value <= squared_distance_almost_massive
				}
				mpo_gok_coalition_member_trigger = yes
			}
			add_to_list = potential_gok_opponents
		}
	}
	#Ideally we find someone at least half as strong as the Gurkhan...
	if = {
		limit = {
			NOT = {
				any_in_list = {
					list = potential_gok_opponents
					#THIS SHOULD CHECK THEIR STRENGTH IS MORE THAN HALF ROOT'S
					confederation_worthy_foe_strength_ratio_value_root <= 2
				}
			}
		}
		#expand search radius
		if = {
			limit = {
				any_independent_ruler = {
					current_military_strength > 0
				}
			}
			every_independent_ruler = {
				limit = {
					highest_held_title_tier >= tier_duchy
					exists = root.capital_county
					realm_to_title_distance_squared = {
						target = root.capital_county
						value <= squared_distance_massive
					}

					mpo_gok_coalition_member_trigger = yes
				}

As written in game/common/scripted_effects/09_mpo_greatest_of_khans_effects.txt.

The first 120 of its 171 lines; the rest is in game/common/scripted_effects/09_mpo_greatest_of_khans_effects.txt from line 999.

Where it is used

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

Source: game/common/scripted_effects/09_mpo_greatest_of_khans_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?