A lot of updating, making republics work

This commit is contained in:
Thakia 2026-11-24 16:18:56 -03:00
parent 09fb57c091
commit 4d6f569e96
99 changed files with 9792 additions and 9342 deletions

View file

@ -35,13 +35,30 @@ on_army_monthly = {
# scope:war is the war causing the previous controller and the occupant to be hostile
on_county_occupied = {
effect = {
# #Guelphs & Ghibellines
# if = {
# limit = {
# scope:county = title:c_roma
# exists = scope:county.holder
# is_ghibelline_trigger = yes
# scope:war ?= {
# NOT = { has_variable = gg_rome_occupied }
# }
# }
# scope:war = { set_variable = gg_rome_occupied }
# gg_triggered_catalyst_effect = {
# ACTOR = root
# RECIPIENT = scope:county.holder
# CATALYST = catalyst_gg_rome_occupied
# }
# }
random = { # chance of granting a knight eligibility for marauder / besieger accolade
chance = 2
modifier = {
factor = accolade_progress
}
modifier = {
NOT = {
if = {
limit = {
any_knight = {
OR = {
can_be_acclaimed = yes
@ -50,7 +67,7 @@ on_county_occupied = {
}
}
knight_army ?= {
location.county = scope:county
location.county ?= scope:county
}
OR = {
AND = { # needed for besieger
@ -70,159 +87,158 @@ on_county_occupied = {
}
}
}
factor = 0
}
set_variable = {
name = accolade_progress
value = 0
}
random_list = {
10 = { # marauder
trigger = {
any_knight = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
set_variable = {
name = accolade_progress
value = 0
}
random_list = {
10 = { # marauder
trigger = {
any_knight = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
}
}
knight_army ?= {
location.county ?= scope:county
}
NOT = {
has_trait = compassionate
}
marauder_attribute_trigger = no
}
}
random_knight = {
limit = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
}
}
knight_army ?= {
location.county ?= scope:county
}
NOT = {
has_trait = compassionate
}
marauder_attribute_trigger = no
}
weight = {
base = 1
modifier = {
add = 60
is_acclaimed = yes
}
modifier = {
add = 30
has_trait = sadistic
}
modifier = {
add = 30
has_trait = callous
}
modifier = {
add = 30
has_trait = wrathful
}
modifier = {
add = 30
has_trait = greedy
}
}
knight_army ?= {
location.county = scope:county
}
NOT = {
has_trait = compassionate
}
marauder_attribute_trigger = no
save_scope_as = marauder
}
send_interface_message = {
type = msg_accolade_eligibility
title = accolade_marauder_unlock.t
left_icon = scope:marauder
right_icon = scope:recipient
custom_tooltip = accolade_marauder_unlock.tt
scope:marauder = {
set_variable = {
name = marauder_attribute_unlock
value = yes
}
}
}
}
random_knight = {
limit = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
10 = { # besieger
trigger = {
any_knight = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
}
}
knight_army ?= {
location.county ?= scope:county
any_army_maa_regiment = {
is_unit_type = siege_weapon
}
}
besieger_attribute_trigger = no
}
}
random_knight = {
limit = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
}
}
knight_army ?= {
location.county ?= scope:county
any_army_maa_regiment = {
is_unit_type = siege_weapon
}
}
besieger_attribute_trigger = no
}
weight = {
base = 1
modifier = {
add = 60
is_acclaimed = yes
}
modifier = {
add = 30
has_trait = calm
}
modifier = {
add = 30
has_trait = patient
}
}
knight_army ?= {
location.county = scope:county
}
NOT = {
has_trait = compassionate
}
marauder_attribute_trigger = no
save_scope_as = besieger
}
weight = {
base = 1
modifier = {
add = 60
is_acclaimed = yes
}
modifier = {
add = 30
has_trait = sadistic
}
modifier = {
add = 30
has_trait = callous
}
modifier = {
add = 30
has_trait = wrathful
}
modifier = {
add = 30
has_trait = greedy
}
send_interface_message = {
type = msg_accolade_eligibility
title = accolade_besieger_unlock.t
left_icon = scope:besieger
right_icon = scope:recipient
custom_tooltip = accolade_besieger_unlock.tt
scope:besieger = {
set_variable = {
name = besieger_attribute_unlock
value = yes
}
}
}
save_scope_as = marauder
}
send_interface_message = {
type = msg_accolade_eligibility
title = accolade_marauder_unlock.t
left_icon = scope:marauder
right_icon = scope:recipient
custom_tooltip = accolade_marauder_unlock.tt
scope:marauder = {
set_variable = {
name = marauder_attribute_unlock
value = yes
}
}
}
}
10 = { # besieger
trigger = {
any_knight = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
}
}
knight_army ?= {
location.county = scope:county
any_army_maa_regiment = {
is_unit_type = siege_weapon
}
}
besieger_attribute_trigger = no
}
}
random_knight = {
limit = {
OR = {
can_be_acclaimed = yes
accolade ?= {
accolade_can_have_more_attributes = yes
}
}
knight_army ?= {
location.county = scope:county
any_army_maa_regiment = {
is_unit_type = siege_weapon
}
}
besieger_attribute_trigger = no
}
weight = {
base = 1
modifier = {
add = 60
is_acclaimed = yes
}
modifier = {
add = 30
has_trait = calm
}
modifier = {
add = 30
has_trait = patient
}
}
save_scope_as = besieger
}
send_interface_message = {
type = msg_accolade_eligibility
title = accolade_besieger_unlock.t
left_icon = scope:besieger
right_icon = scope:recipient
custom_tooltip = accolade_besieger_unlock.tt
scope:besieger = {
set_variable = {
name = besieger_attribute_unlock
value = yes
}
}
}
}
}
}
}
scope:county = {
if = {
limit = {
holder = {
NOT = { has_perk = enduring_hardships_perk }
NOT = { has_perk = a_mans_home_perk }
}
}
change_county_control = county_control_loss_value
@ -413,7 +429,7 @@ on_siege_completion = {
}
}
}
# If you have the Sacred Destruction tenet get piety/destroy development
# If you have the Sacred Destruction tenet get piety/destroy prosperity
if = {
limit = {
rite = { rite_has_parameter = successful_sieges_give_piety }
@ -509,60 +525,88 @@ on_siege_completion = {
army_commander ?= {
if = {
limit = {
has_trait = military_engineer
is_commanding_army = yes
location.barony = scope:barony
}
add_trait_xp = {
trait = military_engineer
value = {
value = location.fort_level
divide = 2
min = 1
add = {
value = martial
divide = 20
if = {
limit = { has_trait = military_engineer }
add_trait_xp = {
trait = military_engineer
value = {
value = location.fort_level
divide = 2
min = 1
add = {
value = martial
divide = 20
}
}
}
}
if = {
limit = { has_trait = reaver }
add_trait_xp = {
trait = reaver
value = {
value = 0.2
add = {
value = martial
divide = 20
}
}
}
}
if = {
limit = { has_trait = peasant_leader }
add_trait_xp = {
trait = peasant_leader
value = {
value = 0.1
add = {
value = martial
divide = 20
}
}
}
}
}
}
army_commander ?= {
if = {
limit = {
has_trait = reaver
is_commanding_army = yes
location.barony = scope:barony
}
add_trait_xp = {
trait = reaver
value = {
value = 0.2
add = {
value = martial
divide = 20
if = {
limit = {
army_owner = {
government_has_flag = government_has_merit
OR = {
this = root
AND = {
exists = scope:war
is_participant_in_war = scope:war
NOT = { is_at_war_with = root }
}
}
}
}
}
army_commander ?= {
if = {
limit = {
has_trait = peasant_leader
is_commanding_army = yes
}
add_trait_xp = {
trait = peasant_leader
value = {
value = 0.1
add = {
value = martial
divide = 20
}
save_temporary_scope_as = siege_army
army_commander ?= {
if = {
limit = { can_gain_military_career_merit_trigger = yes }
send_interface_message = {
type = msg_siege_effect
title = msg_military_merit_siege_won
left_icon = this
right_icon = scope:barony
change_merit = minor_merit_gain
}
}
}
army_owner = {
every_knight = {
limit = {
knight_army ?= scope:siege_army
can_gain_military_career_merit_trigger = yes
}
change_merit = miniscule_merit_gain
}
}
}
}
}
@ -642,50 +686,60 @@ on_siege_looting = {
}
effect = {
scope:barony.title_province ?= {
# Adventurer Siege replenish
every_army_in_location = {
limit = {
OR = {
AND = {
root = { is_landless_adventurer = yes }
army_owner = root
}
army_owner = {
is_landless_adventurer = yes
is_at_war = yes
any_war_ally = { this = root }
}
}
}
every_army_maa_regiment = {
save_scope_as = sieger
scope:barony = {
title_province ?= {
save_scope_as = siege_province
# Adventurer Siege replenish
every_army_in_location = {
limit = {
maa_current_troops_count < maa_max_troops_count
OR = {
AND = {
root = { is_landless_adventurer = yes }
army_owner = root
}
army_owner = {
is_landless_adventurer = yes
is_at_war = yes
any_war_ally = { this = root }
}
}
}
every_army_maa_regiment = {
limit = { maa_current_troops_count < maa_max_troops_count }
change_maa_troops_count = adventurer_siege_replenish_amount
}
change_maa_troops_count = adventurer_siege_replenish_amount
}
}
# Strict Organization
every_army_in_location = {
limit = {
OR = {
AND = {
root = {
# Strict Organization
every_army_in_location = {
limit = {
OR = {
AND = {
root = {
is_landless_adventurer = yes
has_perk = strict_organization_perk
}
army_owner = root
}
army_owner = {
is_landless_adventurer = yes
has_perk = strict_organization_perk
is_at_war = yes
any_war_ally = { this = root }
}
army_owner = root
}
army_owner = {
is_landless_adventurer = yes
has_perk = strict_organization_perk
is_at_war = yes
any_war_ally = { this = root }
}
}
army_owner.domicile ?= { change_provisions = adventurer_siege_provisions_amount }
}
army_owner = {
domicile ?= { change_provisions = adventurer_siege_provisions_amount }
add_province_modifier = {
modifier = recently_looted_modifier
years = 5
}
}
trade_market = {
add_trade_market_modifier = {
modifier = gdp_market_recently_sieged_capacity_modifier
years = 5
}
}
trade_market = {
@ -705,12 +759,9 @@ on_siege_looting = {
}
}
}
#Gain some gold on top of the siege loot from the Master of Spoils Camp Officer
if = {
limit = {
employs_court_position = master_of_spoils_camp_officer
}
limit = { employs_court_position = master_of_spoils_camp_officer }
add_gold = {
value = court_position:master_of_spoils_camp_officer.aptitude:master_of_spoils_camp_officer
add = 1
@ -762,12 +813,11 @@ on_army_enter_province = {
1 = epidemic_events.1120 # Corpse catapult event
}
effect = {
save_scope_as = army_owner
# Commander trait leveling
scope:army.army_commander ?= {
if = {
limit = {
has_trait = logistician
}
limit = { has_trait = logistician }
add_trait_xp = {
trait = logistician
value = {
@ -780,9 +830,7 @@ on_army_enter_province = {
}
}
if = {
limit = {
has_trait = organizer
}
limit = { has_trait = organizer }
add_trait_xp = {
trait = organizer
value = {
@ -1067,7 +1115,7 @@ on_raid_action_completion = {
if = {
limit = {
holder = {
NOT = { has_perk = enduring_hardships_perk }
NOT = { has_perk = a_mans_home_perk }
}
}
change_county_control = raid_county_control_loss_value
@ -1096,6 +1144,9 @@ on_raid_action_completion = {
}
every_in_list = {
list = raid_targets
limit = {
NOT = { this = scope:raider }
}
send_interface_message = {
type = msg_raid_lost
left_icon = scope:raider

View file

@ -34,7 +34,6 @@ on_barter_action_completion = {
desc = msg_barter_completed_barterer_desc
left_icon = scope:county.holder
right_icon = scope:barony
show_as_tooltip = {
add_loot = scope:value
scope:barony = {

View file

@ -85,7 +85,7 @@ on_death = {
is_ruler = yes
top_liege != this
has_variable = {
name = vassal_directive_improve_development
name = vassal_directive_improve_prosperity
name = vassal_directive_train_commanders
name = vassal_directive_build_maa
name = vassal_directive_convert_faith
@ -97,7 +97,7 @@ on_death = {
}
primary_heir ?= {
has_none_of_variables = {
name = vassal_directive_improve_development
name = vassal_directive_improve_prosperity
name = vassal_directive_train_commanders
name = vassal_directive_build_maa
name = vassal_directive_convert_faith
@ -111,9 +111,9 @@ on_death = {
}
if = {
limit = {
has_variable = vassal_directive_improve_development
has_variable = vassal_directive_improve_prosperity
}
primary_heir ?= { set_variable = vassal_directive_improve_development }
primary_heir ?= { set_variable = vassal_directive_improve_prosperity }
}
else_if = {
limit = {
@ -193,6 +193,12 @@ on_death = {
famed_parent = scope:famous_parent
}
}
scope:new_memory = {
set_variable = {
name = parent_fame_lvl
value = scope:famous_parent.prestige_level
}
}
trigger_event = {
id = bp2_yearly.4010
days = 5
@ -234,6 +240,12 @@ on_death = {
pious_parent = scope:pious_parent
}
}
scope:new_memory = {
set_variable = {
name = parent_piety_lvl
value = scope:pious_parent.piety_level
}
}
trigger_event = {
id = bp2_yearly.4020
days = 10
@ -314,6 +326,92 @@ on_death = {
}
}
# Dead character has debtors who their heir should inherit (make them have a money claim)
if = {
limit = {
any_in_list = { variable = owes_me_money }
}
save_scope_as = dead_lender
if = { # Reversed form of story_cycle_loan on_owner_death, but for the lender
limit = { primary_heir ?= { is_alive = yes } }
primary_heir = { save_scope_as = new_lender }
every_in_list = {
variable = owes_me_money
save_scope_as = debtor
every_owned_story = {
limit = {
story_type = story_cycle_loan
var:lender = scope:dead_lender
NOR = {
story_owner = scope:new_lender
var:lender = { is_player_heir_of = scope:new_lender }
}
}
save_scope_as = inherited_loan
scope:new_lender = {
send_interface_toast = {
type = event_toast_effect_neutral
title = ho_debt_inherited_title
left_icon = scope:debtor
right_icon = scope:dead_lender
custom_description = {
text = ho_debt_inherited_lender_tt
subject = scope:debtor
object = scope:dead_lender
value = scope:inherited_loan.var:amount_owed
}
}
}
scope:debtor = {
send_interface_toast = {
type = event_toast_effect_neutral
title = ho_debt_inherited_title
left_icon = scope:new_lender
right_icon = scope:dead_lender
custom_description = {
text = ho_debt_inherited_debtor_tt
subject = scope:new_lender
object = scope:dead_lender
value = scope:inherited_loan.var:amount_owed
}
transfer_loan_effect = {
OLD_LOAN = scope:inherited_loan
NEW_LENDER = scope:new_lender
NEW_DEBTOR = scope:debtor
}
}
}
}
}
}
else = { # Wipe loans if you have no heir
every_in_list = {
variable = owes_me_money
every_owned_story = {
limit = {
story_type = story_cycle_loan
var:lender = scope:dead_lender
}
save_scope_as = wiped_loan
story_owner = {
send_interface_toast = {
type = event_toast_effect_neutral
title = ho_debt_wiped_title
right_icon = scope:dead_lender
custom_description = {
text = ho_debt_wiped_debtor_tt
subject = this
object = scope:dead_lender
value = scope:wiped_loan.var:amount_owed
}
scope:wiped_loan = { end_loan_story_effect = yes }
}
}
}
}
}
}
if = { # Lower Grandeur a little bit on death
limit = {
has_royal_court = yes
@ -349,85 +447,79 @@ on_death = {
# }
# destroy_title = title:e_mongol_empire
# }
# 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.
this = character:90107
highest_held_title_tier = tier_kingdom
has_realm_law = confederate_partition_succession_law
# Bavaria should be in a fit state for interfering with the handout order.
title:k_bavaria = {
OR = {
is_title_created = no
holder = root
}
any_in_de_jure_hierarchy = {
tier = tier_county
# More than 50%.
count >= 22
holder = {
any_liege_or_above = { this = root }
}
}
}
NOT = { has_primary_title = title:k_bavaria }
NOT = { exists = designated_heir }
is_valid_designated_heir = character:42019
}
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 }
}
}
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
}
#
# # 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.
# this = character:90107
# highest_held_title_tier = tier_kingdom
# has_realm_law = confederate_partition_succession_law
# # Bavaria should be in a fit state for interfering with the handout order.
# title:k_bavaria = {
# OR = {
# is_title_created = no
# holder = root
# }
# any_in_de_jure_hierarchy = {
# tier = tier_county
# # More than 50%.
# count >= 22
# holder = {
# any_liege_or_above = { this = root }
# }
# }
# }
# NOT = { has_primary_title = title:k_bavaria }
# NOT = { exists = designated_heir }
# is_valid_designated_heir = character:42019
# }
# 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 }
# }
# }
# 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
# }
# }
# character:42018 = {
# trigger_event = {
# on_action = ludwig_german_salzburg_to_karlmann
# days = 1
# }
# }
# }
# Diarchies
## Handle regency loyalties.
@ -567,7 +659,7 @@ on_death = {
primary_heir = { save_scope_as = new_wedding_host }
}
if = { # If such an heir exists, copy all involved scopes, clean up, and recreate the promise on all relevant characters
limit = {
limit = {
exists = scope:new_wedding_host
has_variable = promised_grand_wedding_to
}
@ -658,9 +750,9 @@ on_death = {
# Send relevant event to player heir
if = {
limit = {
exists = player_heir
exists = involved_activity
is_travelling = yes
exists = player_heir
# Tour has their own death invalidation event
trigger_if = {
limit = {
@ -1107,7 +1199,10 @@ on_death = {
# Court position boon invalidation
if = {
limit = { exists = var:booner_target }
limit = {
exists = var:booner_target
exists = employer
}
employed_booner_invalidation_effect = { EMPLOYEE = root LIEGE = root.employer }
}
# Cleanup booner focus on dead courtiers
@ -2030,7 +2125,7 @@ on_death = {
if = {
limit = {
OR = {
NOT = {
NOT = {
player_heir = { has_variable = not_subject_to_succession_trials }
}
primary_title.tier > player_heir.primary_title.tier
@ -2174,7 +2269,7 @@ on_death = {
}
if = {
limit = { is_playable_character = no }
set_player_character = top_liege.primary_title.var:administrative_ui_special_title.holder
set_player_character = ceremonial_liege
}
create_title_and_vassal_change = {
type = appointment
@ -2183,7 +2278,7 @@ on_death = {
random_held_title = {
limit = { is_noble_family_title = yes }
change_title_holder = {
holder = top_liege.primary_title.var:administrative_ui_special_title.holder
holder = ceremonial_liege
change = scope:change
}
}
@ -2220,6 +2315,7 @@ on_death = {
}
}
}
#Beatify dead order founders
if = {
limit = {
@ -2274,7 +2370,7 @@ on_death = {
}
if = {
limit = {
primary_title = {
primary_title ?= {
has_variable = founder
var:founder = {
is_alive = yes
@ -2338,6 +2434,7 @@ on_death = {
else = {
add_trait = saint
}
#TODO_PAM_JC order should lose worldliness from its founder becoming a saint
}
#PAM - Holy Myron: the herb-gathering chaplain dies en route; inform whoever sent them
if = {
@ -2704,6 +2801,29 @@ ce3_theocrat_dynasty_chain_succession = {
}
}
## Root = Karlmann, one day after Ludwig the German died with Ludwig the Younger as designated heir
## change_liege does nothing until Karlmann outranks the archbishop, so we wait until he is King of Bavaria
#ludwig_german_salzburg_to_karlmann = {
# trigger = {
# has_title = title:k_bavaria
# title:d_et_salzburg.holder ?= { is_vassal_of = character:42019 }
# }
# effect = {
# 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 = root
# change = scope:salzburg_change
# }
# }
# resolve_title_and_vassal_change = scope:salzburg_change
# }
#}
# 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

File diff suppressed because it is too large Load diff

View file

@ -482,6 +482,7 @@ on_holy_site_artifact_removed = {
custom = every_zealot_fellow_vassal
vassal_stance = zealot
limit = {
this != scope:actor
faith = scope:actor.faith
}
add_opinion = {

View file

@ -373,6 +373,7 @@ on_building_completed = {
scope:character = {
every_character_struggle = {
involvement = involved
limit = { phase_has_catalyst = catalyst_new_building_in_castle }
activate_struggle_catalyst = {
catalyst = catalyst_new_building_in_castle
character = scope:character
@ -393,6 +394,7 @@ on_building_completed = {
scope:character = {
every_character_struggle = {
involvement = involved
limit = { phase_has_catalyst = catalyst_new_building_in_city }
activate_struggle_catalyst = {
catalyst = catalyst_new_building_in_city
character = scope:character
@ -413,6 +415,7 @@ on_building_completed = {
scope:character = {
every_character_struggle = {
involvement = involved
limit = { phase_has_catalyst = catalyst_new_building_in_temple }
activate_struggle_catalyst = {
catalyst = catalyst_new_building_in_temple
character = scope:character
@ -736,9 +739,6 @@ on_building_completed = {
years = 30
}
}
# Brewery counter
brewery_counter_effect = yes
# Coronation Promise
if = {

View file

@ -739,6 +739,7 @@ on_rite_edited = {
# Root is the converted character
# scope:old_faith is the faith they used to have
# scope:old_rite is the rite they used to have
# scope:actor is the character instigating the conversion
# scope:founder is the character instigating the conversion
on_faith_conversion = {
events = {
@ -901,6 +902,10 @@ on_faith_conversion = {
SPONSOR = root
FAITH = scope:old_faith
}
# #Remove Pope-specific GG modifiers
# gg_clean_up_pope_modifiers_effect = yes
# # Christian Situation participation management
# pam_conversion_christian_church_participation_effect = yes
}
}
@ -1186,7 +1191,10 @@ on_rite_change = {
}
pam_destroy_cardinal_title_effect = { CARDINALATE = clerical_elector_title }
}
# #Remove Pope-specific GG modifiers
# gg_clean_up_pope_modifiers_effect = yes
# # Christian Situation participation management
# pam_conversion_christian_church_participation_effect = yes
}
events = {
faith_conversion.0001 # convert capital
@ -1236,8 +1244,8 @@ on_faith_monthly = {
chance = 4 # Roughly once every 2 years
every_faith_rite = {
limit = {
exists = var:converted_development
var:converted_development >= 1
exists = var:converted_prosperity
var:converted_prosperity >= 1
NOT = {
rite_has_parameter = unreformed
}
@ -1245,7 +1253,7 @@ on_faith_monthly = {
save_scope_as = target_rite
# Save all suitable rulers
random = {
chance = var:converted_development
chance = var:converted_prosperity
save_scope_as = faith_target
every_independent_ruler = {
limit = {
@ -1315,7 +1323,7 @@ on_faith_monthly = {
}
add_to_list = migration_targets
}
# If the rite is still large, they only want to move to same-rite rulers
# If the faith is still large, they only want to move to same-rite rulers
if = {
limit = {
scope:target_rite = {
@ -1347,11 +1355,11 @@ on_faith_monthly = {
highest_held_title_tier >= tier_kingdom
}
modifier = {
add = scope:target_rite.var:converted_development
add = scope:target_rite.var:converted_prosperity
NOT = { government_has_flag = government_is_nomadic }
any_sub_realm_county = {
count >= {
value = scope:target_rite.var:converted_development
value = scope:target_rite.var:converted_prosperity
divide = 2
}
rite = scope:target_rite
@ -1440,11 +1448,12 @@ on_faith_monthly = {
highest_held_title_tier >= tier_kingdom
}
modifier = {
add = scope:target_rite.var:converted_development
add = scope:target_rite.var:converted_prosperity
NOT = { government_has_flag = government_is_nomadic }
any_sub_realm_county = {
count >= {
value = scope:target_rite.var:converted_development
value = scope:target_rite.var:converted_prosperity
divide = 2
}
faith = prev.faith
@ -1485,6 +1494,7 @@ faith_holy_order_land_acquisition_pulse = {
subtract = 5
}
every_ruler = {
faith_filter = root
limit = {
holy_order_1000_request_target_trigger = yes
}
@ -1567,6 +1577,7 @@ faith_heresy_events_pulse = {
pagan_conversion_pulse = {
trigger = { #Is the character ready to convert?
is_ai = yes
government_has_flag = government_is_tribal
OR = {
top_liege = this
AND = { # Steppe people convert a bit more often & freely
@ -1574,7 +1585,6 @@ pagan_conversion_pulse = {
primary_title.tier >= tier_duchy
}
}
government_has_flag = government_is_tribal
OR = {
has_realm_law = tribal_authority_2
has_realm_law = tribal_authority_3
@ -1624,7 +1634,7 @@ pagan_conversion_pulse = {
has_innovation = innovation_casus_belli
has_innovation = innovation_plenary_assemblies
has_innovation = innovation_ledger
has_innovation = innovation_development_01
has_innovation = innovation_prosperity_01
has_innovation = innovation_currency_01
}
}
@ -1750,7 +1760,13 @@ on_personal_tenet_loss = {
is_ai = no
NOT = { has_fulfillment_parameter = default_sf_personal_tenet_change_no_stress }
}
add_stress = major_stress_gain
if = {
limit = { culture = { has_cultural_parameter = civic_religion_reduced_tenet_change_stress } }
add_stress = medium_stress_gain
}
else = {
add_stress = major_stress_gain
}
}
hedonistic_obesity_modifier_sync_effect = yes
if = {
@ -1821,11 +1837,11 @@ update_main_rite_action = {
# Faith Rite Growth System #
############################
# Faith scope. Once a month per faith.
# Slowly spawns new rites until the faith reaches its target rite count: floor(counties / X) - 1
# branched rites besides the mainline, so the first branched rite arrives at 2 * X counties.
# Cooldown and target count live in game/common/script_values/02_religion_values.txt.
# Faith scope, once a month per faith
# Cooldown and target count are in 02_religion_values.txt
# Slowly spawns new rites until the faith reaches its target of floor(counties / X) - 1 branched rites besides the mainline
# So the first branched rite arrives at 2 * X counties
faith_rite_growth_pulse = {
trigger = {
NOR = {
@ -1991,7 +2007,7 @@ on_character_holy_site_created = {
effect = {
# Same holy-site slot rules as game start
scope:title.title_province = {
add_holy_site_fallback_special_building_slot_effect = { FAITH = scope:faith }
add_holy_site_fallback_special_district_slot_effect = { FAITH = scope:faith }
}
hidden_effect = {
if = {

View file

@ -21,6 +21,7 @@
# flag:faction_demand
# flag:swear_fealty
# flag:stepped_down
# flag:term_end
# flag:appointment
# flag:appointment_succession
# flag:migration
@ -61,6 +62,7 @@ on_title_destroyed = {
if = {
limit = {
is_ruler = yes
government_has_mechanic = administrative
top_liege = this
administrative_counts_can_be_independent = no
@ -88,6 +90,19 @@ on_title_destroyed = {
target = scope:landed_title
}
}
# Adjust the size of the merchants tally.
else_if = {
limit = {
# Pre-filter out anything higher or lower.
scope:landed_title = { tier = tier_county }
has_global_variable_list = merchants_tally
}
# We don't need to check the list twice, since if they're not in it then removing them from it won't do anything.
remove_list_global_variable = {
name = merchants_tally
target = scope:landed_title
}
}
# Empire Faith Gate: remove holder from empire-holders list when they lose their last empire.
else_if = {
limit = {
@ -232,6 +247,20 @@ on_title_destroyed = {
}
}
if = {
limit = { scope:landed_title = { is_noble_family_title = yes } }
hanseatic_sync_family_head_benefits_effect = { CHARACTER = root }
}
if = {
limit = {
scope:landed_title = {
tier = tier_county
is_noble_family_title = no
}
}
hanseatic_sync_county_benefits_effect = { COUNTY = scope:landed_title }
}
#########
# PAM #
#########
@ -249,6 +278,76 @@ on_title_destroyed = {
}
}
# A realm ruler's term has ended and the ruler for the next term has been decided (e.g. a republican election at term end)
# Fired from code later the same day. If the realm changed hands, on_title_gain has already fired with scope:transfer_type = flag:term_end
# root = the realm ruler for the next term
# scope:title = the primary title of the realm
# scope:previous_holder = the ruler whose term ended
# scope:new_holder = the realm ruler for the next term. Same as scope:previous_holder if they kept the realm (e.g. were re-elected)
# Does *not* provide scope:transfer_type
on_term_ended = {
on_actions = { on_term_ended_events }
effect = {
if = {
limit = { scope:previous_holder = scope:new_holder }
every_player = {
limit = {
OR = {
this = root
is_vassal_or_below_of = root
}
}
if = {
limit = { this = root }
send_interface_toast = {
type = event_toast_effect_good
title = term_ended_reelected_toast_self
left_icon = scope:title
custom_tooltip = term_ended_reelected_toast_self.desc
}
}
else = {
send_interface_toast = {
type = event_toast_effect_neutral
title = term_ended_reelected_toast
left_icon = scope:new_holder
right_icon = scope:title
custom_tooltip = term_ended_reelected_toast.desc
}
}
}
}
}
}
on_term_ended_events = {
effect = {
if = {
limit = { scope:previous_holder = scope:new_holder }
# Re-elected (root)
scope:title ?= {
every_full_assembly_member = {
limit = {
is_ai = no
}
trigger_event = republic_event.0051
}
}
}
else = {
# Elected (root = winner)
scope:title ?= {
every_full_assembly_member = {
limit = {
is_ai = no
}
trigger_event = republic_event.0050
}
}
}
}
}
# A title is transferred to a new character
# root = the new holder
# scope:title = the title that changes hands
@ -310,19 +409,44 @@ on_title_gain = {
if = {
limit = { clerical_elector_title ?= scope:title }
pam_strip_illegal_cardinalate_effect = yes
if = {
limit = { clerical_elector_title ?= scope:title }
add_character_flag = cardinal_flag
situation:the_christian_church ?= {
add_manual_participant = prev
}
}
# Also catches a sitting Head of Faith who is handed a cardinalate
pam_vacate_head_of_faith_cardinalate_effect = yes
}
# A cardinal handed the Church seat must vacate the cardinalate
else_if = {
limit = {
scope:title = {
OR = {
is_head_of_faith = yes
this = title:k_papal_state
}
}
}
pam_vacate_head_of_faith_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
limit = {
scope:transfer_type = flag:election
government_has_flag = government_is_republic
}
scope:title = {
every_full_assembly_member = {
if = {
limit = {
has_character_modifier = gdp_popular_mandate_modifier
}
remove_character_modifier = gdp_popular_mandate_modifier
}
}
}
}
if = {
limit = {
scope:transfer_type = flag:election
@ -402,10 +526,19 @@ on_title_gain = {
add_realm_law_skip_effects = theocratic_elective_succession_law
}
}
if = {
limit = {
scope:title = { is_head_of_faith = yes }
should_use_theocratic_elective_succession_law_trigger = yes
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
government_has_flag = government_is_theocracy
scope:title.tier >= tier_county
highest_held_title_tier = scope:title.tier
exists = puppeteer
@ -416,27 +549,32 @@ on_title_gain = {
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 }
if = {
limit = {
NOT = {
exists = clerical_elector_title
}
}
remove_character_flag = cardinal_flag
}
situation:the_christian_church ?= {
if = {
limit = { is_manual_participant = prev }
remove_manual_participant = prev
if = {
limit = {
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
}
}
}
}
@ -488,7 +626,6 @@ on_title_gain = {
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 = {
@ -1092,6 +1229,7 @@ on_title_gain = {
if = {
limit = {
scope:title = { is_landless_type_title = no }
highest_held_title_tier >= tier_duchy
any_held_title = {
title_tier = duchy
has_variable = adventurer_creation_reason
@ -1152,6 +1290,16 @@ on_title_gain = {
change_government = top_liege.government_type
}
}
if = {
limit = {
is_landed = no
exists = scope:title.title_domicile
location != default_location
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
}
#####################
# DUCHY-TIER TITLES #
@ -1191,53 +1339,41 @@ on_title_gain = {
}
# Transfer title-bound artifacts with the title it's associated with (This is present in two places in this on_action)
if = {
limit = {
scope:previous_holder ?= {
any_character_artifact = {
has_variable = artifact_succession_title #Is this an artifact that should follow a title?
var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist?
var:artifact_succession_title = scope:title #Scope title is the artifact title
scope:previous_holder ?= {
every_character_artifact = {
limit = {
var:artifact_succession_title ?= scope:title
scope:title = { is_title_created = yes }
}
if = {
limit = {
OR = {
scope:transfer_type = flag:conquest
scope:transfer_type = flag:conquest_holy_war
scope:transfer_type = flag:conquest_claim
scope:transfer_type = flag:conquest_populist
scope:transfer_type = flag:abdication
scope:transfer_type = flag:usurped
scope:transfer_type = flag:revoked
scope:transfer_type = flag:faction_demand
}
}
set_owner = {
target = root
history = {
type = conquest
actor = scope:previous_holder
recipient = root
location = scope:previous_holder.location
}
}
}
}
scope:previous_holder = {
every_character_artifact = {
limit = {
has_variable = artifact_succession_title #Is this an artifact that should follow a title?
var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist?
var:artifact_succession_title = scope:title #Scope title is the artifact title
}
if = {
limit = {
OR = {
scope:transfer_type = flag:conquest
scope:transfer_type = flag:conquest_holy_war
scope:transfer_type = flag:conquest_claim
scope:transfer_type = flag:conquest_populist
scope:transfer_type = flag:abdication
scope:transfer_type = flag:usurped
scope:transfer_type = flag:revoked
scope:transfer_type = flag:faction_demand
}
}
set_owner = {
target = root
history = {
type = conquest
actor = scope:previous_holder
recipient = root
location = scope:previous_holder.location
}
}
}
else = {
set_owner = {
target = root
history = {
type = inherited
recipient = root
}
else = {
set_owner = {
target = root
history = {
type = inherited
recipient = root
}
}
}
@ -1416,7 +1552,10 @@ on_title_gain = {
#####################
# KING+ TIER TITLES #
#####################
else = {
else_if = {
limit = {
scope:title.tier >= tier_kingdom
}
# Newly formed Hegemon of China should spruce up their council
# if = {
# limit = {
@ -1448,7 +1587,7 @@ on_title_gain = {
limit = {
OR = {
exists = scope:title.var:ceremonial_title
top_liege.primary_title.var:administrative_ui_special_title ?= scope:title
ceremonial_liege_title ?= scope:title
}
}
if = {
@ -1513,53 +1652,41 @@ on_title_gain = {
}
}
# Transfer title-bound artifacts with the title it's associated with (This is present in two places in this on_action)
if = {
limit = {
scope:previous_holder ?= {
any_character_artifact = {
has_variable = artifact_succession_title #Is this an artifact that should follow a title?
var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist?
var:artifact_succession_title = scope:title #Scope title is the artifact title
scope:previous_holder ?= {
every_character_artifact = {
limit = {
var:artifact_succession_title ?= scope:title
scope:title = { is_title_created = yes }
}
if = {
limit = {
OR = {
scope:transfer_type = flag:conquest
scope:transfer_type = flag:conquest_holy_war
scope:transfer_type = flag:conquest_claim
scope:transfer_type = flag:conquest_populist
scope:transfer_type = flag:abdication
scope:transfer_type = flag:usurped
scope:transfer_type = flag:revoked
scope:transfer_type = flag:faction_demand
}
}
set_owner = {
target = root
history = {
type = conquest
actor = scope:previous_holder
recipient = root
location = scope:previous_holder.location
}
}
}
}
scope:previous_holder = {
every_character_artifact = {
limit = {
has_variable = artifact_succession_title #Is this an artifact that should follow a title?
var:artifact_succession_title = { is_title_created = yes } #Does the title the artifact should follow exist?
var:artifact_succession_title = scope:title #Scope title is the artifact title
}
if = {
limit = {
OR = {
scope:transfer_type = flag:conquest
scope:transfer_type = flag:conquest_holy_war
scope:transfer_type = flag:conquest_claim
scope:transfer_type = flag:conquest_populist
scope:transfer_type = flag:abdication
scope:transfer_type = flag:usurped
scope:transfer_type = flag:revoked
scope:transfer_type = flag:faction_demand
}
}
set_owner = {
target = root
history = {
type = conquest
actor = scope:previous_holder
recipient = root
location = scope:previous_holder.location
}
}
}
else = {
set_owner = {
target = root
history = {
type = inherited
recipient = root
}
else = {
set_owner = {
target = root
history = {
type = inherited
recipient = root
}
}
}
@ -2033,14 +2160,14 @@ on_title_gain = {
remove_character_flag = ceremonial_liege_flag
remove_character_flag = ceremonial_regent_flag
}
top_liege.primary_title.var:administrative_ui_special_title.holder ?= {
ceremonial_liege ?= {
remove_character_flag = ceremonial_liege_flag
remove_character_flag = ceremonial_regent_flag
}
if = {
limit = { tgp_is_ceremonial_regent_trigger = yes } # Not 'actual' ruler
add_character_flag = ceremonial_regent_flag
top_liege.primary_title.var:administrative_ui_special_title.holder ?= { add_character_flag = ceremonial_liege_flag }
ceremonial_liege ?= { add_character_flag = ceremonial_liege_flag }
}
}
# West Francia becomes France when no longer controlled by a Karling
@ -2380,6 +2507,7 @@ on_title_gain = {
is_house_head = no
NOT = { exists = confederation }
exists = house.house_head.confederation
house.house_head.confederation = { is_house_based = no }
liege = house.house_head.liege
is_at_war = no
}
@ -2391,6 +2519,7 @@ on_title_gain = {
limit = {
government_is_japanese_trigger = yes
is_house_head = yes
scope:title = primary_title
}
trigger_event = {
weeks = { 2 4 }
@ -2456,6 +2585,11 @@ on_title_gain = {
if = {
limit = {
government_allows = noble_families
NOT = { scope:title.tier = tier_barony }
trigger_if = {
limit = { government_has_mechanic = administrative }
scope:title.tier >= min_appointment_tier
}
}
government_type = { save_scope_as = nf_gov_type }
# Note: anything that should be run after creation can go in on_noble_family_title_created
@ -2559,13 +2693,24 @@ on_title_gain = {
}
every_vassal_or_below = {
limit = {
is_playable_character = yes
OR = {
highest_held_title_tier >= main_administrative_tier # All governors
liege = root
exists = root.house
}
#normal triggering
every_vassal_or_below = {
limit = {
is_playable_character = yes
exists = scope:previous_holder
government_has_mechanic = administrative
OR = {
highest_held_title_tier >= main_administrative_tier # All governors
liege = root
}
}
trigger_event = {
id = ep3_governor_yearly.3060
days = 1
}
}
trigger_event = ep3_governor_yearly.3060
}
}
}
@ -2769,41 +2914,22 @@ on_title_gain = {
}
# Did I conquer a place with holy order leases not of my faith?
if = {
limit = {
scope:title = {
any_in_de_jure_hierarchy = {
tier = tier_barony
is_under_holy_order_lease = yes
county.holder = {
any_liege_or_above = { this = root }
}
lessee = {
NAND = { # Only for leases of people who are not of your faith or the holder's faith
faith = root.faith
faith = prev.county.holder.faith
}
scope:title = {
every_in_de_jure_hierarchy = {
limit = {
tier = tier_barony
is_under_holy_order_lease = yes
county.holder = {
any_liege_or_above = { this = root }
}
lessee = {
NAND = { # Only for leases of people who are not of your faith or the holder's faith
faith = root.faith
faith = prev.county.holder.faith
}
}
}
}
scope:title = {
every_in_de_jure_hierarchy = {
limit = {
tier = tier_barony
is_under_holy_order_lease = yes
county.holder = {
any_liege_or_above = { this = root }
}
lessee = {
NAND = { # Only for leases of people who are not of your faith or the holder's faith
faith = root.faith
faith = prev.county.holder.faith
}
}
}
revoke_lease = yes
}
revoke_lease = yes
}
}
@ -2894,7 +3020,12 @@ on_title_gain = {
}
# Natural Disaster Recovery project invalidation
great_projects_ensure_unique_disaster_recovery_projects_effect = yes
if = {
limit = {
this = top_liege
}
great_projects_ensure_unique_disaster_recovery_projects_effect = yes
}
###########
# Nomads/Tribals leaving confederacies
@ -2904,6 +3035,7 @@ on_title_gain = {
is_confederation_member = yes
scope:title.tier >= tier_kingdom
government_is_japanese_trigger = no
confederation ?= { is_title_based = no }
}
confederation = {
remove_confederation_member = root
@ -2985,6 +3117,7 @@ on_title_gain = {
is_ruler = no
highest_held_title_tier <= scope:title.tier
government_has_flag = government_is_landless_adventurer
government_has_flag = government_is_merchant
government_has_mechanic = administrative
}
}
@ -3289,13 +3422,7 @@ on_title_gain = {
every_courtier = {
limit = {
location != root.capital_province
is_imprisoned = no
is_travelling = no
is_commanding_army = no
NOR = {
exists = involved_activity
exists = knight_army
}
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -3307,13 +3434,7 @@ on_title_gain = {
every_courtier = {
limit = {
location != root.domicile.domicile_location
is_imprisoned = no
is_travelling = no
is_commanding_army = no
NOR = {
exists = involved_activity
exists = knight_army
}
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -3769,6 +3890,10 @@ on_title_lost = {
gdp_league_focus_on_title_lost
}
on_actions = {
gdp_league_focus_on_title_lost
}
effect = {
################ N3OW Dynamic Titles ##################
@ -4201,13 +4326,7 @@ on_title_lost = {
owner = {
if = {
limit = {
is_alive = yes
is_imprisoned = no
is_travelling = no
NOT = {
exists = involved_activity
}
is_commanding_army = no
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -4457,13 +4576,7 @@ on_title_lost = {
every_courtier = {
limit = {
location != root.capital_province
is_imprisoned = no
is_travelling = no
is_commanding_army = no
NOR = {
exists = involved_activity
exists = knight_army
}
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -4476,13 +4589,7 @@ on_title_lost = {
every_courtier = {
limit = {
location != root.domicile.domicile_location
is_imprisoned = no
is_travelling = no
is_commanding_army = no
NOR = {
exists = involved_activity
exists = knight_army
}
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -4504,6 +4611,16 @@ on_title_lost = {
# Move or destroy estates without a liege
if = {
limit = {
trigger_if = {
limit = {
government_has_flag = government_is_republic
liege != root
}
# ...only do this if your liege is not ~also~ a republic, else vassal republics may fall into this
NOT = {
has_same_government = liege
}
}
# Has an NF title
any_held_title = {
NOT = { this = scope:title }
@ -4518,6 +4635,10 @@ on_title_lost = {
}
if = {
limit = {
NOR = {
government_has_flag = government_is_republic
government_has_flag = government_is_merchant
}
OR = {
exists = scope:new_holder.var:laamp_invasion_flag
trigger_if = {
@ -4597,8 +4718,7 @@ on_title_lost = {
limit = {
is_house_head = no
# Has an NF title
exists = house
house.house_head = {
house.house_head ?= {
any_held_title = { is_noble_family_title = yes }
}
# Only remaining title is NF title
@ -5226,7 +5346,10 @@ on_vassal_gained = {
limit = {
scope:vassal = {
is_confederation_member = yes
scope:vassal.confederation = { has_leading_house = no }
scope:vassal.confederation ?= {
has_leading_house = no
is_title_based = no
}
}
}
scope:vassal.confederation = {
@ -5315,6 +5438,28 @@ on_vassal_gained = {
}
}
}
### If a republic family becomes independent or part of a non-republic...
if = {
limit = {
scope:vassal = {
government_has_flag = government_is_republic
is_landed = no
any_held_title = { is_noble_family_title = yes }
}
NOT = { government_has_flag = government_is_republic }
}
# Create Merchant - this will trigger on_vassal_change and make them a Merchant
scope:vassal = {
create_title_and_vassal_change = {
type = conquest
save_scope_as = change
add_claim_on_loss = no
}
becomes_independent = { change = scope:change }
resolve_title_and_vassal_change = scope:change
}
}
}
}
@ -5329,14 +5474,11 @@ on_vassal_change = {
### If a admin duke-tier character becomes the top-liege's direct vassal, ensure that they have a noble family title
if = {
limit = {
# This trigger is intentionally different from the similar effect in on_title_gain up above. We want all direct vassals of the top liege to have a family title if they can
government_has_mechanic = administrative
government_allows = noble_families
is_house_head = yes
trigger_if = {
# This trigger is intentionally different from the similar effect in on_title_gain up above. We want all direct vassals of the top liege to have a family title if they can
limit = { government_has_flag = government_has_county_tier_noble_families }
highest_held_title_tier >= tier_county
}
trigger_else = { highest_held_title_tier >= tier_duchy }
highest_held_title_tier >= min_appointment_tier
liege = {
top_liege = this
government_allows = noble_families
@ -5355,19 +5497,13 @@ on_vassal_change = {
}
### If an admin ruler becomes independent...
if = {
limit = {
government_has_mechanic = administrative
}
limit = { government_has_mechanic = administrative }
if = {
limit = {
liege = root # I.e. root is independent
}
limit = { liege = root } # I.e. root is independent
if = {
limit = {
is_landed = no
any_held_title = {
is_noble_family_title = yes
}
any_held_title = { is_noble_family_title = yes }
}
if = {
limit = {
@ -5403,19 +5539,19 @@ on_vassal_change = {
limit = {
government_allows = noble_families
NOT = {
exists = house.noble_family
any_held_title = { is_noble_family_title = yes }
}
}
create_noble_family_effect = { GOVERNMENT_GIVER = this }
domicile ?= { set_up_domicile_estate_effect = yes }
}
}
# Byz admin landless NF should always be direct vassal of top liege
# Admin landless NF should always be direct vassal of top liege
else_if = {
limit = {
government_has_flag = government_is_administrative
government_allows = noble_families
liege != top_liege
primary_title = {
primary_title ?= {
is_noble_family_title = yes
}
is_landed = no
@ -5602,6 +5738,7 @@ on_vassal_change = {
liege != root
primary_title ?= {
has_custom_title_name = yes
is_landless_type_title = no
}
}
primary_title = {
@ -5825,7 +5962,6 @@ on_realm_capital_change = {
domicile ?= {
move_domicile = scope:capital_province
}
# don't move them in such cases
if = {
limit = {
is_landed = no

View file

@ -82,10 +82,10 @@ on_travel_plan_movement = {
# We change your Legend if you travel through somewhere relevant
if = {
limit = {
has_legend_chapter_trigger = { CHAPTER = conclusion }
current_travel_plan.current_location = {
has_any_point_of_interest_flag = yes
}
has_legend_chapter_trigger = { CHAPTER = conclusion }
NOT = {
promoted_legend ?= {
has_legend_chapter = {
@ -344,11 +344,16 @@ on_travel_plan_movement = {
}
root.current_travel_plan.current_location.available_loot > 0
}
set_variable = {
name = local_deals_last_haggle_gold
value = adventurers_make_local_deals_option_value
}
add_gold = adventurers_make_local_deals_option_value
add_to_variable_list = {
name = haggle_provinces
target = root.current_travel_plan.current_location
}
make_local_deals_haggle_risk_effect = yes
}
if = {
limit = {
@ -479,7 +484,15 @@ on_travel_plan_movement = {
NOT = { exists = inspiration }
}
save_scope_as = inspired_follower
grant_inspiration_to_character_no_court_artifacts_effect = { CHARACTER = this }
if = {
limit = {
root = { government_has_flag = government_is_merchant }
}
grant_merchant_inspiration_to_character_effect = { CHARACTER = this }
}
else = {
grant_inspiration_to_character_no_court_artifacts_effect = { CHARACTER = this }
}
}
send_interface_message = {
type = send_interface_message_good
@ -558,7 +571,6 @@ on_travel_plan_movement = {
location.county.holder = {
NOR = {
has_relation_friend = root
has_relation_best_friend = root
root = {
is_tributary_of = prev
}
@ -978,9 +990,8 @@ travel_events_on_action = {
150 = travel_events_bp3.60 # A Small Deal
150 = travel_events_bp3.65 # Purse Pursuit
25 = travel_events_bp3.70 # <X> Festival
150 = travel_events_bp3.75 # Dreams Brewing
#150 = travel_events_bp3.75 # Dreams Brewing
100 = travel_events_bp3.80 # A Life of Service
150 = travel_events_bp3.85 # Brewers of Fame
150 = travel_events_bp3.90 # Patron of <X>
150 = travel_events_bp3.95 # A Pilgrim's Tale
150 = travel_events_bp3.100 # Land of Milk and... Fish?
@ -1308,15 +1319,19 @@ on_travel_plan_start = {
}
any_court_position_holder = {
type = court_physician_court_position
is_ai = yes
is_available = yes
is_travel_entourage_character = no
bannable_serving_diarch_trigger = no
}
}
random_court_position_holder = {
type = court_physician_court_position
limit = {
is_ai = yes
is_available = yes
is_travel_entourage_character = no
bannable_serving_diarch_trigger = no
}
save_scope_as = court_phys
}
@ -1334,14 +1349,19 @@ on_travel_plan_start = {
}
any_court_position_holder = {
type = bodyguard_court_position
is_ai = yes
is_available = yes
is_travel_entourage_character = no
bannable_serving_diarch_trigger = no
}
}
random_court_position_holder = {
type = bodyguard_court_position
limit = {
is_ai = yes
is_available = yes
is_travel_entourage_character = no
bannable_serving_diarch_trigger = no
}
save_scope_as = bodyguard
}
@ -1359,15 +1379,19 @@ on_travel_plan_start = {
}
any_court_position_holder = {
type = akolouthos_court_position
is_ai = yes
is_available = yes
is_travel_entourage_character = no
bannable_serving_diarch_trigger = no
}
}
random_court_position_holder = {
type = akolouthos_court_position
limit = {
is_ai = yes
is_available = yes
is_travel_entourage_character = no
bannable_serving_diarch_trigger = no
}
save_scope_as = akolouthos
}
@ -1519,9 +1543,9 @@ on_travel_plan_start = {
# Commented-out events are removed due to spam concerns
# The ones who are left have mechanical impacts; Tours give prestige/stress loss, pilgrimages add additional pilgrims, wanderer activities give boons based ona ctivity options for Monument Explorations, etc.
# Chinese debates/examinations give necessary context effects, such as choosing movement if you have none, or resigning from your alnds if you need to take the exam
travel_start_event.1130 # Generic 'travel started' toast, also plays mx_cue_travel_start
#travel_start_event.1000 #Generic start (no activity)
#travel_start_event.1010 #Travelling to a Tournament
travel_start_event.1020 #Setting off on a Tour
@ -1618,6 +1642,7 @@ on_travel_plan_complete = {
current_travel_plan = {
has_travel_option = leisurely_option
}
exists = current_travel_plan.var:travel_plan_provinces_traversed
}
send_interface_toast = {
type = event_generic_good
@ -1640,6 +1665,7 @@ on_travel_plan_complete = {
limit = {
has_perk = travel_logs_perk
has_trait = lifestyle_traveler
exists = current_travel_plan.var:travel_plan_provinces_traversed
}
send_interface_toast = {
type = event_generic_good
@ -2271,6 +2297,7 @@ on_travel_relocation_end = {
travel_laamps_provisions_on_action = {
trigger = {
exists = domicile
domicile = { domicile_uses_provisions = yes }
domicile.provisions <= provisions_privation_threshold_start
NOT = { government_has_flag = government_is_nomadic } # Yurts don't have provisions
}

View file

@ -325,7 +325,27 @@ on_war_started = {
debug_log = "Declared a border war"
debug_log_scopes = yes
}
# gg_triggered_catalyst_effect = {
# ACTOR = scope:attacker
# RECIPIENT = scope:defender
# CATALYST = catalyst_gg_war_declared_on_opposite_party
# }
scope:attacker = {
if = {
limit = {
government_has_flag = government_has_merit
OR = {
vassal_contract_has_flag = celestial_military_appointment
vassal_contract_has_flag = meritocratic_military_appointment
}
}
scope:war = {
set_variable = {
name = military_province_war_defender_tier
value = scope:defender.highest_held_title_tier
}
}
}
if = { # Confession modifier
limit = {
var:pam_confession_penalty_var ?= flag:no_war
@ -648,6 +668,21 @@ on_war_started = {
}
scope:defender = {
if = {
limit = {
government_has_flag = government_has_merit
OR = {
vassal_contract_has_flag = celestial_military_appointment
vassal_contract_has_flag = meritocratic_military_appointment
}
}
scope:war = {
set_variable = {
name = military_province_war_attacker_tier
value = scope:attacker.highest_held_title_tier
}
}
}
if = {
limit = {
any_vassal_or_below = { is_ai = no }
@ -1263,6 +1298,12 @@ on_war_won_attacker = { # As in, won BY attacker. Only one of the two on_actions
# Save scopes for localization.
scope:attacker = { save_scope_as = winner }
scope:defender = { save_scope_as = loser }
# gg_triggered_catalyst_effect = {
# ACTOR = scope:winner
# RECIPIENT = scope:loser
# CATALYST = catalyst_gg_war_won_against_opposite_party
# }
scope:winner = { military_career_war_victory_merit_effect = yes }
# Special rewards for Temüjin vs Jamukha
if = {
limit = {
@ -1774,7 +1815,7 @@ on_war_won_attacker = { # As in, won BY attacker. Only one of the two on_actions
if = {
limit = {
scope:winner = {
has_dlc_feature = roads_to_power
has_playable_adventurer_dlc_trigger = yes
has_variable_list = separatist_uprising_decision_target_var
is_target_in_variable_list = {
name = separatist_uprising_decision_target_var
@ -1984,6 +2025,13 @@ on_war_won_defender = {
scope:attacker = { save_scope_as = loser }
scope:defender = { save_scope_as = winner }
# gg_triggered_catalyst_effect = {
# ACTOR = scope:winner
# RECIPIENT = scope:loser
# CATALYST = catalyst_gg_war_won_against_opposite_party
# }
scope:winner = { military_career_war_victory_merit_effect = yes }
# Give a humiliating memory to nomadic attackers for losing a war they started
if = {
limit = {

View file

@ -148,14 +148,6 @@ yearly_global_pulse = {
}
}
}
#Yearly Imperial Grace Reduction for Hegemonic Tributaries
if = {
limit = {
exists = suzerain
suzerain = { highest_held_title_tier = tier_hegemony }
NOT = { exists = suzerain.top_participant_group:dynastic_cycle }
}
}
# Empire Faith Gate: multi-empire-same-faith legitimacy (iterate list, not every_independent_ruler).
if = {
limit = { empire_faith_gate_enabled_trigger = yes }
@ -226,16 +218,15 @@ yearly_global_pulse = {
NOT = { this = scope:efg_ruler }
efg_same_faith_empire_holder_trigger = yes
scope:efg_ruler = {
NOR = {
NOT = {
has_relation_rival = prev
has_relation_nemesis = prev
}
}
}
scope:efg_ruler = {
set_relation_rival = {
target = prev
reason = efg_contested_empire_rivalry
set_relation_rival_effect = {
TARGET = prev
REASON = efg_contested_empire_rivalry
}
}
}
@ -606,23 +597,35 @@ yearly_playable_pulse = {
# Yearly house head opinion update: to change into only one log maybe?
if = {
limit = {
government_has_flag = government_is_clan
OR = {
government_has_flag = government_uses_house_unity
government_has_flag = government_uses_company_sentiment
}
exists = house
is_house_head = yes
}
save_scope_as = unity_target
if = {
limit = {
has_variable = {
name = steer_unity_towards_harmonious_passive_gain
name = steer_unity_towards_antagonistic_passive_loss
OR = {
has_character_flag = steer_unity_towards_harmonious_passive_gain
has_character_flag = steer_unity_towards_ennobled_passive_gain
has_character_flag = steer_unity_towards_antagonistic_passive_loss
has_character_flag = steer_unity_towards_rapacious_passive_loss
}
}
house = {
add_unity_value = {
value = {
if = {
limit = { root = { has_character_flag = steer_unity_towards_harmonious_passive_gain } }
limit = {
root = {
OR = {
has_character_flag = steer_unity_towards_harmonious_passive_gain
has_character_flag = steer_unity_towards_ennobled_passive_gain
}
}
}
add = medium_unity_gain
}
else = {
@ -816,6 +819,7 @@ yearly_playable_pulse = {
if = {
limit = {
NOT = { government_has_flag = government_has_merchant_company }
OR = {
NOT = { government_allows = noble_families }
AND = {
@ -847,7 +851,7 @@ yearly_playable_pulse = {
}
admin_change_government_effect = yes
}
# Failsafe to ensure we don't have a noble family holding land without other titles - Give any held land to liege
# Failsafe so a noble family is not left holding only barony or lower landed titles. Any land they hold goes to the liege
else_if = {
limit = {
# They are a Vassal
@ -858,23 +862,11 @@ yearly_playable_pulse = {
save_temporary_scope_as = nf_title_temp
}
# And no other high tier Titles
trigger_if = {
limit = { government_has_flag = government_has_county_tier_noble_families }
NOT = {
any_held_title = {
tier >= tier_county
is_noble_family_title = no
is_landless_type_title = no
}
}
}
trigger_else = {
NOT = {
any_held_title = {
tier >= tier_duchy
is_noble_family_title = no
is_landless_type_title = no
}
NOT = {
any_held_title = {
tier >= tier_county
is_noble_family_title = no
is_landless_type_title = no
}
}
}
@ -887,6 +879,7 @@ yearly_playable_pulse = {
limit = {
is_landless_type_title = no
is_noble_family_title = no
is_capital_barony = no
}
add_to_list = revoked_titles
}
@ -1114,13 +1107,8 @@ yearly_playable_pulse = {
is_ai = no
has_government = landless_adventurer_government
location != domicile.domicile_location
is_imprisoned = no
is_travelling = no
NOT = {
exists = involved_activity
}
should_in_default_location_trigger = yes
num_taken_task_contracts <= 0
is_commanding_army = no
}
set_location_to_default = yes
}
@ -1128,6 +1116,7 @@ yearly_playable_pulse = {
limit = {
government_allows = merit
}
military_service_yearly_merit_effect = yes
if = {
limit = {
is_landed = yes
@ -1139,13 +1128,7 @@ yearly_playable_pulse = {
location != root.capital_province
}
trigger_else = { always = yes }
is_imprisoned = no
is_travelling = no
is_commanding_army = no
NOR = {
exists = involved_activity
exists = knight_army
}
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -1161,13 +1144,7 @@ yearly_playable_pulse = {
location != root.domicile.domicile_location
}
trigger_else = { always = yes }
is_imprisoned = no
is_travelling = no
is_commanding_army = no
NOR = {
exists = involved_activity
exists = knight_army
}
should_in_default_location_trigger = yes
}
set_location_to_default = yes
}
@ -1184,11 +1161,14 @@ yearly_playable_pulse = {
}
remove_character_modifier = mpo_confederation_member_modifier
}
# Stray player Herders get turned into Nomads
# Stray player Herders get turned into Nomads, as do Herders that have grown past a single county
if = {
limit = {
is_ai = no
government_has_flag = government_is_herder
OR = {
is_ai = no
highest_held_title_tier > tier_county
}
}
every_held_title = {
limit = {
@ -1203,6 +1183,11 @@ yearly_playable_pulse = {
}
change_government = nomad_government
}
#Estate office governor efficiency for house members
if = {
limit = { is_house_head = yes }
house = { refresh_estate_household_clerks_house_modifier_effect = yes }
}
######################
# Various safeguarding against realm setups with landless participants
@ -1822,7 +1807,7 @@ yearly_playable_pulse = {
rite = { rite_has_parameter = tenet_love_thy_neighbour_county_bonus }
any_held_county = {
faith = prev.faith
county_opinion >= 60
popular_opinion >= 60
NOT = {
has_county_modifier = tenet_love_thy_neighbour_modifier
}
@ -1831,7 +1816,7 @@ yearly_playable_pulse = {
random_held_county = {
limit = {
faith = prev.faith
county_opinion >= 60
popular_opinion >= 60
NOT = {
has_county_modifier = tenet_love_thy_neighbour_modifier
}
@ -2005,6 +1990,27 @@ yearly_playable_pulse = {
trigger_event = accolade.0110
}
}
# GDP Trade Opportunities
if = {
limit = {
is_landless_merchant = yes
trigger_if = {
limit = { is_ai = yes }
is_available = yes
}
}
random = {
chance = {
value = 70
if = {
limit = { has_character_flag = trade_opportunity_frequency_cooldown }
subtract = 50
}
}
trigger_event = { on_action = spawn_trade_opportunity_contract_on_action }
}
}
if = {
limit = {
NOT = { exists = puppeteer }
@ -2683,12 +2689,7 @@ quarterly_playable_pulse = {
realm_maintenance_quarterly_pulse
# Event pools
stewardship_lifestyle_progress_pulse
intrigue_lifestyle_progress_pulse
diplomacy_lifestyle_progress_pulse
martial_lifestyle_progress_pulse
learning_lifestyle_progress_pulse
wanderer_lifestyle_progress_pulse
lifestyle_progress_pulse
# Relation pulses are spread out across the four quarterly pulses a year
lover_quarterly_pulse
@ -2724,6 +2725,18 @@ quarterly_playable_pulse = {
}
}
# A character only has one lifestyle, so at most one of these pulses can be valid
lifestyle_progress_pulse = {
first_valid_on_action = {
stewardship_lifestyle_progress_pulse
intrigue_lifestyle_progress_pulse
diplomacy_lifestyle_progress_pulse
martial_lifestyle_progress_pulse
learning_lifestyle_progress_pulse
wanderer_lifestyle_progress_pulse
}
}
# Called from code once a year for all "playable" characters, at a random point that year (individually for each character). Different time from the random_yearly_everyone_pulse (coincides by random 1 time out of 365)
# Root is the character
random_yearly_playable_pulse = {
@ -2900,7 +2913,6 @@ random_yearly_everyone_pulse = {
}
on_actions = {
yearly_health_pulse
stress_pulse
prison_maintenance_pulse
house_feud_ai_scheme_pulse
}
@ -3007,6 +3019,8 @@ five_year_everyone_pulse = {
move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
}
purge_excess_baron_gold_effect = yes # keep barons from hoarding gold they won't spend in their lifetime
# FP2 - Checks to start El Cid's Travels
# if = {
# limit = { # Am I El Cid?
@ -3391,7 +3405,6 @@ on_yearly_events = {
100 = vassal.2001 # Vassal wants liege to educate their child
100 = vassal.2101 # No feast in a while, vassal requests it
200 = vassal.2201 # You lend money from a vassal
400 = vassal.2205 # Vassal reminds you of the money you owe them
100 = vassal.2301 # Highly skilled vassal progresses development in province
100 = vassal.2401 # Vassal wants gold, offers territory/better Vassal Contract
100 = vassal.2451 # Vassal wants better contract, offers territory/gold
@ -4131,8 +4144,12 @@ on_yearly_events = {
100 = pam_theocratic_ruler_events.0010 # Theocratic ruler: proven warrior and pilgrim; marshal and chaplain counsel sword or crozier
100 = pam_theocratic_ruler_events.0011 # Theocratic ruler: landed subject seeks church burial for fallen crusader kinsman
100 = pam_theocratic_ruler_events.0013 # Theocratic ruler: angelic voice at mass; recruit for choir, seduce, or reject worldly song
50 = pam_theocratic_ruler_events.0014 # Theocratic ruler: neighbouring convert urges adopting foreign core tenets at sermon
50 = pam_theocratic_ruler_events.0014 # Theocratic ruler: neighboring convert urges adopting foreign core tenets at sermon
50 = pam_theocratic_ruler_events.0015 # Theocratic ruler: prayer hearing with top two succession candidates
50 = pam_theocratic_ruler_events.0016 # Theocratic ruler: two religious subordinates discuss faith over bread
50 = pam_theocratic_ruler_events.0017 # Theocratic ruler: head of faith or rite notices ambitious church guidance
50 = pam_theocratic_ruler_events.0018 # Theocratic ruler: bishop spends more time with mayors and merchants than at Mass
50 = pam_theocratic_ruler_events.0019 # Theocratic ruler: liege and religious superior despise each other
# PAM Flavor Events
50 = pam_generic_events.0001 # Gain Religious Scholar