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

Scripted effect · All Under Heaven files

tgp_claim_mandate_of_heaven_effect

tgp_claim_mandate_of_heaven_effect = yes

game/common/scripted_effects/10_dlc_tgp_dynastic_cycle_scripted_effects.txt, line 6 (401 lines). No parameters.

tgp_claim_mandate_of_heaven_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 6 of its file. It takes no parameters: tgp_claim_mandate_of_heaven_effect = yes. The game's script calls it in 7 places, among them Claim the Mandate of Heaven (decision), Seize the Mandate of Heaven (casus belli) and After Rain Comes the Sun (event tgp_dynastic_cycle.0071). Its body carries 3 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/10_dlc_tgp_dynastic_cycle_scripted_effects.txt.

The comment above it in the file

Effect called when claiming the Mandate of Heaven

What it does

  • Every vassal:
    • Where › Any held title:
      • One of these

        • exists = var:ceremonial_title
        • or

          exists = var:administrative_ui_special_title
    • scope:ceremonial_liege: Gains the Trait Former Emperor
    • scope:new_son_of_heaven:
      • destroy_title = scope:ceremonial_title
  • China: Gains the … Title (new son of heaven)
  • If played by the AI › Every held title:
    • title_tier = empire
    • prev:
      • destroy_title = prev
  • If number of tributaries more than 0:
    • Every tributary:
      • Where:
        • Is played by the AI
        • Their primary title:
          • target_is_de_jure_liege_or_above = title:h_china
      • change_liege = { liege = scope:new_son_of_heaven change = scope:mandate_vassalize_tributaries_change }
    • Every Tributary:
      • Where:
        • Not all of these

          • Is played by the AI
          • Their primary title:
            • target_is_de_jure_liege_or_above = title:h_china
      • start_tributary = { contract_group = tributary_celestial suzerain = scope:new_son_of_heaven }
  • scope:new_son_of_heaven:
  • Every De Jure Vassal of China within your Realm who is not a Republic or Theocracy will adopt the Celestial Government
  • Every Independent Ruler in the Dynastic Cycle who has a Celestial Government or the same Heritage as you will become your Vassal and adopt Celestial Government

• 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)
tgp_claim_mandate_of_heaven_effect = {
	save_scope_as = new_son_of_heaven
	set_variable = {
		name = new_son_of_heaven
		value = scope:new_son_of_heaven
		days = 2
	}
	every_vassal = {
		limit = {
			any_held_title = {
				OR = {
					exists = var:ceremonial_title
					exists = var:administrative_ui_special_title
				}
			}
		}
		random_held_title = {
			limit = { exists = var:ceremonial_title }
			save_scope_as = ceremonial_title
		}
		save_temporary_scope_as = ceremonial_liege
		# TGP end the ceremonial liege
		# MESSAGE
		hidden_effect = {
			every_player = {
				limit = { top_liege = scope:ceremonial_liege.top_liege }
				send_interface_message = {
					type = event_generic_bad
					title = tgp_destroy_ceremonial_liege_throne_title
					left_icon = scope:ceremonial_liege
					right_icon = scope:new_son_of_heaven
					show_as_tooltip = {
						scope:new_son_of_heaven = { destroy_title = scope:ceremonial_title }
						scope:ceremonial_liege = { add_trait = former_emperor }
					}
				}
			}
		}
		# Actually destroy
		scope:ceremonial_liege = { add_trait = former_emperor }
		scope:new_son_of_heaven = { destroy_title = scope:ceremonial_title }
	}
	set_variable = {
		name = claimed_mandate_var
		value = yes
		days = 30
	}
	# Grant the Hegemon title
	create_title_and_vassal_change = {
		type = created
		save_scope_as = mandate_change
		add_claim_on_loss = no
	}
	title:h_china = {
		change_title_holder = {
			holder = scope:new_son_of_heaven
			change = scope:mandate_change
		}
	}
	resolve_title_and_vassal_change = scope:mandate_change
	# destroy empire titles for merit hgemony, instead force them granting titles away
	if = {
		limit = {
			is_ai = yes
		}
		every_held_title = {
			title_tier = empire
			prev = { destroy_title = prev }
		}
	}
	# Adjust tributaries
	if = {
		limit = {
			number_of_tributaries > 0
		}
		# Vassalize tributaries within China (except if it's a player)
		create_title_and_vassal_change = {
			type = swear_fealty
			save_scope_as = mandate_vassalize_tributaries_change
		}
		every_tributary = {
			limit = {
				is_ai = yes
				primary_title = {
					target_is_de_jure_liege_or_above = title:h_china
				}
			}
			hidden_effect = { end_tributary = yes }
			change_liege = {
				liege = scope:new_son_of_heaven
				change = scope:mandate_vassalize_tributaries_change
			}
		}
		resolve_title_and_vassal_change = scope:mandate_vassalize_tributaries_change
		# Turn your other tributaries into hegemonic
		every_tributary = {
			custom = custom.every_tributary
			limit = {
				NAND = {
					is_ai = yes
					primary_title = {
						target_is_de_jure_liege_or_above = title:h_china
					}
				}
			}
			start_tributary = {
				contract_group = tributary_celestial
				suzerain = scope:new_son_of_heaven
			}
		}
	}
	scope:new_son_of_heaven = {
		# Get some gold back from any owned domicile
		nomad_domicile_refund_effect = yes
		# Become celestial
		if = {
			limit = {
				NOT = { government_has_flag = government_is_celestial }
			}
			tgp_domicile_conversion_when_changing_government_type = {

As written in game/common/scripted_effects/10_dlc_tgp_dynastic_cycle_scripted_effects.txt.

The first 120 of its 401 lines; the rest is in game/common/scripted_effects/10_dlc_tgp_dynastic_cycle_scripted_effects.txt from line 6.

Where it is used

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

Events (4)

Scripted effects (1)

Source: game/common/scripted_effects/10_dlc_tgp_dynastic_cycle_scripted_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?