Scripted effect
launch_hungarian_migration_scripted_effect
launch_hungarian_migration_scripted_effect = { INVADER = … }game/common/scripted_effects/00_decisions_effects.txt, line 1927 (536 lines). Parameters: $INVADER$.
launch_hungarian_migration_scripted_effect is a scripted effect in Crusader Kings III, written at line 1927 of its file. A call passes 1 parameter: INVADER. The game's script calls it in 1 place, among them Migrate to Pannonia (casus belli). Its body carries 8 texts of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_decisions_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)
launch_hungarian_migration_scripted_effect = {
$INVADER$ = {
#If Hungary already exists, just tell us it's getting a name change.
if = {
limit = {
title:k_hungary = { is_title_created = yes }
}
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.pannonia_renamed
title:k_hungary = { set_title_name = k_hungary }
}
#Otherwise, if Hungary doesn't exist, create & acquire it _whilst_ giving it a name change.
else_if = {
limit = {
title:k_hungary = { is_title_created = no }
}
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.pannonia_renamed_and_usurped
hidden_effect = {
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
title:k_hungary = {
change_title_holder = {
holder = $INVADER$
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
title:k_hungary = { set_title_name = k_hungary }
}
}
#If $INVADER$ has both k_hungary & any other kingdom-tier title, destroy the excess titles.
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.destroy_other_kingdoms
hidden_effect = {
if = {
limit = {
has_title = title:k_hungary
any_held_title = {
title_tier >= kingdom
count >= 2
}
}
every_held_title = {
title_tier >= kingdom
limit = {
NOT = { this = title:k_hungary }
}
save_temporary_scope_as = excess_kingdom
$INVADER$ = { destroy_title = scope:excess_kingdom }
}
}
}
#Replace all Avar territories within Pannonia with Mogyer, excepting Keve & Krasso.
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.mogyers_move_to_pannonia
hidden_effect = {
every_sub_realm_county = {
limit = {
title_capital_county.title_province = { geographical_region = custom_hungary }
culture = culture:avar
NOR = {
this = title:c_keve
this = title:c_krasso
holder = {
AND = {
is_ai = no
has_culture = prev.culture
}
}
}
}
set_county_culture = culture:mogyer
#Switch 'em to $INVADER$'s faith if unreformed & $INVADER$ is any Magyar pagan.
if = {
limit = {
$INVADER$.faith.religion = religion:magyar_religion
faith = { has_doctrine_parameter = unreformed }
}
set_county_faith = $INVADER$.faith
set_county_rite = $INVADER$.rite
}
}
}
#Replace all Mogyer territories outside of the Pannonian Basin
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.mogyers_outside_pannonia
hidden_effect = {
every_sub_realm_county = {
limit = {
NOT = {
title_capital_county.title_province = { geographical_region = custom_hungary }
}
culture = culture:mogyer
}
set_county_culture = culture:pecheneg
}
#Switch 'em to Tengri if Magyar pagan.
every_sub_realm_county = {
limit = {
NOT = {
title_capital_county.title_province = { geographical_region = custom_hungary }
}
culture = culture:pecheneg
religion = religion:magyar_religion
}
set_county_faith = faith:tengri_pagan
}
}
#All territory outside Pannonia is given to new holders and/or made independent.
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.territory_outside_pannonia.non_mogyer_vassals
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.territory_outside_pannonia.mogyer_vassals
custom_tooltip = launch_hungarian_migration_scripted_effect.tt.territory_outside_pannonia.former_territories
hidden_effect = {
#All direct vassal non-Mogyers are given their independence, unless they hold land within Pannonia.
every_vassal = {
limit = {
NOT = { culture = culture:mogyer }As written in game/common/scripted_effects/00_decisions_effects.txt.
The first 120 of its 536 lines; the rest is in game/common/scripted_effects/00_decisions_effects.txt from line 1927.
Where it is used
Every place in common/, events/ and history/ that calls launch_hungarian_migration_scripted_effect.
Casus belli (1)
Source: game/common/scripted_effects/00_decisions_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.