hopefully updated on actions and scripted triggers

This commit is contained in:
trashmasteruni 2026-10-19 21:12:02 +02:00
parent 84ac41f6ca
commit a4d812a52c
27 changed files with 10879 additions and 4415 deletions

View file

@ -24,29 +24,6 @@ on_army_monthly = {
}
}
}
ROOT = {
if = {
limit = {
ROOT = { is_at_war = yes }
NOT = {
has_character_modifier = armies_raised_modifier
}
}
add_character_modifier = {
modifier = armies_raised_modifier
years = 5
}
}
else_if = {
limit = {
ROOT = { NOT = { is_at_war = yes } }
has_character_modifier = armies_raised_modifier
}
remove_character_modifier = armies_raised_modifier
}
else = {
}
}
}
}
@ -482,7 +459,7 @@ on_siege_completion = {
# If you have the Miles Christi tenet get SP
pam_miles_christi_fulfillment_from_combat_effect = yes
if = {
limit = {
has_personal_tenet_flag = tenet_aniconism_destruction_fulfillment
@ -495,7 +472,7 @@ on_siege_completion = {
change_spiritual_fulfillment = minor_spiritual_fulfillment_value
}
}
# We change your legend to reflect this siege
if = {
limit = {

View file

@ -258,7 +258,7 @@ on_death = {
}
if = {
limit = {
player_heir = { is_ai = no NOT = { government_has_flag = government_allows_nomad_domicile_titles }}
player_heir = { is_ai = no }
}
player_heir = {
every_held_title = {
@ -273,16 +273,11 @@ on_death = {
limit = {
is_ai = no
}
if = {
every_held_title = {
limit = {
NOT = { government_has_flag = government_allows_nomad_domicile_titles }
}
every_held_title = {
limit = {
is_nomad_title = yes
}
set_variable = player_domicile_title
is_nomad_title = yes
}
set_variable = player_domicile_title
}
player_heir = {
add_character_flag = {
@ -351,7 +346,7 @@ on_death = {
# destroy_title = title:e_mongol_empire
# }
# Fix gods-damned Bavaria splitting from East Francia in an ugly fashion in 867.
# Ludwig the Younger inherits East Francia and Karlmann Bavaria, as historically.
if = {
limit = {
# Make sure we're looking at the right guy & that the circumstances haven't changed too much.
@ -374,28 +369,60 @@ on_death = {
}
}
NOT = { has_primary_title = title:k_bavaria }
# Players can sort this themselves: you just need to have Bavaria as your primary title and it's all fine.
is_ai = yes
NOT = { exists = designated_heir }
is_valid_designated_heir = character:42019
}
# If we've got no Bavaria, create it.
if = {
limit = {
title:k_bavaria = { is_title_created = no }
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
}
title:k_bavaria = {
change_title_holder = {
holder = root
change = scope:change
set_designated_heir = character:42019
}
else_if = {
limit = {
this = character:90107
has_variable = ludwig_younger_designated_by_history
designated_heir ?= character:42019
NAND = {
highest_held_title_tier = tier_kingdom
has_realm_law = confederate_partition_succession_law
title:k_bavaria = {
OR = {
is_title_created = no
holder = root
}
any_in_de_jure_hierarchy = {
tier = tier_county
count >= 22
holder = {
any_liege_or_above = { this = root }
}
}
}
NOT = { has_primary_title = title:k_bavaria }
}
resolve_title_and_vassal_change = scope:change
}
# Then switch around.
set_primary_title_to = title:k_bavaria
clear_designated_heir = yes
}
# Salzburg sits outside any de jure kingdom, so it would follow Ludwig the Younger into East Francia instead of going to Bavaria with Karlmann
if = {
limit = {
this = character:90107
designated_heir ?= character:42019
title:d_et_salzburg.holder ?= { is_vassal_of = root }
character:42018 ?= {
is_alive = yes
is_vassal_of = root
}
}
create_title_and_vassal_change = {
type = granted
save_scope_as = salzburg_change
add_claim_on_loss = no
}
title:d_et_salzburg.holder = {
change_liege = {
liege = character:42018
change = scope:salzburg_change
}
}
resolve_title_and_vassal_change = scope:salzburg_change
}
# Diarchies
@ -784,12 +811,6 @@ on_death = {
limit = { ep1_artifact_is_court_artifact_trigger = yes }
set_variable = equipped_court_succession
}
if = {
limit = {
any_equipped_character_artifact = { artifact_visual_after_death_trigger = yes }
}
trigger_event = death_management.0150
}
}
if = {
@ -2341,6 +2362,25 @@ on_death = {
}
}
}
# CE3 achievement: The Father, the Son, and the Holy Grandson - pass the theocrat dynasty chain to the player's same-dynasty heir
if = {
limit = {
is_ai = no
has_variable = ce3_theocrat_dynasty_chain
exists = dynasty
player_heir ?= { dynasty ?= root.dynasty }
}
save_scope_value_as = {
name = ce3_theocrat_dynasty_chain_predecessor
value = var:ce3_theocrat_dynasty_chain
}
player_heir = {
trigger_event = {
on_action = ce3_theocrat_dynasty_chain_succession
days = 1
}
}
}
#If you are a Christian ruler who does not take pam_decision_last_rites their will have their legitimacy and vassal opinion lowered
if = {
limit = {
@ -2603,6 +2643,33 @@ pam_dulia_personal_sainthood_convert = {
}
}
# Root = the player's heir, one day after the player's same-dynasty predecessor died
# scope:ce3_theocrat_dynasty_chain_predecessor = the predecessor's chain length
ce3_theocrat_dynasty_chain_succession = {
trigger = {
is_ai = no
exists = scope:ce3_theocrat_dynasty_chain_predecessor
government_has_flag = government_is_theocracy
any_held_title = { has_clerical_region = yes }
}
effect = {
set_variable = {
name = ce3_theocrat_dynasty_chain
value = {
add = scope:ce3_theocrat_dynasty_chain_predecessor
add = 1
}
}
if = {
limit = { var:ce3_theocrat_dynasty_chain >= 3 }
add_achievement_global_variable_effect = {
VARIABLE = ce3_07_the_father_the_son_and_the_holy_grandson_achievement_unlocked
VALUE = yes
}
}
}
}
# Root = character
# Triggered when someone is about to die from a natural death but is given a second chance by meeting
# the has_natural_death_second_chance scripted rule

View file

@ -1,699 +0,0 @@
mpo_yearly_events_nomads = {
trigger = {
has_mpo_dlc_trigger = yes
government_has_flag = government_is_nomadic
}
random_events = {
chance_to_happen = 100
# EVENT CHAINS/STORY CYCLE EVENTS
100 = nomad_events.0001 # Starts the Achmach Fanakiti event chain
# Regular events
150 = mpo_nomad_events.1030 # You choose a sport for your son to tryhard
200 = mpo_nomad_events.1020 # Your kin wants to break off from your tribe
250 = court_astrologer_events.0002 # Your Astrologer suggest a better place to migrate to
250 = nomad_events.0100 # Two vassals have a herd dispute
250 = nomad_events.0120 # You take an evening ride with someone
200 = nomad_events.0130 # A merchant offers you some herd
150 = nomad_events.0140 # A foreign merchant passes by your capital and asks to stay
250 = nomad_events.0150 # You share a drink with a courtier
300 = nomad_events.0160 # Your spouse tells you they admire you
300 = nomad_events.0170 # Your spouse is scared of your high dread
250 = nomad_events.0180 # Random courtier laughs at your child low prowess
250 = nomad_events.0190 # Reminisce of a past memory
250 = nomad_events.0200 # Someone tells you of a dream they had
250 = nomad_events.0220 # Spouse scolds you for your low Prowess
250 = nomad_events.0230 # Spouse is feeling homesick
200 = nomad_events.0240 # Neighbouring Nomad's herd shows up in your capital
100 = nomad_events.0250 # Enthusiastic priest asks you to convert
100 = nomad_events.0260 # Distant priest arrives at your court
100 = mpo_nomad_events.1050 # A neighboring herder is salty at you
300 = mpo_nomad_events.1060 # You trade with non-nomad neighbors
50 = mpo_nomad_events.1070 #You wake up after having ridden off alone
200 = mpo_nomad_events.1080 #Neighbor is intruding on your land hunting a criminal
150 = mpo_nomad_events.1100 #You adapt your herds to the local terrain
150 = mpo_nomad_events.1110 #Your capital is by a place you can fish
200 = mpo_events_tova.0025 # You are invited to a knucklebone shooting game
200 = mpo_events_tova.0030 # No astrologer? Someone comes to you with a vision
200 = mpo_events_tova.0035 # Anda comes to you with marital concerns
200 = mpo_events_tova.0045 # A Treasured Friend
250 = nomad_events_oltner.0001 # Hunt sighting in your lands
250 = nomad_events_oltner.0002 # Bird sighting in your lands
250 = nomad_events_oltner.0003 # Dangerous Hunt sighting in your lands
150 = nomad_events_oltner.0004 # Zud - Dangerous animals eat your herd
250 = nomad_events_oltner.0005 # Good season! Animals aplenty.
200 = nomad_events_oltner.0006 # You are offered a skilled Master of the Chase from a tributary
200 = nomad_events_oltner.0007 # You are offered a falcon from a tributary
50 = mpo_bb_events.0001 # blood brother comes by for a wrestling match
100 = mpo_events_anna.0001 #Train Them Young - teach a child how to ride a horse
200 = mpo_events_anna.0005 #Stories from the Past - choose a story to be told
200 = mpo_events_anna.0010 #Whistle Like an Arrow - being taught how to whistle as a child
250 = mpo_events_ariana.0001 # Nest Sighting
50 = mpo_events_ariana.0010 # Your Heir wants to convert to a different faith
250 = mpo_events_ariana.0020 # A spouse is suspicious of a councillor
250 = mpo_events_ariana.0050 # A family member risks being branded
150 = mpo_events_ariana.0060 # A child in your family spots an eagles nest with treasure
250 = mpo_events_ariana.0080 # Someone tells you about a magical tree
150 = pet_animal.3050 # Your rival has an eagle
250 = mpo_events_ariana.0090 # Your child wants to be a herder
250 = mpo_events_ariana.0100 # A non-martial gender family member is very skilled
150 = mpo_events_ariana.0110 # Your court astrologer wants you to move your capital
# SEASON SPECIFIC EVENTS
300 = mpo_nomads_season_events.0001 # Herders robbed during drought
300 = mpo_nomads_season_events.0005 # A hungry neighbour asks for herd
300 = mpo_nomads_season_events.0010 # A well-to-do neighbor offers herd
300 = mpo_nomads_season_events.0015 # Two Kurultai members fight over food
150 = nomad_events.0110 # A snow wolf attacks a child (weighted up during white zud/cold zud)
300 = nomad_events.0210 # Spouse/Child is worried about low herd
150 = mpo_nomad_events.1120 #It's winter. wolves are hungry for your herd (weighted up during white zud/cold zud)
}
}
mpo_migration_finished = {
effect = {
if = { # We send an event if you're migrating into a Tributary's lands
limit = {
has_variable = migrating_into_tributary_war_var
}
trigger_event = {
id = migration_events.0002
days = 1
}
}
set_variable = {
name = recently_migrated
years = 3
}
every_held_county = {
limit = {
exists = duchy
duchy = root.capital_province.duchy
}
change_county_control = -50
}
every_realm_province = {
limit = {
has_province_modifier = recently_looted_modifier
}
remove_province_modifier = recently_looted_modifier
}
if = {
limit = {
highest_held_title_tier >= tier_duchy
}
while = {
count = 2
trigger_event = {
on_action = mpo_migration_contract
months = 1
}
}
}
else = {
trigger_event = {
on_action = mpo_migration_contract
months = 1
}
}
domicile ?= {
move_domicile = root.capital_province
}
every_vassal = {
domicile ?= {
move_domicile = prev.capital_province
}
}
if = {
limit = {
has_character_modifier = mpo_migrating_accolade_duke_modifier
}
remove_character_modifier = mpo_migrating_accolade_duke_modifier
}
else_if = {
limit = {
has_character_modifier = mpo_migrating_accolade_king_modifier
}
remove_character_modifier = mpo_migrating_accolade_king_modifier
}
else_if = {
limit = {
has_character_modifier = mpo_migrating_accolade_emperor_modifier
}
remove_character_modifier = mpo_migrating_accolade_emperor_modifier
}
if = {
limit = {
has_variable = nomad_migration_preserve_coronation
}
remove_variable = nomad_migration_preserve_coronation
}
}
}
mpo_migration_contract = {
trigger = {
is_landed = yes
has_mpo_dlc_trigger = yes
government_has_flag = government_is_nomadic
has_variable = recently_migrated
any_held_county = {
is_landless_type_title = no
exists = title_province
county_control < 90
}
}
random_events = {
100 = mpo_contract_events.0001
100 = mpo_contract_events.0011
100 = mpo_contract_events.0021
100 = mpo_contract_events.0031
20 = mpo_contract_events.0041
100 = mpo_contract_events.0051
100 = mpo_contract_events.0061
100 = mpo_contract_events.0071
100 = mpo_contract_events.0081
100 = mpo_contract_events.0091
}
}
# Triggered from code on the day after a migration travel ends
#
# root - migrating ruler
# scope:actor - migration ruler (compatibility with triggers and effects used in migration interaction)
# scope:recipient - holder of the target title
# scope:target_title - higher tier title target of the migration. Can be of any tier
# scope:domain - county or duchy tier title, all land within it shall become new personal domain of the migrating ruler
#
on_migration_travel_end = {
events = {
migration_events.0001
}
effect = {
if = { # MPO ACHIEVEMENT Steppe by Steppe
limit = {
is_ai = no
exists = global_var:started_steppe_by_steppe_achievement
situation:the_great_steppe ?= {
situation_sub_region:steppe_west = {
situation_sub_region_has_county = root.capital_county
}
}
}
add_achievement_global_variable_effect = {
VARIABLE = mpo_steppe_by_steppe_achievement_unlocked
VALUE = yes
}
}
migration_title_and_vassal_change_effect = yes
trigger_event = {
on_action = mpo_migration_finished
}
}
}
# triggered from code when migration war ends
#
# root - migrating ruler
# scope:actor - migration ruler (compatibility with triggers and effects used in migration interaction)
# scope:recipient - primary defender in migration war
# scope:target_title - higher tier title target of the migration. Can be of any tier
# scope:domain - county or duchy tier title, all land within it shall become new personal domain of the migrating ruler
# scope:war - migration war. War will disappear after this onaction
on_migration_war_end = {
effect = {
if = { # MPO ACHIEVEMENT Steppe by Steppe
limit = {
is_ai = no
exists = global_var:started_steppe_by_steppe_achievement
location = {
geographical_region = world_steppe_west
}
}
add_achievement_global_variable_effect = {
VARIABLE = mpo_steppe_by_steppe_achievement_unlocked
VALUE = yes
}
}
if = {
limit = {
scope:war = { has_variable = migration_victory }
}
migration_title_and_vassal_change_effect = yes
trigger_event = {
on_action = mpo_migration_finished
}
if = {
limit = {
has_variable = nomad_migration_preserve_coronation
}
remove_variable = nomad_migration_preserve_coronation
}
every_character_situation = {
limit = {
any_participant_group = {
participant_group_type = nomad_rulers_capital
participant_group_has_character = root
}
}
every_participant_group = {
limit = {
participant_group_type = nomad_rulers_capital
participant_group_has_character = root
}
every_situation_group_participant = {
limit = {
save_temporary_scope_as = temp_scope
NOT = { this = root }
is_migrating = yes
exists = current_travel_plan
OR = {
current_travel_plan.final_destination_province.county = scope:target_title
scope:domain = {
any_in_de_jure_hierarchy = {
tier = tier_county
this = scope:temp_scope.current_travel_plan.final_destination_province.county
}
}
}
}
save_scope_as = invalidated_ruler
scope:invalidated_ruler = {
send_interface_message = {
type = msg_migration_into_realm
title = war_invalidated_migration
desc = war_invalidated_migration_desc
left_icon = root
right_icon = scope:invalidated_ruler
}
}
}
}
}
}
}
}
# triggered from code right after kurultai succession has been resolved
#
# root - new heir (character)
# scope:was_kurultai - (bool) if new heir was part of the predecessor's Kurultai Council
# scope:kurultai_members - list all characters who were part of the predecessor's Kurultai Council
# scope:obedient_kurultai - list all obedient characters who were part of the Kurultai Election (both Council and Children)
# scope:disobedient_kurultai - list all disobedient characters who were part of the Kurultai Election (both Council and Children)
#
on_kurultai_succession_stable = {
trigger = {
has_realm_law = single_heir_succession_kurultai_law
}
effect = {
root = {
if = {
limit = {
exists = this
"list_size(obedient_kurultai)" > 0
}
every_in_list = {
list = obedient_kurultai
limit = {
exists = this
this != root
}
add_opinion = {
target = root
modifier = obedience_opinion
years = 5
}
}
create_character_memory = {
type = had_stable_kurultai_succession
}
}
}
}
}
# triggered from code right after kurultai succession has been resolved
#
# root - new heir (character)
# scope:was_kurultai - (bool) if new heir was part of the predecessor's Kurultai Council
# scope:kurultai_members - list all characters who were part of the predecessor's Kurultai Council
# scope:obedient_kurultai - list all obedient characters who were part of the Kurultai Election (both Council and Children)
# scope:disobedient_kurultai - list all disobedient characters who were part of the Kurultai Election (both Council and Children)
#
on_kurultai_succession_chaotic = {
trigger = {
has_realm_law = single_heir_succession_kurultai_law
primary_title = {
title_held_years < 1
}
}
effect = {
root = {
if = {
limit = {
exists = this
"list_size(obedient_kurultai)" > 0
}
every_in_list = {
list = obedient_kurultai
limit = {
exists = this
this != root
}
add_opinion = {
target = root
modifier = obedience_opinion
years = 5
}
}
}
# Siblings gain claims on all your titles
every_held_title = {
limit = {
tier >= tier_county
}
save_scope_as = title_claim
root = {
every_sibling = {
limit = {
OR = {
AND = {
is_male = yes
faith_dominant_gender_male_or_equal = yes
}
AND = {
is_female = yes
faith_dominant_gender_female_or_equal = yes
}
}
NOT = {
has_claim_on = scope:title_claim
}
}
add_pressed_claim = scope:title_claim
add_to_list = ai_claimant_faction_preference
}
every_in_list = {
list = disobedient_kurultai
limit = {
OR = {
AND = {
is_male = yes
faith_dominant_gender_male_or_equal = yes
}
AND = {
is_female = yes
faith_dominant_gender_female_or_equal = yes
}
}
NOT = {
has_claim_on = scope:title_claim
}
}
add_pressed_claim = scope:title_claim
add_to_list = ai_claimant_faction_preference
}
}
}
random_in_list = {
list = ai_claimant_faction_preference
limit = {
is_physically_able = yes
}
weight = {
base = 1
modifier = {
add = martial
}
modifier = {
add = prowess
}
modifier = {
add = dread
}
modifier = {
add = -250
is_adult = no
}
}
add_character_flag = nomad_preferred_claimant
}
create_character_memory = {
type = had_chaotic_kurultai_succession
}
}
}
random_on_action = {
10 = kurultai_succession_chaotic_minor
20 = kurultai_succession_chaotic_medium
90 = kurultai_succession_chaotic_major
}
}
kurultai_succession_chaotic_minor = {
trigger = {
# No trigger for Minor penalties
NOT = {
has_character_flag = had_mongolia_split
}
}
weight_multiplier = {
base = 1
modifier = { # be a bit kinder to the AI
factor = 2
is_ai = yes
}
}
random_events = {
100 = mpo_chaotic_kurultai_succession.0001 # Siblings become your rivals
150 = mpo_chaotic_kurultai_succession.0002 # Brother seizes the lands of a Tributary and becomes independent
150 = mpo_chaotic_kurultai_succession.0003 # Tributary leaves
100 = mpo_chaotic_kurultai_succession.0004 # County Control loss
100 = mpo_chaotic_kurultai_succession.0005 # Loss of Prestige Level
100 = mpo_chaotic_kurultai_succession.0006 # 10% of Herd defects to Neighboring realm
100 = mpo_chaotic_kurultai_succession.0007 # Good Courtiers defect to Neighbor
100 = mpo_chaotic_kurultai_succession.0008 # MaA Regiment defects to neighbor
}
}
kurultai_succession_chaotic_medium = {
trigger = {
OR = {
"list_size(disobedient_kurultai)" >= 2
"list_size(obedient_kurultai)" <= 0
}
OR = {
highest_held_title_tier >= tier_kingdom
any_tributary = {
count >= 10
}
}
NOT = {
has_character_flag = had_mongolia_split
}
}
random_events = {
100 = mpo_chaotic_kurultai_succession.0009 # Gold divided by Siblings
100 = mpo_chaotic_kurultai_succession.0010 # Legitimacy -500
100 = mpo_chaotic_kurultai_succession.0011 # 20% of Herd defects to Neighboring realm
350 = mpo_chaotic_kurultai_succession.0013 # 20% Realm Split
150 = mpo_chaotic_kurultai_succession.0016 # 3 Tributaries leave
}
}
kurultai_succession_chaotic_major = {
trigger = {
OR = {
"list_size(disobedient_kurultai)" >= "list_size(obedient_kurultai)"
"list_size(obedient_kurultai)" <= 0
}
OR = {
highest_held_title_tier >= tier_kingdom
any_tributary = {
count >= 10
}
}
NOT = {
has_character_flag = had_mongolia_split
}
}
weight_multiplier = {
base = 1
modifier = { # be a bit kinder to the AI
factor = 0.5
is_ai = yes
}
}
random_events = {
300 = mpo_chaotic_kurultai_succession.0012 # 50% Split realm De Jure with Sibling
50 = mpo_chaotic_kurultai_succession.0014 # Extreme kurultai disapproval: shatter realm
100 = mpo_chaotic_kurultai_succession.0015 # 40% of Herd defects to Neighboring realm
100 = mpo_chaotic_kurultai_succession.0017 # All Tributaries leave
}
}
mpo_tributary_check_pulse = {
trigger = {
is_landed = no
is_migrating = no
is_at_war = no
number_of_tributaries > 0
}
effect = {
every_tributary = {
root = {
send_interface_message = {
type = msg_tributaries_breaking_free_bad
title = tributaries_breaking_free_message_title
left_icon = root
right_icon = prev
show_as_tooltip = {
prev = { end_tributary = yes }
}
}
}
send_interface_message = {
type = msg_tributaries_breaking_free_good
title = tributaries_breaking_free_message_player_title
left_icon = this
right_icon = root
end_tributary = yes
}
}
}
}
mpo_de_jure_shift = {
trigger = {
government_has_flag = government_is_nomadic
highest_held_title_tier >= tier_kingdom
}
effect = {
switch = {
trigger = root.highest_held_title_tier
# TODO: TIT-72244 we don't have lists for hegemony for now
#tier_hegemony = {
# de_jure_shifting_effect = {
# UPPER_TIER = hegemony
# LOWER_TIER = empire
# }
#}
tier_empire = {
de_jure_shifting_effect = {
UPPER_TIER = empire
LOWER_TIER = kingdom
}
}
tier_kingdom = {
de_jure_shifting_effect = {
UPPER_TIER = kingdom
LOWER_TIER = duchy
}
}
}
}
}
# root - Character who changed government
# scope:old_government - Character's old government type
on_government_change = {
effect = {
if = {
limit = {
scope:old_government = government_type:nomad_government
NOT = { government_has_flag = government_allows_nomad_domicile_titles }
}
every_held_title = {
limit = { is_nomad_title = yes }
root = {
destroy_title = prev
}
}
}
if = {
limit = {
is_confederation_member = yes
NAND = {
government_is_japanese_trigger = yes
exists = house.house_confederation
}
NOR = {
government_has_flag = government_is_nomadic
government_has_flag = government_is_tribal
}
}
confederation = {
remove_confederation_member = root
}
}
if = {
limit = {
has_variable = crowned_emperor_var
NOR = {
has_game_rule = coronation_laws_off
has_realm_law = crowned_emperor
}
}
add_realm_law = crowned_emperor
}
if = {
limit = {
has_variable = crowned_king_var
NOR = {
has_game_rule = coronation_laws_off
has_realm_law = crowned_king
}
}
add_realm_law = crowned_king
}
if = {
limit = { scope:old_government = government_type:mandala_government }
#Remove Aspect modifiers/variables
if = {
limit = { has_character_modifier = mandala_increments_of_peace_modifier }
remove_character_modifier = mandala_increments_of_peace_modifier
}
if = {
limit = { has_character_modifier = mandala_creator_modifier }
remove_character_modifier = mandala_creator_modifier
}
remove_variable = mandala_house_power_accumulated_increments_of_peace
remove_variable = mandala_house_power_accumulated_creator
#Remove max piety cap modifiers/variables
if = {
limit = { has_character_modifier = budding_divinity_modifier }
remove_character_modifier = budding_divinity_modifier
}
if = {
limit = { has_character_modifier = budding_deity_modifier }
remove_character_modifier = budding_deity_modifier
}
if = {
limit = { has_character_modifier = budding_godhood_modifier }
remove_character_modifier = budding_godhood_modifier
}
remove_variable = not_subject_to_succession_trials
remove_variable = tribute_mission_grace
}
if = {
limit = {
government_has_flag = government_is_mandala
is_house_head = yes
}
#Set the house aspect to default, please
house = {
set_house_aspiration = { type = no_aspect }
}
}
}
}

View file

@ -1,544 +0,0 @@
# referenced by code. Fired yearly on every rite
# root = rite
on_rite_yearly = {
effect = {
rite_yearly_hor_passive_learning_effect = yes
rite_yearly_hor_divergence_drift_effect = yes
}
}
pam_the_christian_church_yearly_on_action = {
effect = {
# Non Christian presence in Europe
pam_the_christian_church_non_christian_kingdom_in_europe_catalyst_effect = yes
# Non-Catholic ruler controls the Papal State's de jure capital
pam_the_christian_church_catholic_hof_weak_papal_state_control_catalyst_effect = yes
# Byzantine emperor is not Christian
pam_the_christian_church_byzantine_emperor_non_christian_catalyst_effect = yes
}
}
# Tier 1 is paced once from pam_cathedral_01 on_start_build (years = 2).
pam_cathedral_great_project_yearly_on_action = {
effect = {
every_great_project = {
limit = {
OR = {
great_project_type = pam_cathedral_02
great_project_type = pam_cathedral_03
}
}
great_project_founder = {
save_scope_as = founder
trigger_event = {
on_action = pam_cathedral_great_project_yearly_founder_events_on_action
years = 5
}
}
great_project_owner = {
if = {
limit = {
this = scope:founder
}
trigger_event = {
on_action = pam_cathedral_great_project_yearly_owner_events_on_action
years = 10
}
}
else = {
trigger_event = {
on_action = pam_cathedral_great_project_yearly_owner_events_on_action
years = 5
}
}
}
}
}
}
pam_cathedral_great_project_yearly_founder_events_on_action = {
random_events = {
1 = pam_great_projects_events.0007
1 = pam_great_projects_events.0008
1 = pam_great_projects_events.0011
1 = pam_great_projects_events.0013
}
}
pam_cathedral_great_project_yearly_owner_events_on_action = {
random_events = {
1 = pam_great_projects_events.0012
}
}
study_faith_success = {
on_actions = {
pam_study_faith_personal_tenet_on_action
}
}
on_travel_plan_movement = {
on_actions = {
pam_mountain_travel_personal_tenet_on_action
sun_worship_desert_travel_personal_tenet_on_action
pam_sanctity_of_nature_travel_on_action
}
}
on_building_completed = {
on_actions = {
pam_sanctity_of_nature_building_completed_on_action
}
}
on_faith_conversion = {
on_actions = {
pam_tax_nonbelievers_faith_conversion_on_action
}
}
on_birth_child = {
on_actions = {
pam_auspicious_birthright_birth_on_action
}
}
pam_study_faith_personal_tenet_on_action = {
effect = {
if = {
limit = {
scope:owner = {
has_personal_tenet_flag = adaptive_study_rite_cultural_acceptance
culture != scope:target.culture
}
}
scope:owner = {
culture = {
change_cultural_acceptance = {
target = scope:target.culture
value = minor_cultural_acceptance_gain
desc = pam_adaptive_study_rite_cultural_acceptance
}
}
send_interface_toast = {
type = event_toast_effect_good
title = pam_adaptive_study_rite_cultural_acceptance_toast
left_icon = scope:owner
right_icon = scope:target
}
}
}
}
}
pam_mountain_travel_personal_tenet_on_action = {
effect = {
if = {
limit = {
has_personal_tenet_flag = cthonic_redoubts_mountain_travel_fulfillment
current_travel_plan.current_location = {
OR = {
terrain = mountains
terrain = desert_mountains
}
}
current_travel_plan = {
NOT = { has_variable = pam_mountain_travel_fulfillment_awarded }
}
}
current_travel_plan = {
set_variable = pam_mountain_travel_fulfillment_awarded
}
send_interface_toast = {
type = event_toast_effect_good
title = pam_cthonic_redoubts_mountain_travel_toast
left_icon = root
add_piety = minor_piety_gain
change_spiritual_fulfillment = minor_spiritual_fulfillment_value
}
}
}
}
sun_worship_desert_travel_personal_tenet_on_action = {
effect = {
if = {
limit = {
has_personal_tenet_flag = tenet_sun_worship_desert_pilgrim
current_travel_plan.current_location = {
OR = {
terrain = desert
terrain = desert_mountains
terrain = oasis
}
}
current_travel_plan = {
NOT = { has_variable = sun_worship_desert_fulfillment_awarded }
}
}
current_travel_plan = {
set_variable = sun_worship_desert_fulfillment_awarded
}
send_interface_toast = {
type = event_toast_effect_good
title = sun_worship_desert_travel_toast
left_icon = root
add_piety = minor_piety_gain
change_spiritual_fulfillment = minor_spiritual_fulfillment_value
}
}
}
}
pam_sanctity_of_nature_travel_on_action = {
effect = {
if = {
limit = {
current_travel_plan.current_location = {
has_province_modifier = preserved_wilderness_modifier
}
}
current_travel_plan = {
if = {
limit = {
NOT = { has_travel_plan_modifier = preserved_wilderness_travel_modifier }
}
add_travel_plan_modifier = preserved_wilderness_travel_modifier
}
}
}
else_if = {
limit = {
current_travel_plan = {
has_travel_plan_modifier = preserved_wilderness_travel_modifier
}
}
current_travel_plan = {
remove_travel_plan_modifier = preserved_wilderness_travel_modifier
}
}
if = {
limit = {
has_personal_tenet_flag = tenet_sanctity_of_nature_wilderness_fulfillment
current_travel_plan.current_location = {
has_holding = no
is_sea_province = no
}
current_travel_plan = {
OR = {
NOT = { has_variable_list = pam_sanctity_of_nature_visited_wilderness }
AND = {
has_variable_list = pam_sanctity_of_nature_visited_wilderness
NOT = {
is_target_in_variable_list = {
name = pam_sanctity_of_nature_visited_wilderness
target = root.current_travel_plan.current_location
}
}
}
}
}
}
change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value
current_travel_plan = {
add_to_variable_list = {
name = pam_sanctity_of_nature_visited_wilderness
target = root.current_travel_plan.current_location
}
}
}
}
}
pam_sanctity_of_nature_building_completed_on_action = {
# add_great_building fires on_building_completed during history setup.
trigger = {
has_global_variable = game_has_started
}
effect = {
if = {
limit = {
has_holding = yes
has_province_modifier = preserved_wilderness_modifier
}
remove_province_modifier = preserved_wilderness_modifier
}
}
}
pam_tax_nonbelievers_faith_conversion_on_action = {
trigger = {
exists = scope:actor
root != scope:actor
scope:actor = {
has_personal_tenet_flag = tax_nonbelievers_fulfillment_from_conversion
}
}
effect = {
scope:actor = {
pam_tax_nonbelievers_conversion_fulfillment_effect = yes
}
}
}
pam_auspicious_birthright_birth_on_action = {
effect = {
if = {
limit = {
OR = {
scope:mother = {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
}
scope:real_father ?= {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
}
}
}
# Base 5% chance for later children; the first-child modifiers shift the chance to 20%.
random_list = {
95 = {
modifier = {
add = -15
OR = {
scope:mother = {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
NOR = {
any_child = {
even_if_dead = yes
this != scope:child
}
}
}
scope:real_father ?= {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
NOR = {
any_child = {
even_if_dead = yes
this != scope:child
}
}
}
}
}
}
5 = {
modifier = {
add = 15
OR = {
scope:mother = {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
NOR = {
any_child = {
even_if_dead = yes
this != scope:child
}
}
}
scope:real_father ?= {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
NOR = {
any_child = {
even_if_dead = yes
this != scope:child
}
}
}
}
}
random_list = {
1 = {
trigger = {
NOR = {
has_trait = dwarf
has_trait = giant
}
}
add_trait = dwarf
}
1 = {
trigger = {
NOR = {
has_trait = giant
has_trait = dwarf
}
}
add_trait = giant
}
1 = {
trigger = {
NOT = { has_trait = albino }
}
add_trait = albino
}
1 = {
trigger = {
NOT = { has_trait = clubfooted }
}
add_trait = clubfooted
}
1 = {
trigger = {
NOT = { has_trait = bleeder }
}
add_trait = bleeder
}
1 = {
trigger = {
NOT = { has_trait = hunchbacked }
}
add_trait = hunchbacked
}
1 = {
trigger = {
NOT = { has_trait = lisping }
}
add_trait = lisping
}
1 = {
trigger = {
NOT = { has_trait = stuttering }
}
add_trait = stuttering
}
1 = {
trigger = {
NOR = {
has_trait = spindly
has_trait = physique_good
}
}
add_trait = spindly
}
1 = {
trigger = {
NOT = { has_trait = scaly }
}
add_trait = scaly
}
1 = {
trigger = {
NOT = { has_trait = wheezing }
}
add_trait = wheezing
}
1 = {
trigger = {
NOR = {
has_trait = beauty_bad
has_trait = beauty_good
}
}
add_trait = beauty_bad_2
}
}
}
}
}
if = {
limit = {
scope:child = {
OR = {
has_trait = dwarf
has_trait = albino
has_trait = clubfooted
has_trait = bleeder
has_trait = scaly
has_trait = giant
has_trait = hunchbacked
has_trait = spindly
has_trait = wheezing
has_trait = lisping
has_trait = stuttering
has_trait = beauty_bad
}
}
OR = {
scope:mother = {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
}
scope:real_father ?= {
has_personal_tenet_flag = mystical_birthright_spiritual_leader
}
}
}
scope:child = {
add_character_modifier = {
modifier = pam_mystical_birthright_spiritual_leader_modifier
}
}
if = {
limit = {
scope:mother = {
is_ai = no
}
}
scope:mother = {
send_interface_toast = {
type = event_toast_effect_good
title = pam_mystical_birthright_spiritual_leader_toast
left_icon = scope:child
custom_tooltip = {
text = pam_mystical_birthright_spiritual_leader_toast_tt
}
}
}
}
if = {
limit = {
scope:real_father ?= {
is_ai = no
}
}
scope:real_father = {
send_interface_toast = {
type = event_toast_effect_good
title = pam_mystical_birthright_spiritual_leader_toast
left_icon = scope:child
custom_tooltip = {
text = pam_mystical_birthright_spiritual_leader_toast_tt
}
}
}
}
}
}
}
# used by code, do not rename or remove.
# root = clerical region holder
# scope:title = clerical region title
# scope:county = capital county
# scope:reason = reason that triggered this mismatch. flag can be:
# - county_converted (county is now of different faith, holder stayed old faith)
# - character_converted (character converted away from county faith)
# - changed_tenets_or_doctrines (county and character are still matching faith but the faith doesn't support clerical regions anymore)
on_clerical_region_faith_mismatch = {
# TIT-75963 player choice when capital converts; TIT-75964 other succession cases
events = {
# Capital converted; both Faiths have Clerical Regions (player)
pam_clergy_events.0051
# AI / other mismatch reasons / new Faith lacks Clerical Regions
pam_clergy_events.0052
}
}
# used by code, do not rename or remove.
# root = challenger character
# scope:sponsor = former sponsor title
# scope:title = challenger title
on_challenger_removed = {
effect = {
if = {
limit = {
is_alive = yes
has_character_flag = antipope_flag
}
remove_character_flag = antipope_flag
}
# TODO_PAM move antipope removal cleanup effects here
#if = {
# limit = { root = scope:title.holder }
# destroy_title = scope:title
#}
}
}

View file

@ -9,7 +9,6 @@
# scope:diverged (true/false) optional scope, true if the faith was created because of a Rite diverging too much. Notice create a 100+ divergence heresy at the start does not count.
on_faith_created = {
effect = {
main_rite = { force_refresh_head_of_rite = yes }
# Faiths created by a rite diverging too far start at 0 fervor
if = {
limit = {
@ -177,26 +176,6 @@ on_faith_created = {
}
}
}
# The founding wave (founder and vassals who already accepted) brings their courts, as with a new rite
# Listed first, since the conversions below add characters to the faith being iterated
if = {
limit = {
NOT = { scope:diverged ?= yes }
}
root = {
every_faith_character = {
limit = { is_ruler = yes }
add_to_temporary_list = pam_reform_founding_wave
}
}
every_in_list = {
list = pam_reform_founding_wave
pam_convert_court_to_faith_effect = {
FAITH = root
OLD_FAITH = scope:old_faith
}
}
}
}
else = {
scope:founder ?= {
@ -292,6 +271,109 @@ on_faith_created = {
pam_seed_cardinals_effect = yes
}
}
# Achievements - evaluated on the acting character, as add_achievement_* gate on is_ai.
scope:founder ?= {
if = {
limit = { faith = root }
add_achievement_flag_effect = { FLAG = achievement_its_not_a_cult_flag }
if = {
limit = {
scope:old_faith = {
religion_tag = west_african_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_siguic
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = west_african_orisha_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_orisha
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = west_african_bori_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_bori
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = west_african_roog_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_roog_sene
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = akom_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_akom
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = kushitism_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_kushitism
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = waaqism_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_waaqism
VALUE = yes
}
}
if = {
limit = {
scope:old_faith = {
religion_tag = north_african_religion
has_doctrine_parameter = unreformed
}
}
add_achievement_global_variable_effect = {
VARIABLE = achievement_mother_of_us_all_achamanism
VALUE = yes
}
}
}
}
# These events need a character, so they fire on the new faith's head, never a founder outside the faith
root.main_rite.head_of_rite ?= {
trigger_event = faith_conversion.0001 # Convert capital county
@ -438,11 +520,13 @@ on_rite_created = {
has_character_flag = forced_conversion_on_reform
}
set_character_faith = root.faith
set_character_rite = root.rite
every_vassal_or_below = {
limit = { faith = scope:old_faith }
random = {
chance = 75
set_character_faith = root.faith
set_character_rite = root.rite
}
}
every_sub_realm_county = {
@ -450,6 +534,7 @@ on_rite_created = {
random = {
chance = 75
set_county_faith = root.faith
set_county_rite = root.rite
}
}
}
@ -641,10 +726,18 @@ on_faith_conversion = {
}
}
trigger_event = NEOW_dynamic_titles.1000
}
######################################################
}
set_variable = {
name = old_rite
value = scope:old_rite
days = 30
}
pam_on_conversion_effect = yes
pam_remove_forbidden_personal_tenet_secret_if_invalid_effect = yes
update_syncretism_personal_tenet_effect = yes
# EP3 - State Faith
if = {
limit = {
@ -967,12 +1060,12 @@ on_rite_change = {
}
}
random_held_title = {
limit = {
tier = tier_county
limit = {
tier = tier_county
any_county_province = {
has_variable = monastic_order_capital
}
}
}
random_county_province = {
limit = {
has_variable = monastic_order_capital
@ -1469,7 +1562,7 @@ pagan_conversion_pulse = {
}
events = {
# global_religion.0001 #Pagan reformed by neighbor, spouse, soulmate, friend, or geographic location
global_religion.0001 #Pagan reformed by neighbor, spouse, soulmate, friend, or geographic location
}
}
@ -1862,304 +1955,3 @@ on_character_holy_site_created = {
}
}
}
on_character_faith_change = {
effect = {
check_for_equal_doctrine_effect = yes
every_held_title = {
update_dynamic_coa = yes
}
# Struggles
## Struggle Catalysts
### Heir changes culture while under age
if = {
limit = {
catalyst_very_important_child_change_culture_or_faith_preliminary_trigger = yes
}
random_parent = {
limit = {
any_character_struggle = {
involvement = involved
}
}
every_character_struggle = {
involvement = involved
activate_struggle_catalyst = {
catalyst = catalyst_very_important_child_change_culture_or_faith
character = root
}
}
}
}
# ## Struggle Effects
## ### persian_struggle: switching faith to anything that isn't an orthodox Sunni creed'll flip you to detractor.
## if = {
## limit = {
## # Gotta be in the appropriate struggle.
## any_character_struggle = { this = struggle:persian_struggle }
## # Filter out pre-existing detractors.
## NOT = { has_trait = fp3_struggle_detractor }
## # Now, check the new faith.
## exists = title:d_sunni.holder
## OR = {
## NOT = { exists = faith.religious_head }
## NOT = { faith.religious_head = title:d_sunni.holder }
## }
## }
## send_interface_toast = {
## type = event_toast_effect_neutral
## title = persian_struggle.tt.converted_away_from_sunni_orthodoxy
## left_icon = root
## hidden_effect = { remove_trait = fp3_struggle_supporter }
## add_trait_force_tooltip = fp3_struggle_detractor
## }
## }
#
# # Local conversion
# if = {
# limit = {
# exists = root.capital_province
# root.capital_province.faith = root.faith
# any_character_struggle = {
# involvement = involved
# phase_has_catalyst = catalyst_convert_local_culture_faith
# is_faith_involved_in_struggle = root.faith
# }
# }
# every_character_struggle = {
# involvement = involved
# activate_struggle_catalyst = {
# catalyst = catalyst_convert_local_culture_faith
# character = root
# }
# }
# }
# else_if = { # Forced conversion
# limit = {
# any_character_struggle = {
# involvement = involved
# is_faith_involved_in_struggle = root.faith
# phase_has_catalyst = catalyst_forced_conversion
# }
# }
# every_character_struggle = {
# involvement = involved
# activate_struggle_catalyst = {
# catalyst = catalyst_forced_conversion
# character = root
# }
# }
# }
# else_if = {
# limit = {
# has_trait = fp3_struggle_supporter
# any_character_struggle = {
# involvement = involved
# is_faith_involved_in_struggle = root.faith
# phase_has_catalyst = catalyst_supporter_forced_conversion
# }
# }
# every_character_struggle = {
# involvement = involved
# activate_struggle_catalyst = {
# catalyst = catalyst_supporter_forced_conversion
# character = root
# }
# log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_supporter_forced_conversion }
# }
# }
# else_if = {
# limit = {
# has_trait = fp3_struggle_detractor
# any_character_struggle = {
# involvement = involved
# is_faith_involved_in_struggle = root.faith
# phase_has_catalyst = catalyst_detractor_forced_conversion
# }
# }
# every_character_struggle = {
# involvement = involved
# activate_struggle_catalyst = {
# catalyst = catalyst_detractor_forced_conversion
# character = root
# }
# log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_detractor_forced_conversion }
# }
# }
# Achievements
if = {
limit = { is_ai = no }
if = { # FP2 - Basque In My Glory
limit = { faith = faith:basque_pagan }
add_achievement_global_variable_effect = {
VARIABLE = fp2_basque_in_my_glory_achievement_unlocked
VALUE = yes
}
}
}
# Hostage story cycle
if = {
limit = {
is_hostage = yes
is_adult = no
# Did they just change to their captor's culture
faith = warden.faith
}
save_scope_as = hostage
warden = {
trigger_event = bp2_yearly.8050
}
}
if = {
limit = {
has_variable = japan_1010_discount
var:japan_1010_discount = faith
}
remove_variable = japan_1010_discount
}
if = {
limit = {
has_character_flag = tgp_japan_1040_discount
faith.religion = religion:shintoism_religion
}
remove_character_flag = tgp_japan_1040_discount
}
#Lose Mandala if you change to a monotheist faith
mandala_no_longer_polytheist_effect = yes
}
events = {
faith_conversion.0002 # Remove obsolete modifiers
faith_conversion.0004 # Convert Theocracies
faith_conversion.0005 # Update marriage opinions
great_holy_war.0025 # Replace Recipient for ongoing GHW
great_holy_war.0029 # Beneficiary converted, remove and replace.
great_holy_war.0059 # Clear Crusader traits on conversion.
great_holy_war.0084 # Replace fallback ghw recipient
great_holy_war.0085 # Remove pledged vassals upon conversion of their liege.
war_event.3100 # Handles invalidation of religious wars
}
}
faith_fervor_events_pulse = {
trigger = {
NOR = {
has_doctrine_parameter = unreformed
has_variable = recent_fervor_event
}
}
random_events = {
chance_to_happen = 6 # ~53% chance of occurring within a given year. 90% chance within 3 years, 99.8% chance within 5.
100 = fervor.1001
100 = fervor.2001
}
}
on_rite_updated = {
events = {
}
effect = {
root = {
save_scope_as = rite
}
if = { # slient it for EC since EC has unique evvent to inform
limit = {
exists = scope:changed_tenets_or_doctrines
OR = {
NOT = {
faith = { has_variable = ecumenical_council_ongoing }
}
exists = scope:consume_rite_edit_token
}
}
# The message icon slot must never be left unset, hence the fall-through to the rite itself
if = {
limit = { any_in_list = { list = added_tenets count >= 1 } }
every_in_list = {
list = added_tenets
save_scope_as = rite_change_icon
}
}
else_if = {
limit = { any_in_list = { list = added_doctrines count >= 1 } }
every_in_list = {
list = added_doctrines
save_scope_as = rite_change_icon
}
}
else_if = {
limit = { any_in_list = { list = removed_tenets count >= 1 } }
every_in_list = {
list = removed_tenets
save_scope_as = rite_change_icon
}
}
else_if = {
limit = { any_in_list = { list = removed_doctrines count >= 1 } }
every_in_list = {
list = removed_doctrines
save_scope_as = rite_change_icon
}
}
else = {
root = { save_scope_as = rite_change_icon }
}
every_player = {
limit = {
OR = {
rite = root
AND = {
faith = root.faith
root.faith.main_rite = root
}
}
}
send_interface_message = {
type = msg_rite_updated
title = msg_rite_updated
left_icon = scope:rite_change_icon
show_as_tooltip = {
every_in_list = {
list = removed_doctrines
root = { remove_rite_doctrine = prev }
}
every_in_list = {
list = added_doctrines
root = { add_rite_doctrine = prev }
}
every_in_list = {
list = removed_tenets
root = { remove_rite_tenet = prev }
}
every_in_list = {
list = added_tenets
root = { add_rite_tenet = prev }
}
}
}
}
}
head_of_rite ?= {
trigger_event = faith_creation.0004 # Update HoF succession law
trigger_event = faith_creation.0001 # Temporal rel head setup
trigger_event = faith_creation.0002 # Spiritual rel head setup
trigger_event = faith_creation.0011 # Restore Temporal rel head
trigger_event = faith_creation.0012 # Restore Spiritual rel head
trigger_event = faith_creation.1100 # Destroy HoF title if no longer valid
}
}
}

View file

@ -36,6 +36,28 @@ on_title_destroyed = {
owner = { destroy_title = prev }
}
# If the title of an independent admin ruler is destroyed, let's make sure we handle any stray admin vassals
################ N3OW Dynamic Titles ##################
if = {
limit = {
OR = {
scope:title = title:k_kuban
scope:title = title:d_volgorad
scope:title = title:c_volgograd
scope:title = title:b_volgograd
scope:title = title:e_france
scope:title = title:e_nistrenia
scope:title = title:e_europa
scope:title = title:e_britannia
scope:title = title:e_germany
}
}
trigger_event = NEOW_dynamic_titles.1000
}
######################################################
if = {
limit = {
government_has_mechanic = administrative
@ -179,37 +201,6 @@ on_title_destroyed = {
}
}
}
}
}
# A title is transferred to a new character
# root = the new holder
# scope:title = the title that changes hands
# scope:previous_holder = previous holder. Might be dead
on_title_gain = {
effect = {
################ N3OW Dynamic Titles ##################
if = {
limit = {
OR = {
scope:title = title:k_kuban
scope:title = title:d_volgorad
scope:title = title:c_volgograd
scope:title = title:b_volgograd
scope:title = title:e_france
scope:title = title:e_nistrenia
scope:title = title:e_europa
scope:title = title:e_britannia
scope:title = title:e_germany
}
}
trigger_event = NEOW_dynamic_titles.1000
}
######################################################
# Empire Faith Gate: refresh contested-empire modifiers immediately when an empire is destroyed.
if = {
@ -219,7 +210,241 @@ on_title_gain = {
}
root = { efg_recalculate_contested_empire_for_faith_effect = yes }
}
if = {
limit = {
scope:landed_title = {
has_title_law = confederation_elective_succession_law
}
}
if = {
limit = {
has_character_modifier = confederate_king_modifier
}
remove_character_modifier = confederate_king_modifier
}
if = {
limit = {
has_character_modifier = coronated_confed_modifier
}
remove_character_modifier = coronated_confed_modifier
}
}
#########
# PAM #
#########
# if = {
# limit = {
# scope:landed_title = {
# has_clerical_region = yes
# root = { religion = religion:christianity_religion }
# }
# }
# situation:the_christian_church.situation_sub_region:core = {
# remove_clerical_realm_from_sub_region = scope:landed_title
# }
# }
}
}
# A title is transferred to a new character
# root = the new holder
# scope:title = the title that changes hands
# scope:previous_holder = previous holder. Might be dead
on_title_gain = {
effect = {
# refresh the state rite if conquered in a GHW, otherwise crusader kings will follow muslim faith in egypt.
if = {
limit = {
scope:transfer_type = flag:conquest_holy_war
exists = scope:title.state_rite
}
scope:title = {
set_state_rite = root.rite
}
}
if = {
limit = { clerical_elector_title ?= scope:title }
pam_strip_illegal_cardinalate_effect = yes
}
if = {
limit = {
exists = clerical_elector_title
scope:title = clerical_elector_title
}
add_character_flag = cardinal_flag
situation:the_christian_church ?= {
add_manual_participant = prev
}
}
# Unconditional: also catches a sitting Head of Faith who is handed a cardinalate
pam_vacate_head_of_faith_cardinalate_effect = yes
if = {
limit = {
scope:title = { has_clerical_region = yes }
religion = religion:christianity_religion
}
situation:the_christian_church ?= {
add_manual_participant = prev
}
}
if = {
limit = {
government_has_flag = government_is_landless_adventurer
OR = {
scope:transfer_type = flag:inheritance
scope:transfer_type = flag:appointment_succession
}
religion = religion:christianity_religion
OR = {
scope:title = { has_clerical_region = yes }
scope:title = { has_title_law = clerical_appointment_law }
scope:previous_holder = { has_realm_law = clerical_appointment_law }
}
any_held_title = { has_variable = adventurer_creation_reason }
}
destroy_laamp_effect = { ADVENTURER = root }
change_government = ecclesiastical_government
}
if = {
limit = {
OR = {
scope:title = title:d_coptic_papacy
scope:title = title:d_apostolic_church
}
}
change_government = ecclesiastical_government
}
pam_align_theocracy_with_faith_government_effect = yes
# The three-year pulse is too slow for a non-Christian clerical court landed mid-game, which has no other Clerical Appointment candidates
if = {
limit = {
pam_government_is_religious_playable_trigger = yes
religion != religion:christianity_religion
NOT = { exists = primary_heir }
}
pam_seed_monk_courtiers_effect = yes
}
if = {
limit = { scope:title = title:d_benedictine_order }
set_variable = { name = benedictine }
}
if = {
limit = { scope:title = title:k_papal_state }
enforce_papal_latin_court_language_effect = yes
# PAM - track how many Popes in a row have been of the same dynasty
pam_the_christian_church_papal_dynasty_capture_catalyst_effect = yes
if = {
limit = {
faith = { has_doctrine_parameter = has_clerical_electors }
NOT = { has_realm_law = theocratic_elective_succession_law }
}
add_realm_law_skip_effects = theocratic_elective_succession_law
}
}
# Move a county+ Realm Priest Puppet to Clerical Ruler while the puppeteer slot is still free
if = {
limit = {
is_clergy = yes
scope:title.tier >= tier_county
highest_held_title_tier = scope:title.tier
exists = puppeteer
is_puppet_of_type = theological_agent_puppet
}
pam_make_clerical_ruler_puppet_effect = { PUPPETEER = puppeteer }
}
scope:previous_holder ?= {
if = {
limit = {
NOT = { exists = clerical_elector_title }
is_alive = yes
}
remove_character_flag = cardinal_flag
}
if = {
limit = {
is_alive = yes
OR = {
scope:title = { has_clerical_region = yes }
root.clerical_elector_title ?= scope:title
}
NOR = {
exists = clerical_elector_title
any_held_title = { has_clerical_region = yes }
}
}
situation:the_christian_church ?= {
if = {
limit = { is_manual_participant = prev }
remove_manual_participant = prev
}
}
}
}
# An inherited antipope title carries its Flavourization flag to the heir
if = {
limit = {
scope:title.tier = tier_kingdom
pam_is_antipope_trigger = yes
}
add_character_flag = antipope_flag
}
scope:previous_holder ?= {
if = {
limit = {
is_alive = yes
has_character_flag = antipope_flag
pam_is_antipope_trigger = no
}
remove_character_flag = antipope_flag
}
}
# PAM: a player's kin takes a great office of the Church
# pam_establish_antipope_effect waits for this
# The challenger registers only after the title change
if = {
limit = {
religion = religion:christianity_religion
pam_title_is_church_seat_trigger = { TITLE = scope:title }
}
pam_family_becomes_prelate_effect = {
TITLE = scope:title
KIND = flag:head_of_faith
}
}
else_if = {
limit = {
religion = religion:christianity_religion
scope:title = { has_clerical_region = yes }
NOT = {
any_held_title = {
has_clerical_region = yes
this != scope:title
}
}
}
pam_family_becomes_prelate_effect = {
TITLE = scope:title
KIND = flag:archbishop
}
}
# PAM - a Christian prelate takes a landed title outside the clerical regions
pam_the_christian_church_clergy_gained_landed_title_catalyst_effect = yes
if = {
limit = {
religion = religion:christianity_religion
scope:title = { has_clerical_region = yes }
exists = scope:previous_holder
}
pam_react_to_new_archbishop_effect = { TITLE = scope:title }
}
pam_offer_great_schism_stance_effect = yes
######################
# COUNTY-TIER TITLES #
######################
if = {
limit = {
scope:title.tier = tier_county
@ -230,7 +455,6 @@ on_title_gain = {
###########
if = {
limit = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
scope:title = {
is_nomad_title = yes
exists = title_domicile
@ -240,7 +464,6 @@ on_title_gain = {
if = {
limit = {
root = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
any_held_title = {
is_nomad_title = yes
exists = title_domicile
@ -251,7 +474,6 @@ on_title_gain = {
if = {
limit = {
root = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
any_held_title = {
is_nomad_title = yes
exists = title_domicile
@ -287,7 +509,6 @@ on_title_gain = {
}
else_if = {
limit = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
exists = var:player_domicile_title
}
root = {
@ -303,7 +524,6 @@ on_title_gain = {
title_domicile = {
if = {
limit = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
exists = root.dynasty
scope:previous_holder.dynasty ?= root.dynasty
}
@ -330,7 +550,6 @@ on_title_gain = {
root = {
random_held_title = {
limit = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
is_nomad_title = yes
exists = title_domicile
NOT = { this = scope:title }
@ -355,9 +574,6 @@ on_title_gain = {
root = {
random_held_title = {
limit = {
root = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
}
is_nomad_title = yes
exists = title_domicile
NOT = { this = scope:title }
@ -368,7 +584,6 @@ on_title_gain = {
title_domicile = {
if = {
limit = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
exists = root.dynasty
scope:previous_holder.dynasty ?= root.dynasty
}
@ -385,7 +600,6 @@ on_title_gain = {
if = {
limit = {
exists = global_var:game_has_started
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
NOT = {
exists = previous_holder
}
@ -393,7 +607,6 @@ on_title_gain = {
if = {
limit = {
root = {
NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles }
OR = {
house.house_head ?= {
this != root
@ -586,12 +799,12 @@ on_title_gain = {
has_character_flag = domicile_culture_and_faith_check
OR = {
domicile.domicile_culture != scope:title.culture
domicile.domicile_faith != scope:title.faith
domicile.domicile_rite != scope:title.rite
}
}
domicile = {
set_domicile_culture = scope:title.culture
set_domicile_faith = scope:title.faith
set_domicile_rite = scope:title.rite
}
remove_character_flag = domicile_culture_and_faith_check
}
@ -607,8 +820,8 @@ on_title_gain = {
}
}
if = {
limit = { domicile.domicile_faith != scope:title.faith }
scope:title = { set_county_faith = root.domicile.domicile_faith }
limit = { domicile.domicile_rite != scope:title.rite }
scope:title = { set_county_rite = root.domicile.domicile_rite }
}
}
}
@ -796,6 +1009,24 @@ on_title_gain = {
}
}
###########
# CE1 - Isolated Capital only carries over to a successor
###########
if = {
limit = {
scope:title = { has_county_modifier = isolate_capital_decision_modifier }
NOR = {
scope:transfer_type = flag:inheritance
scope:transfer_type = flag:abdication
scope:transfer_type = flag:appointment_succession
scope:transfer_type = flag:election
}
}
scope:title = {
remove_county_modifier = isolate_capital_decision_modifier
}
}
###########
# EP3 ADVENTURERS BECOMING LANDED
###########
@ -1673,6 +1904,30 @@ on_title_gain = {
# trigger_event = roman_restoration.0005
# }
#Mongol empire and GoK should lose other empires
if = {
limit = {
primary_title ?= {
OR = {
this = title:e_mongol_empire
AND = {
exists = global_var:greatest_of_khans_title
this = global_var:greatest_of_khans_title
}
}
}
scope:title = {
NOR = {
this = title:e_mongol_empire
AND = {
exists = global_var:greatest_of_khans_title
this = global_var:greatest_of_khans_title
}
}
}
is_ai = yes
}
destroy_title = scope:title
}
# You just inherited an Emperor title!!
if = {
limit = {
@ -1792,6 +2047,70 @@ on_title_gain = {
# value = yes
# }
# }
# TGP CEREMONIAL RULER
# IMPERIAL INHERITANCE
else_if = {
limit = {
scope:title = {
this = title:k_france
}
NOR = {
dynasty = { this = dynasty:25061 } # Not held by a Karling
any_liege_or_above = {
dynasty = { this = dynasty:25061 } # And does not have a liege that is a Karling
}
has_global_variable = west_francia_renamed
}
}
trigger_event = {
id = title_event.0001
days = 1
}
}
# East Francia becomes Germany when no longer controlled by a Karling
else_if = {
limit = {
scope:title = {
this = title:k_east_francia
}
NOR = {
dynasty = { this = dynasty:25061 } # Not held by a Karling
any_liege_or_above = {
dynasty = { this = dynasty:25061 } # And does not have a liege that is a Karling
}
has_global_variable = east_francia_renamed
}
}
trigger_event = {
id = title_event.0002
days = 1
}
}
# Hidden management event to determine if we need to axe Asturias &, if we do, what notification events to send out afterwards.
else_if = {
limit = {
scope:title = title:k_castille
title:k_asturias = {
# Leon must be de jure part of Asturias, or else there's no reason to ever stop calling it Asturias.
any_in_de_jure_hierarchy = { this = title:d_leon }
}
}
trigger_event = {
id = title_event.0011
days = 1
}
}
# FP2 El Cid Achievement
else_if = {
limit = {
scope:title = title:k_valencia
has_character_flag = fp2_el_cid_blood_relation_legacy
}
set_global_variable = { # DO. NOT. USE. add_achievement_global_variable_effect. IT BREAKS THE ACHIEVEMENT.
name = fp2_el_cid_achievement_unlocked
value = yes
}
}
# TGP CEREMONIAL RULER
# IMPERIAL INHERITANCE
else_if = {
@ -2095,7 +2414,6 @@ on_title_gain = {
}
if = { # Get legitimacy from Reception Hall House Bonus
limit = {
exists = house
house = { has_variable = ep3_legacy_legitimacy_counter }
primary_title = scope:title
}
@ -2243,7 +2561,6 @@ on_title_gain = {
top_liege = root.top_liege
government_has_mechanic = administrative
this != scope:title_gainer
# scope:title != title:k_chrysanthemum_throne
}
send_interface_message = {
type = msg_admin_title_gained
@ -2343,7 +2660,7 @@ on_title_gain = {
# TGP, bow before liege mandated
if = {
limit = {
culture ?= { has_cultural_parameter = must_pledge_loyalty_to_liege }
culture = { has_cultural_parameter = must_pledge_loyalty_to_liege }
}
if = { # if you are now the top liege, all your direct vassals with the same parameter who have not yet sworn fealty to you must swear fealty
limit = {
@ -2353,7 +2670,7 @@ on_title_gain = {
every_vassal = {
if = {
limit = {
culture ?= { has_cultural_parameter = must_pledge_loyalty_to_liege }
culture = { has_cultural_parameter = must_pledge_loyalty_to_liege }
OR = {
government_has_flag = government_is_feudal
government_has_flag = government_is_clan
@ -2372,7 +2689,7 @@ on_title_gain = {
}
else_if = { # if you now have a new liege, and they also follow a culture with the Pay Homage requirement, you must swear continued fealty
limit = {
liege.culture ?= { has_cultural_parameter = must_pledge_loyalty_to_liege }
liege.culture = { has_cultural_parameter = must_pledge_loyalty_to_liege }
OR = {
government_has_flag = government_is_feudal
government_has_flag = government_is_clan
@ -2535,7 +2852,7 @@ on_title_gain = {
if = {
limit = {
has_character_flag = peasant_outfit
NOT = { government_has_flag = government_is_true_herder }
NOT = { government_has_flag = government_is_herder }
}
remove_character_flag = peasant_outfit
}
@ -3056,8 +3373,15 @@ on_title_gain = {
}
}
events = {
roman_restoration.0005 #New Roman Emperor gets Augustus trait. (old holder, if still alive, loses it)
roman_restoration.0199 #Restoring the Pentarchy.
title_event.0021 # Rename/recolor Britannia based on founder's culture; applied immediately on creation
delay = { days = 1 }
realm_maintenance.2001 #Big notification about inheriting emperor tier title
british_isles.1032 # Danelaw-England partition calc.
title_event.0001 # Rename West Francia to France
title_event.0002 # Rename East Francia to Germany
title_event.0011 # Asturias becomes Leon upon emergence of Castille
# If we weren't already in a diarchy but should be, put us in one.
diarchy.0011
ep3_emperor_yearly.2020 # EP3: The Patriarch refuses to crown you as new emperor because you have a criminal trait
@ -3110,7 +3434,6 @@ on_title_gain_inheritance = {
root = {
becomes_independent = { change = scope:change }
}
resolve_title_and_vassal_change = scope:change
}
# if = {
# limit = {
@ -3258,7 +3581,7 @@ on_title_gain_usurpation = {
# scope:new_holder = new holder.
on_title_lost = {
events = {
# british_isles.1033 # Danelaw-England partition calc.
british_isles.1033 # Danelaw-England partition calc.
}
effect = {
@ -3296,7 +3619,7 @@ on_title_lost = {
if = {
limit = {
#We only want to grab tribal cultures.
culture ?= {
culture = {
NOT = { has_cultural_era_or_later = culture_era_early_medieval }
}
#Must have lost their last piece of land.
@ -3400,7 +3723,7 @@ on_title_lost = {
custom_tooltip = msg_rival_dethroned_desc
stress_and_fulfillment_impact = {
stress_impact = {
base = medium_stress_loss
vengeful = medium_stress_loss
}
@ -4725,8 +5048,37 @@ on_vassal_change = {
limit = {
liege = root # I.e. root is independent
}
# And is not of a high enough rank, change government
if = {
limit = {
is_landed = no
any_held_title = {
is_noble_family_title = yes
}
}
if = {
limit = {
domicile.domicile_location.county.holder.top_liege ?= {
government_allows = noble_families
highest_held_title_tier > root.highest_held_title_tier
}
}
create_title_and_vassal_change = {
type = swear_fealty
save_scope_as = change
add_claim_on_loss = no
}
change_liege = {
liege = domicile.domicile_location.county.holder.top_liege
change = scope:change
}
resolve_title_and_vassal_change = scope:change
}
else = {
trigger_event = ep3_laamps.0002
}
}
# And is not of a high enough rank, change government
else_if = {
limit = {
administrative_tier_allows_independence = no
}

File diff suppressed because it is too large Load diff