This commit is contained in:
Magpie490 2025-10-30 12:41:45 +00:00
parent b358a492bc
commit ec9c75701f
191 changed files with 289453 additions and 3189 deletions

View file

@ -54,6 +54,7 @@ republic_government = {
noble_families = yes noble_families = yes
treasury = yes treasury = yes
administrative = yes administrative = yes
landless_playable = yes
replace_gold_cost_by_treasury = yes replace_gold_cost_by_treasury = yes
admin_allows_holding_multiple_primary_tier_titles = yes admin_allows_holding_multiple_primary_tier_titles = yes
} }

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,17 @@
succession_order_laws = { succession_order_laws = {
flag = succession_order_laws flag = succession_order_laws
can_change_law_group = {
custom_tooltip = {
text = CANT_CHANGE_LAW_TOOLTIP
NOR = {
has_realm_law = mandala_succession_law
government_has_flag = government_is_japan_administrative
}
}
}
confederate_partition_succession_law = { confederate_partition_succession_law = {
can_keep = { can_keep = {
always = yes always = yes
@ -66,6 +77,10 @@
government_has_flag = government_is_nomadic government_has_flag = government_is_nomadic
government_has_flag = government_is_clan government_has_flag = government_is_clan
government_has_flag = government_is_administrative government_has_flag = government_is_administrative
government_has_flag = government_is_mandala
government_has_flag = government_is_celestial
government_has_flag = government_is_meritocratic
government_has_flag = government_is_steppe_admin
} }
} }
} }
@ -117,7 +132,7 @@
has_innovation = innovation_heraldry has_innovation = innovation_heraldry
} }
} }
NOT = { government_has_flag = government_is_administrative } NOT = { government_allows = administrative }
} }
succession = { succession = {
order_of_succession = inheritance order_of_succession = inheritance
@ -149,6 +164,10 @@
government_has_flag = government_is_nomadic government_has_flag = government_is_nomadic
government_has_flag = government_is_clan government_has_flag = government_is_clan
government_has_flag = government_is_administrative government_has_flag = government_is_administrative
government_has_flag = government_is_mandala
government_has_flag = government_is_celestial
government_has_flag = government_is_meritocratic
government_has_flag = government_is_steppe_admin
} }
} }
} }
@ -173,11 +192,8 @@
government_has_flag = government_is_feudal government_has_flag = government_is_feudal
culture = { culture = {
has_innovation = innovation_heraldry has_innovation = innovation_heraldry
NOT = {
has_innovation = innovation_hereditary_rule
} }
} NOT = { government_allows = administrative }
NOT = { government_has_flag = government_is_administrative }
} }
succession = { succession = {
order_of_succession = inheritance order_of_succession = inheritance
@ -213,6 +229,10 @@
government_has_flag = government_is_nomadic government_has_flag = government_is_nomadic
government_has_flag = government_is_clan government_has_flag = government_is_clan
government_has_flag = government_is_administrative government_has_flag = government_is_administrative
government_has_flag = government_is_mandala
government_has_flag = government_is_celestial
government_has_flag = government_is_meritocratic
government_has_flag = government_is_steppe_admin
} }
} }
} }
@ -224,11 +244,15 @@
custom_description = { custom_description = {
text = succession_laws_must_not_be_forced_partition text = succession_laws_must_not_be_forced_partition
NAND = { NAND = {
is_independent_ruler = no top_liege != this
vassal_contract_has_flag = locked_to_partition vassal_contract_has_flag = locked_to_partition
} }
} }
} }
can_title_have = {
# Ceremonial Regent
NOT = { exists = var:administrative_ui_special_title.holder }
}
can_have = { can_have = {
NOT = { government_has_flag = government_is_nomadic } NOT = { government_has_flag = government_is_nomadic }
can_have_single_heir_succession_law_trigger = yes can_have_single_heir_succession_law_trigger = yes
@ -243,7 +267,7 @@
} }
trigger_if = { trigger_if = {
limit = { limit = {
government_has_flag = government_is_administrative government_allows = administrative
} }
influence_level >= 4 influence_level >= 4
has_active_diarchy = no has_active_diarchy = no
@ -252,7 +276,6 @@
} }
should_start_with = { should_start_with = {
historical_succession_access_single_heir_succession_law_trigger = yes historical_succession_access_single_heir_succession_law_trigger = yes
NOT = { government_has_flag = government_is_administrative }
} }
succession = { succession = {
order_of_succession = inheritance order_of_succession = inheritance
@ -291,12 +314,18 @@
} }
potential = { potential = {
NOT = { government_has_flag = government_is_nomadic } NOR = {
government_has_flag = government_is_nomadic
government_has_flag = government_is_mandala
}
trigger_if = { trigger_if = {
limit = { limit = {
government_has_flag = government_is_administrative government_allows = administrative
} }
OR = {
is_independent_ruler = yes is_independent_ruler = yes
tgp_is_ceremonial_liege_trigger = yes
}
} }
} }
} }
@ -350,7 +379,7 @@
custom_description = { custom_description = {
text = succession_laws_must_not_be_forced_partition text = succession_laws_must_not_be_forced_partition
NAND = { NAND = {
is_independent_ruler = no top_liege != this
vassal_contract_has_flag = locked_to_partition vassal_contract_has_flag = locked_to_partition
} }
} }
@ -369,7 +398,7 @@
} }
trigger_if = { trigger_if = {
limit = { limit = {
government_has_flag = government_is_administrative government_allows = administrative
} }
influence_level >= 4 influence_level >= 4
has_active_diarchy = no has_active_diarchy = no
@ -416,7 +445,10 @@
} }
is_independent_ruler = yes is_independent_ruler = yes
} }
NOT = { government_has_flag = government_is_nomadic } NOR = {
government_has_flag = government_is_nomadic
government_has_flag = government_is_mandala
}
} }
} }
@ -427,7 +459,7 @@
custom_description = { custom_description = {
text = succession_laws_must_not_be_forced_partition text = succession_laws_must_not_be_forced_partition
NAND = { NAND = {
is_independent_ruler = no top_liege != this
vassal_contract_has_flag = locked_to_partition vassal_contract_has_flag = locked_to_partition
} }
} }
@ -447,7 +479,7 @@
} }
should_start_with = { should_start_with = {
historical_succession_access_single_heir_dynasty_house_trigger = yes historical_succession_access_single_heir_dynasty_house_trigger = yes
NOT = { government_has_flag = government_is_administrative } NOT = { government_allows = administrative }
} }
succession = { succession = {
order_of_succession = inheritance order_of_succession = inheritance
@ -499,6 +531,7 @@
NOR = { NOR = {
government_has_flag = government_is_administrative government_has_flag = government_is_administrative
government_has_flag = government_is_nomadic government_has_flag = government_is_nomadic
government_has_flag = government_is_mandala
} }
} }
} }
@ -506,18 +539,30 @@
acclamation_succession_law = { acclamation_succession_law = {
can_keep = { can_keep = {
can_keep_acclamation_succession_law_trigger = yes can_keep_acclamation_succession_law_trigger = yes
NOT ={
government_has_flag = government_is_special_republic
}
} }
can_pass = { can_pass = {
can_change_acclamation_succession_law_trigger = yes can_change_acclamation_succession_law_trigger = yes
NOT ={
government_has_flag = government_is_special_republic
}
} }
can_have = { can_have = {
NOT = { government_has_flag = government_is_nomadic } NOT = { government_has_flag = government_is_nomadic }
can_have_acclamation_succession_law_trigger = yes can_have_acclamation_succession_law_trigger = yes
NOT ={
government_has_flag = government_is_special_republic
}
} }
should_start_with = { should_start_with = {
has_ep3_dlc_trigger = yes has_ep3_dlc_trigger = yes
has_title = title:e_byzantium has_title = title:e_byzantium
government_has_flag = government_is_administrative government_allows = administrative
NOT ={
government_has_flag = government_is_special_republic
}
} }
succession = { succession = {
order_of_succession = appointment order_of_succession = appointment
@ -542,7 +587,7 @@
} }
} }
potential = { potential = {
government_has_flag = government_is_administrative government_allows = administrative
is_independent_ruler = yes is_independent_ruler = yes
} }
} }
@ -550,12 +595,14 @@
appointment_succession_law = { appointment_succession_law = {
can_keep = { can_keep = {
can_keep_appointment_succession_law_trigger = yes can_keep_appointment_succession_law_trigger = yes
NOT ={
government_has_flag = government_is_special_republic
}
# Vassal Contract allows it # Vassal Contract allows it
custom_description = { custom_description = {
text = succession_laws_must_not_be_forced_partition text = succession_laws_must_not_be_forced_partition
NAND = { NAND = {
is_independent_ruler = no top_liege != this
vassal_contract_has_flag = locked_to_partition vassal_contract_has_flag = locked_to_partition
} }
} }
@ -563,12 +610,21 @@
can_have = { can_have = {
NOT = { government_has_flag = government_is_nomadic } NOT = { government_has_flag = government_is_nomadic }
can_have_appointment_succession_law_trigger = yes can_have_appointment_succession_law_trigger = yes
NOT ={
government_has_flag = government_is_special_republic
}
} }
can_pass = { can_pass = {
can_change_appointment_succession_law_trigger = yes can_change_appointment_succession_law_trigger = yes
} }
should_start_with = { should_start_with = {
government_has_flag = government_is_administrative government_allows = administrative
NOR = {
government_has_flag = government_is_celestial
government_has_flag = government_is_special_republic
government_has_flag = government_is_japan_administrative
government_has_flag = government_is_meritocratic
}
is_independent_ruler = no is_independent_ruler = no
} }
succession = { succession = {
@ -604,7 +660,12 @@
} }
potential = { potential = {
government_has_flag = government_is_administrative government_allows = administrative # Default succession law for all admin types...
NOR = { # ... Unless you have a unique succession available
government_has_flag = government_is_celestial
government_has_flag = government_is_japan_administrative
government_has_flag = government_is_meritocratic
}
is_independent_ruler = no is_independent_ruler = no
} }
} }
@ -713,7 +774,7 @@
can_have_city_succession_law_trigger = yes can_have_city_succession_law_trigger = yes
} }
should_start_with = { should_start_with = {
government_has_flag = government_is_special_republic government_has_flag = government_is_republic
} }
succession = { succession = {
order_of_succession = generate order_of_succession = generate
@ -1026,6 +1087,534 @@
can_have_herder_succession_law_trigger = yes can_have_herder_succession_law_trigger = yes
} }
} }
celestial_appointment_succession_law = {
can_keep = {
government_allows = administrative
is_independent_ruler = no
custom_tooltip = {
text = celestial_appointment_allowed_desc
NOT = { vassal_contract_has_flag = celestial_military_appointment }
}
# Vassal Contract allows it
custom_description = {
text = succession_laws_must_not_be_forced_partition
NAND = {
is_independent_ruler = no
vassal_contract_has_flag = locked_to_partition
}
}
}
can_have = {
government_allows = administrative
is_independent_ruler = no
}
can_pass = {
government_allows = administrative
is_independent_ruler = no
}
should_start_with = {
government_has_flag = government_is_celestial
is_independent_ruler = no
custom_tooltip = {
text = celestial_appointment_allowed_desc
NOT = { vassal_contract_has_flag = celestial_military_appointment }
}
}
succession = {
order_of_succession = appointment
appointment_type = celestial_civic_governor
}
flag = advanced_succession_law
flag = appointment_type_succession
modifier = {
glory_hound_opinion = -10
courtly_opinion = 5
player_heir_opinion = 20
eligible_child_except_player_heir_opinion = -5
}
pass_cost = {
prestige = change_succession_law_prestige_cost
}
revoke_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = {
OR = {
has_realm_law = confederate_partition_succession_law
has_realm_law = partition_succession_law
has_realm_law = high_partition_succession_law
}
}
value = 3
}
}
potential = {
government_has_flag = government_is_celestial
is_independent_ruler = no
}
}
celestial_military_appointment_succession_law = {
can_keep = {
government_allows = administrative
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
vassal_contract_has_flag = celestial_military_appointment
}
# Vassal Contract allows it
custom_description = {
NAND = {
is_independent_ruler = no
vassal_contract_has_flag = locked_to_partition
}
}
}
can_have = {
government_allows = administrative
is_independent_ruler = no
}
can_pass = {
can_change_succession_law_trigger = yes
government_allows = administrative
is_independent_ruler = no
}
should_start_with = {
government_has_flag = government_is_celestial
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
vassal_contract_has_flag = celestial_military_appointment
}
}
succession = {
order_of_succession = appointment
appointment_type = celestial_military_governor
}
flag = advanced_succession_law
flag = appointment_type_succession
modifier = {
glory_hound_opinion = 5
courtly_opinion = -10
player_heir_opinion = 20
eligible_child_except_player_heir_opinion = -5
}
pass_cost = {
prestige = change_succession_law_prestige_cost
}
revoke_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = {
OR = {
has_realm_law = confederate_partition_succession_law
has_realm_law = partition_succession_law
has_realm_law = high_partition_succession_law
}
}
value = 3
}
}
potential = {
government_has_flag = government_is_celestial
is_independent_ruler = no
}
}
japanese_regency_succession_law = {
can_keep = {
can_have_japanese_regency_succession_law_trigger = yes
}
can_pass = {
can_have_japanese_regency_succession_law_trigger = yes
}
can_have = {
can_have_japanese_regency_succession_law_trigger = yes
}
can_title_have = {
exists = var:administrative_ui_special_title
}
should_show_for_title = { # Never show this in the UI, just apply it through script
always = no
}
can_remove_from_title = {
always = no
}
should_start_with = {
always = no
}
succession = {
order_of_succession = appointment
appointment_type = japanese_regent
}
flag = advanced_succession_law
flag = can_designate_heirs
flag = appointment_type_succession
pass_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = { has_realm_law = confederate_partition_succession_law }
value = 1
}
}
potential = {
government_has_flag = government_is_japan_administrative
}
}
japanese_appointment_succession_law = {
can_keep = {
can_keep_japanese_appointment_succession_law_trigger = yes
}
can_pass = {
can_change_japanese_appointment_succession_law_trigger = yes
}
can_have = {
can_have_japanese_appointment_succession_law_trigger = yes
}
should_start_with = {
government_has_flag = government_is_japan_administrative
is_independent_ruler = no
NOT = { has_title = title:k_chrysanthemum_throne }
}
succession = {
order_of_succession = appointment
appointment_type = japanese_governor
}
flag = advanced_succession_law
flag = appointment_type_succession
modifier = {
glory_hound_opinion = -10
parochial_opinion = -5
player_heir_opinion = 20
eligible_child_except_player_heir_opinion = -5
}
pass_cost = {
prestige = change_succession_law_prestige_cost
}
revoke_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = {
OR = {
has_realm_law = confederate_partition_succession_law
has_realm_law = partition_succession_law
has_realm_law = high_partition_succession_law
}
}
value = 3
}
}
potential = {
government_has_flag = government_is_japan_administrative
is_independent_ruler = no
}
}
japanese_military_appointment_succession_law = {
can_keep = {
government_allows = administrative
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
vassal_contract_has_flag = japan_administrative_military_appointment
}
# Vassal Contract allows it
custom_description = {
NAND = {
is_independent_ruler = no
vassal_contract_has_flag = locked_to_partition
}
}
}
can_have = {
government_allows = administrative
is_independent_ruler = no
}
can_pass = {
can_change_succession_law_trigger = yes
government_allows = administrative
is_independent_ruler = no
}
should_start_with = {
government_has_flag = government_is_japan_administrative
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
vassal_contract_has_flag = japan_administrative_military_appointment
}
}
succession = {
order_of_succession = appointment
appointment_type = japanese_military_governor
}
flag = advanced_succession_law
flag = appointment_type_succession
modifier = {
glory_hound_opinion = 5
courtly_opinion = -10
player_heir_opinion = 20
eligible_child_except_player_heir_opinion = -5
}
pass_cost = {
prestige = change_succession_law_prestige_cost
}
revoke_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = {
OR = {
has_realm_law = confederate_partition_succession_law
has_realm_law = partition_succession_law
has_realm_law = high_partition_succession_law
}
}
value = 3
}
}
potential = {
government_has_flag = government_is_japan_administrative
is_independent_ruler = no
}
}
mandala_succession_law = {
can_keep = {
realm_law_is_mandala = yes
}
can_have = {
realm_law_is_mandala = yes
}
can_pass = {
realm_law_is_mandala = yes
}
should_start_with = {
realm_law_is_mandala = yes
}
should_show_for_title = { # Never show this in the UI, just apply it through script
always = no
}
can_remove_from_title = {
always = no
}
succession = {
order_of_succession = inheritance
traversal_order = children
rank = oldest
title_division = single_heir
}
flag = can_designate_heirs
potential = {
realm_law_is_mandala = yes
}
}
meritocratic_appointment_succession_law = {
can_keep = {
government_allows = administrative
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
NOT = { vassal_contract_has_flag = meritocratic_military_appointment }
}
# Vassal Contract allows it
custom_description = {
text = succession_laws_must_not_be_forced_partition
NAND = {
is_independent_ruler = no
vassal_contract_has_flag = locked_to_partition
}
}
}
can_have = {
government_allows = administrative
is_independent_ruler = no
}
can_pass = {
government_allows = administrative
is_independent_ruler = no
}
should_start_with = {
government_has_flag = government_is_meritocratic
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
NOT = { vassal_contract_has_flag = meritocratic_military_appointment }
}
}
succession = {
order_of_succession = appointment
appointment_type = meritocratic_civic_governor
}
flag = advanced_succession_law
flag = appointment_type_succession
modifier = {
glory_hound_opinion = -10
courtly_opinion = 5
player_heir_opinion = 20
eligible_child_except_player_heir_opinion = -5
}
pass_cost = {
prestige = change_succession_law_prestige_cost
}
revoke_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = {
OR = {
has_realm_law = confederate_partition_succession_law
has_realm_law = partition_succession_law
has_realm_law = high_partition_succession_law
}
}
value = 3
}
}
potential = {
government_has_flag = government_is_meritocratic
is_independent_ruler = no
}
}
meritocratic_military_appointment_succession_law = {
can_keep = {
government_allows = administrative
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
vassal_contract_has_flag = meritocratic_military_appointment
}
# Vassal Contract allows it
custom_description = {
text = succession_laws_must_not_be_forced_partition
NAND = {
is_independent_ruler = no
vassal_contract_has_flag = locked_to_partition
}
}
}
can_have = {
government_allows = administrative
is_independent_ruler = no
}
can_pass = {
government_allows = administrative
is_independent_ruler = no
}
should_start_with = {
government_has_flag = government_is_meritocratic
is_independent_ruler = no
custom_tooltip = {
text = celestial_military_appointment_allowed_desc
vassal_contract_has_flag = meritocratic_military_appointment
}
}
succession = {
order_of_succession = appointment
appointment_type = meritocratic_military_governor
}
flag = advanced_succession_law
flag = appointment_type_succession
modifier = {
glory_hound_opinion = -10
courtly_opinion = 5
player_heir_opinion = 20
eligible_child_except_player_heir_opinion = -5
}
pass_cost = {
prestige = change_succession_law_prestige_cost
}
revoke_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = {
OR = {
has_realm_law = confederate_partition_succession_law
has_realm_law = partition_succession_law
has_realm_law = high_partition_succession_law
}
}
value = 3
}
}
potential = {
government_has_flag = government_is_meritocratic
is_independent_ruler = no
}
}
meritocratic_regency_succession_law = {
can_keep = {
can_have_meritocratic_regency_succession_law_trigger = yes
}
can_pass = {
can_have_meritocratic_regency_succession_law_trigger = yes
}
can_have = {
can_have_meritocratic_regency_succession_law_trigger = yes
}
can_title_have = {
exists = var:administrative_ui_special_title
}
should_show_for_title = { # Never show this in the UI, just apply it through script
always = no
}
can_remove_from_title = {
always = no
}
should_start_with = {
always = no
}
succession = {
order_of_succession = appointment
appointment_type = meritocratic_regent
}
flag = advanced_succession_law
flag = can_designate_heirs
flag = appointment_type_succession
pass_cost = {
prestige = change_succession_law_prestige_cost
}
ai_will_do = {
if = {
limit = { has_realm_law = confederate_partition_succession_law }
value = 1
}
}
potential = {
government_allows = administrative
government_allows = merit
tgp_realm_has_ceremonial_liege_trigger = yes
}
}
} }
succession_gender_laws = { succession_gender_laws = {
@ -1042,14 +1631,14 @@ succession_gender_laws = {
can_keep = { can_keep = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = male_only_law } top_liege = { has_realm_law = male_only_law }
} }
trigger_else = { trigger_else = {
custom_tooltip = { custom_tooltip = {
text = culture_not_female_only_tt text = culture_not_male_only_tt
OR = { OR = {
faith = { has_doctrine = doctrine_gender_male_dominated } faith = { has_doctrine = doctrine_gender_male_dominated }
NOT = { NOT = {
@ -1065,8 +1654,16 @@ succession_gender_laws = {
should_start_with = { should_start_with = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no government_has_flag = government_has_merit
government_has_flag = government_is_administrative }
faith = {
has_doctrine = doctrine_gender_male_dominated
}
}
trigger_else_if = {
limit = {
top_liege != this
government_allows = administrative
} }
top_liege = { has_realm_law = male_only_law } top_liege = { has_realm_law = male_only_law }
} }
@ -1102,8 +1699,8 @@ succession_gender_laws = {
can_keep = { can_keep = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = male_preference_law } top_liege = { has_realm_law = male_preference_law }
} }
@ -1131,8 +1728,8 @@ succession_gender_laws = {
should_start_with = { should_start_with = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = male_preference_law } top_liege = { has_realm_law = male_preference_law }
} }
@ -1142,8 +1739,14 @@ succession_gender_laws = {
} }
OR = { OR = {
faith = { faith = {
NOT = { NOR = {
religion_tag = islam_religion religion_tag = islam_religion
AND = {
root = {
government_has_flag = government_has_merit
}
has_doctrine = doctrine_gender_male_dominated
}
} }
has_doctrine = doctrine_gender_male_dominated has_doctrine = doctrine_gender_male_dominated
} }
@ -1152,7 +1755,7 @@ succession_gender_laws = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no is_independent_ruler = no
government_has_flag = government_is_administrative government_allows = administrative
} }
NOT = { NOT = {
top_liege = { has_realm_law = male_only_law } top_liege = { has_realm_law = male_only_law }
@ -1198,8 +1801,8 @@ succession_gender_laws = {
can_keep = { can_keep = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = equal_law } top_liege = { has_realm_law = equal_law }
} }
@ -1230,8 +1833,8 @@ succession_gender_laws = {
should_start_with = { should_start_with = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = equal_law } top_liege = { has_realm_law = equal_law }
} }
@ -1287,19 +1890,25 @@ succession_gender_laws = {
can_keep = { can_keep = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = female_preference_law } top_liege = { has_realm_law = female_preference_law }
} }
trigger_else = { trigger_else = {
custom_tooltip = { custom_description = {
text = female_preference_law_faith_or_culture_trigger text = change_law_female_preference_faith_requirement
OR = {
faith = { faith = {
NOT = { has_doctrine = doctrine_gender_male_dominated } NOT = { has_doctrine = doctrine_gender_male_dominated }
} }
culture = { has_cultural_parameter = female_preference_inheritance } }
custom_tooltip = {
text = female_preference_law_faith_or_culture_trigger
OR = {
faith = { has_doctrine = doctrine_gender_female_dominated }
NOT = {
culture = { has_cultural_parameter = male_only_inheritance }
}
} }
} }
} }
@ -1307,8 +1916,8 @@ succession_gender_laws = {
should_start_with = { should_start_with = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = female_preference_law } top_liege = { has_realm_law = female_preference_law }
} }
@ -1349,17 +1958,17 @@ succession_gender_laws = {
can_keep = { can_keep = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = female_only_law } top_liege = { has_realm_law = female_only_law }
} }
trigger_else = { trigger_else = {
custom_tooltip = { custom_tooltip = {
text = female_only_law_faith_or_culture_trigger text = culture_not_female_only_tt
OR = {
faith = { has_doctrine = doctrine_gender_female_dominated } faith = { has_doctrine = doctrine_gender_female_dominated }
culture = { has_cultural_parameter = female_only_inheritance } NOT = {
culture = { has_cultural_parameter = male_only_inheritance }
} }
} }
} }
@ -1383,8 +1992,8 @@ succession_gender_laws = {
should_start_with = { should_start_with = {
trigger_if = { trigger_if = {
limit = { limit = {
is_independent_ruler = no top_liege != this
government_has_flag = government_is_administrative government_allows = administrative
} }
top_liege = { has_realm_law = female_only_law } top_liege = { has_realm_law = female_only_law }
} }

View file

@ -2,8 +2,11 @@
# Default Feudal Elective # Default Feudal Elective
feudal_elective_succession_law = { feudal_elective_succession_law = {
can_have = { can_have = {
OR = {
government_has_flag = government_is_feudal government_has_flag = government_is_feudal
highest_held_title_tier >= tier_duchy government_has_flag = government_is_special_republic
}
highest_held_title_tier >= tier_county
NOR = { #Cultures have their special flavor. NOR = { #Cultures have their special flavor.
culture = { has_cultural_parameter = witenagemot_succession_enabled } culture = { has_cultural_parameter = witenagemot_succession_enabled }
culture = { has_cultural_parameter = scandinavian_elective_enabled } culture = { has_cultural_parameter = scandinavian_elective_enabled }
@ -16,6 +19,9 @@
can_title_have = { can_title_have = {
can_title_have_law_general_trigger = yes can_title_have_law_general_trigger = yes
} }
should_start_with = {
government_has_flag = government_is_special_republic
}
succession = { succession = {
order_of_succession = election order_of_succession = election
election_type = feudal_elective election_type = feudal_elective
@ -226,6 +232,7 @@
} }
succession = { succession = {
order_of_succession = noble_family order_of_succession = noble_family
title_division = single_heir
} }
flag = can_designate_heirs flag = can_designate_heirs
} }
@ -258,7 +265,9 @@
can_title_have = { can_title_have = {
tier >= tier_kingdom tier >= tier_kingdom
} }
should_show_for_title = { always = no } should_show_for_title = {
has_variable = confederation_culture
}
succession = { succession = {
order_of_succession = election order_of_succession = election
election_type = confederation_elective election_type = confederation_elective
@ -266,12 +275,91 @@
flag = elective_succession_law flag = elective_succession_law
title_allegiance_opinion = 10 title_allegiance_opinion = 10
revoke_cost = { revoke_cost = {
prestige = change_title_succession_law_prestige_cost prestige = {
value = change_title_succession_law_prestige_cost
multiply = 8
if = {
limit = {
NOR = {
government_has_flag = government_is_tribal
government_has_flag = government_is_nomadic
}
}
multiply = 0.1
}
}
} }
pass_cost = { pass_cost = {
prestige = change_title_succession_law_prestige_cost prestige = change_title_succession_law_prestige_cost
} }
} }
# Celestial Ministry Succession
celestial_ministry_appointment_succession_law = {
can_have = {
government_has_flag = government_is_celestial
}
can_pass = {
}
can_title_have = {
OR = {
this = title:e_minister_chancellor
this = title:e_minister_censor
this = title:e_minister_of_personnel
this = title:e_minister_of_revenue
this = title:e_minister_of_rites
this = title:e_minister_of_war
this = title:e_minister_of_justice
this = title:e_minister_of_works
}
}
can_realm_have = {
always = no
}
can_remove_from_title = {
custom_tooltip = {
text = celestial_ministry_appointment_cannot_remove_desc
always = no
}
}
succession = {
order_of_succession = appointment
appointment_type = celestial_minister
}
modifier = {
celestial_government_opinion = 5
}
flag = appointment_type_succession
}
# Celestial Grand Marshal Succession
celestial_grand_marshal_appointment_succession_law = {
can_have = {
government_has_flag = government_is_celestial
}
can_pass = {
}
can_title_have = {
this = title:e_minister_grand_marshal
}
can_realm_have = {
always = no
}
can_remove_from_title = {
custom_tooltip = {
text = celestial_ministry_appointment_cannot_remove_desc
always = no
}
}
succession = {
order_of_succession = appointment
appointment_type = celestial_military_governor
}
modifier = {
celestial_government_opinion = 5
}
flag = appointment_type_succession
}
} }

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,361 @@
#####################
# IMPERIAL POLICIES #
#####################
@imperial_policy_laws_cooldown_value = 10
@imperial_policy_cost_value = 500
imperial_policy_laws = {
default = manor_reform_law
cumulative = no
flag = imperial_policy
defense_mobilization_law = {
flag = defense_mobilization_law
can_keep = {
realm_law_use_imperial_policy_trigger = yes
trigger_if = {
limit = { is_independent_ruler = no }
liege = { has_realm_law = defense_mobilization_law }
}
}
can_pass = {
trigger_if = {
limit = {
top_liege = this
}
custom_tooltip = {
text = imperial_policy_laws_cooldown_desc
NOT = { has_variable = imperial_policy_laws_cooldown }
}
}
tgp_japan_defense_mobilization_valid_trigger = yes
}
on_pass = {
## Set cooldown
set_variable = {
name = imperial_policy_laws_cooldown
years = @imperial_policy_laws_cooldown_value
}
tgp_imperial_policy_event_effect = yes
}
modifier = {
same_heritage_county_advantage_add = 5
men_at_arms_maintenance = -0.15
fort_level = 1
hostile_raid_time = 0.15
}
flag = governors_may_recruit_japanese_horse_archers
flag = cheaper_japanese_domicile_military_buildings
pass_cost = {
prestige = @imperial_policy_cost_value
}
ai_will_do = {
value = 250
}
}
disarmament_law = {
flag = disarmament_law
flag = vassal_internal_wars_cost_doubled
flag = japan_administrative_can_build_castles
can_keep = {
realm_law_use_imperial_policy_trigger = yes
trigger_if = {
limit = { is_independent_ruler = no }
liege = { has_realm_law = disarmament_law }
}
}
can_pass = {
trigger_if = {
limit = {
top_liege = this
}
custom_tooltip = {
text = imperial_policy_laws_cooldown_desc
NOT = { has_variable = imperial_policy_laws_cooldown }
}
}
}
on_pass = {
## Set cooldown
set_variable = {
name = imperial_policy_laws_cooldown
years = @imperial_policy_laws_cooldown_value
}
tgp_imperial_policy_event_effect = yes
}
modifier = {
men_at_arms_recruitment_cost = 0.25
japan_feudal_government_vassal_opinion = -15
development_growth_factor = 0.15
}
pass_cost = {
prestige = @imperial_policy_cost_value
}
ai_will_do = {
value = 200
if = {
limit = {
ai_has_warlike_personality = yes
}
value = -50
}
if = {
limit = { government_has_flag = government_is_japan_feudal }
add = -1000
}
}
}
isolation_law = {
flag = isolation_law
flag = better_physician_treatments
can_keep = {
realm_law_use_imperial_policy_trigger = yes
trigger_if = {
limit = { is_independent_ruler = no }
liege = { has_realm_law = isolation_law }
}
}
can_pass = {
trigger_if = {
limit = {
top_liege = this
}
custom_tooltip = {
text = imperial_policy_laws_cooldown_desc
NOT = { has_variable = imperial_policy_laws_cooldown }
}
}
}
on_pass = {
## Set cooldown
set_variable = {
name = imperial_policy_laws_cooldown
years = @imperial_policy_laws_cooldown_value
}
tgp_imperial_policy_event_effect = yes
}
modifier = {
development_growth_factor = -0.15
epidemic_resistance = 15
diplomatic_range_mult = -0.15
}
pass_cost = {
prestige = @imperial_policy_cost_value
}
ai_will_do = {
value = 0
if = {
limit = {
any_realm_county = {
any_county_province = {
any_province_epidemic = {
count >= 1
outbreak_intensity >= apocalyptic
}
}
}
}
add = 200
}
}
}
imperial_expansion_law = {
flag = imperial_expansion_law
flag = cheaper_japanese_domicile_military_buildings
can_keep = {
realm_law_use_imperial_policy_trigger = yes
trigger_if = {
limit = { is_independent_ruler = no }
liege = { has_realm_law = imperial_expansion_law }
}
}
can_pass = {
trigger_if = {
limit = {
top_liege = this
}
custom_tooltip = {
text = imperial_policy_laws_cooldown_desc
NOT = { has_variable = imperial_policy_laws_cooldown }
}
}
tgp_japan_imperial_expansion_internal_peace_trigger = yes
}
on_pass = {
## Set cooldown
set_variable = {
name = imperial_policy_laws_cooldown
years = @imperial_policy_laws_cooldown_value
}
tgp_imperial_policy_event_effect = yes
}
modifier = {
mercenary_hire_cost_mult = -0.15
men_at_arms_recruitment_cost = -0.15
japan_administrative_government_vassal_opinion = -35
travel_danger = 20
}
pass_cost = {
prestige = @imperial_policy_cost_value
}
ai_will_do = {
value = 80
if = {
limit = {
ai_has_warlike_personality = yes
}
add = 50
}
if = {
limit = { government_has_flag = government_is_japan_administrative }
add = -1000
}
}
}
manor_reform_law = {
flag = manor_reform_law
can_keep = {
realm_law_use_imperial_policy_trigger = yes
trigger_if = {
limit = { is_independent_ruler = no }
liege = { has_realm_law = manor_reform_law }
}
}
can_pass = {
trigger_if = {
limit = {
top_liege = this
}
custom_tooltip = {
text = imperial_policy_laws_cooldown_desc
NOT = { has_variable = imperial_policy_laws_cooldown }
}
}
}
on_pass = {
## Set cooldown
set_variable = {
name = imperial_policy_laws_cooldown
years = @imperial_policy_laws_cooldown_value
}
tgp_imperial_policy_event_effect = yes
}
should_start_with = {
realm_law_use_imperial_policy_trigger = yes
}
modifier = {
domicile_build_gold_cost = 0.25
domicile_monthly_influence_mult = -0.25
domicile_build_speed = 0.25
build_gold_cost = -0.15
build_speed = -0.15
japan_administrative_government_vassal_opinion = -15
}
pass_cost = {
prestige = @imperial_policy_cost_value
}
ai_will_do = {
value = 100
if = {
limit = {
ai_has_builder_or_pious_builder_personality = yes
}
add = 25
}
if = {
limit = { government_has_flag = government_is_japan_administrative }
add = -100
}
}
}
bandit_crackdown_law = {
flag = bandit_crackdown_law
can_keep = {
realm_law_use_imperial_policy_trigger = yes
trigger_if = {
limit = { is_independent_ruler = no }
liege = { has_realm_law = bandit_crackdown_law }
}
}
can_pass = {
trigger_if = {
limit = {
top_liege = this
}
custom_tooltip = {
text = imperial_policy_laws_cooldown_desc
NOT = { has_variable = imperial_policy_laws_cooldown }
}
}
}
on_pass = {
## Set cooldown
set_variable = {
name = imperial_policy_laws_cooldown
years = @imperial_policy_laws_cooldown_value
}
tgp_imperial_policy_event_effect = yes
}
modifier = {
city_holding_build_gold_cost = -0.1
barons_and_minor_landholders_opinion = 15
monthly_county_control_growth_factor = 0.05
monthly_county_control_growth_add = 0.2
development_growth_factor = -0.15
travel_danger = -10
}
pass_cost = {
prestige = @imperial_policy_cost_value
}
ai_will_do = {
value = 0
if = {
limit = { capital_county.county_control <= low_county_control }
add = 150
}
}
}
}

View file

@ -1,124 +1,353 @@
In this folder, law groups and laws can be defined. law_group_name = {
== Inheritance == ### brief = default ( database key, optional )
Any heir that goes up one or more tier due to inheritance gets the laws of the dead ruler. # New rulers will use this law by default, provided its "should_start_with" trigger
Note that currently the law conditions are not checked in any way for law inheritance. # returns true or is undefined
#
default = law_name
== Structure == ### brief: cumulative ( bool, optional )
All script has the ruler as ROOT. # If set, each subsequent law in the group will provide all effects of the previous law
# default = no
#
cumulative = no
law_group_name = { ### brief: flag ( flag )
default = law_name # Optional. New rulers will by default use this law, as long as its "should_start_with" trigger returns true or is not defined # See below for flags with special treatment in code. These flags may also be checked
# in the data/GUI system with LawGroup.HasFlag('some_arbitrary_flag')
#
flag = some_arbitrary_flag
cumulative = yes # If set, each subsequent law in the group will provide all effects of the previous law ### brief: cumulative ( bool, optional )
# If set, this law group is considered part of the Treasury Budget set, and will be displayed within a specific
# budget interface.
# default = no
#
is_treasury_budget_group = no
flag = some_arbitrary_flag # See below for flags treated specially. Also can check it in the data/GUI system with LawGroup.HasFlag('some_arbitrary_flag') ### brief: can_change_law_group ( trigger )
# Optional trigger for law groups that maybe some rulers should see but cant change
# Default is leaving this empty - and then it will always be true
# If this trigger fails - the lawgroup will still be visible but can't be changed by the ruler
#
can_change_law_group = { }
law_name = { law_name = {
can_keep = { # Requirements for keeping the law in the ruler's scope. If this invalidates, the law will be replaced with the default law (see own section) within a month. Also checked after changing faith since doctrinal changes are likely to invalidate laws. Always true if not specified.
### brief: can_keep ( trigger )
# Requirements for keeping the law. If this invalidates, the law will
# be replaced with the default law (see own section) within a month.
# Also checked after changing faith since doctrinal changes are likely
# to invalidate laws. Always true if not specified.
# Root scope = ruler with the law
#
can_keep = { }
### brief: can_have ( trigger )
# Requirements for adopting the law in the ruler's scope. If this is true,
# the character is allowed to adopt the law and the law will show as
# available (but it can be currently disabled if can_pass is false).
# Always true if not specified.
# Root scope = ruler for whom we are checking the law
#
can_have = { }
### brief: can_pass ( trigger )
# Requirements for adopting the law in the ruler's scope. For more
# temporary conditions, e.g. being at war ("I can have the law, but
# can't pass it right now"). Always true if not specified.
# Root scope = ruler for whom we are checking the law
#
can_pass = { }
### brief: should_start_with ( trigger )
# If these conditions are true, this is a valid law for a ruler to start
# with. Note that it always includes the can_keep check.
# Root scope = ruler for whom we are checking the law
#
should_start_with = { }
### brief: can_title_have ( trigger )
# Requirements for titles being able to have this law. Always false if
# not specified.
# Root scope = title for which we are checking the law
#
can_title_have = { }
### brief: can_realm_have ( trigger )
# Requirements for characters being able to apply this law at realm level.
# Always false if not specified.
# By default, the following succession orders imply they can be applied to the whole realm:
# * inheritance
# * theocracy
# * company
# * generate
# * appointment
# Root scope = character for which we are checking the law
#
can_realm_have = { }
### brief: should_show_for_title ( trigger )
# Should this law be shown in the UI for titles?
#
should_show_for_title = { }
### brief: pass_cost ( scripted cost )
# The cost of enacting this law
# Root scope = ruler wanting to pass the law
#
pass_cost = { gold/piety/prestige = ... }
### brief: revoke_cost ( scripted cost )
# The cost of revoking or clearing this law
# Root scope = ruler wanting to revoke the law
#
revoke_cost = { gold/piety/prestige = ... }
### brief: modifier ( character modifier )
# Modifier applied to the ruler when this law is active
#
modifier = { }
### brief: flag ( flag )
# See below for flags treated specially. Can be checked in script
# with has_realm_law_flag = some_arbitrary_flag.
# See below for flags treated specially in code.
#
flag = some_arbitrary_flag
### brief: triggered_flag ( flag )
# Checks and adds flag only if the trigger's condition is met.
# Both trigger and flag *must* be specified within this block.
#
triggered_flag = {
# Some trigger, root is the ruler character scope
#
trigger = { ... }
# See below for flags treated specially in code. Can be checked in
# script with has_realm_law_flag = some_arbitrary_flag
#
flag = some_arbitrary_flag
} }
can_have = { # Requirements for adopting the law in the ruler's scope. If this is true, the character is allowed to adopt the law and the law will show as available (but it can be currantly disabled if can_pass is false). Always true if not specified. ### brief: shown_in_encyclopedia ( bool, optional )
} # If this law should show up in the Encyclopedia
# default = yes
#
shown_in_encyclopedia = yes
can_pass = { # Requirements for adopting the law in the ruler's scope. For more temporary conditions, e.g. being at war ("I can have the law, but can't pass it right now"). Always true if not specified. ### brief: on_pass ( effect )
} # Effect run just before law change.
# Effect run on the ruler when the law is added. Does *NOT* get run
# when default laws are initialized, nor when inheriting a law from
# someone else.
# Root = ruler in question
# If this is done on a title, the title is accessible as scope:title
#
on_pass = { }
should_start_with = { # If these conditions are true, this is a valid law to start with. Note that it always includes the can_keep check. ### brief: on_after_pass ( effect )
} # Effect run just after law change.
# Effect run on the ruler when the law is added. Does *NOT* get run
# when default laws are initialized, nor when inheriting a law from
# someone else.
# Root = ruler in question
# If this is done on a title, the title is accessible as scope:title
#
on_after_pass = { }
can_title_have = { # Requirements for titles being able to have this law, in the title's scope. Always false if not specified ### brief: on_revoke ( effect )
} # Effect run on ruler when the law is removed. Does *NOT* get run when
# law is removed due to inheriting a law from someone else.
# Root = ruler in question
# If this is done on a title, the title is accessible as scope:title
#
on_revoke = { }
should_show_for_title = { # Should the law be shown in the UI for titles? ### brief: succession ( struct, optional )
} # Succession rules. Any new law with a rule set will override the
# previous law's rule set.
pass_cost = { gold/piety/prestige = ... } # Cost of enacting this law
revoke_cost = { gold/piety/prestige = ... } # Cost of revoking or clearing this law
modifier = { # Modifier applied to the ruler when this law is active
}
flag = some_arbitrary_flag # See below for flags treated specially. Also can be checked in script with has_realm_law_flag = some_arbitrary_flag
triggered_flag = { # Checks and adds flag only if the trigger's condition is met. Both trigger and flag *must* be specified within this block
trigger = { <trigger> } # Some trigger (has character scope)
flag = some_arbitrary_flag # See below for flags treated specially. Also can be checked in script with has_realm_law_flag = some_arbitrary_flag
}
on_pass = { # Effect run on ruler when the law is added. Does *NOT* get run when default laws are initialized, nor when inheriting a law from someone else. If this is done on a title, the title is accessible as scope:title
}
on_revoke = { # Effect run on ruler when the law is removed. Does *NOT* get run when law is removed due to inheriting a law from someone else. If this is done on a title, the title is accessible as scope:title
}
# Succession rules. Any new law with a rule set will override the previous law's rule.
# Overriding is in law definition order # Overriding is in law definition order
#
succession = { succession = {
order_of_succession = inheritance/election/appointment/theocratic/company/generate/player_heir/noble_family
# For inheritance: ### brief: order_of_succession ( enum )
title_division = partition/single_heir # only "traversal_order = children" supports partition # Which order of succession ( provided by code ) does this law use?
#
# Options:
# inheritance
# election
# appointment ( requires traversal, division and rank be undefined )
# theocratic
# company
# generate
# generate_from_template
# player_heir
# noble_family
#
order_of_succession = inheritance
### brief: title_division ( enum )
# Used to determine how titles are split during succession
# Requires order_of_succession = inheritance or noble_family
#
# Options:
# partition ( only available when traversal_order = children )
# single_heir ( only valid for inheritance and noble_family order_of_succession )
#
title_division = partition
### brief: traversal_order ( enum )
# Determines which set of characters is considered when building
# the line of succession.
#
# Options:
# children( may only be defined if title_division = partition )
# dynasty
# dynasty_house
#
traversal_order = children/dynasty_house/dynasty traversal_order = children/dynasty_house/dynasty
rank = oldest/youngest ### brief: rank ( enum )
# Determines how characters in the line of succession are sorted
#
# Options:
# oldest
# youngest
#
rank = oldest
# For theocratic & company only: ### brief: pool_character_config ( database key, situational )
pool_character_config = key # entry in common/pool_character_selectors, used when choosing a character from the pool or generating a new one # Entry in common/pool_character_selectors, used when choosing a
# character from the pool or generating a new character.
# Only available for theocratic, company, and generate.
#
pool_character_config = key
# For election only: ### brief: election_type ( database key, situational )
election_type = key # entry in common/succession_election # Entry in common/succession_election, used to determine which type
# of election should be used for succession.
# Only available for election.
#
election_type = key
# For appointment only: ### brief: appointment_type ( database key, situational )
appointment_type = key # entry in common/succession_appointment # Entry in common/succession_appointment, used to determine which type
# of appointment should be used for succession.
# Only available for appointment.
#
appointment_type = key
# Generic rules:
gender_law = male_only/male_preference/equal/female_preference/female_only
faith = same_faith/same_religion/same_family # Faith restrictions on who can inherit. If no one fulfilling this is found, the restriction is ignored (but titles with the flag destroy_if_invalid_heir = yes will be destroyed) ### Generic Rules
create_primary_tier_titles = yes # If set, then under partition all titles you can create of your primary tier will be created for free, resulting in a more split-up realm ### brief: gender_law ( enum, optional )
# Used to determine which gender(s) are valid for succession.
#
# Options:
# male_only
# male_preference
# equal
# female_preference
# female_only
#
gender_law = equal
primary_heir_minimum_share = 0.5 # The primary heir will get at least this portion of titles, which means if there's a lot of heirs the primary still gets a lot of land ### brief: gender_law ( enum, optional )
# Used to determine which faith(s) are valid for succession.
# If no character fulfilling this requirement is found, the restriction
# is ignored (but titles with the flag destroy_if_invalid_heir = yes
# will be destroyed).
#
# Options:
# same_faith
# same_religion
# same_family
#
faith = same_faith
exclude_rulers = yes # If set, the title can not be inherited by rulers (anyone with titles) ### brief: create_primary_tier_titles ( bool, optional )
# If set, then under partition all titles you can create of your primary
# tier will be created for free, resulting in a more split-up realm
# default = no
#
create_primary_tier_titles = no
limit_to_courtiers = no # If set, only immediate courtiers and away courtiers of a ruler will be allowed to inherit ### brief: primary_heir_minimum_share ( fixed point, optional )
# If defined, the primary heir will get at least this portion of
# titles, which means if there's a lot of heirs the primary still
# gets a guaranteed amount of land
#
primary_heir_minimum_share = 0.5
### brief: exclude_rulers ( bool, optional )
# If set, the title can not be inherited by rulers (anyone with titles)
# default = no
#
exclude_rulers = no
### brief: limit_to_courtiers ( bool, optional )
# If set, only immediate courtiers and away courtiers of a ruler
# will be allowed to inherit
# default = no
#
limit_to_courtiers = no
} }
ai_will_do = { ... } # Script value in ruler scope. If above 0, the AI will enact this law if able. Law enactment is checked in the RARE_TASK_TICK. If multiple laws are possible, the AI will enact the one with the highest score ### brief: ai_will_do ( value )
# Script value in the ruler scope. If above 0, the AI will enact this
# law if able. Law enactment is checked in the RARE_TASK_TICK. If multiple
# laws are possible, the AI will enact the one with the highest score.
# Root scope = ruler in question
#
ai_will_do = { ... }
} }
# Multiple laws can be defined in a single law group.
another_law_name = {} another_law_name = {}
} }
== Default law == ### NOTES ###
### Inheritance ###
Any heir that goes up one or more tier due to inheritance gets the laws of the dead ruler.
Note that currently the law conditions are not checked in any way for law inheritance.
### Default law ###
All rulers have a single law from each group. All rulers have a single law from each group.
If a group has a default set, that law will be checked first. If a group has a default set, that law will be checked first.
Otherwise, or if it is invalid, the laws are checked in definition order. Otherwise, or if it is invalid, the laws are checked in definition order.
The first checked law where "should_start_with" returns true (or does not exist) gets used. Note that "can_pass" is ignored entirely. The first checked law where "should_start_with" returns true (or does not exist) gets used. Note that "can_pass" is ignored entirely when determining a default law.
When a default law is set, "on_pass" is *not* executed When a default law is set, "on_pass" is *not* executed
== Title Succession Laws == ### Title Succession Laws ###
Laws are usually defined for realm. However some succession laws are valid for only titles, or for both realms and titles: Laws are usually defined for realm. However some succession laws are valid for titles.
Title only: This is primary based on order_of_succession:
- order_of_succession = elective
Realm only:
- order_of_succession = theocratic/company
- order_of_succession = inheritance + title_division = partition
Realm & Title:
- order_of_succession = inheritance + title_division = single_heir
== Associated loc == Title only:
player_heir
election
noble_family
generate_from_template
Realm only:
inheritance ( title_division = partition )
theocratic
company
generate
Realm & Title:
inheritance ( title_division = single_heir )
appointment
### Associated Localization ###
The key of the law will be used as its name. E.G., law_name: "Law Name" The key of the law will be used as its name. E.G., law_name: "Law Name"
The key plus "_effects" can optionally be defined to provide custom effects. E.G., law_name_effects: "Does some law thingy" The key plus "_effects" can optionally be defined to provide custom effects. E.G., law_name_effects: "Does some law thingy"
The key plus "_effects_not_in_prev" can optionally be defined to provide custom effects that should *not* be included when listing effects inherited from earlier laws. E.G., law_name_effects_not_in_prev: "Does some law thingy" The key plus "_effects_not_in_prev" can optionally be defined to provide custom effects that should *not* be included when listing effects inherited from earlier laws. E.G., law_name_effects_not_in_prev: "Does some law thingy"
CHARACTER.GetActiveLawInGroupWithFlag('realm_law') - Will get the character's active law in a group. The group must have the given flag. Note that it does not work for dead characters CHARACTER.GetActiveLawInGroupWithFlag('realm_law') - Will get the character's active law in a group. The group must have the given flag. Note that it does not work for dead characters
== Hardcoded flags == ### Hardcoded Flags ###
Some flags have special meaning, and are used by the game code. Some flags have special meaning, and are used by the game code.
Law Groups: Law Groups:

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,385 @@
# Adds $FLAG$ to the character if a player
add_achievement_flag_effect = {
if = {
limit = {
is_ai = no
}
add_character_flag = $FLAG$
}
}
# Adds $VALUE$ to the character $VARIABLE$ if a player, sets to zero first if not already a present variable
add_achievement_variable_effect = {
if = {
limit = {
is_ai = no
}
if = {
limit = {
NOT = { has_variable = $VARIABLE$ }
}
set_variable = {
name = $VARIABLE$
value = 0
}
}
change_variable = {
name = $VARIABLE$
add = $VALUE$
}
}
}
# Sets $VALUE$ to the global variable named $VARIABLE$ if a player
add_achievement_global_variable_effect = {
if = {
limit = {
is_ai = no
}
set_global_variable = {
name = $VARIABLE$
value = $VALUE$
}
}
}
# Adds $FLAG$ to list of unavailable achievements if a player
add_to_global_unavailable_achievements_list_effect = {
if = {
limit = {
is_ai = no
}
add_to_global_variable_list = {
name = unavailable_achievements
target = $FLAG$
}
}
}
fp2_had_friend_with_benefits = { # History's Best Friend
if = {
limit = {
is_ai = no
has_fp2_dlc_trigger = yes
has_relation_best_friend = scope:had_sex_with_effect_partner
AND = { # Implicit for readability
culture = { has_cultural_tradition = tradition_fp2_ritualised_friendship }
scope:had_sex_with_effect_partner.culture = { has_cultural_tradition = tradition_fp2_ritualised_friendship }
}
}
add_achievement_global_variable_effect = { # (Has additional check for consistency)
VARIABLE = fp2_historys_best_friends_achievement_unlocked
VALUE = yes
}
}
}
fp2_holiday_in_iberia_check = {
if = {
limit = { exists = global_var:fp2_holiday_in_iberia_achievement_unlocked }
add_achievement_global_variable_effect = {
VARIABLE = fp2_holiday_in_iberia_achievement_unlocked
VALUE = yes
}
}
}
ep2_im_in_my_elements_terrain_grabber_effect = {
# Grab various terrain types and add them to a list.
## Plains
if = {
limit = {
location = { terrain = plains }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:plains
}
}
## Sea
else_if = {
limit = {
location = { terrain = sea }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:sea
}
}
## Coastal_sea
else_if = {
limit = {
location = { terrain = coastal_sea }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:coastal_sea
}
}
## Farmlands
else_if = {
limit = {
location = { terrain = farmlands }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:farmlands
}
}
## Hills
else_if = {
limit = {
location = { terrain = hills }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:hills
}
}
## Mountains
else_if = {
limit = {
location = { terrain = mountains }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:mountains
}
}
## Desert
else_if = {
limit = {
location = { terrain = desert }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:desert
}
}
## Desert_mountains
else_if = {
limit = {
location = { terrain = desert_mountains }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:desert_mountains
}
}
## Oasis
else_if = {
limit = {
location = { terrain = oasis }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:oasis
}
}
## Jungle
else_if = {
limit = {
location = { terrain = jungle }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:jungle
}
}
## Forest
else_if = {
limit = {
location = { terrain = forest }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:forest
}
}
## Taiga
else_if = {
limit = {
location = { terrain = taiga }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:taiga
}
}
## Wetlands
else_if = {
limit = {
location = { terrain = wetlands }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:wetlands
}
}
## Steppe
else_if = {
limit = {
location = { terrain = steppe }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:steppe
}
}
## Floodplains
else_if = {
limit = {
location = { terrain = floodplains }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:floodplains
}
}
## Drylands
else_if = {
limit = {
location = { terrain = drylands }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:drylands
}
}
## Terraced Hills
else_if = {
limit = {
location = { terrain = terraced_hills }
}
add_to_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:terraced_hills
}
}
# Error suppression.
if = {
limit = {
always = no
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:plains
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:sea
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:coastal_sea
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:farmlands
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:hills
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:mountains
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:desert
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:desert_mountains
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:oasis
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:jungle
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:forest
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:taiga
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:wetlands
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:steppe
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:floodplains
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:drylands
}
is_target_in_variable_list = {
name = ep2_im_in_my_elements_achievement_terrain_list
target = flag:terraced_hills
}
}
}
}
player_succeeded_at_a_thousand_and_one_nights_achievement_effect = {
scope:host = {
if = {
limit = {
exists = global_var:started_a_thousand_and_one_nights_achievement
is_ai = no
}
set_global_variable = {
name = finished_a_thousand_and_one_nights_achievement
value = yes
}
}
}
}
process_tour_achievement_tallies_effect = {
scope:host = {
if = {
limit = {
exists = global_var:started_the_grandest_tour_achievement
is_ai = no
scope:stop_host_scope.highest_held_title_tier >= tier_kingdom
}
scope:activity = {
add_to_variable_list = {
name = the_grandest_tour_achievement_tally_list
target = scope:stop_host_scope
}
}
}
if = {
limit = {
exists = global_var:started_imperial_march_achievement
is_ai = no
scope:activity = {
has_activity_option = {
category = special_type
option = tour_type_intimidation
}
}
scope:stop_host_scope = { is_powerful_vassal = yes }
}
scope:activity = {
add_to_variable_list = {
name = imperial_march_achievement_list
target = scope:stop_host_scope
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -22,29 +22,169 @@ change_to_administrative_hereditary_effect = {
change_to_administrative_effect = { change_to_administrative_effect = {
save_scope_as = governor save_scope_as = governor
top_liege = { save_scope_as = governor_liege }
if = { if = {
limit = { limit = {
NOT = { government_has_flag = government_is_administrative } OR = {
NOT = { government_allows = administrative }
AND = {
government_allows = administrative
scope:governor_liege = { government_has_flag = government_is_japan_administrative }
NOT = { government_has_flag = government_is_japan_administrative }
}
AND = {
government_allows = administrative
scope:governor_liege = { government_has_flag = government_is_meritocratic }
NOT = { government_has_flag = government_is_meritocratic }
}
AND = {
government_allows = administrative
scope:governor_liege = { government_has_flag = government_is_celestial }
NOT = { government_has_flag = government_is_celestial }
}
AND = {
government_allows = administrative
scope:governor_liege = { government_has_flag = government_is_steppe_admin }
NOT = { government_has_flag = government_is_steppe_admin }
}
}
}
# Only case where Estate type is shared between Admin and non-Admin
if = {
limit = {
NAND = {
government_has_flag = government_is_japan_feudal
scope:governor_liege = { government_has_flag = government_is_japan_administrative }
}
} }
change_government = administrative_government
save_scope_as = new_admin save_scope_as = new_admin
} }
# Change government
if = { if = {
limit = { limit = {
primary_title.tier >= tier_duchy scope:governor_liege = { government_has_flag = government_is_japan_administrative }
}
tgp_domicile_conversion_when_changing_government_type = {
NEW_DOMICILE_TYPE = japanese_manor
NEW_GOVERNMENT_TYPE = japan_administrative_government
}
change_government = japan_administrative_government
}
else_if = {
limit = {
OR = {
#This is Mongol breakup and they are hegemon
AND = {
exists = scope:great_yuan_ruler
this = scope:great_yuan_ruler
primary_title = title:h_china
}
scope:governor_liege = { government_has_flag = government_is_celestial }
}
}
capital_province = {
if = {
limit = {
OR = {
has_holding_type = tribal_holding
has_holding_type = herder_holding
has_holding_type = nomad_holding
}
}
set_holding_type = castle_holding
}
}
tgp_domicile_conversion_when_changing_government_type = {
NEW_DOMICILE_TYPE = east_asian_estate
NEW_GOVERNMENT_TYPE = celestial_government
}
change_government = celestial_government
}
else_if = {
limit = {
scope:governor_liege = { government_has_flag = government_is_steppe_admin }
}
capital_province = {
if = {
limit = {
OR = {
has_holding_type = tribal_holding
has_holding_type = herder_holding
has_holding_type = nomad_holding
}
}
set_holding_type = castle_holding
}
}
tgp_domicile_conversion_when_changing_government_type = {
NEW_DOMICILE_TYPE = east_asian_estate
NEW_GOVERNMENT_TYPE = steppe_admin_government
}
change_government = steppe_admin_government
}
else_if = {
limit = {
OR = {
scope:governor_liege = { government_has_flag = government_is_meritocratic }
tgp_should_become_meritocratic_trigger = yes
}
}
capital_province = {
if = {
limit = {
OR = {
has_holding_type = tribal_holding
has_holding_type = herder_holding
has_holding_type = nomad_holding
}
}
set_holding_type = castle_holding
}
}
tgp_domicile_conversion_when_changing_government_type = {
NEW_DOMICILE_TYPE = east_asian_estate
NEW_GOVERNMENT_TYPE = meritocratic_government
}
change_government = meritocratic_government
}
else = {
capital_province = {
if = {
limit = {
OR = {
has_holding_type = tribal_holding
has_holding_type = herder_holding
has_holding_type = nomad_holding
}
}
set_holding_type = castle_holding
}
}
add_character_flag = new_government_is_byz_admin
tgp_domicile_conversion_when_changing_government_type = {
NEW_DOMICILE_TYPE = estate
NEW_GOVERNMENT_TYPE = administrative_government
}
change_government = administrative_government
remove_character_flag = new_government_is_byz_admin
}
}
if = {
limit = {
primary_title.tier >= min_appointment_tier
liege = { liege = {
is_independent_ruler = yes scope:governor_liege = this
government_has_flag = government_is_administrative government_allows = administrative
} }
house.house_head = { house.house_head = {
top_liege = scope:governor_liege
NOT = { NOT = {
any_held_title = { is_noble_family_title = yes } any_held_title = { is_noble_family_title = yes }
} }
} }
} }
create_noble_family_effect = yes create_noble_family_effect = { GOVERNMENT_GIVER = top_liege }
} }
hidden_effect = { hidden_effect = {
if = { if = {
limit = { limit = {
@ -55,7 +195,10 @@ change_to_administrative_effect = {
} }
} }
if = { if = {
limit = { exists = scope:new_admin } limit = {
exists = scope:new_admin
exists = domicile
}
domicile ?= { domicile ?= {
set_up_domicile_estate_effect = yes set_up_domicile_estate_effect = yes
} }
@ -64,6 +207,40 @@ change_to_administrative_effect = {
change_to_administrative_interaction_effect = { change_to_administrative_interaction_effect = {
scope:actor = { scope:actor = {
if = {
limit = { has_treasury = yes }
pay_short_term_treasury = {
target = scope:recipient
treasury = {
value = 50
scope:recipient = {
if = {
limit = { highest_held_title_tier >= tier_kingdom }
multiply = 10
}
else_if = {
limit = { highest_held_title_tier >= tier_duchy }
multiply = 6
}
else_if = {
limit = { highest_held_title_tier >= tier_county }
multiply = 3
}
}
if = {
limit = { scope:gold ?= yes }
add = scope:actor.medium_gold_value
}
if = {
limit = {
scope:actor = { has_realm_law_flag = admin_change_vassal_gov_cheaper }
}
multiply = 0.5
}
}
}
}
else = {
pay_short_term_gold = { pay_short_term_gold = {
target = scope:recipient target = scope:recipient
gold = { gold = {
@ -95,7 +272,22 @@ change_to_administrative_interaction_effect = {
} }
} }
} }
scope:recipient = { change_to_administrative_effect = yes } }
scope:recipient = {
change_to_administrative_effect = yes
#And now we also convert all the administrative vassals below so they also match the actor's form of admin.
#For non admin sub-vassals the newly converted main vassal can still ask using the same interaction but we
hidden_effect = {
every_vassal_or_below = {
limit = {
government_allows = administrative
is_ai = yes #Humans get to be asked directly
}
change_to_administrative_effect = yes
}
}
}
if = { if = {
limit = { limit = {
scope:hook = yes scope:hook = yes
@ -118,41 +310,6 @@ change_to_administrative_interaction_effect = {
} }
} }
set_up_domicile_patrician_estate_effect = {
if = {
limit = { is_domicile_type = patrician_estate }
# Intentionally one level lower than what you can get
if = {
limit = {
NOT = { has_domicile_building_or_higher = estate_main_02 }
owner.culture ?= { has_innovation = innovation_city_planning }
}
add_domicile_building = estate_main_02
}
if = {
limit = {
has_domicile_building = estate_main_02
NOT = { has_domicile_building_or_higher = estate_main_03 }
owner.culture ?= { has_innovation = innovation_manorialism }
}
add_domicile_building = estate_main_03
}
switch = {
trigger = has_domicile_building
estate_main_03 = {
while = {
count = 2
add_random_internal_estate_building = yes
}
}
estate_main_02 = {
add_random_internal_estate_building = yes
}
}
fill_external_estate_building_effect = yes
}
}
set_up_domicile_estate_effect = { set_up_domicile_estate_effect = {
if = { if = {
limit = { is_domicile_type = estate } limit = { is_domicile_type = estate }
@ -172,6 +329,7 @@ set_up_domicile_estate_effect = {
} }
add_domicile_building = estate_main_03 add_domicile_building = estate_main_03
} }
hidden_effect = {
switch = { switch = {
trigger = has_domicile_building trigger = has_domicile_building
estate_main_03 = { estate_main_03 = {
@ -184,7 +342,98 @@ set_up_domicile_estate_effect = {
add_random_internal_estate_building = yes add_random_internal_estate_building = yes
} }
} }
}
fill_external_estate_building_effect = yes fill_external_estate_building_effect = yes
} }
else_if = {
limit = { is_domicile_type = japanese_manor }
# Intentionally one level lower than what you can get
if = {
limit = {
NOT = { has_domicile_building_or_higher = japanese_manor_main_02 }
owner.culture ?= { has_innovation = innovation_city_planning }
}
add_domicile_building = japanese_manor_main_02
}
if = {
limit = {
has_domicile_building = japanese_manor_main_02
NOT = { has_domicile_building_or_higher = japanese_manor_main_03 }
owner.culture ?= { has_innovation = innovation_manorialism }
}
add_domicile_building = japanese_manor_main_03
}
hidden_effect = {
switch = {
trigger = has_domicile_building
japanese_manor_main_03 = {
while = {
count = 2
add_random_internal_japanese_manor_building = yes
}
}
japanese_manor_main_02 = {
add_random_internal_japanese_manor_building = yes
}
}
}
fill_external_japanese_manor_building_effect = yes
}
else_if = {
limit = { is_domicile_type = east_asian_estate }
# Intentionally one level lower than what you can get
if = {
limit = {
NOT = { has_domicile_building_or_higher = east_asian_estate_main_02 }
owner.culture ?= { has_innovation = innovation_city_planning }
}
add_domicile_building = east_asian_estate_main_02
}
if = {
limit = {
has_domicile_building = east_asian_estate_main_02
NOT = { has_domicile_building_or_higher = east_asian_estate_main_03 }
owner.culture ?= { has_innovation = innovation_manorialism }
}
add_domicile_building = east_asian_estate_main_03
}
hidden_effect = {
switch = {
trigger = has_domicile_building
east_asian_estate_main_03 = {
while = {
count = 2
add_random_internal_east_asian_estate_building = yes
}
}
east_asian_estate_main_02 = {
add_random_internal_east_asian_estate_building = yes
}
}
}
fill_external_east_asian_estate_building_effect = yes
}
} }
noble_family_title_realm_setup_effect = {
save_scope_as = top_liege
every_noble_family = {
save_scope_as = nf_title
holder ?= {
save_scope_as = nf_holder
house ?= {
save_scope_as = nf_house
# Ensure holders of historical noble family titles are the default house heads
if = {
limit = { house_head != scope:nf_holder }
set_house_head = scope:nf_holder
}
}
}
scope:nf_title = {
set_color_from_title = scope:nf_holder.capital_county
# Ensure Noble Family CoA match House
set_coa = scope:nf_house
}
}
}

View file

@ -0,0 +1,653 @@

#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#### Extramaritial sex effects: applies adultery/fornicator traits, opionions and informs spouse. Needs SPOUSE_EVENT = yes/no
# extramarital_sex_attempt_exposure_consequences_with_target_effect - for failed sex attempts, spouse does not dislike target
# extramarital_sex_exposure_consequences_with_target_effect - standard one for exposure (note, you have to run this on both characters!)
# extramaritial_sex_exposure_consequences_with_had_recent_sex_var_effect - for sex without targets, based on had_recent_sex var (set in had_sex_with_unknown_effect)
# extramarital_sex_exposure_consequences_effect - "support" effect
# extramarital_sex_discovery_consequences_with_target_effect
# - standard one discovery (note, you have to run this on both characters!)
# mother_of_young_child_has_lover_variable_effect
# - when adultery has been discovered, this effect can set if paternity could be doubted
# spy_on_mother_pregnancy_adultery_effect
# expose_lover_secret_or_run_consequence_effect
# - Checks for the existence of a Lover Secret with a target, and which either exposes it, or runs the extramarital_sex_exposure_consequences_with_target_effect for both characters. Takes TARGET and EXPOSER
#####################################################################
# EFFECTS
#####################################################################
####Extramaritial sex effects:
#To be used when a character is exposed/discovered as an adulterer/fornicator (for the consequences, not the exposure/discovery itself). Lover secret exposure, discovered seduce schemes, events.
# Exposure effects: These are used when the cheating has been made public (i.e. not for secret discovery without exposure)
# Discovery effects: These re used when the cheating is not public, but a partner has discovered the cheater
#The target version is for situations where it's known who the other character was and adds some opinion penalties and consequences for them as well.
extramarital_sex_exposure_consequences_with_target_effect = { #Note: only adds stuff for one of the sex partners, it must be run twice! It is intentionally kept this way so you can apply it in two different places in an event chain etc.
save_temporary_scope_as = sex_character
#Applies traits, piety level loss, unfaithfulness opinions
$TARGET$ = { save_scope_as = sex_partner }
if = { # Check to make absolutely sure it's extramarital
limit = {
NOT = { scope:sex_character = { is_consort_of = scope:sex_partner } }
}
if = { # Check to make sure your culture isn't A-okay with this
limit = {
NOT = {
culture = { has_cultural_parameter = adultery_always_accepted }
}
}
extramarital_sex_exposure_consequences_effect = { SPOUSE_EVENT = $SPOUSE_EVENT$ }
#Slept with spouse opinions & potential rivalry
$TARGET$ = {
every_spouse = {
limit = { this != scope:sex_character } #Extra safety
save_scope_as = sex_partner_spouse
hidden_effect = {
#Remove duplicate opinion from discovery
if = {
limit = {
has_opinion_modifier = {
target = scope:sex_character
modifier = slept_with_spouse_discovered_opinion
}
}
remove_opinion = {
target = scope:sex_character
modifier = slept_with_spouse_discovered_opinion
}
}
}
if = {
limit = { accepts_adultery_without_penalty_trigger = no }
if = { #(only visible for directly relevant exposure)
limit = {
always = yes
}
add_opinion = {
target = scope:sex_character
modifier = slept_with_spouse_exposed_opinion
}
}
else = {
hidden_effect = {
add_opinion = {
target = scope:sex_character
modifier = slept_with_spouse_exposed_opinion
}
}
}
hidden_effect = {
#Rivalry
if = {
limit = {
is_ai = yes
scope:sex_character = { is_ai = yes }
ai_vengefulness >= medium_positive_ai_value
can_set_relation_nemesis_trigger = { CHARACTER = scope:sex_character }
}
set_relation_nemesis = {
reason = nemesis_extramarital_sex_exposure
copy_reason = rival
target = scope:sex_character
involved_character = scope:sex_partner
}
}
else = {
scope:sex_partner = { save_scope_as = relationship_reason_involved_character }
progress_towards_rival_effect = { CHARACTER = scope:sex_character OPINION = 0 REASON = rival_slept_with_spouse }
clear_saved_scope = relationship_reason_involved_character
}
# HOUSE RELATIONS
if = {
limit = {
exists = house
exists = scope:sex_character.house
}
house = {
change_house_relation_effect = {
HOUSE = scope:sex_character.house
VALUE = house_relation_damage_medium_value
REASON = cuckoldry
CHAR = scope:sex_character
TARGET_CHAR = root
TITLE = scope:dummy_gender
}
}
}
}
}
}
}
}
}
}
extramaritial_sex_exposure_consequences_with_had_recent_sex_var_effect = {
if = {
limit = { exists = var:had_recent_sex }
if = {
limit = { var:had_recent_sex = flag:male }
dummy_male = { save_scope_as = unknown_sex_partner }
}
else = {
dummy_female = { save_scope_as = unknown_sex_partner }
}
extramarital_sex_exposure_consequences_effect = { SPOUSE_EVENT = $SPOUSE_EVENT$ }
}
}
extramarital_sex_attempt_exposure_consequences_with_target_effect = {
#Applies traits, piety level loss, unfaithfulness opinions
$TARGET$ = { save_scope_as = sex_partner }
save_scope_value_as = { #For use desc in adultery.4001
name = unsuccessful_sex_attempt
value = yes
}
extramarital_sex_exposure_consequences_effect = { SPOUSE_EVENT = $SPOUSE_EVENT$ }
}
extramarital_sex_exposure_consequences_effect = {
save_temporary_scope_as = sex_character
save_temporary_scope_value_as = {
name = spouse_event
value = $SPOUSE_EVENT$
}
#APPLY TRAITS & REMOVE PIETY LEVELS
add_adulterer_fornicator_trait_or_nothing_effect = yes
remove_piety_level_for_shunned_or_criminal_trait_effect = { TRAIT = adulterer } #Fornicator falls under same doctrine
if = {
limit = {
OR = {
AND = {
exists = scope:sex_partner
relation_with_character_is_sodomy_in_my_or_lieges_faith_trigger = { CHARACTER = scope:sex_partner }
}
AND = {
exists = scope:unknown_sex_partner
relation_with_character_is_sodomy_in_my_or_lieges_faith_trigger = { CHARACTER = scope:unknown_sex_partner }
}
}
}
add_trait = sodomite
remove_piety_level_for_shunned_or_criminal_trait_effect = { TRAIT = sodomite }
}
if = {
limit = {
exists = scope:sex_partner
relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = scope:sex_partner }
}
add_trait = incestuous
remove_piety_level_for_shunned_or_criminal_trait_effect = { TRAIT = incestuous }
}
#Family Feud
house_feud_lover_exposure_effect = yes
#APPLY UNFAITHFUL OPINIONS TOWARDS SPOUSES AND LOVERS (only visible for directly relevant exposure)
if = {
limit = {
always = yes
}
every_relation = {
type = soulmate
limit = {
soulmate_relation_is_exclusive_trigger = yes
NOT = { #So we don't add it both at discovery and exposure
has_opinion_modifier = {
target = scope:sex_character
modifier = betrayed_our_promise
}
}
}
add_opinion = {
target = scope:sex_character
modifier = betrayed_our_promise
}
}
every_spouse = {
if = {
limit = { accepts_adultery_without_penalty_trigger = no }
add_opinion = {
target = scope:sex_character
modifier = unfaithful_spouse_exposed_opinion
}
}
}
}
else = {
hidden_effect = {
every_relation = {
type = soulmate
limit = {
soulmate_relation_is_exclusive_trigger = yes
NOT = { #So we don't add it both at discovery and exposure
has_opinion_modifier = {
target = scope:sex_character
modifier = betrayed_our_promise
}
}
}
add_opinion = {
target = scope:sex_character
modifier = betrayed_our_promise
}
}
every_spouse = {
if = {
limit = { accepts_adultery_without_penalty_trigger = no }
add_opinion = {
target = scope:sex_character
modifier = unfaithful_spouse_exposed_opinion
}
}
}
}
}
every_spouse = {
hidden_effect = {
#Remove duplicate opinion from discovery
if = {
limit = {
has_opinion_modifier = {
target = scope:sex_character
modifier = unfaithful_spouse_discovered_opinion
}
}
remove_opinion = {
target = scope:sex_character
modifier = unfaithful_spouse_discovered_opinion
}
}
}
#NOTIFY SPOUSE (SHOULD ALWAYS BE "NO" IF EFFECT IS USED ON SECRET EXPOSURE)
if = {
limit = {
scope:spouse_event = yes
accepts_adultery_without_penalty_trigger = no
}
scope:sex_character = { save_scope_as = adultery_spouse }
trigger_event = adultery.4001
}
}
}
extramarital_sex_discovery_consequences_with_target_effect = {
save_temporary_scope_as = sex_character
# If the discoverer is my partner
if = {
limit = {
OR = {
is_consort_of = $DISCOVERER$
has_relation_lover = $DISCOVERER$
has_relation_soulmate = $DISCOVERER$
}
}
#Spouse and lover opinions
$DISCOVERER$ = {
if = {
limit = {
has_relation_soulmate = scope:sex_character
soulmate_relation_is_exclusive_trigger = yes
NOT = { $TARGET$ = $DISCOVERER$ }
}
add_opinion = {
target = scope:sex_character
modifier = betrayed_our_promise
}
}
if = {
limit = {
is_consort_of = scope:sex_character
accepts_adultery_without_penalty_trigger = no
}
add_opinion = {
target = scope:sex_character
modifier = unfaithful_spouse_discovered_opinion
}
}
}
}
# If the discoverer is my sex partner's spouse
if = {
limit = {
$TARGET$ = {
is_consort_of = $DISCOVERER$
}
}
$DISCOVERER$ = {
if = {
limit = { accepts_adultery_without_penalty_trigger = no }
add_opinion = {
target = scope:sex_character
modifier = slept_with_spouse_discovered_opinion
}
}
}
}
}
###misc
mother_of_young_child_has_lover_variable_effect = {
if = {
limit = {
$LOVER_1$ = { sex_opposite_of = $LOVER_2$ }
}
#Who is the woman?
if = {
limit = { $LOVER_1$ = { is_female = yes } }
$LOVER_1$ = { save_temporary_scope_as = mother_check }
}
else = {
$LOVER_2$ = { save_temporary_scope_as = mother_check }
}
#Is SPOUSE the woman's spouse, and do they have a young child together?
$SPOUSE$ = {
if = {
limit = {
is_spouse_of = scope:mother_check
any_child = {
is_child_of = scope:mother_check
NOR = {
has_trait = bastard
has_trait = legitimized_bastard
}
age <= 5
}
}
set_variable = {
name = mother_of_young_child_has_lover
value = scope:mother_check
}
}
}
}
}
spy_on_mother_pregnancy_adultery_effect = {
show_as_tooltip = {
if = { # Check whether root or Spymaster should spy
limit = {
exists = cp:councillor_spymaster
NOT = { cp:councillor_spymaster = scope:mother }
cp:councillor_spymaster.intrigue > intrigue
}
cp:councillor_spymaster = {
duel = {
skill = intrigue
target = scope:mother
6 = {
compare_modifier = {
value = scope:duel_value
multiplier = 0.5
min = -5
}
desc = adultery.1003.duel_success
root = {
custom_tooltip = adultery.1003.duel_success_tt
}
}
4 = {
compare_modifier = {
value = scope:duel_value
multiplier = -0.5
min = -3
}
desc = adultery.1003.duel_failure
root = {
reverse_add_opinion = {
target = scope:mother
modifier = spied_on_me_opinion
}
}
}
}
}
}
else = {
duel = {
skill = intrigue
target = scope:mother
6 = {
compare_modifier = {
value = scope:duel_value
multiplier = 0.5
min = -5
}
desc = adultery.1003.duel_success
custom_tooltip = adultery.1003.duel_success_tt
}
4 = {
compare_modifier = {
value = scope:duel_value
multiplier = -0.5
min = -3
}
desc = adultery.1003.duel_failure
reverse_add_opinion = {
target = scope:mother
modifier = spied_on_me_opinion
}
}
}
}
}
hidden_effect = {
scope:mother = {
if = {
limit = {
is_alive = yes
}
add_character_flag = {
flag = father_suspects_this_pregnancy
months = 8
}
}
}
if = { # Check whether root or Spymaster should spy
limit = {
exists = cp:councillor_spymaster
NOT = { cp:councillor_spymaster = scope:mother }
cp:councillor_spymaster.intrigue > intrigue
}
cp:councillor_spymaster = {
duel = {
skill = intrigue
target = scope:mother
6 = {
compare_modifier = {
value = scope:duel_value
multiplier = 0.5
min = -5
}
trigger = {
scope:mother.pregnancy_real_father != root
exists = scope:mother.pregnancy_assumed_father
}
root = {
debug_spouse_and_pregnancy_real_father_effect = yes
trigger_event = {
id = adultery.1004
days = { 10 15 }
}
}
}
4 = {
compare_modifier = {
value = scope:duel_value
multiplier = -0.5
min = -3
}
root = {
trigger_event = {
id = adultery.1009
days = { 10 15 }
}
}
}
}
}
}
else = {
duel = {
skill = intrigue
target = scope:mother
6 = {
compare_modifier = {
value = scope:duel_value
multiplier = 0.5
min = -5
}
trigger = {
scope:mother.pregnancy_real_father != root
}
debug_spouse_and_pregnancy_real_father_effect = yes
trigger_event = {
id = adultery.1004
days = { 10 15 }
}
}
4 = {
compare_modifier = {
value = scope:duel_value
multiplier = -0.5
min = -3
}
compare_modifier = {
trigger = {
exists = cp:councillor_spymaster
cp:councillor_spymaster = scope:mother.pregnancy_real_father
}
target = cp:councillor_spymaster
value = intrigue
multiplier = 5
}
trigger_event = {
id = adultery.1009
days = { 10 15 }
}
}
}
}
}
}
expose_lover_secret_or_run_consequence_effect = {
# TARGET = lover to be checked
# EXPOSER = secret_exposer in case of a Secret reveal
# Look for a Lover Secret and save it if one exists
if = {
limit = {
$TARGET$ = { is_alive = yes} # Check whether the other party is still alive
any_secret = {
type = secret_lover
secret_target = $TARGET$
}
}
random_secret = {
type = secret_lover
limit = {
secret_target = $TARGET$
}
save_scope_as = lover_secret_to_expose
}
}
# Expose the Secret if it exists
if = {
limit = {
exists = scope:lover_secret_to_expose
}
scope:lover_secret_to_expose = {
expose_secret = $EXPOSER$
}
}
# Otherwise run the expose effects
else = {
if = {
limit = {
is_spouse_of = $EXPOSER$
}
extramarital_sex_exposure_consequences_with_target_effect = {
TARGET = $TARGET$
SPOUSE_EVENT = no
}
}
else = {
extramarital_sex_exposure_consequences_with_target_effect = {
TARGET = $TARGET$
SPOUSE_EVENT = yes
}
}
save_scope_as = this_character
if = {
limit = { $TARGET$ = { is_alive = yes } } # Check whether the other party is still alive
$TARGET$ = {
extramarital_sex_exposure_consequences_with_target_effect = {
TARGET = scope:this_character
SPOUSE_EVENT = yes
}
}
}
}
}
debug_spouse_and_pregnancy_real_father_effect = {
scope:mother.pregnancy_real_father = { save_scope_as = real_father }
scope:mother.pregnancy_assumed_father = { save_scope_as = assumed_father }
if = {
limit = { scope:real_father = scope:assumed_father }
debug_log = "Real Father and Assumed Father were the same!"
}
else = {
#debug_log = "Adultery discovered from spying on mother!"
#debug_log_scopes = yes
}
}

View file

@ -0,0 +1,90 @@
#####################################################################
# EFFECT LIST
#####################################################################
# Effects used in the Adventure Inspiration
start_adventure_effect = {
#To save the location so we can use it in the effect checking the distance
set_adventure_distance_variable_effect = { # Figure out how far it is there
ADVENTURER = $ADVENTURER$
DESTINATION = $LOCATION$
}
$ADVENTURER$ = {
# Set a variable to check for availability
set_variable = gone_adventuring
# Set up the event cycle
# To trigger the event that progresses the inspiration
trigger_event = {
id = fund_inspiration.0053
days = 1
}
# Fallback to make sure the inspiration is handled somehow if it goes on for too long
trigger_event = {
id = fund_inspiration.0054
years = 10
}
}
}
set_adventure_distance_variable_effect = {
# Requires ADVENTURER = character
# Requires DESTINATION = barony_title
$ADVENTURER$.location = {
save_temporary_scope_as = start_barony
}
# Calculate distance to the destination
# The value set indicates how long time it will take for the adventurer to come back
if = {
limit = {
scope:start_barony = {
squared_distance = {
target = $DESTINATION$
value > long_adventure_max_length
}
}
}
set_variable = {
name = adventure_distance
value = very_long_adventure_var
}
}
else_if = {
limit = {
scope:start_barony = {
squared_distance = {
target = $DESTINATION$
value > medium_adventure_max_length
}
}
}
set_variable = {
name = adventure_distance
value = long_adventure_var
}
}
else_if = {
limit = {
scope:start_barony = {
squared_distance = {
target = $DESTINATION$
value > short_adventure_max_length
}
}
}
set_variable = {
name = adventure_distance
value = medium_adventure_var
}
}
else = {
set_variable = {
name = adventure_distance
value = short_adventure_var
}
}
}

View file

@ -0,0 +1,730 @@
#######################################
# AI Tweaks #
# For a better challenge, a better AI #
#######################################
ai_budget_manipulation_effect = {
# Tweaks to the War Chest AI budget - sometimes the AI will be brave enough to boom
if = { # Some special logic to make certain AI's save up gold to revoke titles in their desired domain
limit = {
is_ai = yes
is_at_war = no
is_playable_character = yes
OR = {
AND = {
has_treasury = no
gold >= 50
gold < minimum_ai_gold_value_for_tyranny_wars
}
AND = {
has_treasury = yes
treasury >= 50
treasury < minimum_ai_treasury_value_for_tyranny_wars
}
}
NOR = {
has_character_flag = ai_revoke_recheck_cooldown
government_has_flag = government_is_nomadic
}
primary_title.tier >= tier_duchy
years_from_game_start >= 3
domain_size < domain_limit
has_realm_law_flag = title_revocation_allowed
OR = { # Tyranny tolerance is based on rationality
AND = {
ai_rationality < 0
tyranny <= 15 # Don't go crazy with tyranny, just a bit is fine
}
AND = {
ai_rationality >= 0
ai_rationality < 50
tyranny <= 5 # Don't go crazy with tyranny, just a bit is fine
}
AND = {
ai_rationality >= 50
tyranny <= 0 # Don't go crazy with tyranny, just a bit is fine
}
}
OR = {
primary_title.title_capital_county = {
holder != root
holder = {
current_military_strength < root.current_military_strength
is_vassal_or_below_of = root
NOR = {
vassal_contract_has_flag = vassal_contract_cannot_revoke_titles
has_relation_friend = root
has_relation_best_friend = root
has_relation_lover = root
has_relation_soulmate = root
is_child_of = root
is_grandchild_of = root
is_great_grandchild_of = root
}
}
}
AND = {
primary_title.tier >= tier_kingdom
exists = primary_title.title_capital_county.de_jure_liege.holder
primary_title.title_capital_county.de_jure_liege = {
holder != root
holder = {
current_military_strength < root.current_military_strength
is_vassal_or_below_of = root
NOR = {
vassal_contract_has_flag = vassal_contract_cannot_revoke_titles
has_relation_friend = root
has_relation_best_friend = root
has_relation_lover = root
has_relation_soulmate = root
is_child_of = root
is_grandchild_of = root
is_great_grandchild_of = root
}
}
}
}
any_sub_realm_county = {
holder != root
title_province = { has_holding_type = castle_holding }
this != root.primary_title.title_capital_county
duchy = root.primary_title.title_capital_county.duchy
holder = {
current_military_strength < root.current_military_strength
NOR = {
vassal_contract_has_flag = vassal_contract_cannot_revoke_titles
has_relation_friend = root
has_relation_best_friend = root
has_relation_lover = root
has_relation_soulmate = root
is_child_of = root
is_grandchild_of = root
is_great_grandchild_of = root
}
}
}
}
trigger_if = {
limit = {
domain_size > 3
}
NOR = {
has_trait = generous
has_trait = just
}
}
NOT = {
primary_title = title:e_hre
}
}
if = {
limit = {
primary_title.title_capital_county = {
holder != root
holder = {
current_military_strength < root.current_military_strength
is_vassal_or_below_of = root
NOT = { vassal_contract_has_flag = vassal_contract_cannot_revoke_titles }
}
}
}
add_character_flag = { flag = ai_save_gold_for_revoke years = 6 }
}
else_if = {
limit = {
primary_title.title_capital_county = {
holder = root
title_province = { free_building_slots <= 0 }
}
}
add_character_flag = { flag = ai_save_gold_for_revoke years = 6 }
}
else = {
random_list = {
50 = {
add_character_flag = { flag = ai_save_gold_for_revoke years = 6 }
}
50 = {
add_character_flag = { flag = ai_revoke_recheck_cooldown years = 6 }
}
}
}
}
else_if = {
limit = {
is_ai = yes
is_playable_character = yes
primary_title.tier >= tier_duchy
years_from_game_start >= 3
NOR = {
has_character_flag = ai_revoke_recheck_cooldown
has_character_flag = ai_save_gold_for_revoke
government_has_flag = government_is_nomadic
}
}
add_character_flag = { flag = ai_revoke_recheck_cooldown years = 6 }
}
if = { # Conquerors are special; they don't care about states or eras - they just want to conquer, and put their resources towards just that.
limit = {
has_variable = conqueror
}
# For now they just buff the war chest, and nothing else
move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_war_chest }
move_budget_gold = { gold = short_term_gold from = budget_short_term to = budget_war_chest }
# Conquerors have no concern for the future; only here and now matters
move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
# For now they just buff the war chest, and nothing else
move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_war_chest }
move_budget_treasury = { treasury = short_term_treasury from = budget_short_term to = budget_war_chest }
# Conquerors have no concern for the future; only here and now matters
move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_short_term }
}
}
else_if = { # Adventurers only need short term gold.
limit = {
is_ai = yes
has_government = landless_adventurer_government
}
move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term }
move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
}
else = {
if = {
limit = {
is_ai = yes
is_at_war = no # While at war, the War Chest should be preserved at all costs
is_playable_character = yes
OR = {
AND = {
has_treasury = no
gold > 0
war_chest_gold >= 10
}
AND = {
has_treasury = yes
treasury > 0
war_chest_treasury >= 10
}
}
NOR = {
has_character_flag = ai_save_gold_for_revoke
any_targeting_faction = {
NOT = { faction_is_type = peasant_faction }
faction_power >= halved_faction_power_threshold
}
}
trigger_if = {
limit = {
government_has_flag = government_is_tribal
}
prestige >= expensive_building_tier_1_cost
}
NAND = { # Iberian Struggle rulers that go for escalation should always go for a full war chest
any_character_struggle = {
phase_has_catalyst = catalyst_winning_large_conquest_war
}
has_character_flag = agenda_towards_escalation
}
}
# Chance to make an AI boom its economy if they do not fall into an archetype
if = {
limit = {
ai_has_builder_or_pious_builder_personality = no
ai_has_warlike_personality = no
ai_has_cautious_personality = no
NOT = {
has_character_flag = ai_boom_cooldown
}
}
random = {
chance = {
value = primary_title.tier
if = {
limit = {
has_trait = diligent
}
add = 1
}
if = {
limit = {
has_trait = architect
}
add = 4
}
}
add_character_flag = { flag = ai_boom years = 15 }
add_character_flag = { flag = ai_boom_cooldown years = 30 } # To balance the AI out
}
}
# Early Game, there are still building slots to fill
# At this point, the AI will boom more aggressively than normal
if = {
limit = {
OR = {
any_held_title = {
title_tier = county
title_province = { free_building_slots > 0 }
}
ai_should_focus_on_building_in_their_capital = yes
}
ai_has_warlike_personality = no # Warlike AI's go straight to the more restrictive second set of conditions
}
# Early Game - Capital Focus
# AI's want to fill up their Capital County's building slots, first level buildings have the highest RoI so it's stupid not to
# There's no guarantee that they will spend the gold on buildings for specifically their capital, but they are heavily incentivised to do so
# They may spend on buildings in secondary counties/baronies, or on MaA
if = {
limit = {
capital_county.title_province = {
free_building_slots > 0
}
ai_has_warlike_personality = no
ai_has_cautious_personality = no
}
move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
else_if = { # Cautious AI's keep a half of their war chest as a buffer
limit = {
capital_county.title_province = {
free_building_slots > 0
}
ai_has_cautious_personality = yes
OR = {
AND = {
has_treasury = no
war_chest_gold >= halved_ai_war_chest_gold_maximum
}
AND = {
has_treasury = yes
war_chest_treasury >= halved_ai_war_chest_treasury_maximum
}
}
}
move_budget_gold = { gold = excess_over_halved_ai_war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = excess_over_halved_ai_war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
# Early Game - Building up Secondary Counties
# The AI wants first-level buildings in all of its Counties
# This is when personalities will begin to manifest in a bigger way
# The else_if is intended, it's a continuation of the above logic
else_if = { # Economical boom AI's just go for it, hard
limit = {
ai_has_builder_or_pious_builder_personality = yes
}
move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
else_if = { # Cautious AI's will want a minimum war chest in absolute terms, based on tier
limit = {
OR = {
AND = {
has_treasury = no
war_chest_gold > cautious_ai_minimum_war_chest_gold
}
AND = {
has_treasury = yes
war_chest_treasury > cautious_ai_minimum_war_chest_treasury
}
}
ai_has_cautious_personality = yes
}
move_budget_gold = { gold = excess_over_cautious_ai_minimum_war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = excess_over_cautious_ai_minimum_war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
# Warlike AI's have a few conditions
# If they have a full war chest and have been at peace for 3 years, they'll stuff half their war chest into short term
# This is a somewhat close representation of if they want to declare war
# But it's not a particularly aggressive cooldown, as we do want AI's to build up a minimum, even if they are warlike
else_if = {
limit = {
ai_has_warlike_personality = yes
OR = {
AND = {
has_treasury = no
war_chest_gold >= war_chest_gold_maximum
}
AND = {
has_treasury = yes
war_chest_treasury >= war_chest_treasury_maximum
}
}
days_of_continuous_peace >= 1825 # 5 years
}
move_budget_gold = { gold = excess_over_a_quarter_ai_war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = excess_over_a_quarter_ai_war_chest_gold from = budget_war_chest to = budget_short_term }
}
}
# If no personality archetype is present, AI's with the ai_boom flag, appropriate traits, or decent boldness will boom
else_if = {
limit = {
OR = {
has_character_flag = ai_boom
ai_boldness >= 25
has_trait = diligent
has_trait = architect
}
}
if = { # If you have enough war chest gold and short term gold to build a holding, and doing so would be smart, do it!
limit = {
domain_size < domain_limit
OR = {
AND = {
has_treasury = no
gold >= main_building_tier_1_cost
long_term_gold < main_building_tier_1_cost
}
AND = {
has_treasury = yes
treasury >= main_building_tier_1_cost
long_term_treasury < main_building_tier_1_cost
}
}
NOT = {
government_has_flag = government_is_tribal
}
culture = { # The requirements for Castles, temples, and Cities
has_innovation = innovation_motte
has_innovation = innovation_city_planning
}
any_held_title = {
title_tier = county
any_county_province = {
has_holding = no
barony_cannot_construct_holding = no
}
}
}
move_budget_gold = { gold = main_building_tier_1_cost from = budget_war_chest to = budget_long_term }
move_budget_gold = { gold = main_building_tier_1_cost from = budget_short_term to = budget_long_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = main_building_tier_1_cost from = budget_war_chest to = budget_long_term }
move_budget_treasury = { treasury = main_building_tier_1_cost from = budget_short_term to = budget_long_term }
}
}
else = {
move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
}
}
# Mid-Late game, there are no more building slots to fill
# Heavily personality based, with some quirks here and there
# The else_if is intended, it's a continuation of the above logic
else_if = { # Economical boom AI's will empty their entire treasury to boom
limit = {
ai_has_builder_or_pious_builder_personality = yes
}
if = { # If you have enough war chest gold and short term gold to build a holding, and doing so would be smart, do it!
limit = {
domain_size < domain_limit
OR = {
AND = {
has_treasury = no
gold >= main_building_tier_1_cost
long_term_gold < main_building_tier_1_cost
}
AND = {
has_treasury = yes
treasury >= main_building_tier_1_cost
long_term_treasury < main_building_tier_1_cost
}
}
NOT = {
government_has_flag = government_is_tribal
}
culture = { # The requirements for Castles, temples, and Cities
has_innovation = innovation_motte
has_innovation = innovation_city_planning
}
any_held_title = {
title_tier = county
any_county_province = {
has_holding = no
barony_cannot_construct_holding = no
}
}
}
move_budget_gold = { gold = main_building_tier_1_cost from = budget_war_chest to = budget_long_term }
move_budget_gold = { gold = main_building_tier_1_cost from = budget_short_term to = budget_long_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = main_building_tier_1_cost from = budget_war_chest to = budget_long_term }
move_budget_treasury = { treasury = main_building_tier_1_cost from = budget_short_term to = budget_long_term }
}
}
else = {
move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
}
else_if = { # Cautious AI's will only boom if they feel really, really safe
limit = {
OR = {
AND = {
has_treasury = no
war_chest_gold > cautious_ai_minimum_war_chest_gold
}
AND = {
has_treasury = yes
war_chest_treasury > cautious_ai_minimum_war_chest_treasury
}
}
ai_has_cautious_personality = yes
current_military_strength >= max_military_strength
days_of_continuous_peace >= 1825 # 5 years
OR = {
any_ally = {
count >= 2
}
dread >= 50 # Dread makes cautious characters feel safe
}
}
move_budget_gold = { gold = excess_over_cautious_ai_minimum_war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = excess_over_cautious_ai_minimum_war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
else_if = { # Warlike AI's will invest half their war chest if it's full, and nothing is going on
limit = {
ai_has_warlike_personality = yes
OR = {
AND = {
has_treasury = no
war_chest_gold >= war_chest_gold_maximum
}
AND = {
has_treasury = yes
war_chest_treasury >= war_chest_treasury_maximum
}
}
NOT = {
government_has_flag = government_is_nomadic
}
capital_county.title_province = {
free_building_slots <= 0
}
days_of_continuous_peace >= 2555 # 7 years
}
move_budget_gold = { gold = halved_ai_war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = halved_ai_war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
else_if = { # Special logic for warlike AI's during the Iranian Intermezzo, they need to be more aggressive than usual
limit = {
has_trait = fp3_struggle_detractor
ai_has_warlike_personality = yes
OR = {
AND = {
has_treasury = no
war_chest_gold < war_chest_gold_maximum
}
AND = {
has_treasury = yes
war_chest_treasury < war_chest_treasury_maximum
}
}
days_of_continuous_peace < 2555
}
move_budget_gold = { gold = short_term_gold from = budget_short_term to = budget_war_chest }
move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_war_chest }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = short_term_treasury from = budget_short_term to = budget_war_chest }
move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_war_chest }
}
}
else_if = { # Warlike AI's will invest their long term gold into their war chest if it's not full
limit = {
ai_has_warlike_personality = yes
OR = {
AND = {
has_treasury = no
war_chest_gold < war_chest_gold_maximum
long_term_gold >= 1
}
AND = {
has_treasury = yes
war_chest_treasury < war_chest_treasury_maximum
long_term_treasury >= 1
}
}
}
move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_war_chest }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = long_term_treasury from = budget_long_term to = budget_war_chest }
}
}
# For AI's with no particular personality, warlike, booming, or cautious, we have them boom through a flag system
# Bold AI's boom with all their war chest gold, non-bold with half
else_if = {
limit = {
has_character_flag = ai_boom
ai_boldness >= 25
}
if = { # If you have enough war chest gold and short term gold to build a holding, and doing so would be smart, do it!
limit = {
domain_size < domain_limit
OR = {
AND = {
has_treasury = no
gold >= main_building_tier_1_cost
long_term_gold < main_building_tier_1_cost
}
AND = {
has_treasury = yes
treasury >= main_building_tier_1_cost
long_term_treasury < main_building_tier_1_cost
}
}
NOT = {
government_has_flag = government_is_tribal
}
culture = { # The requirements for Castles, temples, and Cities
has_innovation = innovation_motte
has_innovation = innovation_city_planning
}
any_held_title = {
title_tier = county
any_county_province = {
has_holding = no
barony_cannot_construct_holding = no
}
}
}
move_budget_gold = { gold = main_building_tier_1_cost from = budget_war_chest to = budget_long_term }
move_budget_gold = { gold = main_building_tier_1_cost from = budget_short_term to = budget_long_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = main_building_tier_1_cost from = budget_war_chest to = budget_long_term }
move_budget_treasury = { treasury = main_building_tier_1_cost from = budget_short_term to = budget_long_term }
}
}
else = {
move_budget_gold = { gold = war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_gold = { gold = war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
}
else_if = {
limit = {
has_character_flag = ai_boom
OR = {
AND = {
has_treasury = no
war_chest_gold >= halved_ai_war_chest_gold_maximum
}
AND = {
has_treasury = yes
war_chest_treasury >= halved_ai_war_chest_treasury_maximum
}
}
}
move_budget_gold = { gold = excess_over_halved_ai_war_chest_gold from = budget_war_chest to = budget_short_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = excess_over_halved_ai_war_chest_treasury from = budget_war_chest to = budget_short_term }
}
}
if = { # Some special logic to catch the rare instances where a non-Tribe ends up with a tribal main holding
limit = {
NOT = {
government_has_flag = government_is_tribal
}
capital_province = {
has_holding_type = tribal_holding
}
OR = {
AND = {
has_treasury = no
long_term_gold < feudalize_holding_interaction_cost
}
AND = {
has_treasury = yes
long_term_treasury < feudalize_holding_interaction_cost
}
}
}
move_budget_gold = { gold = feudalize_holding_interaction_cost from = budget_war_chest to = budget_long_term }
move_budget_gold = { gold = feudalize_holding_interaction_cost from = budget_short_term to = budget_long_term }
if = {
limit = {
has_treasury = yes
}
move_budget_treasury = { treasury = feudalize_holding_interaction_cost from = budget_war_chest to = budget_long_term }
move_budget_treasury = { treasury = feudalize_holding_interaction_cost from = budget_short_term to = budget_long_term }
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,875 @@

#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#remove_adultery_variables_effect
#####################################################################
# EFFECTS
#####################################################################
#Saves a scope value with the "strongest" ai value (not exact values but based on the low/medium/high values in 00_ai_values.txt)
strongest_ai_value_effect = {
random_list = {
1 = { #Positive boldness
trigger = { ai_boldness > 0 }
modifier = {
ai_boldness >= low_positive_boldness
factor = 100
}
modifier = {
ai_boldness >= medium_positive_boldness
factor = 100
}
modifier = {
ai_boldness >= high_positive_boldness
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_boldness
}
}
1 = { #Positive compassion
trigger = { ai_compassion > 0 }
modifier = {
ai_compassion >= low_positive_compassion
factor = 100
}
modifier = {
ai_compassion >= medium_positive_compassion
factor = 100
}
modifier = {
ai_compassion >= high_positive_compassion
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_compassion
}
}
1 = { #Positive greed
trigger = { ai_greed > 0 }
modifier = {
ai_greed >= low_positive_greed
factor = 100
}
modifier = {
ai_greed >= medium_positive_greed
factor = 100
}
modifier = {
ai_greed >= high_positive_greed
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_greed
}
}
1 = { #Positive energy
trigger = { ai_energy > 0 }
modifier = {
ai_energy >= low_positive_energy
factor = 100
}
modifier = {
ai_energy >= medium_positive_energy
factor = 100
}
modifier = {
ai_energy >= high_positive_energy
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_energy
}
}
1 = { #Positive honor
trigger = { ai_honor > 0 }
modifier = {
ai_honor >= low_positive_honor
factor = 100
}
modifier = {
ai_honor >= medium_positive_honor
factor = 100
}
modifier = {
ai_honor >= high_positive_honor
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_honor
}
}
1 = { #Positive rationality
trigger = { ai_rationality > 0 }
modifier = {
ai_rationality >= low_positive_rationality
factor = 100
}
modifier = {
ai_rationality >= medium_positive_rationality
factor = 100
}
modifier = {
ai_rationality >= high_positive_rationality
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_rationality
}
}
1 = { #Positive vengefulness
trigger = { ai_vengefulness > 0 }
modifier = {
ai_vengefulness >= low_positive_vengefulness
factor = 100
}
modifier = {
ai_vengefulness >= medium_positive_vengefulness
factor = 100
}
modifier = {
ai_vengefulness >= high_positive_vengefulness
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_vengefulness
}
}
1 = { #Positive zeal
trigger = { ai_zeal > 0 }
modifier = {
ai_zeal >= low_positive_zeal
factor = 100
}
modifier = {
ai_zeal >= medium_positive_zeal
factor = 100
}
modifier = {
ai_zeal >= high_positive_zeal
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:positive_zeal
}
}
1 = { #negative boldness
trigger = { ai_boldness < 0 }
modifier = {
ai_boldness <= low_negative_boldness
factor = 100
}
modifier = {
ai_boldness <= medium_negative_boldness
factor = 100
}
modifier = {
ai_boldness <= high_negative_boldness
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_boldness
}
}
1 = { #negative compassion
trigger = { ai_compassion < 0 }
modifier = {
ai_compassion <= low_negative_compassion
factor = 100
}
modifier = {
ai_compassion <= medium_negative_compassion
factor = 100
}
modifier = {
ai_compassion <= high_negative_compassion
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_compassion
}
}
1 = { #negative greed
trigger = { ai_greed < 0 }
modifier = {
ai_greed <= low_negative_greed
factor = 100
}
modifier = {
ai_greed <= medium_negative_greed
factor = 100
}
modifier = {
ai_greed <= high_negative_greed
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_greed
}
}
1 = { #negative energy
trigger = { ai_energy < 0 }
modifier = {
ai_energy <= low_negative_energy
factor = 100
}
modifier = {
ai_energy <= medium_negative_energy
factor = 100
}
modifier = {
ai_energy <= high_negative_energy
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_energy
}
}
1 = { #negative honor
trigger = { ai_honor < 0 }
modifier = {
ai_honor <= low_negative_honor
factor = 100
}
modifier = {
ai_honor <= medium_negative_honor
factor = 100
}
modifier = {
ai_honor <= high_negative_honor
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_honor
}
}
1 = { #negative rationality
trigger = { ai_rationality < 0 }
modifier = {
ai_rationality <= low_negative_rationality
factor = 100
}
modifier = {
ai_rationality <= medium_negative_rationality
factor = 100
}
modifier = {
ai_rationality <= high_negative_rationality
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_rationality
}
}
1 = { #negative vengefulness
trigger = { ai_vengefulness < 0 }
modifier = {
ai_vengefulness <= low_negative_vengefulness
factor = 100
}
modifier = {
ai_vengefulness <= medium_negative_vengefulness
factor = 100
}
modifier = {
ai_vengefulness <= high_negative_vengefulness
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_vengefulness
}
}
1 = { #negative zeal
trigger = { ai_zeal < 0 }
modifier = {
ai_zeal <= low_negative_zeal
factor = 100
}
modifier = {
ai_zeal <= medium_negative_zeal
factor = 100
}
modifier = {
ai_zeal <= high_negative_zeal
factor = 100
}
set_variable = {
name = strongest_ai_value
value = flag:negative_zeal
}
}
}
}
ai_chance_to_become_conqueror_effect = {
save_scope_as = possible_conqueror
if = {
limit = {
NOT = { has_game_rule = no_conquerors_frequency }
ai_has_cautious_personality = no
top_liege = this
is_landed = yes
is_adult = yes
age <= 60
NOT = { is_incapable = yes }
ai_boldness >= 0
ai_greed >= 0
gold >= 50
is_at_war = no
highest_held_title_tier >= tier_duchy
domain_size >= 3
NOR = {
any_ally = {
is_ai = no # Would be annoying as conquerors don't help their allies
}
mpo_has_gok_mongol_empire_trigger = yes
has_character_flag = used_to_be_conqueror
}
any_neighboring_and_across_water_top_liege_realm_owner = {
scope:possible_conqueror = {
has_any_cb_on = prev
current_military_strength >= prev.current_military_strength
}
}
NOT = {
any_owned_story = {
story_type = story_take_mandate_of_heaven
}
}
trigger_if = {
limit = {
OR = {
has_game_rule = strong_default_conquerors_frequency
has_game_rule = strong_few_conquerors_frequency
has_game_rule = strong_very_few_conquerors_frequency
has_game_rule = strong_many_conquerors_frequency
}
}
sub_realm_size >= 15
domain_size >= 4
current_military_strength >= 3000
gold >= 500
age <= 35
}
OR = {
AND = {
is_ai = no
NOT = { has_game_rule = no_conquerors_bonuses }
}
AND = {
exists = global_var:active_conquerors
global_var:active_conquerors < 12
}
}
}
random = {
chance = {
value = 0.25
add = {
value = primary_title.tier
divide = 12
}
if = {
limit = {
martial >= 10
}
add = {
value = martial
divide = 5
}
}
if = {
limit = {
intrigue >= 10
}
add = {
value = intrigue
divide = 10
}
}
if = {
limit = {
diplomacy >= 10
}
add = {
value = diplomacy
divide = 10
}
}
if = {
limit = {
has_trait = brave
}
add = 0.25
}
if = {
limit = {
has_trait = ambitious
}
add = 0.5
}
if = {
limit = {
has_trait = compassionate
}
add = -0.25
}
if = {
limit = {
has_trait = shy
}
add = -0.25
}
if = {
limit = {
has_trait = lazy
}
add = -0.25
}
if = {
limit = {
has_trait = content
}
add = -1
}
if = {
limit = {
has_trait = craven
}
add = -1
}
if = {
limit = {
ai_has_warlike_personality = yes
}
add = 0.25
}
if = {
limit = {
OR = {
government_has_flag = government_is_tribal
government_has_flag = government_is_clan
}
}
add = 1.5
}
if = {
limit = {
government_has_flag = government_is_nomadic
}
add = 2
}
if = {
limit = {
government_has_flag = government_is_nomadic
highest_held_title_tier >= tier_kingdom
domicile.herd >= 10000
}
add = 2
}
if = {
limit = {
gold >= massive_gold_value
}
add = 0.25
}
if = {
limit = {
war_chest_gold >= war_chest_gold_maximum
}
add = 0.25
}
if = {
limit = {
culture = { has_cultural_pillar = ethos_bellicose }
}
add = 0.25
}
if = {
limit = {
prestige_level >= 3
}
add = 0.25
}
if = {
limit = {
faith = { has_doctrine = tenet_warmonger }
}
add = 0.25
}
if = {
limit = {
culture = { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith }
}
add = -0.25
}
if = {
limit = {
faith = { has_doctrine_parameter = pacifist_opinion_active }
}
add = -0.25
}
if = {
limit = {
ai_has_economical_boom_personality = yes
}
add = -0.25
}
if = {
limit = {
can_use_conquest_cbs_trigger = yes
}
add = 2
}
if = {
limit = {
can_use_conquest_cbs_trigger = no
}
add = -0.5
}
if = {
limit = {
can_use_conquest_cbs_trigger = yes
primary_title.tier >= tier_kingdom
prestige_level >= 2
gold >= major_gold_value
}
add = 4
}
if = { # Caliphs/caliph-holders should often become conquerors
limit = {
faith = { has_doctrine = doctrine_temporal_head }
OR = {
this = faith.religious_head
any_vassal_or_below = {
this = faith.religious_head
}
}
}
add = 5
}
if = {
limit = {
primary_title = { has_title_law = princely_elective_succession_law }
}
add = -0.25
}
if = {
limit = {
has_trait = education_martial_5
}
add = 1
}
if = {
limit = {
is_ai = yes
OR = {
has_character_modifier = bp2_destined_modifier
has_character_modifier = bp2_tool_of_fate_modifier
}
}
add = 2
}
if = {
limit = {
is_ai = yes
OR = {
has_character_modifier = a_cultures_great_defender_modifier
has_character_modifier = inspired_defenders_modifier
has_character_modifier = uniter_and_conqueror_modifier
}
}
add = 2
}
if = {
limit = {
is_ai = no
}
add = -2.5
}
if = {
limit = {
is_ai = no
has_game_rule = hard_difficulty
}
add = -7.5
}
else_if = {
limit = {
is_ai = no
has_game_rule = very_hard_difficulty
}
add = -50
}
if = {
limit = {
is_ai = yes
AND = {
exists = global_var:active_conquerors
global_var:active_conquerors >= 3
}
}
add = -1
}
if = {
limit = {
is_ai = yes
AND = {
exists = global_var:active_conquerors
global_var:active_conquerors >= 5
}
}
add = -3.5
}
if = {
limit = {
is_ai = yes
AND = {
exists = global_var:active_conquerors
global_var:active_conquerors >= 7
}
}
add = -2
}
if = {
limit = {
is_ai = yes
AND = {
exists = global_var:active_conquerors
global_var:active_conquerors >= 10
}
}
add = -2
}
if = {
limit = {
is_ai = no
OR = {
has_character_modifier = bp2_destined_modifier
has_character_modifier = bp2_tool_of_fate_modifier
}
}
multiply = 5
}
if = {
limit = {
is_ai = no
OR = {
has_character_modifier = a_cultures_great_defender_modifier
has_character_modifier = inspired_defenders_modifier
has_character_modifier = uniter_and_conqueror_modifier
}
}
multiply = 5
}
if = {
limit = {
OR = {
has_game_rule = few_conquerors_frequency
has_game_rule = strong_few_conquerors_frequency
}
}
multiply = 0.5
}
if = {
limit = {
OR = {
has_game_rule = very_few_conquerors_frequency
has_game_rule = strong_very_few_conquerors_frequency
}
}
multiply = 0.1
}
if = {
limit = {
is_ai = yes
has_game_rule = strong_many_conquerors_frequency
}
add = 0.5
}
if = {
limit = {
is_ai = yes
OR = {
has_game_rule = many_conquerors_frequency
has_game_rule = strong_many_conquerors_frequency
}
}
add = 0.5
multiply = 2
}
}
if = {
limit = {
is_ai = no
}
trigger_event = {
id = conqueror.0001
days = 10
}
}
else = {
trigger_event = conqueror.0001
}
}
}
}
ai_chance_to_become_mandala_godking_effect = {
save_scope_as = possible_godking
if = {
limit = {
top_overlord = this
is_landed = yes
age <= 50
NOT = { is_incapable = yes }
is_ai = yes
is_at_war = no
trigger_if = {
limit = { exists = global_var:active_mandalas }
global_var:active_mandalas < 5
}
any_neighboring_and_across_water_top_liege_realm_owner = {
OR = {
current_military_strength < scope:possible_godking.current_military_strength
any_tributary = {
in_diplomatic_range = scope:possible_godking
current_military_strength < scope:possible_godking.current_military_strength
}
}
}
#There aren't already 2 active Mandala Capitals in the dejure Kingdom
less_than_max_amount_of_mandala_capitals_trigger = yes
}
random = {
chance = {
value = 50
#If has Mandala Capital or Ruined Capital make into 100
if = {
limit = { has_mandala_capital_trigger = yes }
add = 100
}
add = primary_title.tier
if = {
limit = { martial >= 10 }
add = {
value = martial
divide = 5
}
}
if = {
limit = { intrigue >= 10 }
add = {
value = intrigue
divide = 10
}
}
if = {
limit = { diplomacy >= 10 }
add = {
value = diplomacy
divide = 10
}
}
if = {
limit = { stewardship >= 10 }
add = {
value = stewardship
divide = 10
}
}
if = {
limit = { learning >= 10 }
add = {
value = learning
divide = 10
}
}
if = {
limit = { has_trait = zealous }
add = 1
}
if = {
limit = { has_trait = pilgrim }
add = 1
}
if = {
limit = { has_trait = brave }
add = 0.25
}
if = {
limit = { has_trait = ambitious }
add = 0.5
}
if = {
limit = { has_trait = compassionate }
add = -0.25
}
if = {
limit = { has_trait = shy }
add = -0.25
}
if = {
limit = { has_trait = lazy }
add = -0.25
}
if = {
limit = { has_trait = content }
add = -1
}
if = {
limit = { has_trait = craven }
add = -1
}
if = {
limit = { has_trait = cynical }
add = -1
}
if = {
limit = { gold >= massive_gold_value }
add = 1
}
if = {
limit = {
house = { has_house_power_parameter = aspect_of_destruction }
war_chest_gold >= war_chest_gold_maximum
}
add = 1
}
add = piety_level
if = {
limit = {
OR = {
has_trait = education_diplomacy_5
has_trait = education_stewardship_5
has_trait = education_intrigue_5
has_trait = education_martial_5
}
}
add = 1
}
}
create_story = story_mandala
}
}
}

View file

@ -0,0 +1,32 @@
try_create_lawfully_imprison = {
if = {
limit = {
is_imprisoned = no
root = {
has_imprisonment_reason = prev
}
}
try_create_important_action = {
important_action_type = action_can_lawfully_imprison
actor = root
recipient = this
}
}
}
try_create_pardon = {
if = {
limit = {
target_is_liege_or_above = root
is_imprisoned = no
root = {
has_imprisonment_reason = prev
}
}
try_create_important_action = {
important_action_type = action_can_pardon
actor = root
recipient = this
}
}
}

View file

@ -0,0 +1,376 @@
find_title_for_almohad_spawn_effect = {
if = { # The important thing is to not mess too much with players who can't resist
limit = {
title:c_tinmallal = {
holder = { is_ai = yes }
OR = {
NOT = { exists = duchy.holder }
duchy.holder = { is_ai = yes }
}
}
}
title:c_tinmallal = {
save_scope_as = almohad_county
}
}
else = {
title:k_maghreb = {
random_in_de_jure_hierarchy = {
continue = { tier > tier_county }
limit = {
tier = tier_county
holder = { is_ai = yes } # Let's not murder players
NOT = { this = title:c_marrakesh }
save_temporary_scope_as = potential_almohad_county
# If someone holds k_maghreb, put the Almohads in their realm
trigger_if = {
limit = { exists = title:k_maghreb.holder }
title:k_maghreb.holder = {
OR = {
this = scope:potential_almohad_county.holder
any_sub_realm_county = {
this = scope:potential_almohad_county
}
}
}
}
# Either this should be the holder's only title, or it should NOT be their capital
trigger_if = {
limit = {
holder = {
any_sub_realm_county = { count > 1 }
}
}
this != holder.capital_county
}
}
weight = {
base = 1
# Prefer already Muslim counties
modifier = {
add = 5
religion = religion:islam_religion
}
# Massively prefer to avoid a player-held Duchies if possible
modifier = {
factor = 0.01
exists = duchy.holder
duchy.holder = { is_ai = no }
}
}
save_scope_as = almohad_county
}
}
}
if = { # Discard stuff from here on out
limit = { NOT = { exists = scope:almohad_county } }
debug_log = "No Almohad title found, Almohad's won't spawn"
}
# Convert the County and warn relevant people
else = {
set_global_variable = {
name = spawned_almohads
value = yes
}
scope:almohad_county = {
set_county_faith = faith:masmudi
}
scope:almohad_county.holder = {
if = {
limit = {
is_ai = no
}
trigger_event = almohad.1001
}
every_liege_or_above = {
limit = { is_ai = no }
trigger_event = almohad.1001
}
}
trigger_event = { # Random amount of time to convert the province or otherwise prepare
id = almohad.0002
days = { 400 1000 }
}
}
}
create_almohads_effect = {
create_character = {
template = ibn_tumart_character_template
name = Amghar_ibn_Tumert
location = scope:almohad_county.title_province
dynasty_house = house:house_tumert
save_scope_as = ibn_tumart
}
faith:masmudi = {
change_fervor = {
value = 50
desc = fervor_gain_almohads
}
}
scope:ibn_tumart = {
create_story = {
type = story_almohad_invasion
save_scope_as = story
}
add_pressed_claim = title:k_maghreb
add_character_modifier = {
modifier = almohad_leader_modifier
}
add_character_flag = {
flag = immune_to_disease
years = 15
}
}
scope:story = {
set_variable = {
name = ibn_tumart
value = scope:ibn_tumart
}
set_variable = {
name = almohad_county
value = scope:almohad_county
}
}
almohads_find_target_titles_effect = yes
find_almohad_titles_and_assign_to_ibn_tumart_effect = yes
create_character = {
template = abd_al_mumin_character_template
name = Abd_al_Mu_min
employer = scope:ibn_tumart
dynasty_house = house:house_almohad
save_scope_as = al_mumin
}
scope:al_mumin = {
add_pressed_claim = title:k_maghreb
add_character_modifier = {
modifier = almohad_leader_modifier
}
add_character_flag = {
flag = immune_to_disease
years = 15
}
}
scope:story = {
set_variable = {
name = al_mumin
value = scope:al_mumin
}
}
scope:almohad_county.holder = {
set_global_variable = {
name = almohads_waiting_for_player_responses
value = 0
years = 1 # Clear out eventually, just in case
}
set_global_variable = {
name = almohads_player_responses_received
value = 0
years = 1 # Clear out eventually, just in case
}
if = {
limit = { is_ai = no }
change_global_variable = {
name = almohads_waiting_for_player_responses
add = 1
}
trigger_event = almohad.1002
}
every_liege_or_above = {
limit = { is_ai = no }
change_global_variable = {
name = almohads_waiting_for_player_responses
add = 1
}
trigger_event = almohad.1002
}
if = {
limit = {
global_var:almohads_waiting_for_player_responses = 0
}
remove_global_variable = almohads_waiting_for_player_responses
remove_global_variable = almohads_player_responses_received
almohads_go_to_war_effect = yes
}
else = {
trigger_event = {
id = almohad.0004
days = 5
}
}
}
}
find_almohad_titles_and_assign_to_ibn_tumart_effect = {
create_title_and_vassal_change = {
type = usurped
save_scope_as = change
add_claim_on_loss = no
}
scope:almohad_county = {
change_title_holder = {
holder = scope:ibn_tumart
change = scope:change
take_baronies = yes
}
}
resolve_title_and_vassal_change = scope:change
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
scope:ibn_tumart.faith.religious_head_title = {
change_title_holder = {
holder = scope:ibn_tumart
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
almohads_go_to_war_effect = {
scope:ibn_tumart = {
almohads_become_independent_effect = yes
almohads_declare_war_for_target_title_effect = yes
spawn_first_almohad_troops_effect = yes
}
}
almohads_become_independent_effect = {
hidden_effect = {
if = {
limit = { scope:ibn_tumart = { is_imprisoned = yes } }
scope:ibn_tumart = { release_from_prison = yes }
}
}
create_title_and_vassal_change = {
type = independency
save_scope_as = going_independent
add_claim_on_loss = no
}
scope:ibn_tumart = {
becomes_independent = {
change = scope:going_independent
}
}
resolve_title_and_vassal_change = scope:going_independent
}
almohads_find_target_titles_effect = {
if = {
limit = { exists = title:k_maghreb.holder }
title:k_maghreb = {
save_scope_as = maghreb_target_title
holder = {
save_scope_as = first_target
}
}
if = {
limit = {
NOT = { scope:almohad_county.holder.top_liege = title:k_maghreb.holder.top_liege }
scope:almohad_county.holder.top_liege = {
any_sub_realm_county = {
this != scope:almohad_county
kingdom = title:k_maghreb
}
}
}
scope:almohad_county.holder.top_liege = {
save_scope_as = second_target
}
}
}
else = {
ordered_independent_ruler = {
limit = { highest_held_title_tier > tier_county }
order_by = titles_held_in_k_maghreb
position = 0
save_scope_as = first_target
}
}
}
almohads_declare_war_for_target_title_effect = {
save_scope_as = war_leader
if = {
limit = { exists = scope:first_target }
start_war = {
cb = claim_cb
target = scope:first_target
claimant = scope:war_leader
target_title = scope:maghreb_target_title
}
if = {
limit = {
exists = scope:second_target
NOT = { exists = global_var:almohads_do_not_attack_second_target }
}
start_war = {
cb = claim_cb
target = scope:second_target
claimant = scope:war_leader
target_title = scope:maghreb_target_title
}
}
}
if = {
limit = { exists = global_var:almohads_do_not_attack_second_target }
remove_global_variable = almohads_do_not_attack_second_target
}
else = {
debug_log = "Failed to find a valid war target for the Almohads!"
}
}
spawn_first_almohad_troops_effect = {
spawn_army = {
uses_supply = yes
inheritable = no
name = first_almohad_event_troops
levies = {
value = 1000
}
location = scope:ibn_tumart.capital_province
}
}
spawn_second_almohad_troops_effect = {
if = {
limit = {
is_at_war = yes
}
ordered_war_enemy = {
order_by = max_military_strength
position = 0
save_scope_as = powerful_war_enemy
}
spawn_army = {
uses_supply = yes
inheritable = no
name = second_almohad_event_troops
levies = {
if = {
limit = { exists = scope:powerful_war_enemy }
add = scope:powerful_war_enemy.max_military_strength
multiply = 2
}
else = {
add = 3000
}
}
location = capital_province
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,583 @@

##################################################
# Effects related to Board Games
##################################################
##################################################
# SETUP & CLEANUP EFFECTS
configure_start_board_game_effect = {
# DOCUMENTATION
## scope:bg_initiator
### Who started the board game? This is who the output/invalidation events will fire for.
## scope:bg_attacker
### The hostile party - in the event of a tie, the match is decided against them.
## scope:bg_defender
### The defending party - in the event of a tie, the match is decided in their favour.
## scope:bg_system = flag:XYZ
### These control both the relevant skills, counters, & some flavour adjacent to the game.
### chess
### pachisi
### hnefatafl
### tabula
### go
### fidchell
## scope:locale = flag:XYZ
### These just trigger the event background of the same name. New ones can be added as needed, but should be added across all three events (round, victory, loss/board_games.0001, board_games.0031, board_games.0041), as we can't add a scripted list.
### terrain_scope
### wilderness_scope
### battlefield
### temple
### council_chamber
### courtyard
### dungeon
### docks
### feast
### gallows
### garden
### market
### sitting_room
### bedchamber
### study
### physicians_study
### tavern
### throne_room
### army_camp
### random_nice_day
#### Selects either garden or sitting_room, depending on season.
## output event ID
### Which event fires after the game's completion?
# Sort parties.
$BG_INITIATOR$ = { save_scope_as = bg_initiator }
$BG_DEFENDER$ = { save_scope_as = bg_defender }
$BG_ATTACKER$ = { save_scope_as = bg_attacker }
# Make sure they're clean for setup.
hidden_effect = { remove_board_game_variables_effect = yes}
# Set them both to busy for the single combat.
scope:bg_defender = {
set_variable = {
name = engaged_in_board_game
value = yes
}
}
scope:bg_attacker = {
set_variable = {
name = engaged_in_board_game
value = yes
}
}
## Sadly, we have no good justification for ripping your shirt off whilst playing board games.
# Set rules & system.
save_scope_value_as = {
name = bg_system
value = flag:$SYSTEM$
}
## Chess
### In chess, our counter order is Martial -> Learning -> Intrigue.
if = {
limit = { scope:bg_system = flag:chess }
save_scope_value_as = {
name = bg_skill_a
value = flag:martial
}
save_scope_value_as = {
name = bg_skill_b
value = flag:learning
}
save_scope_value_as = {
name = bg_skill_c
value = flag:intrigue
}
}
## Pachisi
### For pachisi, our counter order is Diplomacy -> Intrigue -> Stewardship.
else_if = {
limit = { scope:bg_system = flag:pachisi }
save_scope_value_as = {
name = bg_skill_a
value = flag:diplomacy
}
save_scope_value_as = {
name = bg_skill_b
value = flag:intrigue
}
save_scope_value_as = {
name = bg_skill_c
value = flag:stewardship
}
}
## Hnefatafl
### For hnefatafl, our counter order is Intrigue -> Martial -> Prowess.
else_if = {
limit = { scope:bg_system = flag:hnefatafl }
save_scope_value_as = {
name = bg_skill_a
value = flag:intrigue
}
save_scope_value_as = {
name = bg_skill_b
value = flag:martial
}
save_scope_value_as = {
name = bg_skill_c
value = flag:prowess
}
}
## Tabula
### For tabula, our counter order is Intrigue -> Learning -> Stewardship.
else_if = {
limit = { scope:bg_system = flag:tabula }
save_scope_value_as = {
name = bg_skill_a
value = flag:intrigue
}
save_scope_value_as = {
name = bg_skill_b
value = flag:learning
}
save_scope_value_as = {
name = bg_skill_c
value = flag:stewardship
}
}
## Go
### For go, our counter order is Learning -> Martial -> Intrigue.
### Additional game design credit: Alexander Windahl.
else_if = {
limit = { scope:bg_system = flag:go }
save_scope_value_as = {
name = bg_skill_a
value = flag:learning
}
save_scope_value_as = {
name = bg_skill_b
value = flag:martial
}
save_scope_value_as = {
name = bg_skill_c
value = flag:intrigue
}
}
## Fidchell
### For fidchell, our counter order is Learning -> Prowess -> Diplomacy.
else_if = {
limit = { scope:bg_system = flag:fidchell }
save_scope_value_as = {
name = bg_skill_a
value = flag:learning
}
save_scope_value_as = {
name = bg_skill_b
value = flag:prowess
}
save_scope_value_as = {
name = bg_skill_c
value = flag:diplomacy
}
}
# Note where the fight is taking place, if we're using a specific location.
save_scope_value_as = {
name = bg_locale
value = flag:$LOCALE$
}
## Grab _scope backgrounds appropriately..
if = {
limit = { scope:bg_locale = flag:terrain_scope }
scope:bg_defender.location = { save_scope_as = background_terrain_scope }
}
else_if = {
limit = { scope:bg_locale = flag:wilderness_scope }
scope:bg_defender.location = { save_scope_as = background_wilderness_scope }
}
## Sort any random_ backgrounds if necessary.
else_if = {
limit = { scope:bg_locale = flag:random_nice_day }
random_list = {
# Indoors.
50 = {
trigger = {
exists = scope:bg_defender.location
is_nice_season_to_be_inside_trigger = { LOCATION = scope:bg_defender.location }
}
save_scope_value_as = {
name = bg_locale
value = flag:sitting_room
}
}
# Outdoors.
50 = {
trigger = {
exists = scope:bg_defender.location
is_nice_season_to_be_outside_trigger = { LOCATION = scope:bg_defender.location }
}
save_scope_value_as = {
name = bg_locale
value = flag:garden
}
}
# Fallback: occasionally characters fall into a bloody void between space and time, I guess, and when they do we need to stop trying to calculate the weather for non-Euclidian space.
50 = {
trigger = {
NOT = { exists = scope:bg_defender.location }
}
save_scope_value_as = {
name = bg_locale
# Because black holes are from space and space lives inside books.
value = flag:study
}
}
}
}
# Arrange aftermath.
save_scope_value_as = {
name = follow_up_event
value = event_id:$OUTPUT_EVENT$
}
save_scope_value_as = {
name = invalidation_event
value = event_id:$INVALIDATION_EVENT$
}
# Configure starting scopes'n'variables.
scope:bg_defender = {
# Set our current round.
set_variable = {
name = bg_current_round
value = 1
}
# Set up our initial scores.
set_variable = {
name = bg_current_score
value = 0
}
}
scope:bg_attacker = {
# Set up our initial scores.
set_variable = {
name = bg_current_score
value = 0
}
}
# Finally, send the first event.
scope:bg_defender = { trigger_event = board_games.0001 }
}
# Clean up all variables resulting from playing a board game.
remove_board_game_variables_effect = {
# Player-side variables.
remove_variable = bg_current_round
remove_variable = bg_current_score
remove_variable = bg_move_result
# If there are any wagering counties, clear the blockers on their being wagered.
if = {
limit = { exists = scope:bg_stake_land_recipient }
scope:bg_stake_land_recipient = { remove_variable = wagered_county }
}
if = {
limit = { exists = scope:bg_stake_land_actor }
scope:bg_stake_land_actor = { remove_variable = wagered_county }
}
# Remove any debug variables.
remove_variable = bg_gib_only_losing_locs
remove_variable = bg_gib_only_winning_locs
# Note, we don't remove var:engaged_in_board_game here, as we run this effect at the start of games for clean-up also.
}
remove_engaged_in_board_game_variables_effect = {
scope:bg_attacker = {
if = {
# Restrict to live characters to prevent errors.
limit = { is_alive = yes }
remove_variable = engaged_in_board_game
}
}
scope:bg_defender = {
if = {
# Restrict to live characters to prevent errors.
limit = { is_alive = yes }
remove_variable = engaged_in_board_game
}
}
}
# Clean all consequences of a single combat.
remove_board_game_info_effect = {
scope:bg_defender = {
# Only remove variables if they're alive, as otherwise we get errors.
if = {
limit = { is_alive = yes }
remove_board_game_variables_effect = yes
}
}
scope:bg_attacker = {
# Only remove variables if they're alive, as otherwise we get errors.
if = {
limit = { is_alive = yes }
remove_board_game_variables_effect = yes
}
}
remove_engaged_in_board_game_variables_effect = yes
}
bg_fire_clean_up_and_invalidate_effect = {
remove_engaged_in_board_game_variables_effect = yes
# We try to wing this at scope:bg_defender...
if = {
limit = {
scope:bg_defender = { is_alive = yes }
}
scope:bg_defender = {
trigger_event = { saved_event_id = scope:invalidation_event }
}
}
# ... then scope:bg_attacker...
else_if = {
limit = {
scope:bg_attacker = { is_alive = yes }
}
scope:bg_attacker = {
trigger_event = { saved_event_id = scope:invalidation_event }
}
}
# ... then scope:bg_initiator...
else_if = {
limit = {
scope:bg_initiator = { is_alive = yes }
}
scope:bg_initiator = {
trigger_event = { saved_event_id = scope:invalidation_event }
}
}
# ... then we give up, as somehow *everyone* involved in the board game has died simultaneously.
}
##################################################
# INTERACTION-SPECIFIC EFFECTS
challenge_to_2p_chess_interaction_lock_in_actor_stake_land_effect = {
scope:actor = {
save_temporary_scope_as = ordering_char_temp
ordered_held_title = {
limit = {
bg_stake_land_valid_neighbouring_county_to_trade_trigger = { NEIGHBOUR = scope:recipient }
}
order_by = bg_stake_land_evaluate_appropriate_county_ordering_value
save_scope_as = bg_stake_land_actor
set_variable = wagered_county
}
}
}
challenge_to_2p_chess_interaction_lock_in_game_type_effect = {
$GAME_TYPE_SETTER$ = {
# Landless characters use their location.
if = {
limit = { is_playable_character = no }
location = {
# Pachisi - favoured in the eastern parts of the map.
if = {
limit = { bg_game_type_region_pachisi_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:pachisi
}
}
# Hnefatafl - favoured in the northern parts of the map.
else_if = {
limit = { bg_game_type_region_hnefatafl_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:hnefatafl
}
}
# Tabula - favoured around the Med.
else_if = {
limit = { bg_game_type_region_tabula_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:tabula
}
}
# Go - favoured around Tibet.
else_if = {
limit = { bg_game_type_region_go_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:go
}
}
# Fidchell - favoured around the Celtic rim.
else_if = {
limit = { bg_game_type_region_fidchell_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:fidchell
}
}
# Chess - fallback.
else = {
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:chess
}
}
}
}
# Landed characters use their capital.
else = {
capital_province = {
# Pachisi - favoured in the eastern parts of the map.
if = {
limit = { bg_game_type_region_pachisi_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:pachisi
}
}
# Hnefatafl - favoured in the northern parts of the map.
else_if = {
limit = { bg_game_type_region_hnefatafl_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:hnefatafl
}
}
# Tabula - favoured around the Med.
else_if = {
limit = { bg_game_type_region_tabula_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:tabula
}
}
# Go - favoured around Tibet.
else_if = {
limit = { bg_game_type_region_go_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:go
}
}
# Fidchell - favoured around the Celtic rim.
else_if = {
limit = { bg_game_type_region_fidchell_trigger = yes }
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:fidchell
}
}
# Chess - fallback.
else = {
save_scope_value_as = {
name = bg_interaction_game_type
value = flag:chess
}
}
}
}
}
}
fp2_bg_stake_friendly_effect = {
$VICTOR$ = {
if = {
# Obscure opinion adds from players.
limit = { is_ai = yes }
add_opinion = {
target = $LOSER$
modifier = pleased_opinion
opinion = 25
}
}
add_stress = minor_stress_loss
}
$LOSER$ = {
if = {
# Obscure opinion adds from players.
limit = { is_ai = yes }
add_opinion = {
target = $VICTOR$
modifier = pleased_opinion
opinion = 10
}
}
add_stress = minor_stress_gain
}
}
fp2_bg_stake_fame_effect = {
$VICTOR$ = { add_prestige = medium_prestige_gain }
$LOSER$ = { add_prestige = minor_prestige_loss }
}
fp2_bg_stake_fortune_effect = {
# A nice, simple, transfer of funds.
$LOSER$ = {
pay_short_term_gold = {
target = $VICTOR$
gold = scope:bg_stake_gold
}
}
}
fp2_bg_stake_titles_effect = {
create_title_and_vassal_change = {
type = granted
save_scope_as = change
}
if = {
limit = { $VICTOR$ = scope:actor }
scope:bg_stake_land_recipient = {
change_title_holder = {
holder = scope:actor
change = scope:change
}
}
}
else_if = {
limit = { $VICTOR$ = scope:recipient }
scope:bg_stake_land_actor = {
change_title_holder = {
holder = scope:recipient
change = scope:change
}
}
}
resolve_title_and_vassal_change = scope:change
}
##################################################
# RESULT EFFECTS
perk_interaction_0122_apply_effects_effect = {
# Stakes.
## Friendlies bet opinion & stress.
if = {
limit = { always = scope:chess_friendly }
fp2_bg_stake_friendly_effect = {
VICTOR = scope:bg_victor
LOSER = scope:bg_loser
}
}
## Fame bets prestige.
if = {
limit = { always = scope:chess_prestige }
fp2_bg_stake_fame_effect = {
VICTOR = scope:bg_victor
LOSER = scope:bg_loser
}
}
## Fortune bets gold.
if = {
limit = { always = scope:chess_gold }
fp2_bg_stake_fortune_effect = {
VICTOR = scope:bg_victor
LOSER = scope:bg_loser
}
}
## Land bets... land.
if = {
limit = { always = scope:chess_land }
fp2_bg_stake_titles_effect = { VICTOR = scope:bg_victor }
}
}

View file

@ -0,0 +1,27 @@
################
# 867 NORTHMEN #
################
bookmark_867_northmen_aellas_capture_war_imprisonment_effect = {
if = {
limit = {
scope:defender_loser = {
this = character:163103 #Aella
is_ai = yes
}
NOR = {
is_target_in_global_variable_list = {
name = triggered_bookmark_events
target = flag:bookmark_867_northmen_aellas_capture
}
character:163103 = { is_imprisoned = yes }
}
}
scope:attacker_winner = {
imprison = {
target = scope:defender_loser
type = dungeon
}
}
}
}

View file

@ -0,0 +1,169 @@
add_tier_one_perfume_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_monthly_minor_prestige_1_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_prestige_gain_per_happy_powerful_vassal_add_1_modifier
}
1 = {
add_artifact_modifier = artifact_happy_powerful_vassal_tax_contribution_mult_1_modifier
}
1 = {
add_artifact_modifier = artifact_courtier_and_guest_opinion_1_modifier
}
1 = {
add_artifact_modifier = artifact_owned_personal_scheme_success_chance_add_1_modifier
}
}
}
add_tier_two_perfume_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_monthly_minor_prestige_2_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_prestige_gain_per_happy_powerful_vassal_add_2_modifier
}
1 = {
add_artifact_modifier = artifact_courtier_and_guest_opinion_2_modifier
}
1 = {
add_artifact_modifier = artifact_clergy_opinion_1_modifier
}
1 = {
add_artifact_modifier = artifact_owned_personal_scheme_success_chance_add_2_modifier
}
}
}
add_tier_three_perfume_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_monthly_minor_prestige_3_modifier
}
1 = {
add_artifact_modifier = artifact_dynasty_opinion_1_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_dynasty_prestige_1_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_prestige_gain_per_happy_powerful_vassal_add_3_modifier
}
1 = {
add_artifact_modifier = artifact_courtier_and_guest_opinion_3_modifier
}
1 = {
add_artifact_modifier = artifact_owned_personal_scheme_success_chance_add_3_modifier
}
1 = {
add_artifact_modifier = artifact_seduce_scheme_phase_duration_add_1_modifier
}
1 = {
add_artifact_modifier = artifact_courting_scheme_phase_duration_add_1_modifier
}
1 = {
add_artifact_modifier = artifact_spouse_opinion_add_1_modifier
}
1 = {
add_artifact_modifier = artifact_stress_gain_1_modifier
}
1 = {
add_artifact_modifier = artifact_negate_health_penalty_add_1_modifier
}
}
}
add_tier_four_perfume_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_monthly_minor_prestige_4_modifier
}
1 = {
add_artifact_modifier = artifact_dynasty_opinion_2_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_dynasty_prestige_2_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_prestige_gain_per_happy_powerful_vassal_add_4_modifier
}
1 = {
add_artifact_modifier = artifact_courtier_and_guest_opinion_4_modifier
}
1 = {
add_artifact_modifier = artifact_owned_personal_scheme_success_chance_add_4_modifier
}
1 = {
add_artifact_modifier = artifact_seduce_scheme_phase_duration_add_2_modifier
}
1 = {
add_artifact_modifier = artifact_courting_scheme_phase_duration_add_2_modifier
}
1 = {
add_artifact_modifier = artifact_spouse_opinion_add_2_modifier
}
1 = {
add_artifact_modifier = artifact_stress_gain_2_modifier
}
1 = {
add_artifact_modifier = artifact_negate_health_penalty_add_2_modifier
}
}
}
add_vetiver_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_health_gain_2_modifier
}
1 = {
add_artifact_modifier = artifact_health_gain_3_modifier
}
}
}
add_camphor_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_courtly_vassal_opinion_2_modifier
}
1 = {
add_artifact_modifier = artifact_courtly_vassal_opinion_3_modifier
}
}
}
add_ambergris_effect = {
random_list = {
pick = 1
unique = yes
1 = {
add_artifact_modifier = artifact_monthly_dynasty_prestige_2_modifier
}
1 = {
add_artifact_modifier = artifact_monthly_dynasty_prestige_3_modifier
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,434 @@

###################
# Generic effects that are used for basic opinion gain etc.
###################
#Basic effect for gaining a camp officer
basic_gained_camp_officer_effect = {
scope:liege = {
# Gain a bit of opinion for being appointed.
reverse_add_opinion = {
target = scope:employee
modifier = made_me_officer_opinion
}
# If they now like us sufficiently, then set up a potential friendship.
hidden_effect = {
if = {
limit = {
reverse_opinion = {
target = scope:employee
value >= 50
}
can_set_relation_potential_friend_trigger = { CHARACTER = scope:employee }
}
set_relation_potential_friend = scope:employee
}
}
# Plus, some ripple consequences.
every_courtier = {
limit = {
this != scope:employee
}
# Friends'n'lovers.
if = {
limit = {
has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:employee }
}
add_opinion = {
target = scope:liege
modifier = made_friend_officer_opinion
}
}
# Foes...
if = {
limit = {
has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:employee }
}
add_opinion = {
target = scope:liege
modifier = made_foe_officer_opinion
}
}
# ... and family who are not foes.
else_if = {
limit = { is_close_or_extended_family_of = scope:employee }
add_opinion = {
target = scope:liege
modifier = made_family_officer_opinion
}
}
}
}
}
#Basic effect for losing a court position
basic_revoked_camp_officer_effect = {
scope:employee = {
add_opinion = {
modifier = revoked_camp_officer_opinion
target = scope:liege
}
}
# Lose whatever you might have gained.
scope:employee = {
remove_opinion = {
target = scope:liege
modifier = made_me_officer_opinion
}
}
scope:liege = {
# If they now dislike us sufficiently, then set up a potential rivalry.
hidden_effect = {
if = {
limit = {
reverse_opinion = {
target = scope:employee
value <= -50
}
can_set_relation_potential_rival_trigger = { CHARACTER = scope:employee }
}
set_relation_potential_rival = scope:employee
}
}
# Plus, some ripple consequences.
every_courtier = {
limit = {
this != scope:employee
}
# Friends'n'lovers.
if = {
limit = {
has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:employee }
}
remove_opinion = {
target = scope:liege
modifier = made_friend_officer_opinion
}
}
# Foes...
if = {
limit = {
has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:employee }
}
remove_opinion = {
target = scope:liege
modifier = made_foe_officer_opinion
}
}
# ... and family who are not foes.
else_if = {
limit = { is_close_or_extended_family_of = scope:employee }
remove_opinion = {
target = scope:liege
modifier = made_family_officer_opinion
}
}
}
}
}
#Basic effect for a camp_officer invalidating
basic_invalidated_camp_officer_effect = {}
################
# EFFECTS FOR SPECIFIC CAMP OFFICER
################
# SECOND
second_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
second_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
scope:employee = {
if = {
limit = { var:loyalty_dependent_on_position ?= scope:liege }
scope:liege = {
remove_hook = {
target = scope:employee
type = loyalty_hook
}
}
}
if = {
limit = { has_character_modifier = ep3_laamp_flavour_ewan_2071_b_work_self_to_death_modifier }
remove_character_modifier = ep3_laamp_flavour_ewan_2071_b_work_self_to_death_modifier
}
}
}
second_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# Quartermaster
quartermaster_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
quartermaster_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
quartermaster_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# Armorer
armorer_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
armorer_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
armorer_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# chief forager
chief_forager_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
chief_forager_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
chief_forager_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# master thief
master_thief_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
master_thief_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
master_thief_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# head porter
head_porter_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
head_porter_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
head_porter_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# head groom
head_groom_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
head_groom_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
head_groom_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# huntperson
huntperson_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
huntperson_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
huntperson_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# kennelperson
kennelperson_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
kennelperson_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
kennelperson_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# chief_engineer
chief_engineer_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
chief_engineer_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
chief_engineer_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# witness
witness_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
witness_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
witness_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# person_haggler
person_haggler_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
person_haggler_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
person_haggler_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# camp cook
camp_cook_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
camp_cook_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
camp_cook_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# master_bard
master_bard_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
master_bard_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
master_bard_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# stooge
stooge_camp_officer_title_accepted_effect = {
# No basic effect here — it applies default opinions that are flipped for a stooge.
}
stooge_camp_officer_title_revoked_effect = {
# No basic effect here — it applies default opinions that are flipped for a stooge.
}
stooge_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# master_of_arms
master_of_arms_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
master_of_arms_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
master_of_arms_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# light_cav_captain
light_cavalry_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
light_cavalry_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
light_cavalry_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# camelry_captain
camelry_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
camelry_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
camelry_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# elephantry_captain
elephantry_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
elephantry_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
elephantry_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# heavy_cavalry_captain
heavy_cavalry_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
heavy_cavalry_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
heavy_cavalry_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# horse_archer_captain
horse_archer_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
horse_archer_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
horse_archer_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# archer_captain
archer_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
archer_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
archer_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# heavy_infantry_captain
heavy_infantry_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
heavy_infantry_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
heavy_infantry_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# light_infantry_captain
light_infantry_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
light_infantry_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
light_infantry_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# pike_captain
pike_captain_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
pike_captain_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
pike_captain_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# master_of_spoils_captain
master_of_spoils_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
master_of_spoils_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
master_of_spoils_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# camp_priest
camp_priest_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
camp_priest_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
camp_priest_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}
# laureate
laureate_camp_officer_title_accepted_effect = {
basic_gained_camp_officer_effect = yes
}
laureate_camp_officer_title_revoked_effect = {
basic_revoked_camp_officer_effect = yes
}
laureate_camp_officer_title_invalidated_effect = {
basic_invalidated_camp_officer_effect = yes
}

View file

@ -0,0 +1,520 @@
#Effects relating to Casus Bellis.
#############################################################################################################################################################################################################
# modify_participants_fame_values #
# by Sean Hughes #
# #
# Description: Makes the correct adjustments to prestige or piety for each participant in a war. #
# #
# Parameters: #
# WINNER: The character who won the war. #
# LOSER: The character who lost the war. #
# IS_RELIGIOUS_WAR: If yes we will modify Piety values instead of Prestige values. #
# FAME_BASE: The base value for calculating how much Prestige or Piety is gained/lost by each character, as below: #
# WINNER_FAME_SCALE: The winner will receive Prestige/Piety equal to FAME_BASE multiplied by this scale. #
# LOSER_FAME_SCALE: The winner will receive Prestige/Piety equal to FAME_BASE multiplied by this scale. **NOTE: This value should always be negative, otherwise the loser will gain piety/prestige!** #
# WINNER_ALLY_FAME_SCALE: Winner's allies will receive Prestige/Piety based on FAME_BASE, multiplied by this scale, then adjusted based on their War Contributuion. #
# LOSER_ALLY_FAME_SCALE: As above, but for the loser's side. ** NOTE: In the current design this should always be the same as WINNER_ALLY_FAME_SCALE, but I'm splitting it out in order to future-proof #
# this effect in case the design changes or modders want to alter how it works. ** #
# #
#############################################################################################################################################################################################################
@maximum_prestige_winner = 1000
@maximum_piety_winner = 1000
@maximum_merit_winner = 1000
@minimum_prestige_loser = -1000
@minimum_piety_loser = -1000
@maximum_prestige_winner_ally = 1000
@maximum_piety_winner_ally = 1000
@maximum_merit_winner_ally = 1000
@maximum_prestige_loser_ally = 1000
@maximum_piety_loser_ally = 1000
modify_all_participants_fame_values = {
# Give the winner the appropriate type & amount of 'fame' (prestige or piety).
if = {
# If the attacker is the winner, we only award fame *experience* instead of actual fame currency.
limit = {
$WINNER$ = scope:attacker
}
if = {
# Piety level progress for winning offensive religious wars.
limit = {
$IS_RELIGIOUS_WAR$ = yes
}
scope:attacker = {
add_piety_experience = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
max = @maximum_piety_winner
}
}
}
else = {
# Prestige level progress for winning all other offensive wars.
scope:attacker = {
add_prestige_experience = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
max = @maximum_prestige_winner
}
}
}
}
else = {
# If the defender is the winner, they get actual fame currency as a reward.
if = {
# Gain piety for winning defensive religious wars.
limit = {
$IS_RELIGIOUS_WAR$ = yes
}
scope:defender = {
add_piety = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
max = @maximum_piety_winner
}
}
}
else = {
# Gain prestige for winning all other defensive wars.
scope:defender = {
add_prestige = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
max = @maximum_prestige_winner
}
}
}
}
if = {
# Award Merit to the victorious attacker
limit = {
$WINNER$ = scope:attacker
}
scope:attacker = {
if = {
limit = {
government_allows = merit
}
change_merit = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
max = @maximum_merit_winner
}
}
}
}
else = {
# Award Merit to the victorious defender
scope:defender = {
if = {
limit = {
government_allows = merit
}
change_merit = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
max = @maximum_merit_winner
}
}
}
}
# Award the appropriate type & amount of 'fame' to the allies of both primary participants.
modify_allies_of_participants_fame_values = {
WINNER = $WINNER$
IS_RELIGIOUS_WAR = $IS_RELIGIOUS_WAR$
FAME_BASE = $FAME_BASE$
WINNER_ALLY_FAME_SCALE = $WINNER_ALLY_FAME_SCALE$
LOSER_ALLY_FAME_SCALE = $LOSER_ALLY_FAME_SCALE$
}
# Take the appropriate type & amount of 'fame' away from the loser of the war.
if = {
# Religious wars cost Piety for the loser.
limit = {
$IS_RELIGIOUS_WAR$ = yes
}
$LOSER$ = {
add_piety = {
value = $FAME_BASE$
multiply = $LOSER_FAME_SCALE$
min = @minimum_piety_loser
}
}
}
else = {
# All other war types cost Prestige from the loser.
$LOSER$ = {
add_prestige = {
value = $FAME_BASE$
multiply = $LOSER_FAME_SCALE$
min = @minimum_prestige_loser
}
}
}
}
modify_all_participants_fame_values_crusading_claim = {
# Give the winner the appropriate type & amount of 'fame' (prestige or piety).
if = {
# If the attacker is the winner, we only award fame *experience* instead of actual fame currency.
limit = {
$WINNER$ = scope:attacker
}
scope:attacker = {
add_prestige_experience = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
}
}
}
else = {
# Gain prestige for winning all other defensive wars.
scope:defender = {
add_prestige = {
value = $FAME_BASE$
multiply = $WINNER_FAME_SCALE$
}
}
}
# Award the appropriate type & amount of 'fame' to the allies of both primary participants.
modify_allies_of_participants_fame_values_crusading_claim = {
WINNER = $WINNER$
FAME_BASE = $FAME_BASE$
WINNER_ALLY_FAME_SCALE = $WINNER_ALLY_FAME_SCALE$
LOSER_ALLY_FAME_SCALE = $LOSER_ALLY_FAME_SCALE$
}
# All other war types cost Prestige from the loser.
$LOSER$ = {
add_prestige = {
value = $FAME_BASE$
multiply = $LOSER_FAME_SCALE$
}
}
}
#############################################################################################################################################################################################################
# modify_allies_of_participants_fame_values #
# by Sean Hughes #
# #
# Description: Makes the correct adjustments to prestige or piety but ONLY for the allies in a war (e.g., not the primary attacker/defender). #
# Used as part of 'modify_participants_fame_values' but can also be used on it's own where desired, such as in a white peace where you don't want to give the primary participants any prestige/piety. #
# #
# Parameters: #
# WINNER: The character who won the war. #
# IS_RELIGIOUS_WAR: If yes we will modify Piety values instead of Prestige values. #
# FAME_BASE: The base value for calculating how much Prestige or Piety is gained/lost by each character, as below: #
# WINNER_ALLY_FAME_SCALE: Winner's allies will receive Prestige/Piety based on FAME_BASE, multiplied by this scale, then adjusted based on their War Contributuion. #
# LOSER_ALLY_FAME_SCALE: As above, but for the loser's side. ** NOTE: In the current design this should always be the same as WINNER_ALLY_FAME_SCALE, but I'm splitting it out in order to future-proof #
# this effect in case the design changes or modders want to alter how it works. ** #
# #
#############################################################################################################################################################################################################
modify_allies_of_participants_fame_values = {
# Give the allies of both primary participants the appropriate type & amount of 'fame'.
if = {
# Religious wars award Piety to participants.
limit = {
$IS_RELIGIOUS_WAR$ = yes
}
if = {
# Award Piety to the victorious attacker's allies.
limit = {
$WINNER$ = scope:attacker
}
add_from_contribution_attackers = {
piety = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_piety_winner_ally
}
opinion = {
modifier = contributed_in_war
}
}
# Award Piety to the defeated defender's allies.
add_from_contribution_defenders = {
piety = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_prestige_loser_ally
}
opinion = {
modifier = contributed_in_war
}
}
}
else = {
# Award Piety to the victorious defender's allies.
add_from_contribution_defenders = {
piety = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_piety_winner_ally
}
opinion = {
modifier = contributed_in_war
}
}
# Award Piety to the defeated attacker's allies.
add_from_contribution_attackers = {
piety = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_prestige_loser_ally
}
opinion = {
modifier = contributed_in_war
}
}
}
}
else = {
# All other war types award Prestige to participants.
if = {
# Award Prestige to the victorious attacker's allies.
limit = {
$WINNER$ = scope:attacker
}
add_from_contribution_attackers = {
prestige = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_prestige_winner_ally
}
opinion = {
modifier = contributed_in_war
}
}
# Award Prestige to the defeated defender's allies.
add_from_contribution_defenders = {
prestige = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_prestige_loser_ally
}
opinion = {
modifier = contributed_in_war
}
}
}
else = {
# Award Prestige to the victorious defender's allies.
add_from_contribution_defenders = {
prestige = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_prestige_winner_ally
}
opinion = {
modifier = contributed_in_war
}
}
# Award Prestige to the defeated attacker's allies.
add_from_contribution_attackers = {
prestige = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_prestige_loser_ally
}
opinion = {
modifier = contributed_in_war
}
}
}
}
# Award Merit to each participant of the winning side
if = {
# Award Merit to the victorious attacker's allies.
limit = {
$WINNER$ = scope:attacker
}
add_from_contribution_attackers = {
merit = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_merit_winner_ally
}
}
}
else = {
# Award Merit to the victorious defender's allies.
add_from_contribution_defenders = {
merit = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_merit_winner_ally
}
}
}
}
modify_allies_of_participants_fame_both_values = {
# Give the allies of both primary participants the appropriate type & amount of 'fame'.
if = {
# Award Piety to the victorious attacker's allies.
limit = {
$WINNER$ = scope:attacker
}
add_from_contribution_attackers = {
prestige = {
value = $PRESTIGE_FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_prestige_winner_ally
}
piety = {
value = $PIETY_FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_piety_winner_ally
}
opinion = {
modifier = contributed_in_war
}
}
# Award Piety to the defeated defender's allies.
add_from_contribution_defenders = {
prestige = {
value = $PRESTIGE_FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_prestige_loser_ally
}
piety = {
value = $PIETY_FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_piety_loser_ally
}
opinion = {
modifier = contributed_in_war
}
}
}
else = {
# Award Piety to the victorious defender's allies.
add_from_contribution_defenders = {
prestige = {
value = $PRESTIGE_FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_prestige_winner_ally
}
piety = {
value = $PIETY_FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
max = @maximum_piety_winner_ally
}
opinion = {
modifier = contributed_in_war
}
}
# Award Piety to the defeated attacker's allies.
add_from_contribution_attackers = {
prestige = {
value = $PRESTIGE_FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_prestige_loser_ally
}
piety = {
value = $PIETY_FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
max = @maximum_piety_loser_ally
}
opinion = {
modifier = contributed_in_war
}
}
}
}
modify_allies_of_participants_fame_values_crusading_claim = {
# Give the allies of both primary participants the appropriate type & amount of 'fame'.
if = {
# Award Prestige to the victorious attacker's allies.
limit = {
$WINNER$ = scope:attacker
}
add_from_contribution_attackers = {
prestige = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
}
opinion = {
modifier = contributed_in_war
}
}
# Award Prestige to the defeated defender's allies.
add_from_contribution_defenders = {
prestige = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
}
opinion = {
modifier = contributed_in_war
}
}
}
else = {
# Award Prestige to the victorious defender's allies.
add_from_contribution_defenders = {
prestige = {
value = $FAME_BASE$
multiply = $WINNER_ALLY_FAME_SCALE$
}
opinion = {
modifier = contributed_in_war
}
}
# Award Prestige to the defeated attacker's allies.
add_from_contribution_attackers = {
prestige = {
value = $FAME_BASE$
multiply = $LOSER_ALLY_FAME_SCALE$
multiply = -1
}
opinion = {
modifier = contributed_in_war
}
}
}
}
add_hook_from_temp_de_jure_liege_to_attacker = {
# Assumes scope of title to be conquered.
# Assumes scope:attacker to be set for the character initiating the war.
# Assumes scope:temp_de_jure_liege to be set for the de jure liege that
# might gain a title from the war.
# Outcome: De jure liege of the contested title will owe a favor towards
# the attacker of the war if the de jure liege is in the vassal tree of the attacker.
if = {
limit = {
exists = scope:temp_de_jure_liege
scope:temp_de_jure_liege != scope:attacker
scope:temp_de_jure_liege = { target_is_liege_or_above = scope:attacker }
scope:temp_de_jure_liege = {
is_ai = yes
}
scope:attacker = {
can_add_hook = {
type = favor_hook
target = scope:temp_de_jure_liege
}
}
}
scope:attacker = {
add_hook = {
type = favor_hook
target = scope:temp_de_jure_liege
}
}
}
}

View file

@ -0,0 +1,778 @@
#Scripted effects relating to childhood
#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#get_guardian_event_target_effect
#save_good_character_effect
#Save a relation scope for the child, use the arguments:
#RELATION = friend
#RELATION = crush
#RELATION = bully
#RELATION = victim
######################################################################
# EFFECTS
######################################################################
#Get a child's Guardian, or alternatively a suitable stand-in, since the event relies on an adult being present
get_guardian_scope_effect = {
if = {
limit = {
any_relation = {
type = guardian
always = yes
}
}
random_relation = {
type = guardian
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
exists = court_owner.court_position:court_tutor_court_position
}
court_owner.court_position:court_tutor_court_position ?= {
save_scope_as = guardian
}
}
else_if = {
limit = {
NOT = { exists = scope:guardian }
exists = court_owner.court_position:court_guru_court_position
}
court_owner.court_position:court_guru_court_position ?= {
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
is_ruler = yes
any_parent = {
is_available_ai_adult = yes
is_in_the_same_court_as = root
}
}
random_parent = {
limit = {
is_available_ai_adult = yes
is_in_the_same_court_as = root
}
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
is_ruler = yes
any_courtier_or_guest = {
is_available_ai_adult = yes
}
}
random_courtier_or_guest = {
limit = {
is_available_ai_adult = yes
}
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
any_parent = {
is_ai = yes
is_available = yes
}
}
random_parent = {
limit = {
is_in_the_same_court_as = root
is_ai = yes
is_available = yes
}
alternative_limit = {
is_ai = yes
is_available = yes
}
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
any_sibling = {
is_available_ai_adult = yes
}
}
random_sibling = {
limit = {
is_available_ai_adult = yes
is_in_the_same_court_as = root
}
alternative_limit = {
is_available_ai_adult = yes
}
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
liege ?= {
any_courtier_or_guest = {
is_available_ai_adult = yes
}
}
}
liege = {
random_courtier_or_guest = {
limit = {
is_available_ai_adult = yes
}
save_scope_as = guardian
}
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
liege ?= {
is_available_ai_adult = yes
}
}
liege = {
save_scope_as = guardian
}
}
if = { #Close to last resort
limit = {
NOT = { exists = scope:guardian }
any_ruler = {
is_ai = yes
culture = root.culture
faith = root.faith
is_available = yes
}
}
random_ruler = {
limit = {
is_ai = yes
culture = root.culture
faith = root.faith
is_available = yes
}
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
any_ruler = {
is_ai = yes
is_available = yes
OR = {
culture = root.culture
faith = root.faith
}
}
}
debug_log = "Resorted to last resort when finding guardian for child"
debug_log_scopes = yes
random_ruler = {
limit = {
is_ai = yes
is_available = yes
OR = {
culture = root.culture
faith = root.faith
}
}
save_scope_as = guardian
}
}
if = {
limit = {
NOT = { exists = scope:guardian }
any_ruler = {
is_ai = yes
is_available = yes
}
}
debug_log = "Resorted to absolute last resort when finding guardian for child"
debug_log_scopes = yes
random_ruler = {
limit = {
is_ai = yes
is_available = yes
}
save_scope_as = guardian
}
}
}
#Save a relation scope for the child, use the arguments:
#RELATION =
#SCOPE =
save_good_character_effect = {
#Make sure that this list prioritizes other child vassals/heirs when the child being bullied is a player or player heir.
save_temporary_scope_value_as = {
name = $SCOPE$_relation
value = yes
}
if = {
limit = {
NOT = { exists = scope:$RELATION$ }
is_playable_character = yes
}
every_vassal = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
}
if = {
limit = {
is_playable_character = yes
NOT = { exists = scope:$RELATION$ }
}
every_courtier = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
if = {
limit = {
is_playable_character = yes
NOT = { exists = scope:$RELATION$ }
exists = liege
this != liege
}
liege = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_vassal = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
}
if = {
limit = {
is_playable_character = no
NOT = { exists = scope:$RELATION$ }
exists = liege
this != liege
}
liege = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_vassal = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_courtier_or_guest = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
}
if = {
limit = {
NOT = { exists = scope:$RELATION$ }
exists = host
this != host
}
host = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_vassal = {
if = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
every_child = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_warden_hostage = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
every_courtier_or_guest = {
limit = {
save_good_$RELATION$_character_trigger_check = yes
}
add_to_list = good_child_relation_character
}
}
}
if = {
limit = {
NOT = { exists = scope:$RELATION$ }
}
#To actually pick the relation
random_in_list = {
list = good_child_relation_character
limit = {
is_vassal_of = root
}
alternative_limit = {
is_courtier_of = root
}
alternative_limit = {
exists = liege
is_primary_heir_of = liege
}
alternative_limit = {
exists = liege
is_heir_of = liege
}
alternative_limit = {
always = yes
}
weight = {
base = 1
modifier = {
add = 2
is_powerful_vassal_of = root
}
modifier = {
add = 1
exists = root.liege
is_vassal_of = root.liege
}
modifier = {
add = 1
exists = root.liege
any_parent = {
is_vassal_of = root.liege
}
}
modifier = {
add = 4
age >= root.age_dif_child_down
age <= root.age_dif_child_up
}
modifier = {
add = -0.5
exists = scope:crush_relation
root = { has_sexuality = none }
OR = {
AND = {
is_female = yes
root = { is_female = yes }
}
AND = {
is_male = yes
root = { is_male = yes }
}
}
}
}
save_scope_as = $SCOPE$
}
}
}
send_event_about_player_heir_childhood_personality_effect = {
every_heir_title = {
limit = {
holder ?= {
is_ai = no
player_heir ?= scope:personality_child
NOT = { is_in_list = childhood_personality_event }
}
is_title_created = yes #Since partition succession may result in uncreated titles having heirs but not holders.
}
holder = {
add_to_list = childhood_personality_event
}
}
every_in_list = {
list = childhood_personality_event
trigger_event = child_personality.$ID$
}
}
add_suitable_same_realm_children_to_list = {
if = {
limit = {
OR = {
father ?= {
is_ai = no
}
mother ?= {
is_ai = no
}
host ?= {
is_ai = no
}
}
}
if = {
limit = { exists = location.county.holder.top_liege }
location.county.holder.top_liege = {
save_scope_as = top_liege_scope
}
}
else = {
save_scope_as = top_liege_scope
}
scope:top_liege_scope = {
if = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
if = {
limit = {
any_courtier_or_guest = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
every_courtier_or_guest = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
}
if = {
limit = {
any_warden_hostage = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
every_warden_hostage = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
}
if = {
limit = {
any_vassal_or_below = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
every_vassal_or_below = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
}
if = {
limit = {
any_vassal_or_below = {
any_courtier_or_guest = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
}
every_vassal_or_below = {
limit = {
any_courtier_or_guest = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
every_courtier_or_guest = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
}
}
if = {
limit = {
any_vassal_or_below = {
any_warden_hostage = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
}
every_vassal_or_below = {
limit = {
any_warden_hostage = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
}
every_warden_hostage = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
}
}
}
}
else = {
if = {
limit = { exists = location.county.holder }
location.county.holder = {
save_scope_as = top_liege_scope
}
}
else = {
save_scope_as = top_liege_scope
}
scope:top_liege_scope = {
if = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
every_courtier = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
every_warden_hostage = {
limit = {
is_ai = yes
is_available_child = yes
this != root
age >= 6
}
add_to_list = suitable_same_realm_children
}
}
}
}
add_similar_age_same_court_children_to_list = {
location.county.holder = {
if = {
limit = {
is_ai = yes
save_good_crush_character_trigger_check = yes
}
add_to_list = similar_age_same_court_children
}
if = {
limit = {
any_courtier_or_guest = {
is_ai = yes
save_good_crush_character_trigger_check = yes
}
}
every_courtier_or_guest = {
limit = {
is_ai = yes
save_good_crush_character_trigger_check = yes
}
add_to_list = similar_age_same_court_children
}
}
if = {
limit = {
any_warden_hostage = {
is_ai = yes
save_good_crush_character_trigger_check = yes
}
}
every_warden_hostage = {
limit = {
is_ai = yes
save_good_crush_character_trigger_check = yes
}
add_to_list = similar_age_same_court_children
}
}
}
}
guardian_or_court_tutor_trigger_event = {
if = {
limit = {
any_relation = {
type = guardian
}
}
random_relation = {
type = guardian
trigger_event = $EVENT$
}
}
else_if = {
limit = {
exists = court_owner.court_position:court_guru_court_position
}
court_owner.court_position:court_guru_court_position = {
trigger_event = $EVENT$
}
}
else = {
court_owner.court_position:court_tutor_court_position ?= {
trigger_event = $EVENT$
}
}
}

View file

@ -0,0 +1,801 @@
#Effects relating to commanders
#get_valid_commander_list_effect: Creates a list of all valid commander characters called "valid_commanders"
get_valid_commander_list_effect = {
every_vassal = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = $ARMY_OWNER$ }
}
add_to_list = $LIST$
}
every_courtier = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = $ARMY_OWNER$ }
}
add_to_list = $LIST$
}
}
knight_increase_prowess_chance_effect = {
random_list = {
60 = {
modifier = {
add = {
value = this.learning
multiply = -1
multiply = 2
}
}
modifier = {
factor = 0.5
dynasty ?= {
has_dynasty_perk = warfare_legacy_3
}
}
}
30 = {
add_prowess_skill = 1
}
10 = {
blademaster_lifestyle_rank_up_effect = yes
modifier = {
add = 5
has_education_martial_trigger = yes
}
modifier = {
add = 4
has_trait = education_martial_prowess_1
}
modifier = {
add = 8
has_trait = education_martial_prowess_2
}
modifier = {
add = 12
has_trait = education_martial_prowess_3
}
modifier = {
add = 16
has_trait = education_martial_prowess_4
}
modifier = {
add = 15
has_trait = lifestyle_blademaster
}
modifier = {
add = 10
has_trait = shrewd
}
modifier = {
add = 10
has_trait = physique_good
}
modifier = {
add = 5
has_trait = intellect_good_1
}
modifier = {
add = 15
has_trait = intellect_good_2
}
modifier = {
add = 30
has_trait = intellect_good_3
}
modifier = {
factor = 3
culture = {
has_cultural_parameter = blademaster_traits_more_common
}
}
modifier = {
factor = 0
AND = {
has_trait = lifestyle_blademaster
has_trait_xp = {
trait = lifestyle_blademaster
value >= trait_third_level
}
}
}
}
}
#This effect is used when the knight does something "good", so let's save them for the player to perhaps reward in the future
if = {
limit = {
liege ?= { is_ai = no }
NOT = { has_character_flag = was_the_target_of_event_court_5060 }
}
if = {
limit = {
exists = var:number_of_impressive_knight_things
}
change_variable = {
name = number_of_impressive_knight_things
add = 1
}
}
else = {
set_variable = {
name = number_of_impressive_knight_things
value = 1
}
}
# Maintenance of the variable
if = {
limit = {
NOT = { has_character_flag = is_schedueled_for_court_5061_maintenance }
}
add_character_flag = {
flag = is_schedueled_for_court_5061_maintenance
years = 4
}
trigger_event = {
id = court.5061
years = 4
}
}
liege = {
add_to_variable_list = {
name = impressive_knights
target = prev
}
}
}
}
berserker_kill_version_randomization_effect = {
random_list = {
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_head_ripped_off
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v2"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_cloven_in_half
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v3"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_viciously_dismembered
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v4"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_ripped_apart_limb_by_limb
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v5"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_chopped_to_pieces
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v6"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_heart_ripped_out
killer = root
}
}
}
1 = {
trigger = {
scope:enemy_knight = {
NOT = {
has_trait = brave
}
}
}
modifier = {
add = 99
scope:enemy_knight = {
has_trait = craven
}
}
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v7"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_fear
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v8"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_skull_cracked_open
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "berserker_rage_killed_enemy_no_trait_v9"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_strangled_with_own_intestines
killer = root
}
}
}
}
}
shieldmaiden_kill_version_randomisation_effect = {
random_list = {
10 = {
scope:combat_side = {
battle_event = {
key = "shieldmaiden_skill_killed_enemy_no_trait_v1"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_decapitated
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "shieldmaiden_skill_killed_enemy_no_trait_v2"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_cloven_in_half
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "shieldmaiden_skill_killed_enemy_no_trait_v3"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_viciously_dismembered
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "shieldmaiden_skill_killed_enemy_no_trait_v4"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_piteously_cut_down
killer = root
}
}
}
10 = {
scope:combat_side = {
battle_event = {
key = "shieldmaiden_skill_killed_enemy_no_trait_v5"
left_portrait = root
right_portrait = scope:enemy_knight
type = death
target_right = yes
}
}
scope:enemy_knight = {
death = {
death_reason = death_chopped_to_pieces
killer = root
}
}
}
}
}
recruit_terrain_specialist_effect = {
if = {
limit = {
exists = root.capital_province
any_pool_character = {
is_adult = yes
province = root.capital_province
can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
martial >= medium_skill_rating
culture = root.culture
opinion = { # Just to make sure you don't pull in rivals or similar
value >= -30
target = root
}
}
}
random_pool_character = {
province = root.capital_province
limit = {
is_adult = yes
can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
martial >= medium_skill_rating
culture = root.culture
opinion = { # Just to make sure you don't pull in rivals or similar
value >= -30
target = root
}
}
if = {
limit = {
NOT = {
has_trait = $SPECIALIST_TRAIT$
}
}
add_trait = $SPECIALIST_TRAIT$
}
random = {
chance = 50
wanderer_give_random_commander_trait_effect = yes
}
save_scope_as = new_commander
}
}
else = {
create_character = {
employer = root
template = $SPECIALIST_TEMPLATE_CHARACTER$
faith = root.faith
culture = root.culture
gender_female_chance = {
if = {
limit = { root.culture = { has_cultural_parameter = martial_custom_male_only_combatant } }
add = 0
}
else_if = {
limit = { root.culture = { has_cultural_parameter = martial_custom_female_only_combatant } }
add = 100
}
else = {
add = 50
}
}
save_scope_as = new_commander
}
}
if = { # Error suppression
limit = {
exists = scope:new_commander
}
scope:new_commander = {
add_character_flag = {
flag = blocked_from_leaving
years = 25
}
}
if = {
limit = {
scope:new_commander = {
NOT = {
is_courtier_of = root
}
}
}
add_courtier = scope:new_commander
}
send_interface_toast = {
title = commander_recruited.t
left_icon = scope:new_commander
custom_tooltip = commander_recruited.desc
}
}
}
recruit_three_nomadic_capital_characters_effect = {
save_scope_as = root_scope
create_character = {
employer = scope:root_scope
template = $NOMAD_TEMPLATE_CHARACTER$
faith = domicile.domicile_faith
culture = domicile.domicile_culture
save_scope_as = new_commander
}
if = { # Error suppression
limit = {
exists = scope:new_commander
}
scope:new_commander = {
assign_random_nickname_effect = yes
add_character_flag = {
flag = blocked_from_leaving
years = 25
}
}
if = {
limit = {
scope:new_commander = {
NOT = {
is_courtier_of = scope:root_scope
}
}
}
add_courtier = scope:new_commander
}
send_interface_message = {
title = nomad_character_recruited.t
left_icon = scope:new_commander
custom_tooltip = commander_recruited.desc
}
}
create_character = {
employer = scope:root_scope
template = $NOMAD_TEMPLATE_CHARACTER$
faith = domicile.domicile_faith
culture = domicile.domicile_culture
save_scope_as = new_commander
}
if = { # Error suppression
limit = {
exists = scope:new_commander
}
scope:new_commander = {
assign_random_nickname_effect = yes
add_character_flag = {
flag = blocked_from_leaving
years = 25
}
}
if = {
limit = {
scope:new_commander = {
NOT = {
is_courtier_of = scope:root_scope
}
}
}
add_courtier = scope:new_commander
}
send_interface_message = {
title = nomad_character_recruited.t
left_icon = scope:new_commander
custom_tooltip = commander_recruited.desc
}
}
create_character = {
employer = scope:root_scope
template = $NOMAD_TEMPLATE_CHARACTER$
faith = domicile.domicile_faith
culture = domicile.domicile_culture
save_scope_as = new_commander
}
if = { # Error suppression
limit = {
exists = scope:new_commander
}
scope:new_commander = {
assign_random_nickname_effect = yes
add_character_flag = {
flag = blocked_from_leaving
years = 25
}
}
if = {
limit = {
scope:new_commander = {
NOT = {
is_courtier_of = scope:root_scope
}
}
}
add_courtier = scope:new_commander
}
send_interface_message = {
title = nomad_character_recruited.t
left_icon = scope:new_commander
custom_tooltip = commander_recruited.desc
}
}
}
commander_trait_lvling_ai_effect = {
save_scope_as = root_scope
random_list = {
1 = {
trigger = { has_trait = logistician }
add_trait_xp = {
trait = logistician
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(logistician)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = military_engineer }
add_trait_xp = {
trait = military_engineer
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(military_engineer)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = aggressive_attacker }
add_trait_xp = {
trait = aggressive_attacker
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(aggressive_attacker)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = unyielding_defender }
add_trait_xp = {
trait = unyielding_defender
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(unyielding_defender)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = forder }
add_trait_xp = {
trait = forder
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(forder)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = flexible_leader }
add_trait_xp = {
trait = flexible_leader
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(flexible_leader)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = desert_warrior }
add_trait_xp = {
trait = desert_warrior
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(desert_warrior)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = jungle_stalker }
add_trait_xp = {
trait = jungle_stalker
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(jungle_stalker)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = reaver }
add_trait_xp = {
trait = reaver
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(reaver)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = reckless }
add_trait_xp = {
trait = reckless
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(reckless)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = holy_warrior }
add_trait_xp = {
trait = holy_warrior
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(holy_warrior)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = open_terrain_expert }
add_trait_xp = {
trait = open_terrain_expert
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(open_terrain_expert)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = rough_terrain_expert }
add_trait_xp = {
trait = rough_terrain_expert
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(rough_terrain_expert)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = forest_fighter }
add_trait_xp = {
trait = forest_fighter
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(forest_fighter)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = cautious_leader }
add_trait_xp = {
trait = cautious_leader
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(cautious_leader)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = organizer }
add_trait_xp = {
trait = organizer
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(organizer)"
divide = 100
}
}
}
1 = {
trigger = { has_trait = winter_soldier }
add_trait_xp = {
trait = winter_soldier
value = {
value = 100
subtract = "scope:root_scope.has_trait_xp(winter_soldier)"
divide = 100
}
}
}
}
}

View file

@ -0,0 +1,689 @@
#Effects used in Lifestyle Focus events
#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#
#####################
# COMPLIMENT SYSTEM #
#####################
#This system evaluates whether a character would accept a certain type of compliment (types listed below) from another character. It will set a compliment_outcome varaible with a flag value of either good, neutral or bad which can be used to trigger follow up events.
#randomize_available_compliment_effect - as there are more compliment types than option buttons, you can use this effect to randomize a number of flags to trigger options (12 types of compliments).
#randomize_good_available_compliment_effect - this one will do its best to pick a good compliment option, recommended to use this one for at least one of the randomized options so that the player has at least one option which is likely to be successful. Defaults to randomize_available_compliment_effect if nothing good can be found.
#randomize_available_ai_value_compliment_effect - as the one above, but only uses the ai value compliments (8 types), the "light" version.
#clear_available_compliments_effect - clears all available compliment flags.
#evaluate_compliment_effect - evaluates the outcome of the compliment with a random_list and sets a compliment_outcome variable.
#evaluate_compliment_with_type_variable_effect - the same as the one above but also saves a variable containing the type of comliment used.
#COMPLIMENT TYPES
#compassionate (ai value)
#bold (ai value)
#honorable (ai value)
#rational (ai value)
#zealous (ai value)
#energetic (ai value)
#forgiving (ai value)
#beautiful
#strong
#extroverted
#dominant
#If you don't want to specify the available compliments, you can use this to get a selection relative to your root.diplomacy skill and your target's preferences.
#Run the effect as many times as the amount of compliment options you need.
#More diplomatically skilled characters has a higher chance to receive options which have a high likelihood of success.
#If you want to block a certain compliment, you can add that flag yourself before randomizing and then removing it afterwards.
#Use in scope of compliment giver.
#Needs arguments COMPLIMENT_RECEIVER
randomize_available_compliment_effect = {
random_list = {
1 = {
trigger = { NOT = { has_character_flag = available_compliment_compassionate } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_compassion >= low_positive_compassion }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_compassion < 0 }
}
add_character_flag = available_compliment_compassionate
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_bold } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_boldness >= low_positive_boldness }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_boldness < 0 }
}
add_character_flag = available_compliment_bold
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_honorable } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_honor >= low_positive_honor }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_honor < 0 }
}
add_character_flag = available_compliment_honorable
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_greedy } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_greed >= low_positive_greed }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_greed < 0 }
}
add_character_flag = available_compliment_greedy
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_rational } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_rationality >= low_positive_rationality }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_rationality < 0 }
}
add_character_flag = available_compliment_rational
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_zealous } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_zeal >= low_positive_zeal }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_zeal < 0 }
}
add_character_flag = available_compliment_zealous
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_energetic } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_energy >= low_positive_energy }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_energy < 0 }
}
add_character_flag = available_compliment_energetic
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_forgiving } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_vengefulness <= low_negative_vengefulness }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { ai_vengefulness > 0 }
}
add_character_flag = available_compliment_forgiving
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_beautiful } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { attraction >= 10 }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { attraction < -10 }
}
add_character_flag = available_compliment_beautiful
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_strong } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = {
OR = {
has_trait = strong
has_trait = physique_good_1
has_trait = physique_good_2
has_trait = physique_good_3
}
}
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = {
OR = {
has_trait = weak
has_trait = physique_bad_1
has_trait = physique_bad_2
has_trait = physique_bad_3
}
}
}
add_character_flag = available_compliment_strong
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_extroverted } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { has_personality_extroverted_trigger = yes }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { has_personality_introverted_trigger = yes }
}
add_character_flag = available_compliment_extroverted
}
1 = {
trigger = { NOT = { has_character_flag = available_compliment_dominant } }
modifier = {
factor = 3
root.diplomacy >= decent_skill_rating
$COMPLIMENT_RECEIVER$ = { has_personality_dominant_trigger = yes }
}
modifier = {
factor = 2
root.diplomacy < medium_skill_rating
$COMPLIMENT_RECEIVER$ = { has_personality_submissive_trigger = yes }
}
add_character_flag = available_compliment_dominant
}
}
}
#Randomizes an available compliment which is likely to work, needs argument COMPLIMENT_RECEIVER.
randomize_good_available_compliment_effect = {
random_list = {
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_compassion >= low_positive_compassion }
NOT = { has_character_flag = available_compliment_compassionate }
}
add_character_flag = available_compliment_compassionate
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_boldness >= low_positive_boldness }
NOT = { has_character_flag = available_compliment_bold }
}
add_character_flag = available_compliment_bold
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_honor >= low_positive_honor }
NOT = { has_character_flag = available_compliment_honorable }
}
add_character_flag = available_compliment_honorable
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_greed >= low_positive_greed }
NOT = { has_character_flag = available_compliment_greedy }
}
add_character_flag = available_compliment_greedy
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_rationality >= low_positive_rationality }
NOT = { has_character_flag = available_compliment_rational }
}
add_character_flag = available_compliment_rational
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_zeal >= low_positive_zeal }
NOT = { has_character_flag = available_compliment_zealous }
}
add_character_flag = available_compliment_zealous
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_energy >= low_positive_energy }
NOT = { has_character_flag = available_compliment_energetic }
}
add_character_flag = available_compliment_energetic
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { ai_vengefulness <= low_negative_vengefulness }
NOT = { has_character_flag = available_compliment_forgiving }
}
add_character_flag = available_compliment_forgiving
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { attraction >= 10 }
NOT = { has_character_flag = available_compliment_beautiful }
}
add_character_flag = available_compliment_beautiful
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = {
OR = {
has_trait = strong
has_trait = physique_good
}
}
NOT = { has_character_flag = available_compliment_strong }
}
add_character_flag = available_compliment_strong
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { has_personality_extroverted_trigger = yes }
NOT = { has_character_flag = available_compliment_extroverted }
}
add_character_flag = available_compliment_extroverted
}
100 = {
trigger = {
$COMPLIMENT_RECEIVER$ = { has_personality_dominant_trigger = yes }
NOT = { has_character_flag = available_compliment_dominant }
}
add_character_flag = available_compliment_dominant
}
1 = { #Fallback
randomize_available_compliment_effect = { COMPLIMENT_RECEIVER = $COMPLIMENT_RECEIVER$ }
}
}
}
#Same as randomize_available_compliment_effect but it only uses the 8 ai value compliments. Required argument COMPLIMENT_RECEIVER (not tested)
randomize_available_ai_value_compliment_effect = {
add_character_flag = available_compliment_beautiful
add_character_flag = available_compliment_strong
add_character_flag = available_compliment_extroverted
add_character_flag = available_compliment_dominant
randomize_available_compliment_effect = { COMPLIMENT_RECEIVER = $COMPLIMENT_RECEIVER$ }
remove_character_flag = available_compliment_beautiful
remove_character_flag = available_compliment_strong
remove_character_flag = available_compliment_extroverted
remove_character_flag = available_compliment_dominant
}
#Clears all the compliment flags after the event
clear_available_compliments_effect = {
remove_character_flag = available_compliment_compassionate
remove_character_flag = available_compliment_bold
remove_character_flag = available_compliment_honorable
remove_character_flag = available_compliment_greedy
remove_character_flag = available_compliment_rational
remove_character_flag = available_compliment_zealous
remove_character_flag = available_compliment_energetic
remove_character_flag = available_compliment_forgiving
remove_character_flag = available_compliment_beautiful
remove_character_flag = available_compliment_strong
remove_character_flag = available_compliment_extroverted
remove_character_flag = available_compliment_dominant
}
#EVALUATION
#Use in scope of compliment receiver.
#2 types, regular evaluate_compliment_effect and evaluate_compliment_with_type_variable_effect which saves the variable containing the type (evaluated_compliment_type)
#Needs arguments COMPLIMENT_TYPE (see compliment type list above) and COMPLIMENT_GIVER (the name of the scope).
evaluate_compliment_effect = {
save_scope_value_as = {
name = evaluated_compliment_type
value = flag:$COMPLIMENT_TYPE$
}
if = {
limit = { exists = scope:evaluated_compliment_type } #Because there are error messages otherwise
random_list = {
# BAD OUTCOME
0 = { # Base chance of 0, since we don't ever want to randomly penalize the player due to bad luck even if they picked the right compliment.
modifier = {
add = 100 #Incorrect type of compliment significantly increases chances of being insulted.
OR = {
AND = {
scope:evaluated_compliment_type = flag:compassionate
ai_compassion < 0
}
AND = {
scope:evaluated_compliment_type = flag:bold
ai_boldness < 0
}
AND = {
scope:evaluated_compliment_type = flag:honorable
ai_honor < 0
}
AND = {
scope:evaluated_compliment_type = flag:greedy
ai_greed < 0
}
AND = {
scope:evaluated_compliment_type = flag:rational
ai_rationality < 0
}
AND = {
scope:evaluated_compliment_type = flag:zealous
ai_zeal < 0
}
AND = {
scope:evaluated_compliment_type = flag:energetic
ai_energy < 0
}
AND = {
scope:evaluated_compliment_type = flag:forgiving
ai_vengefulness > 0
}
AND = {
scope:evaluated_compliment_type = flag:beautiful
attraction < -10
}
AND = {
scope:evaluated_compliment_type = flag:strong
OR = {
has_trait = weak
has_trait = physique_bad_1
has_trait = physique_bad_2
has_trait = physique_bad_3
}
}
AND = {
scope:evaluated_compliment_type = flag:extroverted
has_personality_introverted_trigger = yes
}
AND = {
scope:evaluated_compliment_type = flag:dominant
has_personality_submissive_trigger = yes
}
}
}
modifier = { #Humble people struggle with compliments
factor = 1.5
has_trait = humble
}
save_scope_value_as = {
name = compliment_outcome
value = flag:bad
}
}
60 = { #NEUTRAL OUTCOME
modifier = {
factor = 1.3
has_trait = arrogant
}
modifier = {
factor = 1.3
has_trait = humble
}
save_scope_value_as = {
name = compliment_outcome
value = flag:neutral
}
}
25 = { #GOOD OUTCOME
modifier = { #Great compliment (not step-based)
factor = 8
OR = {
AND = {
scope:evaluated_compliment_type = flag:extroverted
has_personality_extroverted_trigger = yes
}
AND = {
scope:evaluated_compliment_type = flag:dominant
has_personality_dominant_trigger = yes
}
}
}
modifier = { #Great compliment (step-based)
factor = 2 #Adds up to 8 with the two modifiers below
OR = {
AND = {
scope:evaluated_compliment_type = flag:compassionate
ai_compassion >= high_positive_compassion
}
AND = {
scope:evaluated_compliment_type = flag:bold
ai_boldness >= high_positive_boldness
}
AND = {
scope:evaluated_compliment_type = flag:honorable
ai_honor >= high_positive_honor
}
AND = {
scope:evaluated_compliment_type = flag:greedy
ai_greed >= high_positive_greed
}
AND = {
scope:evaluated_compliment_type = flag:rational
ai_rationality >= high_positive_rationality
}
AND = {
scope:evaluated_compliment_type = flag:zealous
ai_zeal >= high_positive_zeal
}
AND = {
scope:evaluated_compliment_type = flag:energetic
ai_energy >= high_positive_energy
}
AND = {
scope:evaluated_compliment_type = flag:forgiving
ai_vengefulness <= high_negative_vengefulness
}
AND = {
scope:evaluated_compliment_type = flag:beautiful
attraction >= 30
}
AND = {
scope:evaluated_compliment_type = flag:strong
has_trait = physique_good_3
}
}
}
modifier = { #Good compliment (step-based)
factor = 2 #Adds up to 4 with the modifier below
OR = {
AND = {
scope:evaluated_compliment_type = flag:compassionate
ai_compassion >= medium_positive_compassion
}
AND = {
scope:evaluated_compliment_type = flag:bold
ai_boldness >= medium_positive_boldness
}
AND = {
scope:evaluated_compliment_type = flag:honorable
ai_honor >= medium_positive_honor
}
AND = {
scope:evaluated_compliment_type = flag:greedy
ai_greed >= medium_positive_greed
}
AND = {
scope:evaluated_compliment_type = flag:rational
ai_rationality >= medium_positive_rationality
}
AND = {
scope:evaluated_compliment_type = flag:zealous
ai_zeal >= medium_positive_zeal
}
AND = {
scope:evaluated_compliment_type = flag:energetic
ai_energy >= medium_positive_energy
}
AND = {
scope:evaluated_compliment_type = flag:forgiving
ai_vengefulness <= medium_negative_vengefulness
}
AND = {
scope:evaluated_compliment_type = flag:beautiful
attraction >= 20
}
AND = {
scope:evaluated_compliment_type = flag:strong
OR = {
has_trait = physique_good_2
has_trait = physique_good_3
has_trait = strong
}
}
}
}
modifier = { #Good compliment (step-based)
factor = 4
OR = {
AND = {
scope:evaluated_compliment_type = flag:compassionate
ai_compassion >= low_positive_compassion
}
AND = {
scope:evaluated_compliment_type = flag:bold
ai_boldness >= low_positive_boldness
}
AND = {
scope:evaluated_compliment_type = flag:honorable
ai_honor >= low_positive_honor
}
AND = {
scope:evaluated_compliment_type = flag:greedy
ai_greed >= low_positive_greed
}
AND = {
scope:evaluated_compliment_type = flag:rational
ai_rationality >= low_positive_rationality
}
AND = {
scope:evaluated_compliment_type = flag:zealous
ai_zeal >= low_positive_zeal
}
AND = {
scope:evaluated_compliment_type = flag:energetic
ai_energy >= low_positive_energy
}
AND = {
scope:evaluated_compliment_type = flag:forgiving
ai_vengefulness <= low_negative_vengefulness
}
AND = {
scope:evaluated_compliment_type = flag:beautiful
attraction >= 10
}
AND = {
scope:evaluated_compliment_type = flag:strong
OR = {
has_trait = physique_good_1
has_trait = physique_good_2
has_trait = physique_good_3
has_trait = strong
}
}
}
}
modifier = { #Arrogant people like compliments
factor = 1.5
has_trait = arrogant
}
modifier = { #Diplomacy affects success chance
factor = {
value = $COMPLIMENT_GIVER$.diplomacy
subtract = diplomacy
multiply = 0.05 #I.e. 0.5 if 10 skill difference
add = 1 #To bring it to something like 1.5
}
}
save_scope_value_as = {
name = compliment_outcome
value = flag:good
}
}
}
}
}
compliment_to_love_letter_effect = {
if = {
limit = { exists = scope:compliment_outcome }
if = {
limit = { scope:compliment_outcome = flag:good }
set_variable = {
name = love_letter_quality
value = 4
days = 150
}
}
else_if = {
limit = { scope:compliment_outcome = flag:neutral }
set_variable = {
name = love_letter_quality
value = 2
days = 150
}
}
else_if = {
limit = { scope:compliment_outcome = flag:bad }
set_variable = {
name = love_letter_quality
value = 1
days = 150
}
}
set_variable = {
name = love_letter_compliment_type
value = scope:evaluated_compliment_type
}
}
}
compliment_to_love_letter_cleanup_effect = {
if = {
limit = { has_variable = love_letter_quality }
remove_variable = love_letter_quality
}
if = {
limit = { has_variable = love_letter_quality }
remove_variable = love_letter_compliment_type
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,122 @@
#Custom Loc scripted effects
# all date calculations are done in DAYS
# to be run in the root character scope
get_period_of_time_word_setup_effect = {
set_variable = {
name = start_date
value = $START_DATE$
}
set_variable = {
name = current_date
value = current_date
}
set_variable = {
name = period_of_time
value = {
value = var:current_date
subtract = var:start_date
}
}
}
# To be called in the after block of the event where this is used so the variables get cleaned up
clean_up_period_of_time_word_effect = {
remove_variable = start_date
remove_variable = current_date
remove_variable = period_of_time
}
set_raunchy_compliment_noun_effect = {
random_list = {
#Vixen
10 = {
trigger = { is_female = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:vixen
days = 5
}
}
#Minx
10 = {
trigger = { is_female = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:minx
days = 5
}
}
#Temptress
10 = {
trigger = { is_female = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:temptress
days = 5
}
}
#Siren
10 = {
trigger = { is_female = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:siren
days = 5
}
}
#Enchantress
10 = {
trigger = { is_female = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:enchantress
days = 5
}
}
#Lion
10 = {
trigger = { is_male = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:lion
days = 5
}
}
#Stallion
10 = {
trigger = { is_male = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:stallion
days = 5
}
}
#Stag
10 = {
trigger = { is_male = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:stag
days = 5
}
}
#Beast
10 = {
trigger = { is_male = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:beast
days = 5
}
}
#Stud
10 = {
trigger = { is_male = yes }
set_variable = {
name = raunchy_compliment_noun
value = flag:stud
days = 5
}
}
}
}

View file

@ -0,0 +1,119 @@
add_death_event_blocker_effect = {
set_variable = {
name = block_death_event_from
value = $DEAD$
days = 3
}
#If we get timed variables in list:
# add_to_variable_list = {
# name = block_death_event_from
# target = $DEAD$
# days = 3
# }
}
silent_disappearance_effect = {
hidden_effect = {
if = {
limit = { is_alive = yes }
death = {
death_reason = death_disappearance
}
}
}
}
silent_disappearance_ai_effect = {
hidden_effect = {
if = {
limit = {
is_alive = yes
root = { is_ai = yes }
}
death = {
death_reason = death_disappearance
}
}
}
}
silent_disappearance_ai_if_created_effect = {
hidden_effect = {
if = {
limit = {
is_alive = yes
root = { is_ai = yes }
has_character_flag = created
}
death = {
death_reason = death_disappearance
}
}
}
}
silent_disappear_ai_if_not_hired = {
hidden_effect = {
if = {
limit = {
is_alive = yes
root = { is_ai = yes }
employer != root
}
death = {
death_reason = death_disappearance
}
}
else_if = {
limit = {
is_alive = yes
employer != root
}
move_to_pool = yes
}
}
}
silent_disappear_ai_if_not_hired_with_flag = {
hidden_effect = {
if = {
limit = {
is_alive = yes
root = { is_ai = yes }
employer != root
has_character_flag = created
}
death = {
death_reason = death_disappearance
}
}
else_if = {
limit = {
is_alive = yes
employer != root
has_character_flag = created
}
move_to_pool = yes
}
}
}
save_died_in_battle_variables_effect = {
set_variable = {
name = battle_death_enemy
value = $ENEMY$
}
set_variable = {
name = battle_death_leader
value = $LEADER$
}
set_variable = {
name = battle_death_location
value = $LOCATION$
}
}

View file

@ -0,0 +1,72 @@
##################################################
# Shortcuts
##################################################
# Easily set-or-add to a variable.
increment_variable_effect = {
if = {
limit = {
NOT = { exists = var:$VAR$ }
}
set_variable = {
name = $VAR$
value = $VAL$
}
}
else = {
change_variable = {
name = $VAR$
add = $VAL$
}
}
}
increment_variable_remove_at_zero_effect = {
if = {
limit = { exists = var:$VAR$ }
change_variable = {
name = $VAR$
add = $VALUE$
}
if = {
limit = { var:$VAR$ <= 0 }
remove_variable = $VAR$
}
}
}
# Easily set-or-add to a _global_ variable - generally only for use in logging.
increment_global_variable_effect = {
if = {
limit = {
NOT = { exists = global_var:$VAR$ }
}
set_global_variable = {
name = $VAR$
value = $VAL$
}
}
else = {
change_global_variable = {
name = $VAR$
add = $VAL$
}
}
}
##################################################
# Debug
##################################################
log_debug_variable_for_persian_struggle_effect = {
if = {
limit = {
gather_debug_variables_for_persian_struggle_trigger = yes
is_struggle_type = persian_struggle
}
increment_global_variable_effect = {
VAR = sp_$VAR$
VAL = 1
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,471 @@
#Effects used in Statecraft Lifestyle Focus events
#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#
# A Flaw of Character:
# diplomacy_family_0008_appropriate_lesson_effect Used to evaluate if the lesson the player picked was suitable for their heir.
#
# The Power of Words: Outcome for complimenting somebody
# diplomacy_majesty_0004_outcome_effect
#
# Manipulating a Vassal:
# diplomacy_generic_0012_good_outcome_effect Successful Manipulation, gain Hook and Opinion
# diplomacy_generic_0012_bad_outcome_effect Failed Manipulation, lose Opinion
# diplomacy_generic_0012_terrible_outcome_effect Failed Manipulation, lose Hook and Prestige
# diplomacy_generic_0012_tooltip_effect Tooltip-Only Summary of Possible Outcomes
#
# Court Visit
# diplomacy_foreign_special_1010_court_visit_outcome_preview_effect Non-executing effect used to show the player a preview of possible event outcomes in a tooltip.
# diplomacy_foreign_special_1010_court_visit_outcome_great_effect The best possible outcome from this event chain
# diplomacy_foreign_special_1010_court_visit_outcome_good_effect The standard outcome from this event chain
# diplomacy_foreign_special_1010_court_visit_outcome_bad_effect The worst possible outcome from this event chain
# diplomacy_foreign_special_1010_clean_up_court_visit_effect Clears all flags and variables after the event chain has concluded.
# diplomacy_foreign_special_1010_court_visit_interesting_relation_okay_effect One of several effects for what your visitor does to your courtier behind closed doors. This one is neutral.
# diplomacy_foreign_special_1010_court_visit_interesting_relation_befriend_effect One of several effects for what your visitor does to your courtier behind closed doors. This one they become friends.
# diplomacy_foreign_special_1010_court_visit_interesting_relation_manipulate_effect One of several effects for what your visitor does to your courtier behind closed doors. This one they turn them against you.
# diplomacy_foreign_special_1010_court_visit_interesting_relation_seduce_effect One of several effects for what your visitor does to your courtier behind closed doors. This one they seduce them.
# diplomacy_foreign_special_1010_court_visit_join_seduction_successfully_effect If your visitor tried to seduce your courtier, and you're spying on them, you have the chance of joining in!
# diplomacy_foreign_special_1010_court_visit_interesting_relation_outcome_effect Finalized the closed door relationship effect.
diplomacy_majesty_0004_outcome_effect = {
random_list = {
1 = {
desc = diplomacy_majesty.0004.success.tt
show_chance = no
show_as_tooltip = {
add_diplomacy_lifestyle_xp = medium_lifestyle_xp
reverse_add_opinion = {
target = scope:compliment_receiver
modifier = kindness_opinion
opinion = 25
}
}
}
1 = {
desc = diplomacy_majesty.0004.neutral.tt
show_chance = no
show_as_tooltip = {
add_diplomacy_lifestyle_xp = minor_lifestyle_xp
}
}
1 = {
desc = diplomacy_majesty.0004.failure.tt
show_chance = no
show_as_tooltip = {
reverse_add_opinion = {
target = scope:compliment_receiver
modifier = cruelty_opinion
opinion = -25
}
}
}
}
hidden_effect = {
if = {
limit = {
exists = scope:compliment_outcome
scope:compliment_outcome = flag:good
}
trigger_event = { id = diplomacy_majesty.0005 days = 7 }
}
else_if = {
limit = {
exists = scope:compliment_outcome
scope:compliment_outcome = flag:neutral
}
send_interface_toast = {
left_icon = scope:compliment_receiver
title = diplomacy_majesty.0004.neutral_outcome.desc
add_diplomacy_lifestyle_xp = minor_lifestyle_xp
}
}
else_if = {
limit = {
exists = scope:compliment_outcome
scope:compliment_outcome = flag:bad
}
trigger_event = { id = diplomacy_majesty.0006 days = 7 }
}
}
}
# Court Visit Effects
diplomacy_foreign_special_1010_court_visit_outcome_preview_effect = {
show_as_tooltip = {
$CHARACTER$ = {
random_list = {
1 = {
show_chance = no
desc = diplomacy_foreign_special.1017.great
root = {
reverse_add_opinion = {
target = $CHARACTER$
modifier = friendliness_opinion
opinion = 30
}
if = {
limit = { $CHARACTER$ = scope:target_list_member_a }
custom_tooltip = diplomacy_foreign_special.1017.friends_a
}
else_if = {
limit = { $CHARACTER$ = scope:target_list_member_b }
custom_tooltip = diplomacy_foreign_special.1017.friends_b
}
else = {
custom_tooltip = diplomacy_foreign_special.1017.friends_c
}
add_diplomacy_lifestyle_perk_points = 1
}
}
1 = {
show_chance = no
desc = diplomacy_foreign_special.1017.good
root = {
diplomacy_foreign_special_1010_court_visit_outcome_good_effect = { CHARACTER = $CHARACTER$ }
}
}
1 = {
show_chance = no
desc = diplomacy_foreign_special.1017.bad
root = {
diplomacy_foreign_special_1010_court_visit_outcome_bad_effect = { CHARACTER = $CHARACTER$ }
}
}
}
}
}
}
diplomacy_foreign_special_1010_court_visit_outcome_great_effect = {
reverse_add_opinion = {
target = $CHARACTER$
modifier = friendliness_opinion
opinion = 30
}
hidden_effect = {
add_opinion = {
target = $CHARACTER$
modifier = friendliness_opinion
opinion = 30
}
}
progress_towards_friend_effect = {
CHARACTER = $CHARACTER$
OPINION = 0
REASON = friend_court_visit
}
add_diplomacy_lifestyle_perk_points = 1
}
diplomacy_foreign_special_1010_court_visit_outcome_good_effect = {
reverse_add_opinion = {
target = $CHARACTER$
modifier = respect_opinion
opinion = 15
}
hidden_effect = {
add_opinion = {
target = $CHARACTER$
modifier = friendliness_opinion
opinion = 15
}
}
add_diplomacy_lifestyle_perk_points = 1
}
diplomacy_foreign_special_1010_court_visit_outcome_bad_effect = {
reverse_add_opinion = {
target = $CHARACTER$
modifier = disappointed_opinion
opinion = -15
}
}
diplomacy_foreign_special_1010_clean_up_court_visit_effect = {
remove_variable = court_visit_points
remove_variable = no_of_court_visit_events
remove_character_flag = is_in_diplomacy_foreign_special_event
remove_character_flag = court_visit_hunt_or_dance
remove_character_flag = court_visit_dance_or_holy_place
remove_character_flag = private_dinner
remove_character_flag = compliment
remove_character_flag = in_success_event
remove_character_flag = in_failure_event
}
diplomacy_foreign_special_1010_court_visit_interesting_relation_okay_effect = {
scope:foreign_guest = {
add_opinion = {
target = scope:interesting_relation
modifier = friendliness_opinion
opinion = 15
}
reverse_add_opinion = {
target = scope:interesting_relation
modifier = friendliness_opinion
opinion = 15
}
}
}
diplomacy_foreign_special_1010_court_visit_interesting_relation_befriend_effect = {
scope:interesting_relation = {
set_relation_friend = { reason = friend_court_visit target = scope:foreign_guest }
}
scope:foreign_guest = {
hidden_effect = {
add_opinion = {
target = scope:interesting_relation
modifier = friendliness_opinion
opinion = 30
}
reverse_add_opinion = {
target = scope:interesting_relation
modifier = friendliness_opinion
opinion = 30
}
}
}
}
diplomacy_foreign_special_1010_court_visit_interesting_relation_manipulate_effect = {
scope:foreign_guest = {
if = {
limit = {
can_add_hook = {
target = scope:interesting_relation
type = manipulation_hook
}
}
add_hook = {
target = scope:interesting_relation
type = manipulation_hook
}
}
}
scope:interesting_relation = {
add_opinion = {
target = scope:foreign_guest
modifier = trust_opinion
opinion = 30
}
add_opinion = {
target = scope:host_ruler
modifier = suspicion_opinion
opinion = -20
}
hidden_effect = { if = { limit = { NOT = { has_relation_potential_rival = scope:host_ruler } } set_relation_potential_rival = scope:host_ruler } }
}
}
diplomacy_foreign_special_1010_court_visit_interesting_relation_seduce_effect = {
scope:foreign_guest = {
set_relation_lover = { reason = lover_court_visit_seduction target = scope:interesting_relation involved_character = root }
hidden_effect = {
intercourse_with_character_effect = { INTERCOURSE_CHARACTER = scope:interesting_relation }
add_opinion = {
target = scope:interesting_relation
modifier = romance_opinion
opinion = 30
}
reverse_add_opinion = {
target = scope:interesting_relation
modifier = romance_opinion
opinion = 30
}
}
}
}
diplomacy_foreign_special_1010_court_visit_join_seduction_successfully_effect = {
$CHARACTER$ = {
if = {
limit = {
matching_gender_and_sexuality_trigger = {
CHARACTER_1 = $CHARACTER$
CHARACTER_2 = root
}
NOR = {
has_relation_lover = root
is_consort_of = root
}
}
set_relation_lover = { reason = lover_court_visit_seduction target = root }
}
add_opinion = {
target = root
modifier = pleased_opinion
opinion = 30
}
hidden_effect = {
reverse_add_opinion = {
target = $CHARACTER$
modifier = pleased_opinion
opinion = 30
}
}
}
}
diplomacy_foreign_special_1010_court_visit_interesting_relation_outcome_effect = {
if = {
limit = { scope:private_dinner_outcome = flag:okay }
diplomacy_foreign_special_1010_court_visit_interesting_relation_okay_effect = yes
}
else_if = {
limit = { scope:private_dinner_outcome = flag:befriend }
diplomacy_foreign_special_1010_court_visit_interesting_relation_befriend_effect = yes
}
else_if = {
limit = { scope:private_dinner_outcome = flag:manipulate }
diplomacy_foreign_special_1010_court_visit_interesting_relation_manipulate_effect = yes
}
else_if = {
limit = { scope:private_dinner_outcome = flag:seduce }
diplomacy_foreign_special_1010_court_visit_interesting_relation_seduce_effect = yes
}
}
diplomacy_foreign_1150_successful_county_switch_effect = {
# Give your county/vassal to the neighbor
if = {
limit = {
scope:county.holder = scope:neighbor
}
create_title_and_vassal_change = {
type = returned
save_scope_as = change
add_claim_on_loss = no
}
scope:county = {
change_title_holder = {
holder = scope:ruler
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
else_if = {
limit = {
scope:ruler_vassal = {
highest_held_title_tier = tier_county
}
}
create_title_and_vassal_change = {
type = returned
save_scope_as = change
add_claim_on_loss = no
}
scope:ruler_vassal = {
change_liege = {
liege = scope:ruler
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
else = {
create_title_and_vassal_change = {
type = returned
save_scope_as = change
add_claim_on_loss = no
}
scope:county = {
change_title_holder = {
holder = scope:ruler
change = scope:change
}
}
}
# The neighbor gives his county/vassal to you.
if = {
limit = {
scope:neighbor_county.holder = scope:ruler
}
create_title_and_vassal_change = {
type = returned
save_scope_as = change
add_claim_on_loss = no
}
scope:neighbor_county = {
change_title_holder = {
holder = scope:neighbor
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
else = {
create_title_and_vassal_change = {
type = returned
save_scope_as = change
add_claim_on_loss = no
}
scope:neighbor_vassal = {
change_liege = {
liege = scope:neighbor
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
# Add xp
scope:ruler = { add_diplomacy_lifestyle_xp = major_lifestyle_experience }
# Add positive opinion
scope:neighbor = {
add_opinion = {
modifier = respect_opinion
target = scope:ruler
opinion = low_positive_opinion
}
}
}
diplomacy_foreign_1150_failed_county_switch_effect = {
# Add xp
scope:ruler = { add_diplomacy_lifestyle_xp = miniscule_lifestyle_experience }
# Add negative opinion (both neighbor and possible vassal)
scope:neighbor = {
add_opinion = {
modifier = respect_opinion
target = scope:ruler
opinion = low_negative_opinion
}
}
if = {
limit = {
exists = scope:neighbor_vassal
}
scope:neighbor_vassal = {
add_opinion = {
modifier = respect_opinion
target = scope:ruler
opinion = medium_negative_opinion
}
}
}
# Reduce control in your county (...sell-out)
scope:neighbor_county = {
change_county_control = major_county_control_loss
}
}

View file

@ -0,0 +1,980 @@

### Effects for handling Diplomacy Lifestyle Perks
# sound_foundations_skill_gain_effect: Randomly gain a skill point because of your child
# sound_foundations_random_removal_effect: Removes a random one of the modifiers added by Sound Foundations
sound_foundations_skill_gain_effect = {
if = {
limit = {
NOT = { has_variable = current_sound_foundations_value }
}
set_variable = {
name = current_sound_foundations_value # Number of applied modifiers
value = 0
}
}
every_child = {
add_to_temporary_list = current_amount_of_children
}
if = {
limit = {
exists = var:current_sound_foundations_value
save_temporary_scope_as = affected_parent
var:current_sound_foundations_value < sound_foundations_max
any_in_list = {
list = current_amount_of_children
count > scope:affected_parent.var:current_sound_foundations_value
}
}
if = {
limit = { government_has_flag = government_is_mandala }
random_list = {
1 = {
add_character_modifier = {
modifier = mandala_sound_foundations_martial_gain
}
}
1 = {
add_character_modifier = {
modifier = mandala_sound_foundations_diplomacy_gain
}
}
1 = {
add_character_modifier = {
modifier = mandala_sound_foundations_intrigue_gain
}
}
1 = {
add_character_modifier = {
modifier = mandala_sound_foundations_stewardship_gain
}
}
1 = {
add_character_modifier = {
modifier = mandala_sound_foundations_learning_gain
}
}
}
change_variable = {
name = current_sound_foundations_value
add = 1
}
}
else = {
random_list = {
1 = {
add_character_modifier = {
modifier = sound_foundations_martial_gain
}
}
1 = {
add_character_modifier = {
modifier = sound_foundations_diplomacy_gain
}
}
1 = {
add_character_modifier = {
modifier = sound_foundations_intrigue_gain
}
}
1 = {
add_character_modifier = {
modifier = sound_foundations_stewardship_gain
}
}
1 = {
add_character_modifier = {
modifier = sound_foundations_learning_gain
}
}
}
change_variable = {
name = current_sound_foundations_value
add = 1
}
}
}
}
sound_foundations_random_removal_effect = {
if = {
limit = {
has_perk = sound_foundations_perk
}
every_child = {
add_to_temporary_list = current_amount_of_children
}
if = {
limit = {
exists = var:current_sound_foundations_value
save_temporary_scope_as = affected_parent
var:current_sound_foundations_value <= sound_foundations_max
var:current_sound_foundations_value > 0
any_in_list = {
list = current_amount_of_children
count > scope:affected_parent.var:current_sound_foundations_value
NOT = { has_character_flag = about_to_die_but_not_dead_yet_flag } # Applied from on action death; called before imminent death
}
}
random_list = {
1 = {
trigger = {
has_character_modifier = sound_foundations_martial_gain
}
remove_character_modifier = sound_foundations_martial_gain
}
1 = {
trigger = {
has_character_modifier = sound_foundations_diplomacy_gain
}
remove_character_modifier = sound_foundations_diplomacy_gain
}
1 = {
trigger = {
has_character_modifier = sound_foundations_intrigue_gain
}
remove_character_modifier = sound_foundations_intrigue_gain
}
1 = {
trigger = {
has_character_modifier = sound_foundations_stewardship_gain
}
remove_character_modifier = sound_foundations_stewardship_gain
}
1 = {
trigger = {
has_character_modifier = sound_foundations_learning_gain
}
remove_character_modifier = sound_foundations_learning_gain
}
}
change_variable = {
name = current_sound_foundations_value
subtract = 1
}
}
}
}
groomed_to_rule_random_skills_effect = {
save_scope_as = child
if = {
limit = {
trigger_if = {
limit = { age <= childhood_education_start_age }
has_trait = rowdy # Default trait for martial ed
}
trigger_else_if = {
limit = { age < adulthood_start_age }
has_focus = education_martial
}
trigger_else = {
has_trait = education_martial
}
}
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:martial
}
}
else_if = {
limit = {
trigger_if = {
limit = { age <= childhood_education_start_age }
has_trait = charming # Default trait for intrigue ed
}
trigger_else_if = {
limit = { age < adulthood_start_age }
has_focus = education_intrigue
}
trigger_else = {
has_trait = education_intrigue
}
}
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:intrigue
}
}
else_if = {
limit = {
trigger_if = {
limit = { age <= childhood_education_start_age }
has_trait = curious # Default trait for diplomacy ed
}
trigger_else_if = {
limit = { age < adulthood_start_age }
has_focus = education_diplomacy
}
trigger_else = {
has_trait = education_diplomacy
}
}
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:diplomacy
}
}
else_if = {
limit = {
trigger_if = {
limit = { age <= childhood_education_start_age }
has_trait = bossy # Default trait for stewardship ed
}
trigger_else_if = {
limit = { age < adulthood_start_age }
has_focus = education_stewardship
}
trigger_else = {
has_trait = education_stewardship
}
}
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:stewardship
}
}
else_if = {
limit = {
trigger_if = {
limit = { age <= childhood_education_start_age }
has_trait = pensive # Default trait for learning ed
}
trigger_else_if = {
limit = { age < adulthood_start_age }
has_focus = education_learning
}
trigger_else = {
has_trait = education_learning
}
}
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:learning
}
}
else = { # Fallback in case something goes wrong
random_list = {
1 = {
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:martial
}
}
1 = {
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:diplomacy
}
}
1 = {
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:intrigue
}
}
1 = {
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:stewardship
}
}
1 = {
save_temporary_scope_value_as = {
name = skill_to_increase
value = flag:learning
}
}
}
}
if = {
limit = {
scope:skill_to_increase = flag:martial
}
random_list = {
1 = {
send_interface_message = {
type = event_martial_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_martial_skill = 1
}
scope:parent = {
send_interface_message = {
type = event_martial_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_martial_skill = 1
}
}
}
}
}
1 = {
send_interface_message = {
type = event_martial_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_martial_skill = 2
}
scope:parent = {
send_interface_message = {
type = event_martial_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_martial_skill = 2
}
}
}
}
}
1 = {
send_interface_message = {
type = event_martial_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_martial_skill = 3
}
scope:parent = {
send_interface_message = {
type = event_martial_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_martial_skill = 3
}
}
}
}
}
}
}
else_if = {
limit = {
scope:skill_to_increase = flag:intrigue
}
random_list = {
1 = {
send_interface_message = {
type = event_intrigue_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_intrigue_skill = 1
}
scope:parent = {
send_interface_message = {
type = event_intrigue_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_intrigue_skill = 1
}
}
}
}
}
1 = {
send_interface_message = {
type = event_intrigue_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_intrigue_skill = 2
}
scope:parent = {
send_interface_message = {
type = event_intrigue_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_intrigue_skill = 2
}
}
}
}
}
1 = {
send_interface_message = {
type = event_intrigue_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_intrigue_skill = 3
}
scope:parent = {
send_interface_message = {
type = event_intrigue_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_intrigue_skill = 3
}
}
}
}
}
}
}
else_if = {
limit = {
scope:skill_to_increase = flag:diplomacy
}
random_list = {
1 = {
send_interface_message = {
type = event_diplomacy_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_diplomacy_skill = 1
}
scope:parent = {
send_interface_message = {
type = event_diplomacy_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_diplomacy_skill = 1
}
}
}
}
}
1 = {
send_interface_message = {
type = event_diplomacy_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_diplomacy_skill = 2
}
scope:parent = {
send_interface_message = {
type = event_diplomacy_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_diplomacy_skill = 2
}
}
}
}
}
1 = {
send_interface_message = {
type = event_diplomacy_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_diplomacy_skill = 3
}
scope:parent = {
send_interface_message = {
type = event_diplomacy_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_diplomacy_skill = 3
}
}
}
}
}
}
}
else_if = {
limit = {
scope:skill_to_increase = flag:stewardship
}
random_list = {
1 = {
send_interface_message = {
type = event_stewardship_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_stewardship_skill = 1
}
scope:parent = {
send_interface_message = {
type = event_stewardship_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_stewardship_skill = 1
}
}
}
}
}
1 = {
send_interface_message = {
type = event_stewardship_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_stewardship_skill = 2
}
scope:parent = {
send_interface_message = {
type = event_stewardship_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_stewardship_skill = 2
}
}
}
}
}
1 = {
send_interface_message = {
type = event_stewardship_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_stewardship_skill = 3
}
scope:parent = {
send_interface_message = {
type = event_stewardship_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_stewardship_skill = 3
}
}
}
}
}
}
}
else_if = {
limit = {
scope:skill_to_increase = flag:learning
}
random_list = {
1 = {
send_interface_message = {
type = event_learning_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_learning_skill = 1
}
scope:parent = {
send_interface_message = {
type = event_learning_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_learning_skill = 1
}
}
}
}
}
1 = {
send_interface_message = {
type = event_learning_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_learning_skill = 2
}
scope:parent = {
send_interface_message = {
type = event_learning_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_learning_skill = 2
}
}
}
}
}
1 = {
send_interface_message = {
type = event_learning_good
title = groomed_to_rule_msg_title
left_icon = scope:parent
add_learning_skill = 3
}
scope:parent = {
send_interface_message = {
type = event_learning_good
title = groomed_to_rule_msg_title
left_icon = scope:child
show_as_tooltip = {
scope:child = {
add_learning_skill = 3
}
}
}
}
}
}
}
}
childhood_groomed_to_rule_skill_gain_effect = {
every_parent = {
limit = {
is_alive = yes
has_perk = groomed_to_rule_perk
}
save_scope_as = parent
root = {
groomed_to_rule_random_skills_effect = yes
}
}
}
save_commission_epic_loc_variables = {
story_owner = {
set_variable = {
name = composition_type
value = scope:story.var:composition_type
}
set_variable = {
name = composition_detail
value = scope:story.var:composition_detail
}
if = {
limit = {
exists = scope:story.var:composer
}
set_variable = {
name = composer_exists
value = yes
}
scope:story.var:composer = {
save_scope_as = composer
}
}
}
}
clear_commission_epic_loc_variables = {
remove_variable = composition_type
remove_variable = composition_detail
remove_variable = composer_exists
}
update_embassies_effect = {
if = {
limit = {
has_perk = embassies_perk
is_landless_adventurer = no
}
remove_all_character_modifier_instances = embassies_perk_modifier
set_variable = {
name = current_embassies_perk_value
value = 0
}
set_variable = {
name = previous_current_embassies_perk_value
value = 0
}
if = {
limit = {
exists = var:previous_current_embassies_perk_value
exists = var:current_embassies_perk_value
}
every_ally = {
prev = {
change_variable = {
name = previous_current_embassies_perk_value
add = 1
}
if = {
limit = {
exists = var:current_embassies_perk_value
var:current_embassies_perk_value < embassies_max
}
change_variable = {
name = current_embassies_perk_value
add = 1
}
add_character_modifier = {
modifier = embassies_perk_modifier
}
}
}
}
# For players that were over the cap before the change so that they don't feel like they've "lost progress"
save_temporary_scope_as = variable_check
if = {
limit = {
var:current_embassies_perk_value < scope:variable_check.var:previous_current_embassies_perk_value
}
set_variable = {
name = current_embassies_perk_value
value = var:previous_current_embassies_perk_value
}
}
}
}
}
try_remove_perk_alliance_opinion_effect = {
if = {
limit = {
has_opinion_modifier = {
modifier = perk_negotiated_alliance_opinion
target = $TARGET$
}
}
remove_opinion = {
modifier = perk_negotiated_alliance_opinion
target = $TARGET$
}
}
}
# friendly_counsel_skill_gain_effect: Randomly gain a skill point because of your friend
# friendly_counsel_random_removal_effect: Removes a random one of the modifiers added by Friendly Counsel
friendly_counsel_skill_gain_effect = {
if = {
limit = {
has_perk = friendly_counsel_perk
}
if = {
limit = {
NOT = { has_variable = current_friendly_counsel_perk_value }
}
set_variable = {
name = current_friendly_counsel_perk_value
value = 0
}
}
every_relation = {
type = friend
add_to_temporary_list = friendly_counsel_friends
}
every_relation = {
type = best_friend
add_to_temporary_list = friendly_counsel_friends
}
every_relation = {
type = blood_brother
add_to_temporary_list = friendly_counsel_friends
}
if = {
limit = {
exists = var:current_friendly_counsel_perk_value
save_temporary_scope_as = affected_friend
OR = {
var:current_friendly_counsel_perk_value < friendly_counsel_max
AND = { # If you have a Blood Brother you get one extra skill
government_has_flag = government_is_nomadic
var:current_friendly_counsel_perk_value < 6
any_in_list = {
list = friendly_counsel_friends
has_relation_blood_brother = root
}
}
}
any_in_list = {
list = friendly_counsel_friends
count > scope:affected_friend.var:current_friendly_counsel_perk_value
}
}
random_list = {
1 = {
add_character_modifier = {
modifier = friendly_counsel_martial_gain
}
}
1 = {
add_character_modifier = {
modifier = friendly_counsel_diplomacy_gain
}
}
1 = {
add_character_modifier = {
modifier = friendly_counsel_intrigue_gain
}
}
1 = {
add_character_modifier = {
modifier = friendly_counsel_stewardship_gain
}
}
1 = {
add_character_modifier = {
modifier = friendly_counsel_learning_gain
}
}
}
change_variable = {
name = current_friendly_counsel_perk_value
add = 1
}
}
}
}
friendly_counsel_random_removal_effect = {
if = {
limit = {
has_perk = friendly_counsel_perk
}
every_relation = {
type = friend
add_to_temporary_list = friendly_counsel_friends
}
every_relation = {
type = best_friend
add_to_temporary_list = friendly_counsel_friends
}
if = {
limit = {
exists = var:current_friendly_counsel_perk_value
save_temporary_scope_as = affected_friend
var:current_friendly_counsel_perk_value <= friendly_counsel_max
var:current_friendly_counsel_perk_value > 0
any_in_list = {
list = friendly_counsel_friends
count > scope:affected_friend.var:current_friendly_counsel_perk_value
NOT = { has_character_flag = about_to_die_but_not_dead_yet_flag }
}
}
random_list = {
1 = {
trigger = {
has_character_modifier = friendly_counsel_martial_gain
}
remove_character_modifier = friendly_counsel_martial_gain
}
1 = {
trigger = {
has_character_modifier = friendly_counsel_diplomacy_gain
}
remove_character_modifier = friendly_counsel_diplomacy_gain
}
1 = {
trigger = {
has_character_modifier = friendly_counsel_intrigue_gain
}
remove_character_modifier = friendly_counsel_intrigue_gain
}
1 = {
trigger = {
has_character_modifier = friendly_counsel_stewardship_gain
}
remove_character_modifier = friendly_counsel_stewardship_gain
}
1 = {
trigger = {
has_character_modifier = friendly_counsel_learning_gain
}
remove_character_modifier = friendly_counsel_learning_gain
}
}
change_variable = {
name = current_friendly_counsel_perk_value
subtract = 1
}
}
}
}
update_confidants_effect = {
if = {
limit = {
has_perk = confidants_perk
}
remove_all_character_modifier_instances = confidants_perk_modifier
save_temporary_scope_as = confidant_scope
set_variable = {
name = current_confidants_perk_value
value = 0
}
if = {
limit = {
exists = var:current_confidants_perk_value
}
every_relation = {
type = friend
add_to_temporary_list = confidant_friend_list
}
every_in_list = {
list = confidant_friend_list
scope:confidant_scope = {
if = {
limit = {
exists = var:current_confidants_perk_value
var:current_confidants_perk_value < confidants_max
}
change_variable = {
name = current_confidants_perk_value
add = 1
}
add_character_modifier = {
modifier = confidants_perk_modifier
}
}
}
}
remove_variable = current_confidants_perk_value
}
}
}

View file

@ -0,0 +1,472 @@
#Effects used in Lifestyle Focus events
#####################################################################
# EFFECT LIST
#####################################################################
# random_dummy_gender_effect - saves event target dummy_gender as female or female (50/50 chance)
# random_dummy_gender_soldier_effect - saves a random soldier gender as event target dummy_gender
# dummy_opposite_gender_effect - saves the dummy character of the opposite sex compared to TARGET
random_dummy_gender_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_gender } }
1 = { dummy_male = { save_scope_as = dummy_gender } }
}
}
}
romance_target_gender_effect = {
hidden_effect = {
if = {
limit = { NOT = { has_sexuality = asexual } }
random_list = {
50 = {
trigger = { is_attracted_to_women = yes }
dummy_female = { save_scope_as = $SCOPE_NAME$ }
}
50 = {
trigger = { is_attracted_to_men = yes }
dummy_male = { save_scope_as = $SCOPE_NAME$ }
}
}
}
else = {
#If this effect is used for content not blocked for asexual characters, we assume this effect is used to find out what gender society expects us to prefer.
save_temporary_scope_as = asexual_char
#If homosexuality seems to be accepted, there is a change of same gender attraction target
if = {
limit = {
NOR = {
trait_is_shunned_or_criminal_in_faith_trigger = {
FAITH = scope:asexual_char.faith
TRAIT = sodomite
GENDER_CHARACTER = dummy_female
}
trait_is_shunned_or_criminal_in_faith_trigger = {
FAITH = scope:asexual_char.faith
TRAIT = sodomite
GENDER_CHARACTER = dummy_male
}
}
}
random_list = {
10 = {
modifier = {
is_female = yes
add = 80
}
dummy_male = { save_scope_as = $SCOPE_NAME$ }
}
10 = {
modifier = {
is_male = yes
add = 80
}
dummy_female = { save_scope_as = $SCOPE_NAME$ }
}
}
}
#If homosexuality isn't accepted, we 100% go with opposite sex
else = {
if = {
limit = { is_female = yes }
dummy_male = { save_scope_as = $SCOPE_NAME$ }
}
else = {
dummy_female = { save_scope_as = $SCOPE_NAME$ }
}
}
}
}
}
random_dummy_gender_soldier_effect = {
save_temporary_scope_as = root_character
hidden_effect = {
random_list = {
1 = {
trigger = {
dummy_female = {
can_be_combatant_based_on_gender_trigger = {
ARMY_OWNER = scope:root_character
}
}
}
dummy_female = { save_scope_as = $SCOPE_NAME$ }
}
1 = {
trigger = {
dummy_male = {
can_be_combatant_based_on_gender_trigger = {
ARMY_OWNER = scope:root_character
}
}
}
dummy_male = { save_scope_as = $SCOPE_NAME$ }
}
}
}
}
random_dummy_gender_non_combatant_effect = {
save_temporary_scope_as = root_character
hidden_effect = {
random_list = {
1 = {
trigger = {
dummy_female = {
NOT = {
can_be_combatant_based_on_gender_trigger = {
ARMY_OWNER = scope:root_character
}
}
}
}
dummy_female = { save_scope_as = $SCOPE_NAME$ }
}
1 = {
trigger = {
dummy_male = {
NOT = {
can_be_combatant_based_on_gender_trigger = {
ARMY_OWNER = scope:root_character
}
}
}
}
dummy_male = { save_scope_as = $SCOPE_NAME$ }
}
}
}
}
random_dummy_gender_spy_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_gender } }
1 = { dummy_male = { save_scope_as = dummy_gender } }
}
}
}
random_dummy_gender_musician_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_musician_gender } }
1 = { dummy_male = { save_scope_as = dummy_musician_gender } }
}
}
}
random_dummy_gender_servant_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_servant_gender } }
1 = { dummy_male = { save_scope_as = dummy_servant_gender } }
}
}
}
random_dummy_gender_assassin_effect = {
hidden_effect = {
random_list = {
50 = {
modifier = {
add = 50
exists = scope:owner
scope:owner.faith = { has_doctrine = doctrine_gender_female_dominated }
}
dummy_female = { save_scope_as = dummy_assassin_gender }
}
50 = {
modifier = {
add = 50
exists = scope:owner
scope:owner.faith = { has_doctrine = doctrine_gender_male_dominated }
}
dummy_male = { save_scope_as = dummy_assassin_gender }
}
}
}
}
random_dummy_gender_scholar_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_scholar_gender } }
25 = { dummy_male = { save_scope_as = dummy_scholar_gender } }
}
}
}
random_dummy_gender_mystic_effect = {
hidden_effect = {
random_list = {
4 = { dummy_female = { save_scope_as = dummy_mystic_gender } }
1 = { dummy_male = { save_scope_as = dummy_mystic_gender } }
}
}
}
random_dummy_gender_physician_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_physician_gender } }
1 = { dummy_male = { save_scope_as = dummy_physician_gender } }
}
}
}
random_dummy_gender_chancellor_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_gender } }
1 = { dummy_male = { save_scope_as = dummy_gender } }
}
}
}
random_dummy_gender_marshal_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_gender } }
1 = { dummy_male = { save_scope_as = dummy_gender } }
}
}
}
random_dummy_gender_steward_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_gender } }
1 = { dummy_male = { save_scope_as = dummy_gender } }
}
}
}
random_dummy_gender_spymaster_effect = {
hidden_effect = {
random_list = {
1 = { dummy_female = { save_scope_as = dummy_gender } }
1 = { dummy_male = { save_scope_as = dummy_gender } }
}
}
}
random_dummy_gender_landholder_effect = {
hidden_effect = {
random_list = {
##################################
# Female Chance (adds up to 50%) #
##################################
25 = { # Female Landowners Common (50-50)
trigger = {
OR = {
has_realm_law = equal_law
has_realm_law = female_preference_law
has_realm_law = female_only_law
# These cultures historically granted equal property rights to women.
culture = {
OR = {
has_cultural_pillar = heritage_north_germanic
has_cultural_parameter = gender_equal_inheritance
}
}
}
}
dummy_female = { save_scope_as = dummy_gender }
}
15 = { # Female Landowners Uncommon (33-67)
trigger = {
OR = {
has_realm_law = male_preference_law
has_realm_law = equal_law
has_realm_law = female_preference_law
has_realm_law = female_only_law
# These religions historically granted more property rights to women.
faith = {
religion_tag = islam_religion # Based on the Early Islamic Reforms.
religion_tag = hinduism_religion # Based on the Dharmasatras.
religion_tag = judaism_religion # Based on Mosaic Law.
}
# These cultures historically granted more property rights to women.
has_culture = culture:english
has_culture = culture:norman
culture = { has_cultural_pillar = heritage_north_germanic } # Scandanavian women often managed households and had full property rights.
culture = { has_cultural_pillar = heritage_iberian } # Granted by the Liber Judiciorum ca 642/642. Includes Basque.
culture = { has_cultural_pillar = heritage_indo_aryan } # Based on the Dharmasatras.
}
}
dummy_female = { save_scope_as = dummy_gender }
}
10 = { # Female Landowners Rare (17-83)
trigger = {
OR = {
# These cultures historically prevented women from owning/inheriting land.
NOT = {
culture = { has_cultural_pillar = heritage_goidelic } # Patriarchical society which made women subordinate to men.
culture = { has_cultural_pillar = heritage_east_slavic } # Patriarchical society which made women subordinate to men.
culture = { has_cultural_pillar = heritage_south_slavic }
culture = { has_cultural_pillar = heritage_byzantine } # Based on Roman Law
culture = { has_cultural_pillar = heritage_latin } # Based on Roman Law
}
# But if their legal system changes to allow it, women should gain full ownership/inheritance rights.
has_realm_law = equal_law
has_realm_law = female_preference_law
has_realm_law = female_only_law
}
}
dummy_female = { save_scope_as = dummy_gender }
}
################################
# Male Chance (adds up to 50%) #
################################
25 = { # Male Landowners Common (50-50)
trigger = {
OR = {
has_realm_law = equal_law
has_realm_law = male_preference_law
has_realm_law = male_only_law
}
}
dummy_male = { save_scope_as = dummy_gender }
}
15 = { # Male Landowners Uncommon (33-67)
trigger = {
OR = {
has_realm_law = female_preference_law
has_realm_law = equal_law
has_realm_law = male_preference_law
has_realm_law = male_only_law
}
}
dummy_male = { save_scope_as = dummy_gender }
}
10 = { # Male Landowners Rare (17-83)
trigger = {
}
dummy_male = { save_scope_as = dummy_gender }
}
}
}
}
random_dummy_gender_clergy_effect = {
hidden_effect = {
random_list = {
50 = {
trigger = {
faith = {
NOR = {
has_doctrine = doctrine_clerical_gender_male_only
AND = {
has_doctrine = doctrine_clerical_gender_either
has_doctrine = doctrine_gender_male_dominated
}
}
}
}
dummy_female = { save_scope_as = dummy_clergy_gender }
}
50 = {
trigger = {
faith = {
NOR = {
has_doctrine = doctrine_clerical_gender_female_only
AND = {
has_doctrine = doctrine_clerical_gender_either
has_doctrine = doctrine_gender_female_dominated
}
}
}
}
dummy_male = { save_scope_as = dummy_clergy_gender }
}
}
}
}
dummy_opposite_gender_effect = {
if = {
limit = { $TARGET$ = { is_female = yes } }
dummy_male = { save_scope_as = dummy_opposite_gender }
}
else = {
dummy_female = { save_scope_as = dummy_opposite_gender }
}
}
dummy_attracted_gender_effect = {
if = {
limit = {
$TARGET$ = {
is_attracted_to_men = yes
is_attracted_to_women = yes
}
}
dummy_male = { save_scope_as = dummy_attracted_gender }
}
else_if = {
limit = { $TARGET$ = { is_attracted_to_men = yes } }
dummy_male = { save_scope_as = dummy_attracted_gender }
}
else = {
dummy_female = { save_scope_as = dummy_attracted_gender }
}
}
random_dummy_gender_peasant_effect = {
hidden_effect = {
random_list = {
50 = {
modifier = { # 3 times as likely if faith is male dominated
add = 150
faith = {
has_doctrine_parameter = male_dominated_law
}
}
modifier = {
add = 50
has_realm_law = male_preference_law
}
dummy_male = { save_scope_as = dummy_peasant_gender }
}
50 = {
modifier = { # 3 times as likely if faith is female dominated
add = 150
faith = {
has_doctrine_parameter = female_dominated_law
}
}
modifier = {
add = 50
has_realm_law = female_preference_law
}
dummy_female = { save_scope_as = dummy_peasant_gender }
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,660 @@
steal_artifact_in_siege_effect = {
# Save scopes for localization
$LOCATION$ = { save_scope_as = SAISE_location }
$ATTACKER$ = { save_scope_as = SAISE_attacker }
$DEFENDER$ = { save_scope_as = SAISE_defender }
$ARTIFACT$ = { save_scope_as = this_artifact }
scope:this_artifact = {
# Suppress generic notifications, as we will send custom ones
set_variable = {
name = suppress_artifact_notifications
value = yes
days = 1
}
if = {
limit = {
NOT = { has_variable = stolen_artifact }
}
set_variable = {
name = stolen_artifact
value = 1
}
}
else = {
change_variable = {
name = stolen_artifact
add = 1
}
}
# Transfer the artifact to its new owner
if = {
limit = {
has_variable = ai_to_ai_destroy_in_sieges
scope:SAISE_attacker = {
is_ai = yes
}
scope:SAISE_defender = {
is_ai = yes
}
}
destroy_artifact = this
}
else = {
set_owner = {
target = scope:SAISE_attacker
history = {
location = scope:SAISE_location
actor = scope:SAISE_defender
recipient = scope:SAISE_attacker
type = taken_in_siege
}
}
scope:SAISE_defender = { add_personal_artifact_claim = scope:this_artifact }
if = {
limit = {
scope:SAISE_attacker = {
has_ep3_dlc_trigger = yes
is_roman_emperor_trigger = yes
culture = { has_cultural_parameter = holds_triumphs }
}
}
scope:SAISE_attacker = {
set_variable = {
name = byz_valid_for_trophy
value = scope:this_artifact
years = 9
}
}
}
# Send notifications to the relevant parties
scope:SAISE_defender = {
send_interface_toast = {
type = msg_artifact_lost
title = artifact_lost_toast
left_icon = scope:this_artifact
right_icon = scope:SAISE_attacker
if = {
limit = { $IS_RAID$ = yes }
custom_tooltip = artifact_lost_in_raid
}
else = {
custom_tooltip = artifact_lost_in_siege
}
}
}
scope:SAISE_attacker = {
send_interface_toast = {
type = msg_artifact_gained
right_icon = scope:this_artifact
}
if = {
limit = {
NOT = { any_claimed_artifact = { this = scope:this_artifact } }
}
scope:this_artifact = {
set_variable = {
name = last_person_to_steal
value = scope:SAISE_attacker
}
}
}
}
}
}
}
steal_artifact_in_event_effect = {
if = {
limit = { exists = $VICTIM$.capital_province }
set_local_variable = {
name = location
value = $VICTIM$.capital_province
}
}
else_if = {
limit = { exists = $VICTIM$.location }
set_local_variable = {
name = location
value = $VICTIM$.location
}
}
$ARTIFACT$ = {
save_scope_as = artifact_to_steal
hidden_effect = {
if = {
limit = {
exists = local_var:location
}
set_owner = {
target = $THIEF$
history = {
type = stolen
actor = $VICTIM$ #stolen from
recipient = $THIEF$ #stealer
location = local_var:location
}
}
}
else = { #If no location exists it is "conquered"
set_owner = {
target = $THIEF$
history = {
type = conquest
actor = $THIEF$ #stealer
recipient = $VICTIM$ #stolen from
}
}
}
if = {
limit = {
NOT = { has_variable = stolen_artifact }
}
set_variable = {
name = stolen_artifact
value = 1
}
}
else = {
change_variable = {
name = stolen_artifact
add = 1
}
}
}
}
$VICTIM$ = {
add_personal_artifact_claim = scope:artifact_to_steal
}
}
damage_artifact_in_battle_effect = {
# Save scopes for localization
$OWNER$ = {
save_scope_as = DAIBE_owner
}
$OPPONENT$ = { save_scope_as = DAIBE_opponent }
$LOCATION$ = { save_scope_as = DAIBE_location }
$ARTIFACT$ = {
save_scope_as = DAIBE_artifact
# Suppress generic notifications, as we will send custom ones
set_variable = {
name = suppress_artifact_notifications
value = yes
days = 1
}
set_variable = {
name = DAIBE_damage
value = $DURABILITY_LOSS$
days = 1
}
# Damage the artifact by the specified amount
add_durability = {
value = 0
subtract = var:DAIBE_damage
}
}
# Transformed into an if / else as I found the following note somewhere else:
# NOTE: We must not run ANY script after we destroy an artifact, or we will cause errors
if = {
# If the artifact has no durability left, destroy it now.
limit = { scope:DAIBE_artifact.artifact_durability <= 0 }
destroy_artifact = scope:DAIBE_artifact
}
# Send notifications to the relevant party IF the artifact was not destroyed
else = {
$OWNER$ = {
# Send the toast
send_interface_toast = {
title = artifact_damaged_toast
left_icon = scope:DAIBE_artifact
right_icon = scope:DAIBE_opponent
if = {
limit = {
$IS_DUEL$ = yes
}
custom_tooltip = artifact_damaged_in_duel
}
else = {
custom_tooltip = artifact_damaged_in_siege
}
}
}
}
}
flag_as_trash_artifact = {
set_variable = {
name = ai_to_ai_destroy_in_sieges
value = yes
}
}
flag_as_unwanted_artifact = {
set_variable = {
name = unwanted_artifact
value = yes
}
}
flag_as_cursed_artifact = {
set_variable = {
name = cursed_artifact
value = yes
}
}
#For use with trinket looks / call this effect (set_up_trinket_adjective_effect = yes) in the line before creating the trinket
#Use this in the trinket's name/description in the loc-file [ROOT.Char.Custom('TrinketLookAdjective')] /and/ [ROOT.Char.Custom('TrinketLookAdverbFollowup')]
#Remember to clear the var:trinket_adjective_followup in your after = { ... }
set_up_trinket_adjective_effect = {
random_list = {
50 = {
set_variable = {
name = trinket_adjective_followup
value = flag:adorned
}
}
50 = {
set_variable = {
name = trinket_adjective_followup
value = flag:decorated
}
}
50 = {
set_variable = {
name = trinket_adjective_followup
value = flag:embellished
}
}
50 = {
set_variable = {
name = trinket_adjective_followup
value = flag:ornamented
}
}
}
}
# Grant claims on familial banners
grant_banner_house_claim_effect = {
save_scope_as = familial_banner
hidden_effect = {
if = { # Dynasty banner not owned or claimed by all child house's already
limit = {
exists = var:banner_dynasty
var:banner_dynasty = {
any_dynasty_member = {
this = house.house_head
house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already
}
}
}
var:banner_dynasty = {
every_dynasty_member = {
limit = {
this = house.house_head
house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already
}
house = { add_house_artifact_claim = scope:familial_banner }
}
}
}
else_if = { # House banner not owned or claimed by creating house already
limit = {
exists = var:banner_house
var:banner_house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already
}
var:banner_house = { add_house_artifact_claim = scope:familial_banner }
}
}
}
#Determine what type of artifact a court artifact is, for defacement
determine_artifact_damage_type_effect = {
$ARTIFACT$ = { save_scope_as = artifact_to_determine }
scope:artifact_to_determine = {
random_list = {
10 = {
trigger = {
OR = {
artifact_type = chest
artifact_type = box
artifact_type = cabinet
artifact_type = pedestal
artifact_type = tapestry
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big
artifact_type = wall_shield
artifact_type = throne
artifact_type = throne_special
artifact_type = book
}
}
set_variable = artifact_burned
}
10 = {
trigger = {
OR = {
artifact_type = sculpture
artifact_type = box
artifact_type = goblet
artifact_type = pedestal
artifact_type = book
artifact_type = elixir
artifact_type = panacea
artifact_type = philosophers_stone
}
}
set_variable = artifact_knocked_over
}
10 = {
trigger = {
OR = {
artifact_type = sculpture
artifact_type = chest
artifact_type = box
artifact_type = cabinet
artifact_type = goblet
artifact_type = pedestal
artifact_type = tapestry #cloth
artifact_type = animal_skull
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big #shields, banners
artifact_type = wall_small #animal trophy
artifact_type = wall_shield
artifact_type = wall_shield_special #kite shields
artifact_type = throne
artifact_type = throne_special
artifact_type = book
artifact_type = elixir
artifact_type = panacea
artifact_type = philosophers_stone #box
}
}
set_variable = artifact_smeared_food
}
10 = {
trigger = {
OR = {
artifact_type = chest
artifact_type = box
artifact_type = cabinet
artifact_type = pedestal
artifact_type = tapestry
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big
artifact_type = wall_small
artifact_type = throne
artifact_type = throne_special
artifact_type = book
}
}
set_variable = artifact_spilled_drink
}
10 = {
trigger = {
OR = {
artifact_type = tapestry
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = book
}
}
set_variable = artifact_tear
}
10 = {
trigger = {
OR = {
artifact_type = tapestry
artifact_type = animal_skull
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big
artifact_type = wall_small
artifact_type = wall_shield
artifact_type = wall_shield_special
}
}
set_variable = artifact_tear_down
}
10 = {
trigger = {
OR = {
artifact_type = chest
artifact_type = box
artifact_type = pedestal
artifact_type = tapestry
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big
artifact_type = wall_small
artifact_type = wall_shield
artifact_type = wall_shield_special
artifact_type = throne
artifact_type = throne_special
artifact_type = book
}
}
set_variable = artifact_threw_up
}
10 = {
trigger = {
OR = {
artifact_type = sculpture
artifact_type = chest
artifact_type = box
artifact_type = cabinet
artifact_type = goblet
artifact_type = pedestal
artifact_type = tapestry #cloth
artifact_type = animal_skull
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big #shields, banners
artifact_type = wall_small #animal trophy
artifact_type = wall_shield
artifact_type = wall_shield_special #kite shields
artifact_type = throne
artifact_type = throne_special
artifact_type = book
artifact_type = elixir
artifact_type = panacea
artifact_type = philosophers_stone #box
}
}
set_variable = artifact_unspeakable
}
10 = {
trigger = {
NOR = {
artifact_type = sculpture
artifact_type = chest
artifact_type = box
artifact_type = cabinet
artifact_type = goblet
artifact_type = pedestal
artifact_type = tapestry #cloth
artifact_type = animal_skull
artifact_type = animal_hide
artifact_type = animal_hide_big
artifact_type = wall_big #shields, banners
artifact_type = wall_small #animal trophy
artifact_type = wall_shield
artifact_type = wall_shield_special #kite shields
artifact_type = throne
artifact_type = throne_special
artifact_type = book
artifact_type = elixir
artifact_type = panacea
artifact_type = philosophers_stone #box
}
}
set_variable = artifact_damage_fallback
}
}
}
}
# Destroy Artifact effect
# DESTROYER = Character destroying the artifact
# ARTIFACT = The artifact to destroy
destroy_artifact_aniconist_effect = {
$ARTIFACT$ = {
save_temporary_scope_as = artifact
}
$DESTROYER$ = {
if = {
limit = {
OR = {
$DESTROYER$.faith = { has_doctrine_parameter = destroying_artifacts_is_pious }
$PIETY_BY_DEFAULT$ = yes
}
}
give_destroyed_artifact_piety = yes
}
if = {
limit = {
$GIVE_GOLD$ = yes
}
add_gold = {
if = {
limit = {
scope:artifact = { rarity = illustrious }
}
add = {
value = 25
}
}
else_if = {
limit = {
scope:artifact = { rarity = famed }
}
add = {
value = 15
}
}
else_if = {
limit = {
scope:artifact = { rarity = masterwork }
}
add = {
value = 8
}
}
else = {
add = {
value = 4
}
}
# Boost the value up to something meaningful
multiply = {
value = 10
}
# multiply by durability percentage
multiply = {
add = scope:artifact.artifact_durability
divide = scope:artifact.artifact_max_durability
divide = 2
add = 0.5
}
#Nerf it to bits for LAAMPs
if = {
limit = {
$DESTROYER$ = { has_government = landless_adventurer_government }
}
multiply = {
value = 0.1
round = yes
}
}
if = {
limit = {
exists = scope:artifact.var:ai_to_ai_destroy_in_sieges # Trash artifact
}
max = {
value = $DESTROYER$.tiny_gold_value
multiply = 0.5
}
}
min = 1
}
}
destroy_owned_artifact = scope:artifact
}
}
give_destroyed_artifact_piety = {
add_piety = {
# Base value
value = 5
# Add the artifact's quality
if = {
limit = { exists = scope:artifact.var:quality }
add = scope:artifact.var:quality
}
# If none can be found, add its wealth
else_if = {
limit = { exists = scope:artifact.var:wealth }
add = scope:artifact.var:wealth
}
# Artifact has no quality or wealth (typical for court artifacts), add something based on rarity
else_if = {
limit = {
scope:artifact = { rarity = illustrious }
}
add = {
value = 20
}
}
else_if = {
limit = {
scope:artifact = { rarity = famed }
}
add = {
value = 12
}
}
else_if = {
limit = {
scope:artifact = { rarity = masterwork }
}
add = {
value = 8
}
}
else = {
add = {
value = 4
}
}
# Boost the value up to something meaningful
multiply = 20
# Relics are way cooler to burn, double the final value
if = {
limit = {
scope:artifact = { exists = var:relic }
}
multiply = {
value = 2
desc = aniconist_destroying_relic
}
}
}
}

View file

@ -0,0 +1,254 @@

# EFFECTS RELATONG TO THE DIFFERENT COURT TYPES
#court_trait_handle_multiple_scopes_effect
#court_trait_save_scopes_and_send_interface_message_effect
#assign_court_type_traits_to_courtiers_effect
# Effect to save down the multiple scopes needed to send interface messages about courtiers gaining/leveling court type traits
court_trait_handle_multiple_scopes_effect = {
#Save down two scopes for the gathered message
random_courtier = {
limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
is_of_major_interest_to_root_trigger = yes
}
alternative_limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
is_of_minor_interest_to_root_trigger = yes
}
alternative_limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
}
save_scope_as = courtier_1
}
random_courtier = {
limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
is_of_major_interest_to_root_trigger = yes
this != scope:courtier_1
}
alternative_limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
is_of_minor_interest_to_root_trigger = yes
this != scope:courtier_1
}
alternative_limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
this != scope:courtier_1
}
save_scope_as = courtier_2
}
set_variable = {
name = num_other_relevant_courtiers
value = 1
}
every_courtier = {
limit = {
ep1_courtier_valid_for_court_trait_$TRAIT_LEVEL$_trigger = { TYPE = $COURT_TYPE$ }
}
change_trait_rank = {
trait = $COURT_TYPE$_court
rank = 1
}
root = {
change_variable = {
name = num_other_relevant_courtiers
add = 1
}
}
}
}
# Effect to send interface messages about courtiers gaining/leveling court specific traits
court_trait_save_scopes_and_send_interface_message_effect = {
# Second trait level at CG level 8
if = {
limit = {
any_courtier = {
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = $COURT_TYPE$ }
}
}
# If it's more than two we send a gathered message
if = {
limit = {
any_courtier = {
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = $COURT_TYPE$ }
count > 2
}
}
court_trait_handle_multiple_scopes_effect = {
COURT_TYPE = $COURT_TYPE$
TRAIT_LEVEL = 2
}
send_interface_message = {
type = msg_courtiers_gain_court_traits
title = multiple_courtiers_gained_court_type_trait_title
left_icon = scope:courtier_1
right_icon = scope:courtier_2
custom_tooltip = multiple_courtiers_gained_$COURT_TYPE$_2_trait_desc
}
remove_variable = num_other_relevant_courtiers
}
# Else we send one message per courtier
else = {
every_courtier = {
limit = {
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = $COURT_TYPE$ }
}
save_scope_as = courtier
root = {
send_interface_message = {
type = msg_courtiers_gain_court_traits
title = courtier_gained_court_type_trait_title
right_icon = scope:courtier
scope:courtier = {
change_trait_rank = {
trait = $COURT_TYPE$_court
rank = 1
}
}
}
}
}
}
}
# First trait level at CG level 5
if = {
limit = {
any_courtier = {
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = $COURT_TYPE$ }
}
}
# If it's more than two we send a gathered message
if = {
limit = {
any_courtier = {
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = $COURT_TYPE$ }
count > 2
}
}
court_trait_handle_multiple_scopes_effect = {
COURT_TYPE = $COURT_TYPE$
TRAIT_LEVEL = 1
}
send_interface_message = {
type = msg_courtiers_gain_court_traits
title = multiple_courtiers_gained_court_type_trait_title
left_icon = scope:courtier_1
right_icon = scope:courtier_2
custom_tooltip = multiple_courtiers_gained_$COURT_TYPE$_1_trait_desc
}
}
# Else we send one message per courtier
else = {
every_courtier = {
limit = {
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = $COURT_TYPE$ }
}
save_scope_as = courtier
root = {
send_interface_message = {
type = msg_courtiers_gain_court_traits
title = courtier_gained_court_type_trait_title
right_icon = scope:courtier
scope:courtier = {
change_trait_rank = {
trait = $COURT_TYPE$_court
rank = 1
}
}
#custom_tooltip = courtier_gained_$COURT_TYPE$_1_trait_desc
}
}
}
}
}
}
# Main effect for handling courtiers gaining/leveling court type traits
assign_court_type_traits_to_courtiers_effect = {
save_scope_value_as = {
name = cgv_value
value = root.court_grandeur_current_level
}
# Diplomatic Court
if = {
limit = {
has_court_type = court_diplomatic
any_courtier = {
days_since_joined_court >= days_to_gain_court_type_trait
OR = { #Either they have no trait, or they have one we can level
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = diplomatic }
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = diplomatic }
}
}
}
court_trait_save_scopes_and_send_interface_message_effect = { COURT_TYPE = diplomatic }
}
# Warlike Court
if = {
limit = {
OR = {
has_court_type = court_warlike
has_court_type = court_tribal
has_court_type = court_nomadic
}
any_courtier = {
days_since_joined_court >= days_to_gain_court_type_trait
OR = { #Either they have no trait, or they have one we can level
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = warlike }
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = warlike }
}
}
}
court_trait_save_scopes_and_send_interface_message_effect = { COURT_TYPE = warlike }
}
# Administrative Court
if = {
limit = {
has_court_type = court_administrative
any_courtier = {
days_since_joined_court >= days_to_gain_court_type_trait
OR = { #Either they have no trait, or they have one we can level
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = administrative }
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = administrative }
}
}
}
court_trait_save_scopes_and_send_interface_message_effect = { COURT_TYPE = administrative }
}
# Intrigue Court
if = {
limit = {
has_court_type = court_intrigue
any_courtier = {
days_since_joined_court >= days_to_gain_court_type_trait
OR = { #Either they have no trait, or they have one we can level
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = intrigue }
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = intrigue }
}
}
}
court_trait_save_scopes_and_send_interface_message_effect = { COURT_TYPE = intrigue }
}
# Scholarly Court
if = {
limit = {
has_court_type = court_scholarly
any_courtier = {
days_since_joined_court >= days_to_gain_court_type_trait
OR = { #Either they have no trait, or they have one we can level
ep1_courtier_valid_for_court_trait_1_trigger = { TYPE = scholarly }
ep1_courtier_valid_for_court_trait_2_trigger = { TYPE = scholarly }
}
}
}
court_trait_save_scopes_and_send_interface_message_effect = { COURT_TYPE = scholarly }
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,955 @@
#################################################
# EFFECT LIST #
#################################################
#
# Inspiration Generation Effects
# grant_inspiration_to_character_effect - Creates a new Inspiration and gives it to the scope character. Type of inspiration is weighted based on character skills and personality.
# grant_new_inspiration_in_character_realm_effect - Selects a random Pool character from the scope character's realm, then runs the above effect on them. Afterwards, move to visit the scope character's court.
# grant_new_inspiration_in_region_effect - Selects a random Royal Court in a given $GEOLOGICAL_REGION$. The Court's owner then has the above effect run on them.
# grant_new_inspiration_in_world_effect - Selects a random geological region in the world. The selected region then has the above effect run on it.
#
# Inspired Character Movement Effects
# inspired_character_travel_to_court_effect - Moves $INSPIRED_CHARACTER$ to the court of $NEW_HOST$.
# inspired_character_seek_out_new_royal_court_effect - Forces the scope character to look for a new, different Royal Court to visit as a guest. If one is found, uses the above effect to move there.
#################################################
# Inspiration Generation Effects #
#################################################
grant_inspiration_to_character_effect = {
$CHARACTER$ = {
if = {
limit = { NOT = { exists = inspiration } }
# More likely to get an certain Inspiration type if we will produce higher quality Artifacts of that type.
random_list = {
10 = {
compare_modifier = {
value = weapon_inspiration_average_skill_value
multiplier = 6
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_metal_craftsmanship
}
}
create_inspiration = weapon_inspiration
}
10 = { # =Slightly increased weight due to a low number of Armorers appearing in the world.
compare_modifier = {
value = armor_inspiration_average_skill_value
multiplier = 7.2 # A character with an average of 20 in relevant skills will receive a +120 bonus
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_frugal_armorsmiths
}
}
create_inspiration = armor_inspiration
}
10 = { #Adventurers will on average produce better quality items, handle with care.
compare_modifier = {
value = adventure_inspiration_average_skill_value
multiplier = 9
}
modifier = {
add = 5
culture = { #Some cultures are more likely to pick this vocation than others
OR = {
has_cultural_parameter = more_likely_to_leave_court #Swords for Hire & Caravaneers
has_cultural_tradition = tradition_chivalry
}
}
}
create_inspiration = adventure_inspiration
}
12 = { # Significantly increased weight due to the wide variety of artifact types this inspiration can produce (regalia, crown, trinket).
compare_modifier = {
value = smith_inspiration_average_skill_value
multiplier = 15
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 10
culture = {
OR = {
has_cultural_tradition = tradition_metal_craftsmanship
has_cultural_tradition = tradition_ancient_miners
}
}
}
create_inspiration = smith_inspiration
}
10 = {
compare_modifier = {
value = book_inspiration_average_skill_value
multiplier = 6
}
modifier = {
has_court_position = court_poet_court_position
add = 15
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
OR = {
has_cultural_tradition = tradition_language_scholars
has_cultural_tradition = tradition_philosopher_culture
has_cultural_tradition = tradition_legalistic
}
}
add = 5
}
create_inspiration = book_inspiration
}
11 = { # Increased weight due to a low number of Weavers appearing in the world (probably a lack of high-diplomacy courtiers).
compare_modifier = {
value = weaver_inspiration_average_skill_value
multiplier = 8.4
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
has_cultural_parameter = improved_weaver_inspiration
}
add = 10
}
create_inspiration = weaver_inspiration
}
14 = { # Moderately increased weight due to the variety of artifact types this inspiration can produce (throne, sculpture).
compare_modifier = {
value = artisan_inspiration_average_skill_value
multiplier = 12
}
modifier = {
has_court_position = court_poet_court_position
add = 5
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
has_cultural_parameter = improved_artisan_inspiration
}
add = 15
}
create_inspiration = artisan_inspiration
}
1 = {
modifier = {
add = 30
has_trait = lifestyle_mystic
}
modifier = { #Alchemy arrived to Europe in the 13th century, but existed basically everywhere else before that
add = -20
culture_has_european_heritage_pillar_trigger = yes
}
compare_modifier = {
value = learning
multiplier = 2
}
create_inspiration = alchemy_inspiration
}
5 = {
compare_modifier = {
value = weapon_inspiration_average_skill_value
multiplier = 6
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_longbow_competitions
}
}
create_inspiration = bow_inspiration
}
}
}
}
}
grant_stewardship_inspiration_to_character_effect = {
$CHARACTER$ = {
if = {
limit = { NOT = { exists = inspiration } }
# More likely to get an certain Inspiration type if we will produce higher quality Artifacts of that type.
random_list = {
12 = { # Significantly increased weight due to the wide variety of artifact types this inspiration can produce (regalia, crown, trinket).
compare_modifier = {
value = smith_inspiration_average_skill_value
multiplier = 15
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 10
culture = {
OR = {
has_cultural_tradition = tradition_metal_craftsmanship
has_cultural_tradition = tradition_ancient_miners
}
}
}
create_inspiration = smith_inspiration
}
14 = { # Moderately increased weight due to the variety of artifact types this inspiration can produce (throne, sculpture).
compare_modifier = {
value = artisan_inspiration_average_skill_value
multiplier = 12
}
modifier = {
has_court_position = court_poet_court_position
add = 5
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
has_cultural_parameter = improved_artisan_inspiration
}
add = 15
}
create_inspiration = artisan_inspiration
}
}
}
}
}
grant_learning_inspiration_to_character_effect = {
$CHARACTER$ = {
if = {
limit = { NOT = { exists = inspiration } }
# More likely to get an certain Inspiration type if we will produce higher quality Artifacts of that type.
random_list = {
10 = {
compare_modifier = {
value = book_inspiration_average_skill_value
multiplier = 6
}
modifier = {
has_court_position = court_poet_court_position
add = 15
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
OR = {
has_cultural_tradition = tradition_language_scholars
has_cultural_tradition = tradition_philosopher_culture
has_cultural_tradition = tradition_legalistic
}
}
add = 5
}
modifier = {
factor = 0.5
liege ?= {
any_equipped_character_artifact = {
count >= 2
artifact_slot_type = book
}
}
}
create_inspiration = book_inspiration
}
10 = { # Increased weight due to a low number of Weavers appearing in the world (probably a lack of high-diplomacy courtiers).
trigger = {
diplomacy >= 10
}
compare_modifier = {
value = weaver_inspiration_average_skill_value
multiplier = 8.4
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
has_cultural_parameter = improved_weaver_inspiration
}
add = 10
}
modifier = {
factor = 0.1
liege ?= {
any_equipped_character_artifact = {
count >= 3
artifact_slot_type = wall_big
}
}
}
create_inspiration = weaver_inspiration
}
1 = {
modifier = {
add = 30
has_trait = lifestyle_mystic
}
compare_modifier = {
value = learning
multiplier = 2
}
modifier = { #Alchemy arrived to Europe in the 13th century, but existed basically everywhere else before that
factor = 0.1
culture_has_european_heritage_pillar_trigger = yes
current_year < 1300
}
create_inspiration = alchemy_inspiration
}
}
}
}
}
grant_martial_inspiration_to_character_effect = {
$CHARACTER$ = {
if = {
limit = { NOT = { exists = inspiration } }
# More likely to get an certain Inspiration type if we will produce higher quality Artifacts of that type.
random_list = {
1 = { #Adventurers will on average produce better quality items, handle with care.
compare_modifier = {
value = adventure_inspiration_average_skill_value
multiplier = 9
}
modifier = {
add = 5
culture = { #Some cultures are more likely to pick this vocation than others
OR = {
has_cultural_parameter = more_likely_to_leave_court #Swords for Hire & Caravaneers
has_cultural_tradition = tradition_chivalry
}
}
}
create_inspiration = adventure_inspiration
}
10 = {
compare_modifier = {
value = weapon_inspiration_average_skill_value
multiplier = 6
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_metal_craftsmanship
}
}
modifier = {
factor = 0.1
liege ?= {
any_equipped_character_artifact = {
artifact_slot_type = primary_armament
}
}
}
create_inspiration = weapon_inspiration
}
10 = { # =Slightly increased weight due to a low number of Armorers appearing in the world.
compare_modifier = {
value = armor_inspiration_average_skill_value
multiplier = 7.2 # A character with an average of 20 in relevant skills will receive a +120 bonus
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_frugal_armorsmiths
}
}
modifier = {
factor = 0.1
liege ?= {
any_equipped_character_artifact = {
artifact_slot_type = armor
}
}
}
create_inspiration = armor_inspiration
}
5 = {
compare_modifier = {
value = weapon_inspiration_average_skill_value
multiplier = 6
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_longbow_competitions
}
}
create_inspiration = bow_inspiration
}
}
}
}
}
grant_inspiration_to_character_no_court_artifacts_effect = {
save_scope_as = court_owner
$CHARACTER$ = {
if = {
limit = { NOT = { exists = inspiration } }
# More likely to get an certain Inspiration type if we will produce higher quality Artifacts of that type.
random_list = {
10 = {
compare_modifier = {
value = weapon_inspiration_average_skill_value
multiplier = {
value = 5
#Lower the military inspirations for Advancement Movement
if = {
limit = {
scope:court_owner = {
top_participant_group:dynastic_cycle ?= {
participant_group_type = advancement_movement
}
}
}
multiply = 0
}
}
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_metal_craftsmanship
}
}
create_inspiration = weapon_inspiration
}
10 = {
compare_modifier = {
value = armor_inspiration_average_skill_value
multiplier = {
value = 5
#Lower the military inspirations for Advancement Movement
if = {
limit = {
scope:court_owner = {
top_participant_group:dynastic_cycle ?= {
participant_group_type = advancement_movement
}
}
}
multiply = 0
}
}
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_frugal_armorsmiths
}
}
create_inspiration = armor_inspiration
}
5 = {
compare_modifier = {
value = smith_inspiration_average_skill_value
multiplier = 5
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 10
culture = {
OR = {
has_cultural_tradition = tradition_metal_craftsmanship
has_cultural_tradition = tradition_ancient_miners
}
}
}
create_inspiration = smith_inspiration
}
5 = {
compare_modifier = {
value = book_inspiration_average_skill_value
multiplier = 5
}
modifier = {
has_court_position = court_poet_court_position
add = 15
}
modifier = {
culture = { #Some cultures are more likely to pick this vocation than others
OR = {
has_cultural_tradition = tradition_language_scholars
has_cultural_tradition = tradition_philosopher_culture
has_cultural_tradition = tradition_legalistic
}
}
add = 5
}
create_inspiration = book_inspiration
}
1 = {
modifier = {
add = 30
has_trait = lifestyle_mystic
}
modifier = { #Alchemy arrived to Europe in the 13th century, but existed basically everywhere else before that
add = -20
culture_has_european_heritage_pillar_trigger = yes
}
compare_modifier = {
value = learning
multiplier = 2
}
create_inspiration = alchemy_inspiration
}
5 = {
compare_modifier = {
value = weapon_inspiration_average_skill_value
multiplier = {
value = 6
#Lower the military inspirations for Advancement Movement
if = {
limit = {
scope:court_owner = {
top_participant_group:dynastic_cycle ?= {
participant_group_type = advancement_movement
}
}
}
multiply = 0
}
}
}
modifier = { #Some cultures are more likely to pick this vocation than others
add = 5
culture = {
has_cultural_tradition = tradition_longbow_competitions
}
}
create_inspiration = bow_inspiration
}
}
}
}
}
grant_new_inspiration_in_character_realm_effect = {
save_scope_as = royal_court_owner
every_sub_realm_barony = {
title_province = {
every_pool_character = {
province = this
limit = {
ep1_is_valid_character_for_inspiration_trigger = yes
}
add_to_list = potential_inspired_people
}
}
}
random_in_list = {
list = potential_inspired_people
weight = {
base = 1
modifier = { #Poets are more likely to become inspired
add = 40
has_trait = lifestyle_poet
}
# More learned characters have a greater pool to draw from for their inspirations.
compare_modifier = {
value = learning
multiplier = 5
}
# Older characters are more likely to be inspired from their life's experience.
compare_modifier = {
value = age
}
# We don't want character dropping dead from old age, injuries, or disease right after they begin work on a project!
compare_modifier = {
value = health
multiplier = 20
}
# 'Ambitious' characters are more likely to get an inspiration/seek patronage
ai_value_modifier = {
ai_greed = 0.25
ai_boldness = 0.25
ai_sociability = 0.10
ai_rationality = 0.10
}
}
save_scope_as = inspired_person
}
# If we were unable to find a valid pool character, create one.
if = {
limit = {
NOT = { exists = scope:inspired_person }
}
create_character = {
template = inspired_template
location = scope:royal_court_owner.capital_province
faith = scope:royal_court_owner.faith
culture = scope:royal_court_owner.culture
gender_female_chance = 50
save_scope_as = inspired_person
}
}
# Clear the list in case this effect gets re-used in the same scope.
every_in_list = {
list = potential_inspired_people
remove_from_list = potential_inspired_people
}
scope:inspired_person = {
grant_inspiration_to_character_effect = { CHARACTER = this }
# Travel to the new host's court.
inspired_character_travel_to_court_effect = {
INSPIRED_CHARACTER = scope:inspired_person
NEW_HOST = scope:royal_court_owner
}
}
}
grant_new_inspiration_in_region_effect = {
random_character_with_royal_court = {
limit = {
capital_province ?= {
geographical_region = $GEOGRAPHICAL_REGION$
}
save_temporary_scope_as = tmp_royal_court_owner # Used in 'inspiration_kingdom_modifier' to calculate draw towards this specific court in the region.
}
weight = {
base = 1
inspiration_royal_court_grandeur_attraction_modifier = yes
inspiration_royal_court_oversaturation_penalty_modifier = yes
}
grant_new_inspiration_in_character_realm_effect = yes
}
}
grant_new_inspiration_in_world_effect = {
# When generating new inspired characters, the following criteria are taken into account:
# - The specified region *must* be the home of at least 1 royal court to be eligible.
# - Increased chance for regions which have multiple royal courts.
# - Increased chance for regions which have incredibly prestigious royal courts.
# - Greatly reduced chance for regions which already have multiple inspired people wandering around within them.
random_list = {
# Europe
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_europe_west } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_europe_west }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_europe_west }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_europe_west }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_europe_north } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_europe_north }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_europe_north }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_europe_north }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_europe_south } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_europe_south }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_europe_south }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_europe_south }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_europe_east } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_europe_east }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_europe_east }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_europe_east }
}
# Middle East/Asia Minor
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_asia_minor } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_asia_minor }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_asia_minor }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_asia_minor }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_middle_east_jerusalem } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_middle_east_jerusalem }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_middle_east_jerusalem }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_middle_east_jerusalem }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_middle_east_arabia } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_middle_east_arabia }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_middle_east_arabia }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_middle_east_arabia }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_middle_east_persia } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_middle_east_persia }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_middle_east_persia }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_middle_east_persia }
}
# India
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_india_deccan } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_india_deccan }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_india_deccan }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_india_deccan }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_india_bengal } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_india_bengal }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_india_bengal }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_india_bengal }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_india_rajastan } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_india_rajastan }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_india_rajastan }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_india_rajastan }
}
# Africa
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_africa_north } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_africa_north }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_africa_north }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_africa_north }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_africa_west } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_africa_west }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_africa_west }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_africa_west }
}
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_africa_east } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_africa_east }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_africa_east }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_africa_east }
}
# Steppe
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_steppe } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_steppe }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_steppe }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_steppe }
}
# Tibet
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_tibet } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_tibet }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_tibet }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_tibet }
}
# Burma
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_burma } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_burma }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_burma }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_burma }
}
# China
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_asia_china } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_asia_china }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_asia_china }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_asia_china }
}
# Japan
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_asia_japan } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_asia_japan }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_asia_japan }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_asia_japan }
}
# Korea
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_asia_korea } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_asia_korea }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_asia_korea }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_asia_korea }
}
# Southeast Asia
1 = {
trigger = { any_character_with_royal_court = { exists = capital_province capital_province = { geographical_region = world_asia_southeast } } }
inspiration_region_court_grandeur_attraction_modifier = { GEOGRAPHICAL_REGION = world_asia_southeast }
inspiration_region_oversaturation_penalty_modifier = { GEOGRAPHICAL_REGION = world_asia_southeast }
grant_new_inspiration_in_region_effect = { GEOGRAPHICAL_REGION = world_asia_southeast }
}
}
}
#################################################
# Inspired Character Movement Effects #
#################################################
inspired_character_travel_to_court_effect = {
$INSPIRED_CHARACTER$ = {
save_scope_as = ttc_inspired_character
inspiration = { save_scope_as = ttc_inspiration }
#Save our current host (so we don't return to their court too quickly!).
if = {
limit = { exists = host }
set_variable = {
name = last_visited_ruler
value = this.host
days = 1825
}
}
# If no current host, save as dummy character so we at least have something to compare to.
else = {
set_variable = {
name = last_visited_ruler
value = dummy_female
days = 1825
}
}
visit_court_of = $NEW_HOST$
add_character_flag = {
flag = inspired_character_recent_arrival
months = inspired_character_recent_arrival_duration_value
}
}
}
inspired_character_seek_out_new_royal_court_effect = {
save_scope_as = inspired_character
# Look to see if there is a nearby court we can visit that might fund our inspiration.
random_character_with_royal_court = {
limit = {
# Do not travel outside of diplomatic range in a single 'jump'
in_diplomatic_range = scope:inspired_character
# Do not visit the ruler we had just left, unless at least 5 years have passed.
trigger_if = {
limit = { scope:inspired_character = { has_variable = last_visited_ruler } }
scope:inspired_character.var:last_visited_ruler != this
}
# Only visit rulers who do not consider our faith to be hostile, if possible.
faith = {
faith_hostility_level = {
target = scope:inspired_character.faith
value <= faith_hostile_level
}
}
exists = capital_province
save_temporary_scope_as = tmp_royal_court_owner # Used in 'inspiration_kingdom_modifier' to calculate draw towards this specific court in the region.
}
alternative_limit = {
in_diplomatic_range = scope:inspired_character
trigger_if = {
limit = { scope:inspired_character = { has_variable = last_visited_ruler } }
scope:inspired_character.var:last_visited_ruler != this
}
# Failing that, if possible do not visit rulers who consider our faith to be outright evil.
faith = {
faith_hostility_level = {
target = scope:inspired_character.faith
value <= faith_evil_level
}
}
exists = capital_province
save_temporary_scope_as = tmp_royal_court_owner
}
alternative_limit = {
# Failing that, we can visit anyone else in range.
in_diplomatic_range = scope:inspired_character
trigger_if = {
limit = { scope:inspired_character = { has_variable = last_visited_ruler } }
scope:inspired_character.var:last_visited_ruler != this
}
exists = capital_province
save_temporary_scope_as = tmp_royal_court_owner
}
weight = {
base = 10
inspiration_royal_court_grandeur_attraction_modifier = yes
# Prefer visiting royal courts which are physically closer to us
modifier = {
factor = 0.9 # Total 90.0% weight
capital_province = {
squared_distance = {
target = scope:inspired_character.location
value >= squared_distance_small #150 map-pixels. Roughly one Wales away (top to bottom).
}
}
}
modifier = {
factor = 0.8 # Total 72.0% weight
capital_province = {
squared_distance = {
target = scope:inspired_character.location
value >= squared_distance_medium #250 map-pixels. Roughly one Ireland away (top to bottom).
}
}
}
modifier = {
factor = 0.6 # Total 43.2% weight
capital_province = {
squared_distance = {
target = scope:inspired_character.location
value >= squared_distance_large #650 map-pixels. Roughly one France away (top to bottom).
}
}
}
modifier = {
factor = 0.3 # Total 12.9% weight
capital_province = {
squared_distance = {
target = scope:inspired_character.location
value >= squared_distance_huge #850 map-pixels. Roughly one Holy Roman Empire away (left to right).
}
}
}
# Down-prioritize courts with a lot of inspired people already
modifier = {
factor = 0.9
any_courtier_or_guest = {
count >= 2
exists = inspiration
}
}
modifier = {
factor = 0.8
any_courtier_or_guest = {
count >= 3
exists = inspiration
}
}
modifier = {
factor = 0.7
any_courtier_or_guest = {
count >= 4
exists = inspiration
}
}
modifier = {
factor = 0.6
any_courtier_or_guest = {
count >= 5
exists = inspiration
}
}
modifier = {
factor = 0.001
any_courtier_or_guest = {
count >= 6
exists = inspiration
}
}
}
save_scope_as = new_host
}
# If we have successfully located a new host...
if = {
limit = {
exists = scope:new_host
}
# ...travel to the new host's court.
inspired_character_travel_to_court_effect = {
INSPIRED_CHARACTER = scope:inspired_character
NEW_HOST = scope:new_host
}
}
}

View file

@ -0,0 +1,581 @@

convert_to_administrative_from_feudalism_effect = {
save_scope_as = administrative_liege
change_to_administrative_effect = yes
#Direct Vassals who fulfill the ep3_vassal_will_become_admin criteria are converted. Vassals above 25 opinion always accept
#Vassals are converted as a hierarchy. If a king is converted we convert all who are valid below that king (so his dukes, their counts, and their barons) are all converted.
#If a vassal does not convert (because of not accepting or because they are outside of the de jure empire, etc) then the vassals below them are _not_ converted either.
#Human vassals are given a choice to convert or not in the ping event, even if powerful or having very good relation.
hidden_effect = {
save_scope_as = actor
every_powerful_vassal = { #All valid powerful vassals auto convert - their support was required to take the decision.
limit = {
ep3_vassal_will_become_admin = yes
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (could be Counts, could be Barons)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts could be Barons)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
}
}
}
}
every_vassal = {
limit = {
ep3_vassal_will_become_admin = yes
trigger_if = { #Dukes and above can say no
limit = {
primary_title.tier >= tier_duchy
is_ai = yes
}
opinion = {
target = scope:administrative_liege
value > 25
}
}
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (could be Counts, could be Dukes)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (Could be Counts, could be Barons)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (could be Barons)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
}
}
}
}
every_vassal = {
limit = {
ep3_vassal_will_become_admin = yes
trigger_if = { #Dukes and above can say no
limit = {
primary_title.tier >= tier_duchy
is_ai = yes
}
opinion = {
target = scope:administrative_liege
value > 0
}
}
}
random_list = {
10 = { } #10% of the vassals that like us less than 25 but more than 0 still convert.
90 = {
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (could be Counts, could be Dukes)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (Could be Counts, could be Barons)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
every_vassal = { #Everyone below also converts (could be Barons)
limit = {
ep3_vassal_will_become_admin = yes #We still don't want mayors and bishops
is_ai = yes
}
save_scope_as = recipient
change_to_administrative_effect = yes
}
}
}
}
}
}
every_vassal = {
limit = {
highest_held_title_tier >= tier_duchy
house.house_head ?= this
government_has_flag = government_is_administrative
NOT = {
any_held_title = { is_noble_family_title = yes }
}
}
create_noble_family_effect = { GOVERNMENT_GIVER = this }
}
}
if = {
limit = {
NOT = {
has_character_flag = latin_emp_force_admin_flag
}
top_liege = this
}
add_character_modifier = {
modifier = first_admin_emperor
}
}
change_influence = admin_convert_influence_value
custom_description_no_bullet = {
text = vassals_can_become_administrative
}
custom_tooltip = powerful_vassals_become_administrative
custom_tooltip = vassals_become_administrative
custom_tooltip = vassals_who_may_switch_to_administrative
}
convert_to_administrative_from_feudalism_game_start_effect = {
if = {
limit = { has_dlc_feature = roads_to_power }
# Because we run this twice, since folks can change in the lobby.
if = {
limit = {
NOT = { government_has_flag = government_is_administrative }
}
change_government = administrative_government
create_noble_family_effect = { GOVERNMENT_GIVER = this }
add_to_list = estatified_list
}
every_vassal_or_below = {
limit = {
highest_held_title_tier >= tier_county
OR = {
government_has_flag = government_is_feudal
government_has_flag = government_is_clan
government_has_flag = government_is_tribal
}
NOR = {
faith.religious_head ?= this
liege = {
faith.religious_head ?= this
top_liege != this
}
AND = {
exists = scope:ignore_culture
culture = scope:ignore_culture
}
}
}
change_to_administrative_effect = yes
}
}
}
apply_historic_administrative_game_rule_effect = {
# We'll be doing some excessive triggers below in a bid to lightly future-proof + error-spam mods less, don't worry about it.
## We also do player-specific realms separately — we need to know what their realm is so we do it after the lobby exclusively.
# Egypt.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_egypt_gameplay_not_administrative }
exists = title:k_egypt
}
if = {
limit = { has_game_rule = historicity_extra_admin_egypt_historic_always }
title:k_egypt.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
# Arabia.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_arabia_gameplay_not_administrative }
exists = title:e_arabia
}
if = {
limit = { has_game_rule = historicity_extra_admin_arabia_historic_867 }
# Give the Armenians a fighting chance.
culture:armenian = { save_scope_as = ignore_culture }
title:e_arabia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
# Ghana.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_ghana_gameplay_not_administrative }
exists = title:k_ghana
}
if = {
limit = { has_game_rule = historicity_extra_admin_ghana_historic_always }
title:k_ghana.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
# Kabulistan/the Ghaznivids.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_kabulistan_gameplay_not_administrative }
exists = title:k_kabulistan
}
if = {
limit = { has_game_rule = historicity_extra_admin_kabulistan_historic_always }
title:k_kabulistan.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
# Persia.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_persia_gameplay_not_administrative }
exists = title:e_persia
exists = title:k_persia
}
if = {
limit = {
game_start_date = 1178.10.1
has_game_rule = historicity_extra_admin_persia_historic_1178
}
title:k_persia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
else_if = {
limit = { has_game_rule = historicity_extra_admin_persia_alt_historic_always }
# Independent k_persia.
if = {
limit = {
title:k_persia.holder ?= { top_liege = this }
}
title:k_persia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
# Else, the empire.
else = {
title:e_persia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
}
# Maghreb.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_maghreb_gameplay_not_administrative }
exists = title:k_maghreb
}
if = {
limit = {
game_start_date >= 1066.9.15
has_game_rule = historicity_extra_admin_maghreb_historic_post_1066
}
title:k_maghreb.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
else_if = {
limit = { has_game_rule = historicity_extra_admin_maghreb_alt_historic_always }
title:k_maghreb.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
# Tamilakam/the Cholas.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_tamilakam_gameplay_not_administrative }
exists = title:k_tamilakam
}
if = {
limit = {
game_start_date = 1066.9.15
has_game_rule = historicity_extra_admin_tamilakam_historic_1066
}
title:k_tamilakam.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
else_if = {
limit = { has_game_rule = historicity_extra_admin_tamilakam_alt_historic_always }
title:k_tamilakam.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
# The Carolingians.
if = {
limit = {
NOT = { has_game_rule = historicity_extra_admin_carolingians_gameplay_not_administrative }
game_start_date = 867.1.1
exists = title:k_france
exists = title:k_lotharingia
exists = title:k_east_francia
exists = title:k_italy
}
if = {
limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_all_administrative }
title:k_france.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
title:k_lotharingia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
title:k_east_francia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
title:k_italy.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
if = {
limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_west_francia_administrative }
title:k_france.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
if = {
limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_lotharingia_administrative }
title:k_lotharingia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
if = {
limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_east_francia_administrative }
title:k_east_francia.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
if = {
limit = { has_game_rule = historicity_extra_admin_carolingians_alt_historic_italy_administrative }
title:k_italy.holder ?= { convert_to_administrative_from_feudalism_game_start_effect = yes }
}
}
}
convert_to_feudalism_from_administrative_effect = {
#Gain some gold for selling off your estates
if = {
limit = {
any_vassal = {
any_held_title = { is_noble_family_title = yes }
exists = domicile
}
}
custom_tooltip = estates_get_bought
every_vassal = {
limit = {
any_held_title = { is_noble_family_title = yes }
exists = domicile
}
hidden_effect = {
add_gold = {
value = {
value = major_gold_value
switch = {
trigger = domicile.num_domicile_buildings
7 = { multiply = 7 }
6 = { multiply = 6 }
5 = { multiply = 5 }
4 = { multiply = 4 }
3 = { multiply = 3 }
2 = { multiply = 2 }
}
}
}
}
}
}
#Then change government
if = {
limit = { ep3_is_clan_inclined_trigger = yes }
change_government = clan_government
#Duchies automatically transfer, need to poke the kingdoms
if = {
limit = {
any_vassal = {
primary_title.tier >= tier_kingdom
NOR = {
government_has_flag = government_is_clan
government_has_flag = government_is_theocracy
}
}
}
custom_tooltip = kings_become_clan
every_vassal = {
limit = {
primary_title.tier >= tier_kingdom
NOR = {
government_has_flag = government_is_clan
government_has_flag = government_is_theocracy
}
}
hidden_effect = { change_government = clan_government }
}
}
}
else = {
change_government = feudal_government
#Duchies automatically transfer, need to poke the kingdoms
if = {
limit = {
any_vassal = {
primary_title.tier >= tier_kingdom
NOR = {
government_has_flag = government_is_feudal
government_has_flag = government_is_theocracy
}
}
}
custom_tooltip = kings_become_feudal
every_vassal = {
limit = {
primary_title.tier >= tier_kingdom
NOR = {
government_has_flag = government_is_feudal
government_has_flag = government_is_theocracy
}
}
hidden_effect = { change_government = feudal_government }
}
}
}
#Governors become Dukes tooltip
if = {
limit = {
any_vassal = {
primary_title.tier = tier_duchy
NOT = { government_has_flag = government_is_clan }
}
}
custom_tooltip = governors_become_dukes
}
}
humiliate_stooge_counter_effect = {
if = {
limit = {
NOT = { has_variable = humiliated_stooge_counter_var }
}
set_variable = {
name = humiliated_stooge_counter_var
value = 1
}
}
else = {
change_variable = {
name = humiliated_stooge_counter_var
add = 1
}
}
}
humiliate_stooge_reward_effect = {
hidden_effect = {
scope:stooge ?= {
add_opinion = {
target = root
opinion = -25
modifier = humiliated_opinion
}
}
if = {
limit = {
scope:stooge.var:humiliated_stooge_counter_var ?= 1
}
# First time, it's fine
send_interface_toast = {
type = event_toast_effect_good
title = humiliate_the_stooge_decision_tt
left_icon = root
right_icon = scope:stooge
add_stress = major_stress_impact_loss
add_dread = minor_dread_gain
add_character_modifier = {
modifier = stooge_humiliated_modifier
years = 2
}
}
}
else_if = {
limit = {
scope:stooge.var:humiliated_stooge_counter_var ?= 2
}
send_interface_toast = {
type = event_toast_effect_good
title = humiliate_the_stooge_decision_2_tt
left_icon = root
right_icon = scope:stooge
add_stress = medium_stress_impact_loss
add_dread = medium_dread_gain
add_character_modifier = {
modifier = stooge_humiliated_modifier
years = 2
}
}
}
else_if = {
limit = {
scope:stooge.var:humiliated_stooge_counter_var ?= 3
}
# Third time, crying
send_interface_toast = {
type = event_toast_effect_good
title = humiliate_the_stooge_decision_3_tt
left_icon = root
right_icon = scope:stooge
add_stress = minor_stress_impact_loss
add_dread = major_dread_gain
add_character_modifier = {
modifier = stooge_humiliated_modifier
years = 2
}
}
}
else_if = {
limit = {
scope:stooge.var:humiliated_stooge_counter_var ?= 4
}
# Fourth time, it's over
send_interface_toast = {
type = event_toast_effect_neutral
title = humiliate_the_stooge_decision_4_tt
left_icon = root
right_icon = scope:stooge
add_dread = major_dread_gain
add_character_modifier = {
modifier = stooge_humiliated_fourth_time_modifier
years = 2
}
remove_courtier_or_guest = scope:stooge
scope:stooge = { # They won't join your court
set_variable = {
name = non_recruitable_var
value = root
}
}
}
}
}
}
admin_confirmation_vassal_reward_guts_effect = {
dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
if = {
limit = {
scope:confirmation_liege = { is_ai = yes }
}
reverse_add_opinion = {
target = scope:confirmation_liege
modifier = respect_opinion
opinion = 20
}
}
add_prestige = major_prestige_gain
change_influence = major_influence_gain
}

View file

@ -0,0 +1,66 @@
gain_trait_or_experience_effect = {
if = {
limit = { has_trait = $TRAIT$ }
add_trait_xp = {
trait = $TRAIT$
value = $AMOUNT$
}
}
else = {
add_trait = $TRAIT$
}
}
gain_appropriate_lifestyle_medium_xp_effect = {
if = {
limit = { has_any_lifestyle_focus_trigger = yes }
switch = {
trigger = has_lifestyle
diplomacy_lifestyle = {
add_diplomacy_lifestyle_xp = medium_lifestyle_xp
}
martial_lifestyle = {
add_martial_lifestyle_xp = medium_lifestyle_xp
}
stewardship_lifestyle = {
add_stewardship_lifestyle_xp = medium_lifestyle_xp
}
intrigue_lifestyle = {
add_intrigue_lifestyle_xp = medium_lifestyle_xp
}
learning_lifestyle = {
add_learning_lifestyle_xp = medium_lifestyle_xp
}
}
}
else = { # Fallback
add_diplomacy_lifestyle_xp = medium_lifestyle_xp
}
}
gain_appropriate_lifestyle_major_xp_effect = {
if = {
limit = { has_any_lifestyle_focus_trigger = yes }
switch = {
trigger = has_lifestyle
diplomacy_lifestyle = {
add_diplomacy_lifestyle_xp = major_lifestyle_xp
}
martial_lifestyle = {
add_martial_lifestyle_xp = major_lifestyle_xp
}
stewardship_lifestyle = {
add_stewardship_lifestyle_xp = major_lifestyle_xp
}
intrigue_lifestyle = {
add_intrigue_lifestyle_xp = major_lifestyle_xp
}
learning_lifestyle = {
add_learning_lifestyle_xp = major_lifestyle_xp
}
}
}
else = { # Fallback
add_diplomacy_lifestyle_xp = major_lifestyle_xp
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,247 @@

#Effects used in Feasts
#feast_end_guest_effect - Effect run for all guests when they leave feasts
feast_fire_correct_default_event_effect = {
if = {
limit = {
this = scope:activity.activity_host
}
trigger_event = {
on_action = feast_default_host_event_selection
days = { min_feast_event_spacing max_feast_event_spacing }
}
}
else = {
trigger_event = {
on_action = feast_default_event_selection
days = { min_feast_event_spacing max_feast_event_spacing }
}
}
}
feast_end_guest_effect = {
# Only called on the end of a *successful* feast. Feasts which are interrupted due to death, imprisonment, etc., don't get this, so put critical clean-up stuff in the activity itself.
reveler_lifestyle_rank_up_check_effect = yes
stress_impact = {
base = medium_stress_loss
gluttonous = medium_stress_impact_loss
gregarious = medium_stress_impact_loss
shy = medium_stress_impact_gain
}
}
add_hosted_feast_modifier_towards_character = {
if = {
limit = {
$CHARACTER$ = {
employs_court_position = court_musician_court_position
any_court_position_holder = {
type = court_musician_court_position
is_physically_able = yes
}
}
}
if = {
limit = { # Increase the bonus slightly if musician's culture has Musicical Theorists
$CHARACTER$ = {
any_court_position_holder = {
type = court_musician_court_position
culture = { has_cultural_parameter = characters_are_better_court_musicians }
}
}
}
add_opinion = {
target = $CHARACTER$
modifier = feast_hosted_successful_feast_with_music
opinion = 35
}
}
else = {
add_opinion = {
target = $CHARACTER$
modifier = feast_hosted_successful_feast_with_music
}
}
}
else = {
add_opinion = {
target = $CHARACTER$
modifier = feast_hosted_successful_feast
}
}
}
# Deprecated.
hosted_successful_feast_effect = {
if = {
limit = {
culture = {
has_cultural_parameter = renown_from_feasts
}
exists = dynasty
}
dynasty = {
add_dynasty_prestige = minor_dynasty_prestige_value
}
}
scope:activity = {
every_attending_character = {
limit = { this != root }
custom = every_guest_scope_tt
add_hosted_feast_modifier_towards_character = { CHARACTER = root }
}
}
reveler_lifestyle_rank_up_check_effect = yes
hidden_effect = {
if = {
limit = { exists = scope:spouse }
add_opinion = { #Your opinion of your Spouse increases, considering they did most of the work
target = scope:spouse
modifier = feast_spouse_hosted_successful_feast_opinion
}
}
}
}
hosted_successful_feast_new_effect = {
# Renown gain from Tradition.
if = {
limit = {
culture = { has_cultural_parameter = renown_from_feasts }
}
dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_value }
}
# Piety gain from Tenets.
if = {
limit = {
faith = {
OR = {
has_doctrine_parameter = piety_from_feasts_active
AND = {
has_doctrine_parameter = summer_festivals_active
# Only during 'summer' (May 1st through July 31st).
current_month >= 5
current_month <= 7
}
}
}
}
add_piety = {
value = 0
if = {
limit = {
faith = { has_doctrine_parameter = summer_festivals_active }
# Only during 'summer' (May 1st through July 31st).
current_month >= 5
current_month <= 7
}
add = major_piety_value
}
if = {
limit = {
faith = { has_doctrine = tenet_ritual_celebrations }
}
add = medium_piety_value
}
if = {
limit = {
faith = { has_doctrine = tenet_hedonistic }
}
add = medium_piety_value
}
if = {
limit = {
has_royal_court = yes
has_dlc_feature = royal_court
amenity_level = { target = court_food_quality value >= 5 }
}
multiply = 2.5
}
else_if = {
limit = {
has_royal_court = yes
has_dlc_feature = royal_court
amenity_level = { target = court_food_quality value >= 4 }
}
multiply = 2
}
else_if = {
limit = {
has_royal_court = yes
has_dlc_feature = royal_court
amenity_level = { target = court_food_quality value >= 3 }
}
multiply = 1.5
}
else_if = {
limit = {
has_royal_court = yes
has_dlc_feature = royal_court
amenity_level = { target = court_food_quality value >= 2 }
}
multiply = 1
}
else_if = {
limit = {
has_royal_court = yes
has_dlc_feature = royal_court
amenity_level = { target = court_food_quality value <= 1 }
}
multiply = 0.5
}
# Always give some piety, even if you completely cheaped out.
min = medium_piety_value
}
}
# County development
scope:activity_location.county = {
add_county_modifier = {
modifier = feast_recent_fest_modifier
years = 5
}
}
# Opinion with spouse (various other opinions handled elsewhere).
hidden_effect = {
if = {
limit = { exists = scope:spouse }
add_opinion = { #Your opinion of your Spouse increases, considering they did most of the work
target = scope:spouse
modifier = feast_spouse_hosted_successful_feast_opinion
}
}
}
# tgp_ceremonial_liege_events.0020
if = {
limit = {
var:tgp_ceremonial_liege_events_0020_discount ?= flag:feast
}
tgp_one_up_activity_effect = yes
}
}
hosted_successful_feast_interrupted_effect = {
add_prestige = medium_prestige_gain
scope:activity = {
every_attending_character = {
limit = {
this != scope:host
}
custom = every_guest_scope_tt
add_hosted_feast_modifier_towards_character = { CHARACTER = scope:host }
}
}
reveler_lifestyle_rank_up_check_effect = yes
hidden_effect = {
if = {
limit = { exists = scope:spouse }
add_opinion = { #Your opinion of your Spouse increases, considering they did most of the work
target = scope:spouse
modifier = feast_spouse_hosted_successful_feast_opinion
}
}
}
}

View file

@ -0,0 +1,250 @@
additional_flavor_check_effect = {
if = {
limit = {
is_alive = yes
}
if = { # March / Margrave
limit = {
OR = {
AND = {
vassal_contract_has_flag = has_march_contract
highest_held_title_tier = tier_duchy
}
primary_title ?= {
has_variable = margrave_flag
}
}
}
add_character_flag = margrave_flag
}
else_if = {
limit = {
has_character_flag = margrave_flag
}
remove_character_flag = margrave_flag
}
if = {
limit = {
primary_title ?= title:e_hindustan
}
add_character_flag = e_hindustan
}
else_if = {
limit = {
has_character_flag = e_hindustan
}
remove_character_flag = e_hindustan
}
if = { # Palatinate (Duchy Tier)
limit = {
OR = {
AND = {
vassal_contract_has_flag = has_palatinate_contract
highest_held_title_tier = tier_duchy
}
primary_title ?= {
has_variable = duchy_palatinate_flag
}
}
}
add_character_flag = duchy_palatinate_flag
}
else_if = {
limit = {
has_character_flag = duchy_palatinate_flag
}
remove_character_flag = duchy_palatinate_flag
}
if = { # Palatinate (County Tier)
limit = {
OR = {
AND = {
vassal_contract_has_flag = has_palatinate_contract
highest_held_title_tier = tier_county
}
primary_title ?= {
has_variable = county_palatinate_flag
}
}
}
add_character_flag = county_palatinate_flag
}
else_if = {
limit = {
has_character_flag = county_palatinate_flag
}
remove_character_flag = county_palatinate_flag
}
if = { # Castellan / Burgrave
limit = {
OR = {
AND = {
vassal_contract_has_flag = has_castellan_contract
highest_held_title_tier = tier_county
}
primary_title ?= {
has_variable = castellan_flag
}
}
}
add_character_flag = castellan_flag
}
else_if = {
limit = {
has_character_flag = castellan_flag
}
remove_character_flag = castellan_flag
}
if = { # Tenno
limit = {
primary_title ?= { has_variable = ceremonial_liege_flag }
}
add_character_flag = ceremonial_liege_flag
}
else_if = {
limit = {
has_character_flag = ceremonial_liege_flag
}
remove_character_flag = ceremonial_liege_flag
}
}
}
additional_flavor_check_death_effect = {
if = {
limit = {
OR = {
has_character_flag = margrave_flag
vassal_contract_has_flag = has_march_contract
}
highest_held_title_tier = tier_duchy
}
primary_title ?= {
set_variable = {
name = margrave_flag
days = 1
}
}
}
else_if = {
limit = {
OR = {
has_character_flag = duchy_palatinate_flag
vassal_contract_has_flag = has_palatinate_contract
}
highest_held_title_tier = tier_duchy
}
primary_title ?= {
set_variable = {
name = duchy_palatinate_flag
days = 1
}
}
}
else_if = {
limit = {
OR = {
has_character_flag = county_palatinate_flag
vassal_contract_has_flag = has_palatinate_contract
}
highest_held_title_tier = tier_county
}
primary_title ?= {
set_variable = {
name = county_palatinate_flag
days = 1
}
}
}
else_if = {
limit = {
OR = {
has_character_flag = castellan_flag
vassal_contract_has_flag = has_castellan_contract
}
highest_held_title_tier = tier_county
}
primary_title ?= {
set_variable = {
name = castellan_flag
days = 1
}
}
}
else_if = {
limit = {
has_character_flag = ceremonial_liege_flag
highest_held_title_tier = tier_kingdom
}
primary_title ?= {
set_variable = {
name = ceremonial_liege_flag
days = 1
}
}
}
}
hre_margraves_effect = {
if = {
limit = {
game_start_date = 1066.9.15
}
title:e_hre.holder = {
every_vassal = {
limit = {
primary_title = {
OR = {
this = title:d_steyermark
this = title:d_osterreich
this = title:d_lausitz
this = title:d_meissen
this = title:d_nordgau
}
}
}
primary_title = {
set_variable = {
name = historical_margrave
days = 1
}
}
vassal_contract_set_obligation_level = {
type = special_contract
level = 2
}
additional_flavor_check_effect = yes
}
}
}
else_if = {
limit = {
game_start_date = 1178.10.1
}
title:e_hre.holder = {
every_vassal = {
limit = {
primary_title = {
OR = {
this = title:d_steyermark
this = title:d_lausitz
this = title:d_ostmark
this = title:d_meissen
}
}
}
primary_title = {
set_variable = {
name = historical_margrave
days = 1
}
}
vassal_contract_set_obligation_level = {
type = special_contract
level = 2
}
additional_flavor_check_effect = yes
}
}
}
}

View file

@ -0,0 +1,86 @@
#Effects used in Funerals
#funeral_add_funeral_targets_to_list - Effect fills target list with available funeral target characters
funeral_add_funeral_targets_to_list = {
clear_variable_list = $LIST_NAME$
save_scope_as = list_scope
primary_title ?= {
every_past_holder = {
limit = {
body_is_available = yes
}
scope:list_scope = {
add_to_variable_list = {
name = $LIST_NAME$
target = prev
}
}
}
}
every_close_or_extended_family_member = {
even_if_dead = yes
limit = {
body_is_available = yes
}
scope:list_scope = {
add_to_variable_list = {
name = $LIST_NAME$
target = prev
}
}
}
every_spouse = {
even_if_dead = yes
limit = {
body_is_available = yes
}
scope:list_scope = {
add_to_variable_list = {
name = $LIST_NAME$
target = prev
}
}
}
every_memory = {
limit = {
OR = {
has_memory_type = friend_died
has_memory_type = lover_died
has_memory_type = soulmate_died
}
trigger_if = {
limit = { exists = memory_participant:dead_relation }
memory_participant:dead_relation = { body_is_available = yes }
}
trigger_else = { always = no }
}
memory_participant:dead_relation = {
scope:list_scope = {
add_to_variable_list = {
name = $LIST_NAME$
target = prev
}
}
}
}
# ACH dead officiator
if = {
limit = {
var:dead_officiator_funeral ?= {
body_is_available = yes
}
}
scope:list_scope = {
add_to_variable_list = {
name = $LIST_NAME$
target = var:dead_officiator_funeral
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@


File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,32 @@
eliminate_&_replace_faith_effect = {
if = {
limit = {
exists = $TARGET_FAITH$.religious_head_title
exists = $TARGET_FAITH$.religious_head_title.holder
NOT = { $TARGET_FAITH$.religious_head_title = $REPLACEMENT_FAITH$.religious_head_title }
}
$TARGET_FAITH$.religious_head_title.holder = {
destroy_title = $TARGET_FAITH$.religious_head_title
}
}
every_county = {
limit = { faith = $TARGET_FAITH$ }
set_variable = {
name = forbid_crypto_reconversion
value = yes
days = 30
}
set_county_faith = $REPLACEMENT_FAITH$
}
$TARGET_FAITH$ = {
every_faith_character = {
set_variable = {
name = forbid_crypto_reconversion
value = yes
days = 30
}
set_character_faith = $REPLACEMENT_FAITH$
}
}
}

View file

@ -0,0 +1,187 @@

send_child_to_holy_order_tooltip_effect = {
scope:recipient = {
add_trait = order_member
add_piety_level = 1
custom_tooltip = character_will_leave_court_holy_order
if = {
limit = {
is_married = yes
}
every_spouse = {
divorce = scope:recipient
}
}
if = {
limit = {
exists = betrothed
}
break_betrothal = betrothed
if = {
limit = {
has_been_promised_grand_wedding = yes
}
break_grand_wedding_betrothal_effect = yes
}
}
if = {
limit = {
is_concubine = yes
}
this.concubinist = {
remove_concubine = scope:recipient
}
}
if = {
limit = {
number_of_concubines > 0
}
every_concubine = {
scope:recipient = {
remove_concubine = prev
}
}
}
}
}
send_child_to_holy_order_effect = {
scope:$GRANDMASTER$ = {
add_courtier = scope:recipient
if = {
limit = {
scope:recipient = {
is_close_family_of = scope:actor
}
}
add_opinion = {
target = scope:actor
modifier = pleased_opinion
opinion = 20
}
}
}
scope:recipient = {
add_trait = order_member
add_piety_level = 1
if = {
limit = { is_ruler = yes }
depose = yes
}
if = {
limit = {
faith != scope:$GRANDMASTER$.faith
}
set_character_faith = scope:$GRANDMASTER$.faith
}
if = {
limit = {
is_married = yes
}
every_spouse = {
divorce = scope:recipient
}
}
if = {
limit = {
exists = betrothed
}
break_betrothal = betrothed
if = {
limit = {
has_been_promised_grand_wedding = yes
}
break_grand_wedding_betrothal_effect = yes
}
}
if = {
limit = {
is_concubine = yes
}
this.concubinist = {
remove_concubine = scope:recipient
}
}
if = {
limit = {
number_of_concubines > 0
}
every_concubine = {
scope:recipient = {
remove_concubine = prev
}
}
}
}
}
send_child_to_clergy_effect = {
scope:recipient = {
add_opinion = {
modifier = demanded_taking_vows
target = scope:actor
}
simplified_clergy_effect = { RECIPIENT = scope:recipient }
}
}
simplified_clergy_effect = {
$RECIPIENT$ = {
add_trait = devoted
add_piety_level = 1
if = {
limit = { is_ruler = yes }
depose = yes
}
if = {
limit = {
is_married = yes
}
every_spouse = {
divorce = $RECIPIENT$
}
}
if = {
limit = {
exists = betrothed
}
break_betrothal = betrothed
if = {
limit = {
has_been_promised_grand_wedding = yes
}
break_grand_wedding_betrothal_effect = yes
}
}
if = {
limit = {
is_concubine = yes
}
this.concubinist = {
remove_concubine = $RECIPIENT$
}
}
if = {
limit = {
number_of_concubines > 0
}
every_concubine = {
$RECIPIENT$ = {
remove_concubine = prev
}
}
}
}
}
release_as_executioner_effect = {
scope:actor = {
court_position_grant_effect = {
EMPLOYER = scope:actor
POS = executioner
CANDIDATE = scope:recipient
}
save_scope_as = liege
}
}

View file

@ -0,0 +1,96 @@
#########################################################################
# EFFECT LIST #
#########################################################################
# !!! Remember to add all new effects with a short description here !!! #
#########################################################################
#########################################################################
# EFFECTS #
#########################################################################
add_hook_if_possible_effect = {
if = {
limit = {
can_add_hook = {
target = $TARGET$
type = $TYPE$
}
}
add_hook = {
target = $TARGET$
type = $TYPE$
years = $YEARS$
}
}
}
add_hook_if_possible_default_length_effect = {
if = {
limit = {
can_add_hook = {
target = $TARGET$
type = $TYPE$
}
}
add_hook = {
target = $TARGET$
type = $TYPE$
}
}
}
add_favour_hook_if_possible_simple_effect = {
if = {
limit = {
can_add_hook = {
target = $TARGET$
type = favor_hook
}
}
add_hook = {
target = $TARGET$
type = favor_hook
}
}
}
add_mutual_gendered_blood_sibling_hook_effect = {
# First we do current scope.
if = {
limit = {
$TARGET$ = { is_female = yes }
}
add_hook = {
target = $TARGET$
type = blood_sister_hook
}
}
else = {
add_hook = {
target = $TARGET$
type = blood_brother_hook
}
}
# Then set target's.
save_scope_as = blood_sibling_self
$TARGET$ = {
if = {
limit = {
scope:blood_sibling_self = { is_female = yes }
}
add_hook = {
target = scope:blood_sibling_self
type = blood_sister_hook
}
}
else = {
add_hook = {
target = scope:blood_sibling_self
type = blood_brother_hook
}
}
}
# Clean up after ourselves.
clear_saved_scope = blood_sibling_self
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@

#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#Effects to run in events when intercourse takes place (pregnancy and SDT chance)
#intercourse_with_scope_effect - with a known, existing character
#intercourse_with_dummy_effect - with a dummy character
#intercourse_with_unknown_effect - when the gender(s) of the other character(s) is unclear
#####################################################################
# EFFECTS
#####################################################################
#Needs argument intercourse_character
intercourse_with_character_effect = {
$INTERCOURSE_CHARACTER$ = { add_gold = 1 }
}
intercourse_with_dummy_effect = {
}
intercourse_with_unknown_effect = {
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,114 @@

### Effects for handling Intrigue Lifestyle Perks
# dark_insights_skill_gain_roll_effect: Randomly rolls for whether the character should get a bonus Intrigue or Prowess point
dark_insights_skill_gain_roll_effect = {
#Backup check in case something has gone wrong
if = {
limit = {
has_perk = dark_insights_perk
}
# Backup for the variables
if = {
limit = {
NOT = { has_variable = dark_insights_prowess_increases }
}
set_variable = {
name = dark_insights_prowess_increases
value = 0
}
}
if = {
limit = {
NOT = { has_variable = dark_insights_intrigue_increases }
}
set_variable = {
name = dark_insights_intrigue_increases
value = 0
}
}
# Roll to see if we get a skill increase.
if = {
# For tooltip generation, we need to check if we have the variable yet (the backups above won't create the variables until after the effect is actually run).
limit = {
NOR = {
has_variable = dark_insights_prowess_increases
has_variable = dark_insights_intrigue_increases
}
}
custom_tooltip = dark_insight_gain_stats_tt
}
else_if = {
limit = {
OR = {
var:dark_insights_prowess_increases < dark_insights_prowess_increase_maximum
var:dark_insights_intrigue_increases < dark_insights_intrigue_increase_maximum
}
}
custom_tooltip = dark_insight_gain_stats_tt
hidden_effect = {
random = {
chance = dark_insights_stat_increase_chance
scope:actor = {
}
random_list = {
50 = {
trigger = {
var:dark_insights_prowess_increases < dark_insights_prowess_increase_maximum
}
send_interface_toast = {
title = dark_insights_gain_message
left_icon = scope:actor
right_icon = scope:recipient
add_character_modifier = {
modifier = dark_insights_prowess_modifier
}
}
change_variable = {
name = dark_insights_prowess_increases
add = 1
}
}
50 = {
trigger = {
var:dark_insights_intrigue_increases < dark_insights_intrigue_increase_maximum
}
send_interface_toast = {
title = dark_insights_gain_message
left_icon = scope:actor
right_icon = scope:recipient
add_character_modifier = {
modifier = dark_insights_intrigue_modifier
}
}
change_variable = {
name = dark_insights_intrigue_increases
add = 1
}
}
}
}
}
}
else_if = {
limit = {
var:dark_insights_prowess_increases >= dark_insights_prowess_increase_maximum
var:dark_insights_intrigue_increases >= dark_insights_intrigue_increase_maximum
}
custom_tooltip = dark_insights_maximum_insight_tt
}
}
}

View file

@ -0,0 +1,225 @@

journey_knowledge_hoarding_skill_effect = {
scope:activity = {
if = {
limit = { has_variable = skill_chance }
change_variable = {
name = skill_chance
add = $VALUE$
}
}
else = {
set_variable = {
name = skill_chance
value = $VALUE$
}
}
if = {
limit = {
$VALUE$ == 25
}
custom_tooltip = increase_skill_chance_25
}
if = {
limit = {
$VALUE$ == 20
}
custom_tooltip = increase_skill_chance_20
}
else_if = {
limit = {
$VALUE$ == 15
}
custom_tooltip = increase_skill_chance_15
}
else_if = {
limit = {
$VALUE$ == 10
}
custom_tooltip = increase_skill_chance_10
}
else_if = {
limit = {
$VALUE$ == 5
}
custom_tooltip = increase_skill_chance_5
}
else_if = {
limit = {
$VALUE$ == 30
}
custom_tooltip = increase_skill_chance_30
}
else_if = {
limit = {
$VALUE$ == 35
}
custom_tooltip = increase_skill_chance_35
}
else_if = {
limit = {
$VALUE$ == 50
}
custom_tooltip = increase_skill_chance_50
}
else_if = {
limit = {
$VALUE$ == 2
}
custom_tooltip = increase_skill_chance_2
}
if = {
limit = {
has_variable = skill_chance
var:skill_chance > 100
}
set_variable = {
name = skill_chance
value = 100
}
}
}
}
journey_find_or_create_excellent_court_position_effect = {
#if = {
# limit = {
# any_pool_character = {
# province = $LOCATION$
# culture = $LOCATION$.culture
# aptitude = {
# court_position = $COURT_POSITION$
# value >= 4
# }
# is_available_healthy_ai_adult = yes
# $COURT_POSITION$_validity_trigger = { EMPLOYER = root }
# }
# }
# random_pool_character = {
# province = $LOCATION$
# limit = {
# culture = $LOCATION$.culture
# aptitude = {
# court_position = $COURT_POSITION$
# value >= 4
# }
# is_available_healthy_ai_adult = yes
# $COURT_POSITION$_validity_trigger = { EMPLOYER = root }
# }
# save_scope_as = local_character
# }
#}
#else = {
create_character = {
template = $COURT_POSITION$_template
location = $LOCATION$
culture = $LOCATION$.culture
faith = $LOCATION$.faith
save_scope_as = local_character
}
scope:local_character = {
add_character_flag = {
flag = silently_disappear_me
years = 1
}
}
#}
if = {
limit = {
any_court_position_holder = {
type = $COURT_POSITION$
}
}
random_court_position_holder = {
type = $COURT_POSITION$
save_scope_as = current_holder
}
}
add_character_flag = $COURT_POSITION$
}
journey_employ_in_court_position = {
show_as_tooltip = {
if = {
limit = {
is_valid_to_hire_court_position_type = $COURT_POSITION$_court_position
}
appoint_court_position = {
recipient = $CHARACTER$
court_position = $COURT_POSITION$_court_position
}
}
}
custom_tooltip = will_have_excellent_aptitude
hidden_effect = {
$CHARACTER$ = {
add_to_court_and_entourage_effect = yes
}
}
if = {
limit = {
is_valid_to_hire_court_position_type = $COURT_POSITION$_court_position
NOT = { exists = scope:current_holder }
}
employ_character_as_position_in_current_scope_court_effect = {
CHARACTER = $CHARACTER$
POSITION = $COURT_POSITION$
}
}
else_if = {
limit = {
exists = scope:current_holder
scope:local_character.aptitude:$COURT_POSITION$_court_position > scope:current_holder.aptitude:$COURT_POSITION$_court_position
}
replace_court_position = {
recipient = $CHARACTER$
holder = scope:current_holder
court_position = $COURT_POSITION$_court_position
}
}
}
journey_employ_in_camp_position = {
show_as_tooltip = {
if = {
limit = {
is_valid_to_hire_court_position_type = $COURT_POSITION$_camp_officer
}
appoint_court_position = {
recipient = $CHARACTER$
court_position = $COURT_POSITION$_camp_officer
}
}
}
custom_tooltip = will_have_excellent_aptitude
hidden_effect = {
$CHARACTER$ = {
add_to_court_and_entourage_effect = yes
}
}
if = {
limit = {
is_valid_to_hire_court_position_type = $COURT_POSITION$_camp_officer
NOT = { exists = scope:current_holder }
}
employ_character_as_position_in_current_scope_camp_effect = {
CHARACTER = $CHARACTER$
POSITION = $COURT_POSITION$
}
}
else_if = {
limit = {
exists = scope:current_holder
scope:local_character.aptitude:$COURT_POSITION$_camp_officer > scope:current_holder.aptitude:$COURT_POSITION$_camp_officer
}
replace_court_position = {
recipient = $CHARACTER$
holder = scope:current_holder
court_position = $COURT_POSITION$_camp_officer
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,148 @@

#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#####################################################################
# EFFECTS
#####################################################################
lover_breakup_rivalry_chance_effect = {
random = {
chance = 1
compare_modifier = {
value = ai_vengefulness
multiplier = 0.5
}
modifier = {
add = 25
scope:breaker = {
any_secret = {
type = secret_lover
secret_target != scope:lover
is_known_by = scope:lover
}
}
}
modifier = {
add = 20
has_trait = paranoid
}
modifier = {
add = 15
has_trait = stubborn
}
scope:breaker = {
every_consort = {
limit = {
this != scope:lover
NOR = {
has_relation_rival = scope:lover
has_relation_friend = scope:lover
}
}
add_to_list = other_lovers
}
every_relation = {
type = lover
limit = {
this != scope:lover
NOR = {
has_relation_rival = scope:lover
has_relation_friend = scope:lover
}
}
add_to_list = other_lovers
}
}
random_in_list = {
list = other_lovers
weight = {
base = 1
#More likely to pick another known Lover
modifier = {
add = 3
has_relation_lover = scope:breaker
save_temporary_scope_as = lover_check
scope:breaker = {
OR = {
NOT = {
any_secret = {
type = secret_lover
secret_target = scope:lover_check
NOT = { is_known_by = scope:lover }
}
}
any_secret = {
type = secret_lover
secret_target = scope:lover_check
is_known_by = scope:lover
}
}
}
}
}
save_scope_as = other_lover
}
}
}
remove_lover_or_soulmate_relation_effect = {
if = {
limit = { has_relation_soulmate = $CHARACTER$ }
remove_relation_soulmate = $CHARACTER$
}
else_if = {
limit = { has_relation_lover = $CHARACTER$ }
remove_relation_lover = $CHARACTER$
}
}
lover_breakup_effect = {
$BREAKER$ = {
save_scope_as = breaker
}
$LOVER$ = {
save_scope_as = lover
}
show_as_tooltip = {
$BREAKER$ = {
remove_lover_or_soulmate_relation_effect = { CHARACTER = $LOVER$ }
}
$LOVER$ = {
add_opinion = {
target = $BREAKER$
modifier = lover_breakup_opinion
}
}
}
hidden_effect = {
$LOVER$ = {
if = {
limit = {
is_consort_of = $BREAKER$
}
trigger_event = lover.0202 #Spouse breakup
}
else_if = {
limit = {
opinion = {
target = $BREAKER$
value > 0
}
}
trigger_event = lover.0201 #Normal
}
else = {
trigger_event = lover.0203 #Relieved
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,326 @@
defenders_of_highgod_decision_hall_of_heroes_effect = {
set_variable = {
name = hall_of_heroes
value = yes
}
if = {
limit = {
has_special_building_slot = no
}
add_special_building_slot = hall_of_heroes_01
}
add_special_building = hall_of_heroes_01
}
defenders_of_highgod_decision_effects = {
#Holy site building
#if = {
# limit = {
# faith = {
# any_holy_site = {
# count = 1
# county.holder = root
# }
# }
# }
# faith = {
# every_holy_site = {
# limit = { county.holder = root }
# county.title_province = { defenders_of_highgod_decision_hall_of_heroes_effect = yes }
# }
# }
#}
if = { #The scope has been saved before this effect is run
limit = { exists = scope:holy_site }
scope:holy_site = { county.title_province = { defenders_of_highgod_decision_hall_of_heroes_effect = yes } }
}
else = {
faith = {
every_holy_site = {
county.title_province = {
add_to_list = every_holy_site_province
}
}
}
show_as_tooltip = {
every_in_list = {
list = every_holy_site_province
custom = defenders_of_highgod_decision_effects_holy_site_of_choice
defenders_of_highgod_decision_hall_of_heroes_effect = yes
}
}
}
#Fervor, modifiers and holy_warrior traits
faith = {
save_scope_as = highgod_faith_scope
change_fervor = {
value = medium_fervor_value
desc = fervor_gain_defenders_of_highgod
}
}
add_character_modifier = {
modifier = defender_of_the_faith
}
if = {
limit = { number_of_commander_traits < commander_trait_limit }
add_trait = holy_warrior
}
custom_tooltip = defenders_of_highgod_decision_effects_holy_warriors_tt
hidden_effect = {
every_vassal_or_below = {
add_to_list = warriors
}
every_courtier = {
add_to_list = warriors
}
every_in_list = {
list = warriors
limit = {
is_adult = yes
is_ai = yes
can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
number_of_commander_traits < commander_trait_limit
faith = root.faith
}
random = {
chance = 50
add_trait = holy_warrior
}
}
}
}
strengthen_bloodline_decision_effects = {
dynasty = {
add_dynasty_modifier = {
modifier = strong_blood
}
}
}
dynasty_of_many_crowns_effects = {
if = {
limit = {
NOT = {
has_character_flag = dyn_many_crown_leg
}
}
add_character_flag = dyn_many_crown_leg
}
if = {
limit = {
domicile ?= {
has_domicile_building_or_higher = renown_gain_yurt_01
}
}
if = {
limit = {
domicile ?= {
has_domicile_parameter = nomad_yurt_dynasty_many_crowns_bonus
}
}
every_dynasty_member = {
limit = {
government_has_flag = government_is_nomadic
primary_title ?= {
tier >= tier_kingdom
}
}
domicile ?= {
change_herd = {
value = 1000
multiply = prev.primary_title.tier
}
}
}
}
if = {
limit = {
domicile ?= {
has_domicile_parameter = nomad_yurt_dynasty_many_khans
}
}
dynasty = {
add_dynasty_modifier = {
modifier = dynasty_of_many_crowns_nomad
}
}
}
}
dynasty = {
add_dynasty_modifier = {
modifier = dynasty_of_many_crowns
}
add_dynasty_prestige = monumental_dynasty_prestige_gain
}
}
appoint_a_righteous_caliph_scripted_effect = {
# Create a HoF title & assign it appropriately.
hidden_effect = {
# Are we Muwalladis?
if = {
limit = { faith = faith:muwalladi }
# Transfer the title.
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
title:d_muwalladi = {
change_title_holder = {
holder = scope:founder
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
# Set up the remaining bits'n'bobs.
if = {
limit = {
NOT = { has_realm_law = same_faith_succession_law }
}
add_realm_law_skip_effects = same_faith_succession_law
}
title:d_muwalladi = { add_title_law = temporal_head_of_faith_succession_law }
# Make it the HoF head.
faith = { set_religious_head_title = title:d_muwalladi }
}
# If not, follow the usual flow.
else = {
set_up_dynamic_temporal_hof_title_effect = { NEW_HOLDER = scope:founder }
faith = { set_religious_head_title = scope:new_title }
}
}
custom_tooltip = appoint_a_righteous_caliph_decision.tt.you_become_caliph
# Give scope:founder an extra piety level, if possible.
if = {
limit = { piety_level < max_piety_level }
add_piety_level = 1
}
# Try to scope:founder rivals with scope:old_caliph.
if = {
limit = {
can_set_relation_rival_trigger = { CHARACTER = scope:old_caliph }
}
set_relation_rival = {
target = scope:old_caliph
reason = rival_old_caliph_new_caliph
}
}
# If you've pulled a fast one on your HoF, they see through it.
if = {
limit = { has_character_flag = wishes_to_schism_caliphate_flag }
scope:old_caliph = {
remove_opinion = {
target = scope:founder
modifier = repentant_opinion
}
}
remove_hook = {
target = scope:old_caliph
type = indebted_hook
}
}
# And sort a bit of stress impact for the gravity of things.
stress_impact = {
base = major_stress_impact_gain
humble = major_stress_impact_gain
arrogant = medium_stress_impact_loss
}
}
mozarabic_bind_the_faith_to_rome_decision_fundamentalist_path_scripted_effect = {
# Set the doctrinal alterations.
faith = {
# First, we remove the Rite tenet & replace it with Pursuit of Power.
remove_doctrine = tenet_rite
add_doctrine = tenet_pursuit_of_power
# Then we switch on over from Pluralist to Fundamentalist.
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_fundamentalist
}
}
mozarabic_bind_the_faith_to_rome_decision_righteous_path_scripted_effect = {
# Set the doctrinal alterations.
faith = {
# First, we remove the Rite tenet & replace it with Communal Identity.
remove_doctrine = tenet_rite
add_doctrine = tenet_communal_identity
# Then, we switch on over from Pluralist to Righteous so that we're actually receiving a net bonus.
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_righteous
}
}
mozarabic_bind_the_faith_to_rome_decision_pluralist_path_scripted_effect = {
# Set the doctrinal alterations.
faith = {
# First, we remove the Rite tenet & replace it with Religious Law.
remove_doctrine = tenet_rite
add_doctrine = tenet_religious_legal_pronouncements
# Then, since we're staying pluralist, we make the court chaplain fireable (since you're now really into the nitty-gritty of canon law).
remove_doctrine = doctrine_clerical_succession_spiritual_fixed_appointment
add_doctrine = doctrine_clerical_succession_spiritual_appointment
}
}
mozarabic_break_with_rome_decision_hof_and_ecumenism_processing_scripted_effect = {
# Sort the HoF situation.
hidden_effect = {
# Create & swap-in the title.
set_up_dynamic_spiritual_hof_title_effect = { CREATOR = scope:religious_leader }
# & send out some visual notifications.
every_player = {
limit = { faith = scope:religious_leader.faith }
send_interface_toast = {
title = mozarabic_break_with_rome_decision.tt.new_hof_id
left_icon = scope:religious_leader.faith.religious_head
}
}
}
custom_tooltip = mozarabic_break_with_rome_decision.tt.you_gain_a_hof
# Remove ecumenism.
faith = { remove_doctrine = special_doctrine_ecumenical_christian}
}
mozarabic_break_with_rome_decision_fundamentalist_path_scripted_effect = {
# Set the doctrinal alterations.
faith = {
# First, we remove the Rite tenet & replace it with Armed Pilgrimages.
remove_doctrine = tenet_rite
add_doctrine = tenet_armed_pilgrimages
# Then we switch on over from Pluralist to Fundamentalist.
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_fundamentalist
}
}
mozarabic_break_with_rome_decision_righteous_path_scripted_effect = {
# Set the doctrinal alterations.
faith = {
# First, we remove the Rite tenet & replace it with Pacifism.
remove_doctrine = tenet_rite
add_doctrine = tenet_pacifism
# Then, we switch on over from Pluralist to Righteous.
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_righteous
}
}
mozarabic_break_with_rome_decision_pluralist_path_scripted_effect = {
# Set the doctrinal alterations.
faith = {
# First, we remove the Rite tenet & replace it with Islamic Syncretism.
remove_doctrine = tenet_rite
add_doctrine = tenet_islamic_syncretism
# Then, since we're staying pluralist, we make the court chaplain fireable (since you've *really* localised power now).
remove_doctrine = doctrine_clerical_succession_spiritual_fixed_appointment
add_doctrine = doctrine_clerical_succession_temporal_appointment
}
}

View file

@ -0,0 +1,919 @@
take_stewardship_of_the_sacred_river_effect = {
give_nickname = nick_the_ladylord_of_the_ganges
add_piety_level = 1
add_character_modifier = {
modifier = ruler_of_the_ganges_modifier
}
if = {
limit = {
exists = global_var:ruler_of_ganges
}
if = {
limit = {
NOT = { faith = global_var:ruler_of_ganges.faith}
}
faith = {
save_scope_as = ganges_faith
change_fervor = {
value = major_fervor_gain
desc = fervor_gain_stewardship_of_sacred_rivers
}
}
}
if = {
limit = {
global_var:ruler_of_ganges = {
is_alive = yes
}
}
show_as_tooltip = {
global_var:ruler_of_ganges = {
add_opinion = {
target = root
modifier = humbled_opinion
opinion = -40
}
}
}
}
}
hidden_effect = {
set_global_variable = {
name = ruler_of_ganges
value = root
}
}
}
establish_bactrian_supremacy_effect = {
#Create the title and make it primary
create_title_and_vassal_change = {
type = created
save_scope_as = title_change
add_claim_on_loss = no
}
title:e_bactria = {
change_title_holder = {
holder = root
change = scope:title_change
}
}
resolve_title_and_vassal_change = scope:title_change
set_primary_title_to = title:e_bactria
title:c_balkh = {
add_county_modifier = {
modifier = bactria_royal_tolls_modifier
}
}
hidden_effect = {
every_held_title = {
title_tier = empire
limit = {
NOT = { this = title:e_bactria }
}
every_in_de_jure_hierarchy = {
continue = {
tier >= tier_kingdom
}
limit = {
tier = tier_kingdom
OR = {
holder = root
holder = { target_is_liege_or_above = root }
}
NOT = { is_in_list = new_de_jure_kingdoms }
}
add_to_list = new_de_jure_kingdoms
}
add_to_list = empire_for_destruction
}
every_held_title = {
title_tier = kingdom
limit = {
NOT = { is_in_list = new_de_jure_kingdoms }
}
add_to_list = new_de_jure_kingdoms
}
title:k_kabulistan = {
if = {
limit = {
NOT = { is_in_list = new_de_jure_kingdoms }
}
add_to_list = new_de_jure_kingdoms
}
}
title:k_khorasan = {
if = {
limit = {
NOT = { is_in_list = new_de_jure_kingdoms }
}
add_to_list = new_de_jure_kingdoms
}
}
title:k_transoxiana = {
if = {
limit = {
NOT = { is_in_list = new_de_jure_kingdoms }
}
add_to_list = new_de_jure_kingdoms
}
}
every_in_list = {
list = new_de_jure_kingdoms
limit = {
trigger_if = {
limit = {
exists = this
root = { is_ai = yes }
exists = holder
}
NOR = {
holder.top_liege = { is_ai = no }
holder = { is_ai = no }
}
}
}
set_de_jure_liege_title = title:e_bactria
}
every_in_list = {
list = empire_for_destruction
limit = {
NOT = { this = title:e_bactria } #Just a little safeguarding
}
root = {
destroy_title = prev
}
}
#Notifications for characters who hold land that is now claimed
title:e_bactria = {
every_in_de_jure_hierarchy = {
continue = {
tier >= tier_duchy
}
limit = {
holder ?= {
NOR = {
this = root
target_is_liege_or_above = root
}
}
}
holder = {
if = {
limit = {
NOT = { is_in_list = notification_sent }
}
add_to_temporary_list = notification_sent
trigger_event = central_asia.0013
}
}
}
}
every_vassal = {
limit = {
NOT = {
is_in_list = notification_sent
}
}
trigger_event = central_asia.0012
}
}
}
create_custom_duchy_effect = {
save_scope_as = root_scope
custom_tooltip = create_new_duchy
show_as_tooltip = {
primary_title = {
custom_tooltip = create_custom_duchy_de_jure_changes
}
}
hidden_effect = {
save_scope_as = founder
primary_title = {
save_scope_as = old_title
}
create_dynamic_title = {
tier = duchy
name = NEW_CREATED_TITLE_NAME
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
scope:new_title = {
change_title_holder = {
holder = root
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
scope:new_title = {
set_de_jure_liege_title = scope:old_title.kingdom
}
scope:old_title = {
set_de_jure_liege_title = scope:new_title
}
scope:new_title = {
set_coa = scope:old_title
set_color_from_title = scope:old_title
set_capital_county = scope:old_title.title_capital_county
}
set_primary_title_to = scope:new_title
trigger_event = major_decisions.1101
}
}
create_custom_kingdom_effect = {
custom_tooltip = create_new_kingdom
show_as_tooltip = {
every_held_title = {
custom = create_title_every_held_duchy
title_tier = duchy
custom_tooltip = create_custom_kingdom_de_jure_changes
}
}
hidden_effect = {
save_scope_as = founder
primary_title = {
save_scope_as = old_title
}
create_dynamic_title = {
tier = kingdom
name = NEW_CREATED_TITLE_NAME
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
scope:new_title = {
change_title_holder = {
holder = root
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
#Check if all territory is from a single Empire, and if so, make Kingdom de jure of that Empire
every_sub_realm_county = {
if = {
limit = {
exists = empire
}
empire = {
if = {
limit = {
NOT = {
is_in_list = potential_empires
}
}
add_to_list = potential_empires
}
}
}
}
if = {
limit = {
any_in_list = {
list = potential_empires
count > 0
}
}
ordered_in_list = {
list = potential_empires
order_by = {
every_in_de_jure_hierarchy = {
continue = {
tier > tier_county
}
limit = {
tier = tier_county
holder.top_liege = root
}
add = 1
}
}
position = 0
save_scope_as = old_empire
}
}
if = {
limit = {
exists = scope:old_empire
}
scope:new_title = {
set_de_jure_liege_title = scope:old_empire
}
}
every_held_title = {
title_tier = duchy
if = {
limit = {
#Check if you need to notify a player
OR = {
AND = {
kingdom ?= {
holder ?= {
this != root
is_ai = no
}
}
}
AND = {
empire ?= {
holder ?= {
this != root
is_ai = no
}
}
}
}
}
add_to_temporary_list = duchy_for_notification
root = {
save_temporary_scope_value_as = {
name = send_notifications
value = yes
}
}
}
set_de_jure_liege_title = scope:new_title
}
every_sub_realm_county = {
limit = {
exists = duchy
NOT = { exists = duchy.holder }
holder.top_liege = root
duchy = {
save_temporary_scope_as = test_duchy
}
holder.top_liege = {
completely_controls = scope:test_duchy
}
}
if = {
limit = {
NOT = {
duchy = {
is_in_list = additional_de_jure_duchies
}
}
}
duchy = {
set_de_jure_liege_title = scope:new_title
add_to_list = additional_de_jure_duchies
}
}
}
scope:new_title = {
set_coa = scope:old_title
set_color_from_title = scope:old_title
set_capital_county = scope:old_title.title_capital_county
}
set_primary_title_to = scope:new_title
trigger_event = major_decisions.1101
every_player = {
if = {
limit = {
top_liege = scope:founder
this != root
}
trigger_event = major_decisions.1102
}
else_if = {
limit = {
exists = scope:send_notifications
this != root
top_liege != scope:founder
any_held_title = {
any_in_de_jure_hierarchy = {
continue = {
tier > tier_duchy
}
tier = tier_duchy
is_in_list = duchy_for_notification
}
}
}
every_held_title = {
every_in_de_jure_hierarchy = {
continue = {
tier > tier_duchy
}
limit = {
tier = tier_duchy
is_in_list = duchy_for_notification
}
add_to_list = notification_titles
}
}
if = {
limit = {
any_in_list = {
list = notification_titles
count > 0
}
}
trigger_event = major_decisions.1105
}
}
}
}
}
create_custom_empire_effect = {
custom_tooltip = create_new_empire
show_as_tooltip = {
every_held_title = {
custom = create_title_every_held_kingdom
title_tier = kingdom
custom_tooltip = create_custom_empire_de_jure_changes
}
}
hidden_effect = {
save_scope_as = founder
primary_title = {
save_scope_as = old_title
}
create_dynamic_title = {
tier = empire
name = NEW_CREATED_TITLE_NAME
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
scope:new_title = {
change_title_holder = {
holder = root
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
every_held_title = {
title_tier = kingdom
if = {
limit = {
#Check if you need to notify a player
empire ?= {
holder ?= {
this != root
is_ai = no
}
}
}
add_to_temporary_list = kingdoms_for_notification
root = {
save_temporary_scope_value_as = {
name = send_notifications
value = yes
}
}
}
set_de_jure_liege_title = scope:new_title
}
every_sub_realm_county = {
limit = {
exists = kingdom
NOT = { exists = kingdom.holder }
holder.top_liege = root
kingdom = {
save_temporary_scope_as = test_kingdom
}
holder.top_liege = {
completely_controls = scope:test_kingdom
}
}
if = {
limit = {
NOT = {
kingdom = {
is_in_list = additional_de_jure_kingdoms
}
}
}
kingdom = {
set_de_jure_liege_title = scope:new_title
add_to_list = additional_de_jure_kingdoms
}
}
}
scope:new_title = {
set_coa = scope:old_title
set_color_from_title = scope:old_title
set_capital_county = scope:old_title.title_capital_county
}
set_primary_title_to = scope:new_title
trigger_event = major_decisions.1103
every_player = {
if = {
limit = {
top_liege = scope:founder
this != root
}
trigger_event = major_decisions.1104
}
else_if = {
#Notify any players who lose de jure territory
limit = {
exists = scope:send_notifications
this != root
top_liege != scope:founder
any_held_title = {
any_in_de_jure_hierarchy = {
continue = {
tier > tier_kingdom
}
tier = tier_kingdom
is_in_list = kingdoms_for_notification
}
}
}
every_held_title = {
every_in_de_jure_hierarchy = {
continue = {
tier > tier_kingdom
}
limit = {
tier = tier_kingdom
is_in_list = kingdoms_for_notification
}
add_to_list = notification_titles
}
}
if = {
limit = {
any_in_list = {
list = notification_titles
count > 0
}
}
trigger_event = major_decisions.1105
}
}
}
}
}
break_with_old_ways_become_fundamentalist = {
remove_doctrine = unreformed_faith_doctrine
remove_doctrine = tenet_unreformed_syncretism
add_doctrine = tenet_armed_pilgrimages
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_fundamentalist
}
break_with_old_ways_become_righteous = {
remove_doctrine = unreformed_faith_doctrine
remove_doctrine = tenet_unreformed_syncretism
add_doctrine = tenet_esotericism
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_righteous
}
break_with_old_ways_become_chosen_people = {
remove_doctrine = unreformed_faith_doctrine
remove_doctrine = tenet_unreformed_syncretism
add_doctrine = tenet_communal_identity
remove_doctrine = doctrine_pluralism_pluralistic
add_doctrine = doctrine_pluralism_righteous
}
#EP3
retake_eastern_provinces_decision_effect = {
save_scope_as = root_scope
add_trait = augustus
give_nickname = nick_the_great
change_influence = {
value = massive_influence_gain
multiply = 5
}
custom_tooltip = {
text = every_county_in_theodosian_region
title:k_bulgaria = { set_de_jure_liege_title = title:e_byzantium }
title:k_epirus = { set_de_jure_liege_title = title:e_byzantium }
title:k_hellas = { set_de_jure_liege_title = title:e_byzantium }
title:k_thessalonika = { set_de_jure_liege_title = title:e_byzantium }
title:k_krete = { set_de_jure_liege_title = title:e_byzantium }
title:k_cyprus = { set_de_jure_liege_title = title:e_byzantium }
title:k_nikaea = { set_de_jure_liege_title = title:e_byzantium }
title:k_anatolia = { set_de_jure_liege_title = title:e_byzantium }
title:k_pontus = { set_de_jure_liege_title = title:e_byzantium }
title:k_syria = { set_de_jure_liege_title = title:e_byzantium }
title:k_jerusalem = { set_de_jure_liege_title = title:e_byzantium }
title:k_egypt = { set_de_jure_liege_title = title:e_byzantium }
}
add_legitimacy = {
value = massive_legitimacy_gain
multiply = 2
}
dynasty ?= {
add_dynasty_modifier = retaken_eastern_provinces_modifier
add_dynasty_prestige = 2500
}
if = {
limit = {
culture = { has_cultural_parameter = holds_triumphs }
}
custom_tooltip = {
text = free_triumph_tooltip
add_character_flag = free_triumph_flag
}
}
gain_legitimizing_legend_seed_tooltip_effect = yes
hidden_effect = { legend_seed_great_deed_dynasty_effect = yes }
every_vassal = {
custom = custom.every_admin_vassal
limit = { government_allows = administrative }
add_opinion = {
target = scope:root_scope
modifier = admiration_opinion
opinion = 20
}
}
}
recreate_ere_decision_effect = {
if = {
limit = {
title:c_byzantion.holder = {
this != root
}
}
create_title_and_vassal_change = {
type = revoked
save_scope_as = change
add_claim_on_loss = yes
}
title:c_byzantion = {
change_title_holder = {
holder = root
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
# Give the ERE
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
title:e_byzantium = {
change_title_holder = {
holder = root
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
# Make it primary title
set_primary_title_to = title:e_byzantium
# Make admin
if = {
limit = {
NOT = {
government_has_flag = government_is_administrative
}
}
convert_to_administrative_from_feudalism_effect = yes
}
if = {
limit = {
NOT = {
has_realm_law = acclamation_succession_law
}
}
# Give Acclamation succession
add_realm_law_skip_effects = acclamation_succession_law
}
# Set the capital in Constantinople
if = {
limit = {
NOT = {
capital_county = {
this = title:c_byzantion
}
}
}
set_realm_capital = title:c_byzantion
}
# Get free triumph
custom_tooltip = {
text = free_triumph_tooltip
add_character_flag = free_triumph_flag
}
if = {
limit = {
title:e_latin_empire = {
any_in_de_jure_hierarchy = {
tier < tier_empire
}
}
}
title:e_latin_empire = {
every_in_de_jure_hierarchy = {
limit = {
tier = tier_kingdom
}
set_de_jure_liege_title = title:e_byzantium
}
}
}
change_influence = massive_influence_gain
if = {
limit = {
any_held_title = {
this = title:e_latin_empire
}
}
destroy_title = title:e_latin_empire
}
hidden_effect = {
title:e_byzantium = { set_state_faith = root.faith }
}
}
reinstitute_grain_dole_decision_effect = {
if = {
limit = {
NOT = { capital_county = { has_variable = unlocked_grain_dole } }
}
custom_tooltip = {
text = half_price_chariot_race_tooltip
add_character_flag = half_price_chariot_race_flag
}
}
every_county_in_region = {
region = custom_roman_aegyptus
limit = {
any_county_province = {
has_building_or_higher = cereal_fields_05
}
}
add_county_modifier = {
modifier = grain_providers_county_modifier
years = 25
}
}
capital_county = {
add_county_modifier = {
modifier = panem_et_circenses_county_modifier
years = 25
}
}
add_legitimacy = medium_legitimacy_gain
if = {
limit = {
NOT = { capital_county = { has_variable = unlocked_grain_dole } }
}
add_prestige = {
value = massive_prestige_gain
multiply = 3
}
change_influence = {
value = massive_influence_gain
multiply = 3
}
capital_county = { set_variable = unlocked_grain_dole }
}
else = {
add_prestige = massive_prestige_gain
change_influence = massive_influence_gain
}
}
create_dar_al_islam_effect = {
save_scope_as = new_hegemon
scope:new_hegemon = {
# Get the title and assorted rewards
get_title = title:h_dar_al_islam
add_prestige = 5000
dynasty ?= { add_dynasty_prestige = 5000 }
# Become the head of faith of all islamic faiths that aren't hostile or evil
custom_tooltip = {
text = dar_al_islam_become_head_of_faith_desc
faith.religion = {
every_faith = {
limit = {
faith_hostility_level = {
target = scope:new_hegemon.faith
value < faith_hostile_level
}
}
if = {
limit = {
has_doctrine = doctrine_no_head
}
remove_doctrine = doctrine_no_head
add_doctrine = doctrine_temporal_head
}
else_if = {
limit = {
has_doctrine = doctrine_spiritual_head
}
remove_doctrine = doctrine_spiritual_head
add_doctrine = doctrine_temporal_head
}
if = {
limit = {
has_doctrine = doctrine_theocracy_temporal
}
remove_doctrine = doctrine_theocracy_temporal
add_doctrine = doctrine_theocracy_lay_clergy
}
set_religious_head_title = title:h_dar_al_islam
}
}
}
# Destroy the old head of faith title, but there's no need to show it
hidden_effect = {
if = {
limit = { exists = var:old_hof_title }
destroy_title = var:old_hof_title
remove_variable = old_hof_title
}
}
# Show conversion bonus
custom_tooltip = dar_al_islam_muslim_conversion_desc # Bonus is applied in religion_demand_conversion_default_modifier
# Enable unlimited subjugations
custom_tooltip = {
text = dar_al_islam_subjugation_expanded_desc
house = {
set_variable = {
name = subjugations_expanded
value = yes
}
}
}
# Show faction bonus
custom_tooltip = dar_al_islam_faction_desc # Actual effect is set up in the faction itself
# Make all held empires de jure titles
every_held_title = {
limit = {
tier = tier_empire
}
set_de_jure_liege_title = title:h_dar_al_islam
}
}
# Let's also make all fully controlled empires de jure title, even if you don't hold them
every_empire = {
if = {
limit = {
is_titular = no
trigger_if = {
limit = { exists = holder }
holder != scope:new_hegemon
}
scope:new_hegemon = { completely_controls = prev }
}
set_de_jure_liege_title = title:h_dar_al_islam
}
}
set_global_variable = {
name = created_dar_al_islam
value = yes
}
}

View file

@ -0,0 +1,114 @@

#####################################################################
# EFFECT LIST
#####################################################################
# All effects below determine if a marriage should be matrilineal or not
# marry_on_realm_law - Marry two characters based on Spouse 1's realm law
# marry_spouse_1_dominant - Marry two characters and make Spouse 1 dominant
#####################################################################
# EFFECTS
#####################################################################
marry_on_realm_law = {
if = {
limit = {
$SPOUSE_1$ = { is_ruler = yes }
$SPOUSE_1$ = {
OR = {
has_realm_law = male_only_law
has_realm_law = male_preference_law
}
}
}
$SPOUSE_1$ = { marry = $SPOUSE_2$ }
}
else_if = {
limit = {
$SPOUSE_1$ = { is_ruler = no }
$SPOUSE_1$.liege ?= {
OR = {
has_realm_law = male_only_law
has_realm_law = male_preference_law
}
}
}
$SPOUSE_1$ = { marry = $SPOUSE_2$ }
}
else_if = {
limit = {
$SPOUSE_1$ = { is_ruler = yes }
$SPOUSE_1$ = {
OR = {
has_realm_law = female_only_law
has_realm_law = female_preference_law
}
}
}
$SPOUSE_1$ = { marry_matrilineal = $SPOUSE_2$ }
}
else_if = {
limit = {
$SPOUSE_1$ = { is_ruler = no }
$SPOUSE_1$.liege ?= {
OR = {
has_realm_law = female_only_law
has_realm_law = female_preference_law
}
}
}
$SPOUSE_1$ = { marry_matrilineal = $SPOUSE_2$ }
}
else = {
marry_spouse_1_dominant = {
SPOUSE_1 = $SPOUSE_1$
SPOUSE_2 = $SPOUSE_2$
}
}
}
marry_spouse_1_dominant = {
if = {
limit = {
$SPOUSE_1$ = { is_male = yes }
}
$SPOUSE_1$ = { marry = $SPOUSE_2$ }
}
else = {
$SPOUSE_1$ = { marry_matrilineal = $SPOUSE_2$ }
}
}
vassals_dislike_marry_lowborn_effect = {
$RULER$ = {
if = {
limit = {
is_lowborn = no
$SPOUSE$ = { is_lowborn = yes }
OR = {
NOT = { exists = primary_spouse }
primary_spouse ?= $SPOUSE$
}
}
every_vassal_or_below = {
limit = { has_vassal_stance = courtly }
custom = every_courtly_vassal
add_opinion = {
modifier = married_lowborn_opinion
target = $RULER$
opinion = -50
}
}
every_vassal_or_below = {
limit = { has_vassal_stance = glory_hound }
custom = every_glory_hound_vassal
add_opinion = {
modifier = married_lowborn_opinion
target = $RULER$
opinion = -30
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,879 @@
#Effects used in Lifestyle Focus events
#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#
#giving_up_on_commander_trait_training_effect - Effect for when you give up on your commander training
give_random_commander_trait_effect = {
random_list = {
100 = {
trigger = { NOT = { has_trait = logistician } }
add_trait = logistician
}
100 = {
trigger = { NOT = { has_trait = military_engineer } }
add_trait = military_engineer
}
100 = {
trigger = { NOT = { has_trait = aggressive_attacker } }
add_trait = aggressive_attacker
}
100 = {
trigger = { NOT = { has_trait = unyielding_defender } }
add_trait = unyielding_defender
}
100 = {
trigger = { NOT = { has_trait = forder } }
add_trait = forder
}
100 = {
trigger = { NOT = { has_trait = flexible_leader } }
add_trait = flexible_leader
}
100 = {
trigger = {
NOT = { has_trait = desert_warrior }
any_sub_realm_barony = {
title_province = {
OR = {
terrain = desert
terrain = desert_mountains
terrain = oasis
terrain = drylands
}
}
}
}
add_trait = desert_warrior
}
100 = {
trigger = {
NOT = { has_trait = jungle_stalker }
any_sub_realm_barony = {
title_province = {
terrain = jungle
}
}
}
add_trait = jungle_stalker
}
100 = {
trigger = {
NOT = { has_trait = winter_soldier }
any_sub_realm_barony = {
title_province = {
OR = {
terrain = taiga
geographical_region = world_tibet
geographical_region = world_europe_north
geographical_region = world_europe_east
geographical_region = world_steppe
}
}
}
}
add_trait = winter_soldier
}
100 = {
trigger = {
NOT = { has_trait = forest_fighter }
any_sub_realm_barony = {
title_province = {
OR = {
terrain = forest
terrain = taiga
}
}
}
}
add_trait = forest_fighter
}
100 = {
trigger = {
NOT = { has_trait = open_terrain_expert }
any_sub_realm_barony = {
title_province = {
OR = {
terrain = plains
terrain = farmlands
terrain = steppe
}
}
}
}
add_trait = open_terrain_expert
}
100 = {
trigger = {
NOT = { has_trait = rough_terrain_expert }
any_sub_realm_barony = {
title_province = {
OR = {
terrain = hills
terrain = mountains
terrain = wetlands
}
}
}
}
add_trait = rough_terrain_expert
}
100 = {
trigger = { NOT = { has_trait = reaver } }
add_trait = reaver
}
100 = {
trigger = { NOT = { has_trait = reckless } }
add_trait = reckless
}
100 = {
trigger = { NOT = { has_trait = holy_warrior } }
add_trait = holy_warrior
}
100 = {
trigger = { NOT = { has_trait = organizer } }
add_trait = organizer
}
100 = {
trigger = { NOT = { has_trait = cautious_leader } }
add_trait = cautious_leader
}
}
}
# Ensure that this effect stays up-to-date with all commander traits in 00_traits.txt
select_ct_for_teacher_to_teach_student_effect = {
random_list = {
1 = {
trigger = {
$TEACHER$ = { has_trait = logistician }
$STUDENT$ = { NOT = { has_trait = logistician } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:logistician
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = military_engineer }
$STUDENT$ = { NOT = { has_trait = military_engineer } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:military_engineer
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = aggressive_attacker }
$STUDENT$ = { NOT = { has_trait = aggressive_attacker } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:aggressive_attacker
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = unyielding_defender }
$STUDENT$ = { NOT = { has_trait = unyielding_defender } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:unyielding_defender
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = forder }
$STUDENT$ = { NOT = { has_trait = forder } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:forder
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = flexible_leader }
$STUDENT$ = { NOT = { has_trait = flexible_leader } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:flexible_leader
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = desert_warrior }
$STUDENT$ = { NOT = { has_trait = desert_warrior } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:desert_warrior
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = jungle_stalker }
$STUDENT$ = { NOT = { has_trait = jungle_stalker } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:jungle_stalker
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = winter_soldier }
$STUDENT$ = { NOT = { has_trait = winter_soldier } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:winter_soldier
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = reaver }
$STUDENT$ = { NOT = { has_trait = reaver } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:reaver
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = reckless }
$STUDENT$ = { NOT = { has_trait = reckless } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:reckless
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = holy_warrior }
$STUDENT$ = { NOT = { has_trait = holy_warrior } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:holy_warrior
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = open_terrain_expert }
$STUDENT$ = { NOT = { has_trait = open_terrain_expert } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:open_terrain_expert
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = rough_terrain_expert }
$STUDENT$ = { NOT = { has_trait = rough_terrain_expert } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:rough_terrain_expert
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = forest_fighter }
$STUDENT$ = { NOT = { has_trait = forest_fighter } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:forest_fighter
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = cautious_leader }
$STUDENT$ = { NOT = { has_trait = cautious_leader } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:cautious_leader
}
}
}
1 = {
trigger = {
$TEACHER$ = { has_trait = organizer }
$STUDENT$ = { NOT = { has_trait = organizer } }
}
$STUDENT$ = {
set_variable = {
name = commander_trait_being_taught
value = flag:organizer
}
}
}
}
}
discover_new_commander_trait_to_teach = {
random_list = {
1 = {
trigger = { NOT = { has_trait = logistician } }
set_variable = {
name = commander_trait_being_taught
value = flag:logistician
}
}
1 = {
trigger = { NOT = { has_trait = military_engineer } }
set_variable = {
name = commander_trait_being_taught
value = flag:military_engineer
}
}
1 = {
trigger = { NOT = { has_trait = aggressive_attacker } }
set_variable = {
name = commander_trait_being_taught
value = flag:aggressive_attacker
}
}
1 = {
trigger = { NOT = { has_trait = unyielding_defender } }
set_variable = {
name = commander_trait_being_taught
value = flag:unyielding_defender
}
}
1 = {
trigger = { NOT = { has_trait = forder } }
set_variable = {
name = commander_trait_being_taught
value = flag:forder
}
}
1 = {
trigger = { NOT = { has_trait = flexible_leader } }
set_variable = {
name = commander_trait_being_taught
value = flag:flexible_leader
}
}
1 = {
trigger = {
exists = scope:teacher.location
scope:teacher.location = {
OR = {
terrain = oasis
terrain = desert
terrain = desert_mountains
}
}
NOT = { has_trait = desert_warrior }
}
set_variable = {
name = commander_trait_being_taught
value = flag:desert_warrior
}
}
1 = {
trigger = {
exists = scope:teacher.location
scope:teacher.location = {
terrain = jungle
}
NOT = { has_trait = jungle_stalker }
}
set_variable = {
name = commander_trait_being_taught
value = flag:jungle_stalker
}
}
1 = {
trigger = {
exists = scope:teacher.location
scope:teacher.location = {
OR = {
terrain = taiga
geographical_region = world_tibet
geographical_region = world_europe_north
geographical_region = world_europe_east
geographical_region = world_steppe
}
}
NOT = { has_trait = winter_soldier }
}
set_variable = {
name = commander_trait_being_taught
value = flag:winter_soldier
}
}
1 = {
trigger = { NOT = { has_trait = reaver } }
set_variable = {
name = commander_trait_being_taught
value = flag:reaver
}
}
1 = {
trigger = { NOT = { has_trait = reckless } }
set_variable = {
name = commander_trait_being_taught
value = flag:reckless
}
}
1 = {
trigger = { NOT = { has_trait = holy_warrior } }
set_variable = {
name = commander_trait_being_taught
value = flag:holy_warrior
}
}
1 = {
trigger = { NOT = { has_trait = open_terrain_expert } }
set_variable = {
name = commander_trait_being_taught
value = flag:open_terrain_expert
}
}
1 = {
trigger = { NOT = { has_trait = rough_terrain_expert } }
set_variable = {
name = commander_trait_being_taught
value = flag:rough_terrain_expert
}
}
1 = {
trigger = {
exists = scope:teacher.location
scope:teacher.location = {
OR = {
terrain = forest
terrain = taiga
}
}
NOT = { has_trait = forest_fighter }
}
set_variable = {
name = commander_trait_being_taught
value = flag:forest_fighter
}
}
1 = {
trigger = { NOT = { has_trait = cautious_leader } }
set_variable = {
name = commander_trait_being_taught
value = flag:cautious_leader
}
}
1 = {
trigger = { NOT = { has_trait = organizer } }
set_variable = {
name = commander_trait_being_taught
value = flag:organizer
}
}
}
}
randomize_commander_trait_to_be_taught_effect = {
random_list = {
100 = {
trigger = {
NOT = { has_trait = logistician }
scope:teacher = {
has_trait = logistician
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:logistician
}
}
100 = {
trigger = {
NOT = { has_trait = military_engineer }
scope:teacher = {
has_trait = military_engineer
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:military_engineer
}
}
100 = {
trigger = {
NOT = { has_trait = aggressive_attacker }
scope:teacher = {
has_trait = aggressive_attacker
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:aggressive_attacker
}
}
100 = {
trigger = {
NOT = { has_trait = unyielding_defender }
scope:teacher = {
has_trait = unyielding_defender
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:unyielding_defender
}
}
100 = {
trigger = {
NOT = { has_trait = forder }
scope:teacher = {
has_trait = forder
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:forder
}
}
100 = {
trigger = {
NOT = { has_trait = flexible_leader }
scope:teacher = {
has_trait = flexible_leader
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:flexible_leader
}
}
100 = {
trigger = {
NOT = { has_trait = desert_warrior }
scope:teacher = {
has_trait = desert_warrior
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:desert_warrior
}
}
100 = {
trigger = {
NOT = { has_trait = jungle_stalker }
scope:teacher = {
has_trait = jungle_stalker
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:jungle_stalker
}
}
100 = {
trigger = {
NOT = { has_trait = winter_soldier }
scope:teacher = {
has_trait = winter_soldier
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:winter_soldier
}
}
100 = {
trigger = {
NOT = { has_trait = reaver }
scope:teacher = {
has_trait = reaver
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:reaver
}
}
100 = {
trigger = {
NOT = { has_trait = reckless }
scope:teacher = {
has_trait = reckless
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:reckless
}
}
100 = {
trigger = {
NOT = { has_trait = holy_warrior }
scope:teacher = {
has_trait = holy_warrior
}
}
set_variable = {
name = commander_trait_being_taught
value = flag:holy_warrior
}
}
}
if = { #Fallback
limit = {
NOT = { exists = var:commander_trait_being_taught }
}
set_variable = {
name = commander_trait_being_taught
value = flag:flexible_leader
}
}
}
commander_trait_teaching_setup_effect = {
hidden_effect = {
trigger_event = {
on_action = learn_commander_trait_test
days = { 200 730 }
}
}
if = {
limit = { NOT = {has_relation_mentor = scope:teacher } }
set_relation_mentor = scope:teacher
}
else = {
save_scope_value_as = {
name = long_term_mentor
value = yes
}
}
}
giving_up_on_commander_trait_training_effect = {
custom_tooltip = learn_commander_trait.giving_up_tt
if = {
limit = {
scope:teacher = { is_alive = yes }
}
scope:teacher = {
add_opinion = {
target = root
modifier = gave_up_on_learn_commander_trait_opinion
}
}
}
if = {
limit = {
NOT = { exists = scope:long_term_mentor }
has_relation_mentor = scope:teacher
}
remove_relation_mentor = scope:teacher
}
remove_character_flag = being_taught_commander_trait
remove_variable = commander_trait_being_taught
}
learn_commander_trait_success_effect = {
remove_character_flag = being_taught_commander_trait
if = {
limit = {
has_relation_mentor = scope:teacher
NOT = { exists = scope:long_term_mentor }
scope:teacher = {
is_alive = yes
}
}
remove_relation_mentor = scope:teacher
}
if = {
limit = {
scope:teacher = {
is_alive = yes
}
}
hidden_effect = {
add_opinion = {
target = scope:teacher
modifier = taught_me_commander_trait_opinion
}
}
}
if = {
limit = { var:commander_trait_being_taught = flag:logistician }
add_trait = logistician
}
else_if = {
limit = { var:commander_trait_being_taught = flag:military_engineer }
add_trait = military_engineer
}
else_if = {
limit = { var:commander_trait_being_taught = flag:aggressive_attacker }
add_trait = aggressive_attacker
}
else_if = {
limit = { var:commander_trait_being_taught = flag:unyielding_defender }
add_trait = unyielding_defender
}
else_if = {
limit = { var:commander_trait_being_taught = flag:forder }
add_trait = forder
}
else_if = {
limit = { var:commander_trait_being_taught = flag:flexible_leader }
add_trait = flexible_leader
}
else_if = {
limit = { var:commander_trait_being_taught = flag:desert_warrior }
add_trait = desert_warrior
}
else_if = {
limit = { var:commander_trait_being_taught = flag:jungle_stalker }
add_trait = jungle_stalker
}
else_if = {
limit = { var:commander_trait_being_taught = flag:winter_soldier }
add_trait = winter_soldier
}
else_if = {
limit = { var:commander_trait_being_taught = flag:reaver }
add_trait = reaver
}
else_if = {
limit = { var:commander_trait_being_taught = flag:reckless }
add_trait = reckless
}
else_if = {
limit = { var:commander_trait_being_taught = flag:holy_warrior }
add_trait = holy_warrior
}
else_if = {
limit = { var:commander_trait_being_taught = flag:open_terrain_expert }
add_trait = open_terrain_expert
}
else_if = {
limit = { var:commander_trait_being_taught = flag:rough_terrain_expert }
add_trait = rough_terrain_expert
}
else_if = {
limit = { var:commander_trait_being_taught = flag:forest_fighter }
add_trait = forest_fighter
}
else_if = {
limit = { var:commander_trait_being_taught = flag:cautious_leader }
add_trait = cautious_leader
}
else_if = {
limit = { var:commander_trait_being_taught = flag:organizer }
add_trait = organizer
}
}
learn_commander_trait_final_test_duel_effect = {
duel = {
skill = martial
value = 10
10 = {
compare_modifier = {
value = scope:duel_value
}
desc = learn_commander_trait_final_test_success
custom_tooltip = learn_commander_trait_final_test_success_tt
trigger_event = {
on_action = learn_commander_trait_success
days = 1
}
}
10 = {
desc = learn_commander_trait_final_test_failure
custom_tooltip = learn_commander_trait_final_test_failure_tt
trigger_event = {
on_action = learn_commander_trait_failure
days = 1
}
}
}
}
martial_authority_special_1100_a_failure_effect = {
add_character_modifier = {
modifier = fought_a_seasoned_warrior
days = 3650
}
random = {
chance = 33
increase_wounds_effect = { REASON = training_accident }
}
}
martial_authority_special_1100_soldier_friend_effects_effect = {
hidden_effect = {
set_relation_soldier_friend = scope:soldier_friend
set_relation_potential_friend = scope:soldier_friend
}
reverse_add_opinion = {
target = scope:soldier_friend
modifier = grateful_opinion
opinion = 15
}
add_hook = {
type = loyalty_hook
target = scope:soldier_friend
}
add_courtier = scope:soldier_friend
}

View file

@ -0,0 +1,13 @@

#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#spawn_heavy_infantry_army_effect - create a random fitting HI MAA army
#spawn_single_men_at_arms_army_effect - create a MAA army of a given type
#####################################################################
# EFFECTS
#####################################################################

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,14 @@
# plays a music cue once per player character's lifetime
# example use : play_music_cue_once = { TRACK = "mx_cue_combat_stinger" }
play_music_cue_once = {
if = {
limit = {
is_ai = no
NOT = {
has_character_flag = played_$TRACK$
}
}
add_character_flag = played_$TRACK$
play_music_cue = $TRACK$
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,84 @@
#Effects used in parent events
#####################################################################
# EFFECT LIST
#####################################################################
# !!! Remember to add all new effects with a short description here !!!
#
#increase_parent_meddling_value_effect
#decrease_parent_meddling_value_effect
######################################################################
# EFFECTS
######################################################################
#Effects for increasing and decreasing the parent_meddling variable value used in parent_events
increase_parent_meddling_value_effect = {
hidden_effect = {
if = {
limit = {
root = { is_ai = no }
has_variable = parent_meddling
}
change_variable = {
name = parent_meddling
add = 1
}
}
else = {
set_variable = {
name = parent_meddling
value = 1
}
}
random = {
chance = 10
modifier = {
trigger = { has_variable = parent_meddling }
add = {
value = var:parent_meddling
multiply = 10
}
}
trigger_event = {
on_action = parent_meddling_outcome
days = { 180 365 }
}
}
}
}
decrease_parent_meddling_value_effect = {
hidden_effect = {
if = {
limit = {
root = { is_ai = no }
has_variable = parent_meddling
var:parent_meddling > 1
}
change_variable = {
name = parent_meddling
add = -1
}
}
else_if = {
limit = { has_variable = parent_meddling }
remove_variable = parent_meddling
}
}
}
remove_parent_meddling_value_effect = {
hidden_effect = {
if = {
limit = {
root = { is_ai = no }
has_variable = parent_meddling
}
remove_variable = parent_meddling
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,42 @@

#Effects used in playdates
#playdate_end_guest_effect - Effect run for all guests when they leave playdates
playdate_concluded_my_events_effect = {
save_temporary_scope_as = finished_participant
}
playdate_fire_correct_default_event_effect = {
trigger_event = {
on_action = playdate_event_selection
days = { min_playdate_event_spacing max_playdate_event_spacing }
}
}
playdate_end_guest_effect = {
# Only called on the end of a *successful* playdate. Playdates which are interrupted due to death, imprisonment, etc., don't get this, so put critical clean-up stuff in the activity itself.
stress_impact = {
base = medium_stress_loss
gregarious = medium_stress_impact_loss
charming = minor_stress_impact_loss
shy = medium_stress_impact_gain
pensive = minor_stress_impact_gain
}
}
hosted_successful_playdate_interrupted_effect = {
add_prestige = medium_prestige_gain
scope:activity = {
every_attending_character = {
limit = {
this != scope:host
}
custom = every_guest_scope_tt
add_opinion = {
target = scope:host
modifier = hosted_successful_playdate_opinion
}
}
}
}

View file

@ -0,0 +1,800 @@
##################################################
# Generation
##################################################
## Themes
select_poem_theme_romance_effect = {
set_variable = {
name = poetry_theme
value = flag:romance
}
# Set up a scope for gender effect checking.
save_scope_value_as = {
name = poetry_romance_target
value = yes
}
}
select_poem_theme_mourning_effect = {
set_variable = {
name = poetry_theme
value = flag:mourning
}
}
select_poem_theme_legacy_effect = {
set_variable = {
name = poetry_theme
value = flag:legacy
}
}
select_poem_theme_strife_effect = {
set_variable = {
name = poetry_theme
value = flag:strife
}
}
select_poem_theme_incompetence_effect = {
set_variable = {
name = poetry_theme
value = flag:incompetence
}
}
select_poem_theme_random_effect = {
hidden_effect = {
random_list = {
# Romance
100 = { select_poem_theme_romance_effect = yes }
# Mourning
100 = { select_poem_theme_mourning_effect = yes }
# Legacy
100 = { select_poem_theme_legacy_effect = yes }
# Strife
100 = { select_poem_theme_strife_effect = yes }
# Incompetence
100 = { select_poem_theme_incompetence_effect = yes }
}
}
}
## Subject
### Used to select subject genders, taking any of the following:
#### flag:specific
#### flag:woman
#### flag:man
#### flag:random
### SUBJECT_TARGET needs to be filled out regardless to prevent errors, but is inert unless you've also set flag:specific.
#### Just stick it to root or whoever if not actively using it.
select_poem_subject_gender_effect = {
save_temporary_scope_value_as = {
name = subject
value = $SUBJECT$
}
# If we have a $CHARACTER$ designated, select that.
if = {
limit = { scope:subject = flag:specific }
$SUBJECT_TARGET$ = { save_scope_as = subject }
}
# If we have a manually selected gender, grab that.
else_if = {
limit = { scope:subject = flag:woman }
dummy_female = { save_scope_as = subject }
}
else_if = {
limit = { scope:subject = flag:man }
dummy_male = { save_scope_as = subject }
}
# Otherwise, generate a dummy.
else = {
# Is this a romantic poem?
if = {
limit = { exists = scope:poetry_romance_target }
# If so, only target the correct gender for preference.
romance_target_gender_effect = { SCOPE_NAME = subject }
}
# Otherwise, just a random dummy is fine.
else = {
random_dummy_gender_soldier_effect = { SCOPE_NAME = subject }
}
}
# Finally, set this as a variable on root so that custom loc can access it.
set_variable = {
name = poem_subject
value = scope:subject
}
}
##################################################
# Cleanup
##################################################
cleanup_poem_effect = {
# Remove the generated theme.
remove_variable = poetry_theme
# And designated subject.
remove_variable = poem_subject
}
##################################################
# Send Poem Interaction Consequences
##################################################
@send_poem_rejected_prestige_cost = medium_prestige_loss
@send_poem_rejected_prestige_gain = minor_prestige_gain
@send_poem_accepted_prestige_regain = minor_prestige_gain
send_poem_romance_duel_actor_victory_effect = {
scope:actor = {
if = {
limit = {
has_trait = lifestyle_poet
}
add_trait_xp = {
trait = lifestyle_poet
value = { 5 10 }
}
}
}
# Add a good amount of opinion of scope:actor.
scope:recipient = {
add_opinion = {
target = scope:actor
modifier = sent_poem_romance_opinion
}
hidden_effect = {
random = {
chance = 25
if = {
limit = { can_set_relation_potential_lover_trigger = { CHARACTER = scope:actor } }
set_relation_potential_lover = scope:actor
}
}
}
}
}
send_poem_romance_duel_actor_failure_effect = {
# reduce their opinion of scope:recipient.
hidden_effect = {
scope:actor = {
add_opinion = {
target = scope:recipient
modifier = sent_poem_humiliated_opinion
}
}
}
# & give prestige to scope:recipient
scope:recipient = {
add_opinion = {
opinion = -20
target = scope:actor
modifier = sent_poem_humiliated_opinion
}
hidden_effect = {
random = {
chance = 20
if = {
limit = { can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } }
set_relation_potential_rival = scope:actor
}
}
}
add_prestige = @send_poem_rejected_prestige_gain
}
}
send_poem_mourning_duel_actor_victory_effect = {
scope:actor = {
if = {
limit = {
has_trait = lifestyle_poet
}
add_trait_xp = {
trait = lifestyle_poet
value = { 5 10 }
}
}
}
# Add a modest amount of opinion of scope:actor & some stress loss.
scope:recipient = {
add_opinion = {
target = scope:actor
modifier = sent_poem_mourning_opinion
}
hidden_effect = {
random = {
chance = 25
if = {
limit = { can_set_relation_potential_friend_trigger = { CHARACTER = scope:actor } }
set_relation_potential_friend = scope:actor
}
}
}
add_stress = medium_stress_loss
}
}
send_poem_mourning_duel_actor_failure_effect = {
# reduce their opinion of scope:recipient.
hidden_effect = {
scope:actor = {
add_opinion = {
target = scope:recipient
modifier = sent_poem_humiliated_opinion
}
}
}
scope:recipient = {
add_opinion = {
opinion = -20
target = scope:actor
modifier = sent_poem_humiliated_opinion
}
hidden_effect = {
random = {
chance = 20
if = {
limit = { can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } }
set_relation_potential_rival = scope:actor
}
}
}
add_prestige = @send_poem_rejected_prestige_gain
}
}
send_poem_legacy_duel_actor_victory_effect = {
scope:actor = {
if = {
limit = {
has_trait = lifestyle_poet
}
add_trait_xp = {
trait = lifestyle_poet
value = { 5 10 }
}
}
}
# Add a modest amount of opinion of scope:actor & some piety.
scope:recipient = {
add_opinion = {
target = scope:actor
modifier = sent_poem_grateful_opinion
}
hidden_effect = {
random = {
chance = 25
if = {
limit = { can_set_relation_potential_friend_trigger = { CHARACTER = scope:actor } }
set_relation_potential_friend = scope:actor
}
}
}
add_piety = minor_piety_gain
}
}
send_poem_legacy_duel_actor_failure_effect = {
# reduce their opinion of scope:recipient.
hidden_effect = {
scope:actor = {
add_opinion = {
target = scope:recipient
modifier = sent_poem_humiliated_opinion
}
}
}
# & give prestige to scope:recipient
scope:recipient = {
add_opinion = {
opinion = -20
target = scope:actor
modifier = sent_poem_humiliated_opinion
}
hidden_effect = {
random = {
chance = 20
if = {
limit = { can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } }
set_relation_potential_rival = scope:actor
}
}
}
add_prestige = @send_poem_rejected_prestige_gain
}
}
send_poem_strife_duel_actor_victory_effect = {
scope:actor = {
if = {
limit = {
has_trait = lifestyle_poet
}
add_trait_xp = {
trait = lifestyle_poet
value = { 5 10 }
}
}
}
# Add a modest amount of opinion of scope:actor & some prestige.
scope:recipient = {
add_opinion = {
target = scope:actor
modifier = sent_poem_grateful_opinion
}
hidden_effect = {
random = {
chance = 25
if = {
limit = { can_set_relation_potential_friend_trigger = { CHARACTER = scope:actor } }
set_relation_potential_friend = scope:actor
}
}
}
add_prestige = minor_prestige_gain
}
}
send_poem_strife_duel_actor_failure_effect = {
# reduce their opinion of scope:recipient.
hidden_effect = {
scope:actor = {
add_opinion = {
target = scope:recipient
modifier = sent_poem_humiliated_opinion
}
}
}
# & give prestige to scope:recipient
scope:recipient = {
add_opinion = {
opinion = -20
target = scope:actor
modifier = sent_poem_humiliated_opinion
}
hidden_effect = {
random = {
chance = 20
if = {
limit = { can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } }
set_relation_potential_rival = scope:actor
}
}
}
add_prestige = @send_poem_rejected_prestige_gain
}
}
send_poem_incompetence_duel_actor_victory_effect = {
scope:actor = {
if = {
limit = {
has_trait = lifestyle_poet
}
add_trait_xp = {
trait = lifestyle_poet
value = { 5 10 }
}
}
}
# Reduce opinion of scope:actor & add stress.
scope:recipient = {
add_opinion = {
target = scope:actor
modifier = sent_poem_humiliated_opinion
}
hidden_effect = {
random = {
chance = 50
if = {
limit = { can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } }
set_relation_potential_rival = scope:actor
}
}
}
add_stress = major_stress_gain
}
}
send_poem_incompetence_duel_actor_failure_effect = {
# reduce their opinion of scope:recipient.
hidden_effect = {
scope:actor = {
add_opinion = {
target = scope:recipient
modifier = sent_poem_humiliated_opinion
}
}
}
# & give prestige to scope:recipient
scope:recipient = {
add_opinion = {
opinion = -20
target = scope:actor
modifier = sent_poem_humiliated_opinion
}
hidden_effect = {
random = {
chance = 20
if = {
limit = { can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } }
set_relation_potential_rival = scope:actor
}
}
}
add_prestige = @send_poem_rejected_prestige_gain
}
}
##################################################
# Send Poem Interaction Duels
##################################################
send_poem_romance_duel_victory_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:recipient
show_as_tooltip = { send_poem_romance_duel_actor_victory_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:actor
show_as_tooltip = { send_poem_romance_duel_actor_victory_effect = yes }
}
}
# Calculate the actual effects.
send_poem_romance_duel_actor_victory_effect = yes
}
send_poem_romance_duel_defeat_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:recipient
show_as_tooltip = { send_poem_romance_duel_actor_failure_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:actor
show_as_tooltip = { send_poem_romance_duel_actor_failure_effect = yes }
}
}
# Calculate the actual effects.
send_poem_romance_duel_actor_failure_effect = yes
}
send_poem_romance_duel_effect = {
duel = {
skill = diplomacy
target = $POV_TARGET$
# Scope:actor's words find their mark.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
max = 49
}
desc = send_poem_interaction.success
# Sort notifications & output.
send_poem_romance_duel_victory_notification_effect = yes
}
# Scope:recipient is able to publicly ridicule the poem.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
max = 49
}
desc = send_poem_interaction.failure
# Sort notifications & output.
send_poem_romance_duel_defeat_notification_effect = yes
}
}
}
send_poem_mourning_duel_victory_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:recipient
show_as_tooltip = { send_poem_mourning_duel_actor_victory_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:actor
show_as_tooltip = { send_poem_mourning_duel_actor_victory_effect = yes }
}
}
# Calculate the actual effects.
send_poem_mourning_duel_actor_victory_effect = yes
}
send_poem_mourning_duel_defeat_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:recipient
show_as_tooltip = { send_poem_mourning_duel_actor_failure_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:actor
show_as_tooltip = { send_poem_mourning_duel_actor_failure_effect = yes }
}
}
# Calculate the actual effects.
send_poem_mourning_duel_actor_failure_effect = yes
}
send_poem_mourning_duel_effect = {
duel = {
skill = diplomacy
target = $POV_TARGET$
# Scope:actor's words find their mark.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
max = 49
}
desc = send_poem_interaction.success
# Sort notifications & output.
send_poem_mourning_duel_victory_notification_effect = yes
}
# Scope:recipient is able to publicly ridicule the poem.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
max = 49
}
desc = send_poem_interaction.failure
# Sort notifications & output.
send_poem_mourning_duel_defeat_notification_effect = yes
}
}
}
send_poem_legacy_duel_victory_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:recipient
show_as_tooltip = { send_poem_legacy_duel_actor_victory_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:actor
show_as_tooltip = { send_poem_legacy_duel_actor_victory_effect = yes }
}
}
# Calculate the actual effects.
send_poem_legacy_duel_actor_victory_effect = yes
}
send_poem_legacy_duel_defeat_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:recipient
show_as_tooltip = { send_poem_legacy_duel_actor_failure_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:actor
show_as_tooltip = { send_poem_legacy_duel_actor_failure_effect = yes }
}
}
# Calculate the actual effects.
send_poem_legacy_duel_actor_failure_effect = yes
}
send_poem_legacy_duel_effect = {
duel = {
skill = diplomacy
target = $POV_TARGET$
# Scope:actor's words find their mark.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
max = 49
}
desc = send_poem_interaction.success
# Sort notifications & output.
send_poem_legacy_duel_victory_notification_effect = yes
}
# Scope:recipient is able to publicly ridicule the poem.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
max = 49
}
desc = send_poem_interaction.failure
# Sort notifications & output.
send_poem_legacy_duel_defeat_notification_effect = yes
}
}
}
send_poem_strife_duel_victory_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:recipient
show_as_tooltip = { send_poem_strife_duel_actor_victory_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:actor
show_as_tooltip = { send_poem_strife_duel_actor_victory_effect = yes }
}
}
# Calculate the actual effects.
send_poem_strife_duel_actor_victory_effect = yes
}
send_poem_strife_duel_defeat_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:recipient
show_as_tooltip = { send_poem_strife_duel_actor_failure_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:actor
show_as_tooltip = { send_poem_strife_duel_actor_failure_effect = yes }
}
}
# Calculate the actual effects.
send_poem_strife_duel_actor_failure_effect = yes
}
send_poem_strife_duel_effect = {
duel = {
skill = diplomacy
target = $POV_TARGET$
# Scope:actor's words find their mark.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
max = 49
}
desc = send_poem_interaction.success
# Sort notifications & output.
send_poem_strife_duel_victory_notification_effect = yes
}
# Scope:recipient is able to publicly ridicule the poem.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
max = 49
}
desc = send_poem_interaction.failure
# Sort notifications & output.
send_poem_strife_duel_defeat_notification_effect = yes
}
}
}
send_poem_incompetence_duel_victory_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:recipient
show_as_tooltip = { send_poem_incompetence_duel_actor_victory_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.success
left_icon = scope:actor
show_as_tooltip = { send_poem_incompetence_duel_actor_victory_effect = yes }
}
}
# Calculate the actual effects.
send_poem_incompetence_duel_actor_victory_effect = yes
}
send_poem_incompetence_duel_defeat_notification_effect = {
# Send out toasts.
hidden_effect = {
# Send scope:actor-side toast
scope:actor = {
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:recipient
show_as_tooltip = { send_poem_incompetence_duel_actor_failure_effect = yes }
}
}
# Send scope:recipient-side toast.
send_interface_toast = {
title = send_poem_interaction.failure
left_icon = scope:actor
show_as_tooltip = { send_poem_incompetence_duel_actor_failure_effect = yes }
}
}
# Calculate the actual effects.
send_poem_incompetence_duel_actor_failure_effect = yes
}
send_poem_incompetence_duel_effect = {
duel = {
skill = diplomacy
target = $POV_TARGET$
# Scope:actor's words find their mark.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
max = 49
}
desc = send_poem_interaction.success
# Sort notifications & output.
send_poem_incompetence_duel_victory_notification_effect = yes
}
# Scope:recipient is able to publicly ridicule the poem.
50 = {
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
max = 49
}
desc = send_poem_interaction.failure
# Sort notifications & output.
send_poem_incompetence_duel_defeat_notification_effect = yes
}
}
}

View file

@ -0,0 +1,164 @@
set_interesting_traits_and_modifiers_effect = {
random_list = {
50 = {
trigger = {
has_trait = gluttonous
}
change_current_weight = 150
}
50 = {
trigger = {
has_trait = gluttonous
}
change_current_weight = 100
}
10 = {
trigger = {
NOT = { has_trait = temperate }
}
change_current_weight = 50
}
10 = {
change_current_weight = 25
}
100 = {
}
10 = {
change_current_weight = -25
}
5 = {
trigger = {
NOR = {
has_trait = temperate
has_trait = gluttonous
}
}
change_current_weight = -50
}
}
random_list = {
1 = {
modifier = {
add = 9
culture = {
has_cultural_parameter = loyal_trait_more_common
}
}
add_trait = loyal
}
1 = {
modifier = {
add = 9
culture = {
has_cultural_parameter = disloyal_trait_more_common
}
}
add_trait = disloyal
}
1 = {
modifier = {
add = 9
culture = {
has_cultural_parameter = scholar_official_trait_bonuses
}
}
add_trait = confucian_education
}
98 = {}
}
}
add_random_tiered_trait_xp_effect = {
save_scope_value_as = {
name = level_1_possible
value = flag:$LEVEL_1$
}
save_scope_value_as = {
name = level_3_possible
value = flag:$LEVEL_3$
}
if = {
limit = { has_trait = $TRAIT$ }
random_list = {
15 = {
trigger = { scope:level_1_possible = flag:yes }
add_trait_xp = {
trait = $TRAIT$
value = {
integer_range = {
min = small_lifestyle_random_xp_low
max = small_lifestyle_random_xp_high
}
}
}
}
10 = {
add_trait_xp = {
trait = $TRAIT$
value = {
integer_range = {
min = medium_lifestyle_random_xp_low
max = medium_lifestyle_random_xp_high
}
}
}
}
5 = {
trigger = { scope:level_3_possible = flag:yes }
add_trait_xp = {
trait = $TRAIT$
value = 100
}
}
}
}
}
add_random_tiered_trait_track_xp_effect = {
save_scope_value_as = {
name = level_1_possible
value = flag:$LEVEL_1$
}
save_scope_value_as = {
name = level_3_possible
value = flag:$LEVEL_3$
}
if = {
limit = { has_trait = $TRAIT$ }
random_list = {
15 = {
trigger = { scope:level_1_possible = flag:yes }
add_trait_xp = {
trait = $TRAIT$
track = $TRACK$
value = {
integer_range = {
min = small_lifestyle_random_xp_low
max = small_lifestyle_random_xp_high
}
}
}
}
10 = {
add_trait_xp = {
trait = $TRAIT$
track = $TRACK$
value = {
integer_range = {
min = medium_lifestyle_random_xp_low
max = medium_lifestyle_random_xp_high
}
}
}
}
5 = {
trigger = { scope:level_3_possible = flag:yes }
add_trait_xp = {
trait = $TRAIT$
track = $TRACK$
value = 100
}
}
}
}
}

View file

@ -0,0 +1,407 @@

#Effects relating to pregnancy
#unmarried_mother_pregnancy_effect
#pregnancy_termination_attempt_effect
unmarried_mother_pregnancy_effect = {
add_trait_force_tooltip = pregnant
add_fornicator_trait_or_nothing_effect = yes
hidden_effect = {
set_known_bastard_on_pregnancy = yes #The bastard status is already known since the mother is unmarried.
if = {
limit = {
NOT = {
any_owned_story = {
type = story_peasant_affair
var:peasant_character = scope:mother.pregnancy_real_father
}
}
}
trigger_event = { #This parses whether the mother is planning to confess to a real_father, and checks if there are characters out there who should suspect that they might be the real father
id = adultery.1101
days = 20
}
}
}
}
married_mother_pregnancy_effect = {
add_trait_force_tooltip = pregnant
if = {
limit = {
NOT = { exists = scope:spouse }
exists = primary_spouse
}
primary_spouse = {
save_scope_as = spouse
}
}
if = {
limit = { exists = scope:spouse }
scope:spouse = {
pregnancy_spouse_suspicion_chance_effect = yes
}
}
hidden_effect = {
if = {
limit = {
NOT = {
any_owned_story = {
type = story_peasant_affair
var:peasant_character = {
this = scope:real_father
}
}
}
}
trigger_event = { #This parses whether the mother is planning to confess to a real_father, and checks if there are characters out there who should suspect that they might be the real father
id = adultery.1101
days = 20
}
}
}
}
historical_pregnancy_effect = {
if = {
limit = { exists = var:historical_pregnancy }
switch = {
trigger = var:historical_pregnancy
flag:antoku = {
save_scope_as = mother
character:japanese_yamato_54 = { save_scope_as = father }
create_character = {
name = "Tokihito" # birth name of Antoku
gender_female_chance = 0
random_traits = no
age = 0
dynasty_house = scope:father.house # Yamato
employer = scope:mother.employer
father = scope:father # Emperor Takakura
mother = scope:mother # Noriko
faith = scope:father.faith
culture = scope:father.culture
save_scope_as = child
}
scope:child = { add_pressed_claim = title:k_chrysanthemum_throne }
}
}
create_character_memory = {
type = child_born
participants = { child = scope:child }
}
current_travel_plan ?= {
if = {
limit = {
travel_plan_owner = { is_ruler = yes }
}
add_companion = scope:child
}
}
}
}
#This effect is used to handle all the tings that should ALWAYS be done at birth.
pregnancy_maintainance_effect = {
hidden_effect = {
historical_pregnancy_effect = yes # Handle specific scripted historical births
remove_trait = pregnant
#Save twin as child_2
scope:child = {
if = {
limit = { has_trait = twin }
random_sibling = {
limit = { is_twin_of = scope:child }
save_scope_as = child_2
}
#Identical twins
if = {
limit = { sex_same_as = scope:child_2 }
random = {
chance = 50
copy_inheritable_appearance_from = scope:child_2
}
}
}
}
#BASTARD OR NOT? TO HANDLE NON-COMPLICATED BIRTH EVENTS
#It is a bastard!
if = {
limit = {
OR = {
has_character_flag = unmarried_bastard_pregnancy
has_character_flag = bastard_pregnancy
}
}
#To see if the assumed father has died while pregnant with unknown bastard
if = {
limit = {
scope:mother = {
NOT = { has_character_flag = pregnancy_real_father_of_bastard_is_known_flag }
exists = var:dead_spouse
}
}
var:dead_spouse = {
save_scope_as = father
}
scope:child = {
set_father = scope:father
}
scope:mother = {
remove_variable = dead_spouse
}
}
#To fire the right event for the mother if the child secretly is a bastard
if = {
limit = {
NOT = { has_character_flag = pregnancy_real_father_of_bastard_is_known_flag }
has_character_flag = bastard_pregnancy
secret_disputed_heritage_is_valid_trigger = {
TARGET = scope:child
}
}
add_secret = { #Set up a new secret about the child
type = secret_disputed_heritage
target = scope:child
}
random_secret = { #Find the secret
type = secret_disputed_heritage
limit = {
secret_target = scope:child
}
save_scope_as = new_secret
}
#If the real_father knows they're the father they will get an event about the bastard being born
if = {
limit = {
has_character_flag = pregnancy_real_father_knows
}
scope:child.real_father = {
add_to_list = illegitimacy_secret_knowers
}
}
#If the spouse knows they're NOT the father they will get an event about the bastard being born
if = {
limit = {
has_character_flag = pregnancy_spouse_knows_of_bastardy
}
scope:child.father = {
add_to_list = illegitimacy_secret_knowers
}
}
every_in_list = {
list = illegitimacy_secret_knowers
#A secret bastard is born - Share the news with everyone who knew that it was a bastard
trigger_event = secret_bastard.0001
}
}
#Check for unmarried mother bastardy flag
else_if = {
limit = {
NOT = { has_character_flag = pregnancy_real_father_of_bastard_is_known_flag }
has_character_flag = unmarried_bastard_pregnancy
# Must be able to have the illegitimate child secret.
secret_unmarried_illegitimate_child_is_valid_trigger = {
TARGET = scope:child
}
}
add_secret = { #Set up a new secret about the child
type = secret_unmarried_illegitimate_child
target = scope:child
}
random_secret = { #Find the secret
type = secret_unmarried_illegitimate_child
limit = {
secret_target = scope:child
}
save_scope_as = new_secret
}
#If the real father knows he is the father, let him in on the Secret
if = {
limit = {
has_character_flag = pregnancy_real_father_knows
}
scope:child.real_father = {
trigger_event = secret_bastard.0002 #Announces that a child is born, and lets the recipient learn the unmarried_illegitimate_child secret
}
}
}
}
#Mother married real_father while pregnant - make sure he's set as the father
if = {
limit = {
scope:mother = {
NOR = {
has_character_flag = unmarried_bastard_pregnancy
has_character_flag = bastard_pregnancy
}
any_consort = { this = scope:child.real_father }
NOT = { exists = scope:child.father }
}
}
scope:child = {
set_father = scope:child.real_father
}
}
}
}
pregnancy_cleanup_effect = {
hidden_effect = {
if = {
limit = {
has_character_flag = unmarried_bastard_pregnancy
}
remove_character_flag = unmarried_bastard_pregnancy
}
if = {
limit = {
has_character_flag = bastard_pregnancy
}
remove_character_flag = bastard_pregnancy
}
if = {
limit = {
has_character_flag = pregnancy_real_father_of_bastard_is_known_flag
}
remove_character_flag = pregnancy_real_father_of_bastard_is_known_flag
}
if = {
limit = {
has_character_flag = pregnancy_spouse_knows_of_bastardy
}
remove_character_flag = pregnancy_spouse_knows_of_bastardy
}
if = {
limit = {
has_character_flag = pregnancy_real_father_knows
}
remove_character_flag = pregnancy_real_father_knows
}
if = {
limit = {
has_character_flag = birth_will_go_smoothly
}
remove_character_flag = birth_will_go_smoothly
}
if = {
limit = {
has_character_flag = birth_child_will_become_sickly
}
remove_character_flag = birth_child_will_become_sickly
}
if = {
limit = {
has_character_flag = birth_mother_will_become_ill
}
remove_character_flag = birth_mother_will_become_ill
}
if = {
limit = {
has_variable = borte_first_child_var
}
remove_variable = borte_first_child_var
}
}
if = {
limit = {
has_trait = pregnant
}
remove_trait = pregnant
}
}
pregnancy_termination_attempt_effect = {
random_list = {
100 = { #Pregnancy ends, no negative consequence
#custom_tooltip = pregnancy_treatment_succeeds_tt
show_as_tooltip = {
end_pregnancy = yes
}
hidden_effect = {
trigger_event = {
id = pregnancy.2003
days = { 3 10 }
}
}
}
30 = { #Pregnancy ends, mother becomes Ill
trigger = {
NOT = { has_trait = ill }
}
show_as_tooltip = {
end_pregnancy = yes
add_trait = ill
}
#custom_tooltip = pregnancy_treatment_succeeds_tt
#custom_tooltip = pregnancy_treatment_fall_ill_tt
hidden_effect = {
trigger_event = {
id = pregnancy.2004
days = { 3 10 }
}
}
}
100 = { #The pregnancy continues
custom_tooltip = pregnancy_treatment_fails_tt
hidden_effect = {
trigger_event = {
id = pregnancy.2005
days = { 3 10 }
}
}
}
10 = { #The mother dies
show_as_tooltip = {
death = {
death_reason = death_attempted_treatment
}
}
hidden_effect = {
trigger_event = {
id = pregnancy.2007
days = { 3 10 }
}
}
}
}
}
#Effects to use in birth 3001-3999
#Requires scope:child (scope:child_2, scope:child_3, and twin_list optional)
kill_child_and_possible_twins_effect = {
scope:child = {
death = {
death_reason = death_delivery
}
}
if = {
limit = {
exists = scope:child_2
}
scope:child_2 = {
death = {
death_reason = death_delivery
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,211 @@

#####################################################################
# EFFECT LIST
#####################################################################
increase_crown_authority_effect = {
if = {
limit = { has_realm_law_flag = uses_crown_authority }
#Laws
if = {
limit = { has_realm_law = crown_authority_0 }
add_realm_law = crown_authority_1
}
else_if = {
limit = { has_realm_law = crown_authority_1 }
add_realm_law = crown_authority_2
}
else_if = {
limit = { has_realm_law = crown_authority_2 }
add_realm_law = crown_authority_3
}
}
}
decrease_crown_authority_effect = {
if = {
limit = { has_realm_law_flag = uses_crown_authority }
#Laws
if = {
limit = { has_realm_law = crown_authority_3 }
add_realm_law = crown_authority_2
}
else_if = {
limit = { has_realm_law = crown_authority_2 }
add_realm_law = crown_authority_1
}
else_if = {
limit = { has_realm_law = crown_authority_1 }
add_realm_law = crown_authority_0
}
}
}
increase_tribal_authority_effect = {
if = {
limit = { has_realm_law_flag = uses_tribal_authority }
#Laws
if = {
limit = { has_realm_law = tribal_authority_0 }
add_realm_law = tribal_authority_1
}
else_if = {
limit = { has_realm_law = tribal_authority_1 }
add_realm_law = tribal_authority_2
}
else_if = {
limit = { has_realm_law = tribal_authority_2 }
add_realm_law = tribal_authority_3
}
}
}
decrease_tribal_authority_effect = {
if = {
limit = { has_realm_law_flag = uses_tribal_authority }
#Laws
if = {
limit = { has_realm_law = tribal_authority_3 }
add_realm_law = tribal_authority_2
}
else_if = {
limit = { has_realm_law = tribal_authority_2 }
add_realm_law = tribal_authority_1
}
else_if = {
limit = { has_realm_law = tribal_authority_1 }
add_realm_law = tribal_authority_0
}
}
}
increase_imperial_bureaucracy_effect = {
if = {
limit = { has_realm_law_flag = uses_imperial_bureaucracy }
#Laws
if = {
limit = { has_realm_law = imperial_bureaucracy_0 }
add_realm_law = imperial_bureaucracy_1
}
else_if = {
limit = { has_realm_law = imperial_bureaucracy_1 }
add_realm_law = imperial_bureaucracy_2
}
else_if = {
limit = { has_realm_law = imperial_bureaucracy_2 }
add_realm_law = imperial_bureaucracy_3
}
}
}
decrease_imperial_bureaucracy_effect = {
if = {
limit = { has_realm_law_flag = uses_imperial_bureaucracy }
#Laws
if = {
limit = { has_realm_law = imperial_bureaucracy_3 }
add_realm_law = imperial_bureaucracy_2
}
else_if = {
limit = { has_realm_law = imperial_bureaucracy_2 }
add_realm_law = imperial_bureaucracy_1
}
else_if = {
limit = { has_realm_law = imperial_bureaucracy_1 }
add_realm_law = imperial_bureaucracy_0
}
}
}
# We use this rather than doing it straight in the effect block for better mod compatibility, since this can be overridden without adjusting the rest of the laws file.
remove_law_related_modifiers_effect = {
# We call out some modifiers because we want the player to see what they're losing, but it's fine to hide future modifiers ye may add in a hidden_effect if they're minor.
if = {
limit = { has_character_modifier = liege_authority_boost_has_scapegoat_modifier }
remove_character_modifier = liege_authority_boost_has_scapegoat_modifier
}
}
remove_vassal_directives = {
remove_character_flag = vassal_directive_improve_development
remove_character_flag = vassal_directive_train_commanders
remove_character_flag = vassal_directive_build_maa
remove_character_flag = vassal_directive_convert_faith
remove_character_flag = vassal_directive_convert_culture
remove_character_flag = vassal_directive_improve_cultural_acceptance
remove_character_flag = vassal_directive_building_focus_fortification
remove_character_flag = vassal_directive_building_focus_military
remove_character_flag = vassal_directive_building_focus_economy
remove_character_flag = vassal_directive_manage_fertility
remove_character_flag = vassal_directive_explore_cultures
remove_character_flag = vassal_directive_raid_innovation_intent
remove_character_flag = vassal_directive_raid_herd_intent
}
increase_nomadic_authority_effect = {
if = {
limit = { has_realm_law_flag = uses_nomadic_authority }
#Laws
if = {
limit = { has_realm_law = nomadic_authority_1 }
add_realm_law = nomadic_authority_2
}
else_if = {
limit = { has_realm_law = nomadic_authority_2 }
add_realm_law = nomadic_authority_3
}
else_if = {
limit = { has_realm_law = nomadic_authority_3 }
add_realm_law = nomadic_authority_4
}
}
}
decrease_nomadic_authority_effect = {
if = {
limit = { has_realm_law_flag = uses_nomadic_authority }
#Laws
if = {
limit = { has_realm_law = nomadic_authority_4 }
add_realm_law = nomadic_authority_3
}
else_if = {
limit = { has_realm_law = nomadic_authority_3 }
add_realm_law = nomadic_authority_2
}
else_if = {
limit = { has_realm_law = nomadic_authority_2 }
add_realm_law = nomadic_authority_1
}
}
}
# Should be used in the county title scope
add_law_of_the_land_title_succession_law_if_appropriate_effect = {
save_scope_as = county_title
if = {
limit = {
#tier = tier_county # Commented out for performance reasons, comment back in if this effect is used outside of on_title_gained
NOT = { has_title_law = law_of_the_land_succession_law }
is_noble_family_title = no
title_province ?= {
holding_type = {
has_required_heir_governments = yes
NOT = {
any_required_heir_government_type = {
this = scope:county_title.holder.government_type
}
}
}
}
}
holder = {
send_interface_toast = {
title = succession_law_changed
left_icon = scope:county_title
scope:county_title = { add_title_law = law_of_the_land_succession_law }
}
}
}
}

View file

@ -0,0 +1,871 @@
#For use with HornedMythicalCreature / call this effect (set_up_horned_mythical_creature_effect = yes) in the line before creating the artifact
#Use this in the artifact's name/description in the loc-file [ROOT.Char.Custom('HornedMythicalCreature')]
#Remember to clear the var:horned_mythical_creature in your after = { ... }
set_up_horned_mythical_creature_effect = {
random_list = {
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:tarasque
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:indrik
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:ophiotaurus
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:monocerus
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:centicore
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:erchitu
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:hadhayosh
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:bulgu
}
}
50 = {
set_variable = {
name = horned_mythical_creature
value = flag:catoblepas
}
}
5 = {
trigger = {
location = { geographical_region = custom_iceland }
}
set_variable = {
name = horned_mythical_creature
value = flag:keewakw
}
}
}
}
#For use with RegionalMythicalCreature / call this effect (set_up_regional_mythical_creature_effect = yes) in the line before creating the artifact
#Use this in the artifact's name/description in the loc-file [ROOT.Char.Custom('RegionalMythicalCreature')] /and/ [ROOT.Char.Custom('RegionalMythicalCreatureLower')]
#Remember to clear the var:regional_mythical_creature_trinket in your after = { ... }
set_up_regional_mythical_creature_effect = {
if = {
#Britannia
limit = {
location = { geographical_region = world_europe_west_britannia }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:water_leper
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:fomorian
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:fachan
}
}
}
}
else_if = {
#West Europe
limit = {
location = { geographical_region = world_europe_west }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:cockatrice
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:lou_carcolh
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:myrmecoleon
}
}
}
}
else_if = {
#North Europe
limit = {
location = { geographical_region = world_europe_north }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:antero_vipunen
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:tjelvar
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:fin
}
}
50 = {
trigger = {
location = { geographical_region = custom_gotland }
}
set_variable = {
name = regional_mythical_creature_trinket
value = flag:bysn
}
}
50 = {
trigger = {
location = { geographical_region = custom_gotland }
}
set_variable = {
name = regional_mythical_creature_trinket
value = flag:disma
}
}
}
}
else_if = {
#South Europe
limit = {
location = { geographical_region = world_europe_south }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:basilisk
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:lhombri
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:argus_panoptes
}
}
}
}
else_if = {
#East Europe
limit = {
location = { geographical_region = world_europe_east }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:baba_yaga
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:psoglav
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:sirin
}
}
}
}
else_if = {
#West Africa
limit = {
location = { geographical_region = world_africa_west }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:mami_wata
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:dodo
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:utelif
}
}
}
}
else_if = {
#East Africa
limit = {
location = { geographical_region = world_africa_east }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:liqimsa
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:bulgu
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:opimachus
}
}
}
}
else_if = {
#Middle East
limit = {
location = { geographical_region = world_middle_east }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:manticore
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:behemoth
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:humbaba
}
}
}
}
else_if = {
#India
limit = {
location = { geographical_region = world_india }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:makara
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:yali
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:rakshasha
}
}
}
}
else_if = {
#East Asia
limit = {
location = {
OR = {
geographical_region = world_tibet
geographical_region = world_asia_china
geographical_region = world_asia_japan
geographical_region = world_asia_korea
geographical_region = world_asia_southeast
}
}
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:manaul
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:bashee
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:camphruch
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:qilin
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:tengu
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:naga
}
}
}
}
else_if = {
#West Steppe
limit = {
location = { geographical_region = world_steppe_west }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:aptah_baga #Legendary two-headed frog (from Sakha)
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:xullyukuns #Supernatural water spirit (from Sakha)
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:zilant #Dragon/wyvern-like creature
}
}
}
}
else_if = {
#East Steppe
limit = {
location = { geographical_region = world_steppe_east }
NOT = { exists = var:regional_mythical_creature_trinket }
}
random_list = {
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:yelbeghen #Seven-headed giant/dragon
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:tepegoz #Fleshy giant-like cyclops
}
}
50 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:archura #Deceitful forest demon
}
}
}
}
#Fallback
else = {
random_list = {
100 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:dragon
}
}
5 = {
set_variable = {
name = regional_mythical_creature_trinket
value = flag:cipactli
}
}
}
}
}
select_local_farm_animal_effect = {
random_list = {
50 = {
set_variable = {
name = local_farm_animal
value = flag:goat
}
}
50 = {
set_variable = {
name = local_farm_animal
value = flag:chicken
}
}
50 = {
modifier = {
factor = 0
faith = { religion_tag = hinduism_religion }
}
set_variable = {
name = local_farm_animal
value = flag:cow
}
}
50 = {
set_variable = {
name = local_farm_animal
value = flag:sheep
}
}
50 = {
modifier = {
factor = 0
faith = {
OR = {
religion_tag = islam_religion
religion_tag = judaism_religion
}
}
}
set_variable = {
name = local_farm_animal
value = flag:pig
}
}
50 = {
modifier = {
factor = 0
location = {
NOR = {
geographical_region = world_tibet
geographical_region = world_asia_china
geographical_region = world_asia_korea
geographical_region = world_asia_southeast
geographical_region = ghw_region_mongolia
}
}
}
set_variable = {
name = local_farm_animal
value = flag:yak
}
}
}
}
# Plague effect, get a regionally appropriate faith for people to scapegoat
select_scapegoat_faith_effect = {
random_list = {
100 = { # Courtier in your realm with hostile faith
trigger = {
any_courtier_or_guest = {
save_temporary_scope_as = courtier_to_check
root.faith = {
faith_hostility_level = {
target = scope:courtier_to_check.faith
value >= faith_hostile_level
}
}
}
}
random_courtier_or_guest = {
limit = {
save_temporary_scope_as = courtier_to_check
root.faith = {
faith_hostility_level = {
target = scope:courtier_to_check.faith
value >= faith_hostile_level
}
}
}
faith = { save_scope_as = faith_to_blame }
}
}
100 = { # Vassal in your realm with hostile faith
trigger = {
top_liege ?= {
any_vassal_or_below = {
save_temporary_scope_as = courtier_to_check
root.faith = {
faith_hostility_level = {
target = scope:courtier_to_check.faith
value >= faith_hostile_level
}
}
}
}
}
top_liege = {
random_vassal_or_below = {
limit = {
save_temporary_scope_as = courtier_to_check
root.faith = {
faith_hostility_level = {
target = scope:courtier_to_check.faith
value >= faith_hostile_level
}
}
}
faith = { save_scope_as = faith_to_blame }
}
}
}
100 = { # Neighbouring hostile faith
trigger = {
any_neighboring_and_across_water_top_liege_realm_owner = {
any_sub_realm_county = {
save_temporary_scope_as = county_to_check
root.faith = {
faith_hostility_level = {
target = scope:county_to_check.faith
value >= faith_hostile_level
}
}
}
}
}
random_neighboring_and_across_water_top_liege_realm_owner = {
limit = {
any_sub_realm_county = {
save_temporary_scope_as = county_to_check
root.faith = {
faith_hostility_level = {
target = scope:county_to_check.faith
value >= faith_hostile_level
}
}
}
}
random_sub_realm_county = {
limit = {
save_temporary_scope_as = county_to_check
root.faith = {
faith_hostility_level = {
target = scope:county_to_check.faith
value >= faith_hostile_level
}
}
}
faith = { save_scope_as = faith_to_blame }
}
}
}
10 = { # Regional, fallback
random_list = {
1000 = { # Judaism
trigger = {
capital_province ?= {
OR = {
geographical_region = world_europe
geographical_region = world_asia_minor
geographical_region = world_middle_east
geographical_region = world_africa_east
geographical_region = world_africa_north
}
}
# Jewish faiths shouldn't blame themselves
NOT = { root.faith.religion = religion:judaism_religion }
# Account for Syncretics and the like
root.faith = {
NOT = { has_doctrine_parameter = jewish_syncretic_actor_opinion_active }
}
}
religion:judaism_religion = {
random_faith = {
limit = {
NOR = { # Regional faiths should be excluded
this = faith:malabarism
this = faith:kabarism
}
}
save_scope_as = faith_to_blame
}
}
}
1000 = { # Islam
trigger = {
capital_province ?= {
OR = {
geographical_region = world_middle_east # This would only apply for non-Islamic middle-easterners
geographical_region = world_india
geographical_region = world_africa
geographical_region = world_steppe
geographical_region = world_asia_minor
geographical_region = world_europe_west_iberia
geographical_region = world_africa_east
geographical_region = world_africa_north
geographical_region = world_asia_china
geographical_region = world_asia_southeast
}
}
NOT = { root.faith.religion = religion:islam_religion }
root.faith = {
NOT = { has_doctrine_parameter = islamic_syncretic_actor_opinion_active }
}
}
religion:islam_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # Christianity
trigger = {
capital_province ?= {
OR = {
geographical_region = world_europe
geographical_region = world_india
geographical_region = world_steppe
geographical_region = world_asia_minor
geographical_region = world_tibet
geographical_region = world_middle_east
geographical_region = world_africa_east
geographical_region = world_africa_north
geographical_region = world_asia_china
}
}
NOT = { root.faith.religion = religion:christianity_religion }
root.faith = {
NOT = { has_doctrine_parameter = christian_syncretic_actor_opinion_active }
}
}
religion:christianity_religion = {
if = { # Exclude Eastern Christians for Europe
limit = {
root = {
capital_province = {
OR = {
geographical_region = world_europe
geographical_region = world_asia_minor
}
}
}
}
random_faith = {
limit = {
NOT = { has_doctrine_parameter = eastern_syncretic_actor_opinion_active }
}
save_scope_as = faith_to_blame
}
}
else = { # Exclude non-Eastern Christians for Asia
random_faith = {
limit = {
has_doctrine_parameter = eastern_syncretic_actor_opinion_active
}
save_scope_as = faith_to_blame
}
}
}
}
1000 = { # Jainism
trigger = {
capital_province ?= {
OR = {
geographical_region = world_india
geographical_region = world_burma
geographical_region = world_asia_china
geographical_region = world_asia_korea
geographical_region = world_asia_southeast
}
}
NOT = { root.faith.religion = religion:jainism_religion }
}
religion:jainism_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # Zoroastrianism
trigger = {
capital_province ?= {
OR = {
geographical_region = world_india
geographical_region = world_middle_east_persia
geographical_region = world_asia_china
geographical_region = world_asia_southeast
}
}
NOT = { root.faith.religion = religion:zoroastrianism_religion }
}
religion:zoroastrianism_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # Buddhism (Non-Buddhist Tibetans)
trigger = {
capital_province ?= {
OR = {
geographical_region = world_tibet
geographical_region = world_burma # In case Burma ceases to be Buddhist
geographical_region = world_asia_china # for non buddhist chinese et al
geographical_region = world_asia_japan
geographical_region = world_asia_korea
geographical_region = world_asia_southeast
}
}
NOT = { root.faith.religion = religion:buddhism_religion }
}
religion:buddhism_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # Bon (Non-Bon Tibetans)
trigger = {
capital_province ?= {
geographical_region = world_tibet
geographical_region = world_asia_china
}
NOT = { root.faith.religion = religion:bon_religion }
}
religion:bon_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # West African paganism
trigger = {
capital_province ?= {
geographical_region = world_africa_west
}
NOT = { root.faith.religion = religion:west_african_religion }
}
religion:west_african_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # West African paganism
trigger = {
capital_province ?= {
geographical_region = world_africa_west
}
NOT = { root.faith.religion = religion:west_african_bori_religion }
}
religion:west_african_bori_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # West African paganism
trigger = {
capital_province ?= {
geographical_region = world_africa_west
}
NOT = { root.faith.religion = religion:west_african_orisha_religion }
}
religion:west_african_orisha_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1000 = { # West African paganism
trigger = {
capital_province ?= {
geographical_region = world_africa_west
}
NOT = { root.faith.religion = religion:west_african_roog_religion }
}
religion:west_african_roog_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
1 = { # Generic Paganism, fallback
trigger = {
NOT = { root.faith.religion = religion:paganism_religion }
}
religion:paganism_religion = {
random_faith = {
save_scope_as = faith_to_blame
}
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,712 @@
#Effects relating to religions
# check_for_equal_doctrine_effect
# set_bhakti_effect
# Used to set Equal Law when the Equal Faith Doctrine is gained
check_for_equal_doctrine_effect = {
if = {
limit = {
is_playable_character = yes
faith = {
has_doctrine = doctrine_gender_equal
}
scope:old_faith = {
NOT = { has_doctrine = doctrine_gender_equal }
}
NOT = {
has_realm_law = equal_law
}
}
add_realm_law_skip_effects = equal_law
}
}
# Used to set a Hindu's personal god.
set_bhakti_effect = {
# Remove any previous personal god relation.
## HINDUISM
if = {
limit = { religion = religion:hinduism_religion }
if = {
limit = {
has_character_modifier = bhakti_hinduism_ganga
}
remove_character_modifier = bhakti_hinduism_ganga
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_hinduism_saraswati
}
remove_character_modifier = bhakti_hinduism_saraswati
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_hinduism_kali
}
remove_character_modifier = bhakti_hinduism_kali
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_hinduism_kubera
}
remove_character_modifier = bhakti_hinduism_kubera
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_vaishnavism_lakishmi
}
remove_character_modifier = bhakti_vaishnavism_lakishmi
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_vaishnavism_jagganath
}
remove_character_modifier = bhakti_vaishnavism_jagganath
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_vaishnavism_jagganath
}
remove_character_modifier = bhakti_vaishnavism_jagganath
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_vaishnavism_hayagriva
}
remove_character_modifier = bhakti_vaishnavism_hayagriva
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_shaivism_parvati
}
remove_character_modifier = bhakti_shaivism_parvati
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_shaivism_virabhadra
}
remove_character_modifier = bhakti_shaivism_virabhadra
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_shaivism_munishwarar
}
remove_character_modifier = bhakti_shaivism_munishwarar
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_shaivism_dakshinamoorthy
}
remove_character_modifier = bhakti_shaivism_dakshinamoorthy
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_smartism_ganesha
}
remove_character_modifier = bhakti_smartism_ganesha
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_smartism_vishnu
}
remove_character_modifier = bhakti_smartism_vishnu
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_smartism_shiva
}
remove_character_modifier = bhakti_smartism_shiva
add_piety = massive_piety_loss
}
}
# GERMANIC
else_if = {
limit = { religion = religion:germanic_religion }
if = {
limit = {
has_character_modifier = bhakti_germanic_generic_odin
}
remove_character_modifier = bhakti_germanic_generic_odin
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_germanic_not_danish_ullr
}
remove_character_modifier = bhakti_germanic_not_danish_ullr
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_germanic_danish_tyr
}
remove_character_modifier = bhakti_germanic_danish_tyr
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_germanic_generic_thor
}
remove_character_modifier = bhakti_germanic_generic_thor
add_piety = massive_piety_loss
}
else_if = {
limit = {
has_character_modifier = bhakti_germanic_generic_freyr
}
remove_character_modifier = bhakti_germanic_generic_freyr
add_piety = massive_piety_loss
}
}
else = {
# If no current bhakti, cost is reduced.
add_piety = medium_piety_loss
}
add_character_modifier = $BHAKTI$
}
create_head_of_faith_title_effect = {
# Pay costs
if = {
limit = {
faith = {
has_doctrine_parameter = temporal_head_of_faith
OR = {
has_doctrine = muhammad_succession_sunni_doctrine
has_doctrine = muhammad_succession_shia_doctrine
}
}
}
if = { # Very expensive for non-sayyid to become a Caliph.
limit = { NOT = { has_trait = sayyid } }
add_piety = massive_piety_loss
}
# Free otherwise
}
else_if = {
limit = { faith = { has_doctrine_parameter = temporal_head_of_faith } }
add_piety = major_piety_loss
}
else = { remove_short_term_gold = medium_gold_max_value }
# (Re)create the HoF title
custom_description_no_bullet = {
text = create_temporal_head_of_faith
subject = root
object = scope:faith
# Temporal HoF
if = {
limit = { faith = { has_doctrine_parameter = temporal_head_of_faith } }
if = {
limit = {
faith = {
NOT = { exists = religious_head_title }
}
}
trigger_event = faith_creation.0001 # Creates new dynamic title
}
else = { trigger_event = faith_creation.0011 } # Re-uses existing title.
}
# Spiritual HoF
else_if = {
limit = { faith = { has_doctrine_parameter = spiritual_head_of_faith } }
if = {
limit = {
faith = {
NOT = { exists = religious_head_title }
}
}
trigger_event = faith_creation.0002 # Creates new dynamic title
}
else = { trigger_event = faith_creation.0012 } # Re-uses existing title.
}
}
# Send an informative message to all players about the new HoF
hidden_effect = {
save_scope_as = reformer
faith = {
save_scope_as = faith
change_fervor = {
value = major_fervor_gain
desc = fervor_gain_recreated_hof
}
}
every_player = {
if = {
limit = { faith = scope:faith }
trigger_event = {
id = faith_creation.1010
days = 1
}
}
else = {
trigger_event = {
id = faith_creation.1011
days = 1
}
}
}
}
}
force_create_head_of_faith_title_Effect = { # Has no cost, should be done manually on a per-case basis
custom_description_no_bullet = {
text = create_temporal_head_of_faith
subject = root
object = scope:faith
# Temporal HoF
if = {
limit = { faith = { has_doctrine_parameter = temporal_head_of_faith } }
trigger_event = faith_creation.0001
}
# Spiritual HoF
else_if = {
limit = { faith = { has_doctrine_parameter = spiritual_head_of_faith } }
trigger_event = faith_creation.0002
}
}
}
# Dynamic HoF title creation
set_up_dynamic_temporal_hof_title_effect = {
faith = { save_scope_as = my_faith }
create_dynamic_title = {
tier = duchy
name = REL_HEAD_TITLE_NAME
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
scope:new_title = {
set_destroy_if_invalid_heir = yes
set_no_automatic_claims = yes
set_definitive_form = yes
set_always_follows_primary_heir = yes
change_title_holder = {
holder = $NEW_HOLDER$
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
faith = { set_religious_head_title = scope:new_title }
if = {
limit = {
NOT = { has_realm_law = same_faith_succession_law }
}
add_realm_law_skip_effects = same_faith_succession_law
}
scope:new_title = {
generate_coa = religious_title
add_title_law = temporal_head_of_faith_succession_law
}
}
set_up_dynamic_spiritual_hof_title_effect = {
# Sort scopes & starting processes.
faith = { save_scope_as = my_faith }
create_dynamic_title = {
tier = duchy
name = REL_HEAD_TITLE_NAME
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
# Nab a suitable character.
if = {
limit = {
any_theocratic_vassal = { faith = $CREATOR$.faith }
}
ordered_theocratic_vassal = {
limit = { faith = $CREATOR$.faith }
order_by = head_of_faith_selection_weight
save_scope_as = new_religious_head
}
}
else = {
create_character = {
location = $CREATOR$.capital_province
age = { 30 50 }
gender_female_chance = root_faith_clergy_gender_female_chance
trait = education_learning_4
faith = $CREATOR$.faith
culture = $CREATOR$.culture
learning = { 14 22 }
save_scope_as = new_religious_head
}
}
# Try to land the new title.
scope:my_faith = {
random_holy_site = {
# Prefer a capital that's under $CREATOR$.
limit = { county.holder = $CREATOR$ }
# Even if it's indirectly under $CREATOR$.
alternative_limit = {
county.holder = { target_is_liege_or_above = $CREATOR$ }
}
# Then go for any that's held by someone of the faith.
alternative_limit = { county.holder.faith = $CREATOR$.faith }
# Under *extreme* circumstances, pick any holy site with at least some faithful.
alternative_limit = { county.faith = $CREATOR$.faith }
# Ok, just pick any of them. We're out of options and we need _somewhere_.
alternative_limit = { always = yes }
save_scope_as = holy_site
}
}
if = {
limit = { exists = scope:holy_site }
scope:new_title = { set_capital_county = scope:holy_site.county }
}
# Configure final effects.
hidden_effect = {
scope:new_title = {
set_landless_title = yes
set_destroy_if_invalid_heir = yes
set_no_automatic_claims = yes
set_definitive_form = yes
set_always_follows_primary_heir = yes
change_title_holder = {
holder = scope:new_religious_head
change = scope:change
}
}
}
resolve_title_and_vassal_change = scope:change
faith = { set_religious_head_title = scope:new_title }
scope:new_title = { generate_coa = religious_title }
# We enclose the law safeguard in an if statement to prevent errors when this is only _about_ to be fired.
hidden_effect = {
if = {
limit = { exists = scope:new_religious_head }
scope:new_religious_head = {
if = {
limit = {
NOT = { has_realm_law = same_faith_theocratic_succession_law }
}
add_realm_law_skip_effects = same_faith_theocratic_succession_law
}
}
}
}
}
# Excommunication management.
add_excommunication_tooltip_only_effect = {
show_as_tooltip = {
add_trait_force_tooltip = excommunicated
add_character_modifier = { # Minor negative modifier that stops us from immediately getting our excommunication recinded (so you have a guaranteed 'penance period').
modifier = recent_excommunication
days = 365
}
}
}
add_excommunication_actual_effect = {
add_trait = excommunicated
add_character_modifier = { # Minor negative modifier that stops us from immediately getting our excommunication recinded (so you have a guaranteed 'penance period').
modifier = recent_excommunication
days = 365
}
}
add_excommunication_actual_effect_5_years_version = {
add_trait = excommunicated
add_character_modifier = { # Minor negative modifier that stops us from immediately getting our excommunication recinded (so you have a guaranteed 'penance period').
modifier = recent_excommunication
years = 5
}
}
create_holy_order_neutral_effect = {
# Create a general holy order.
create_holy_order = {
leader = $LEADER$
capital = $CAPITAL$
save_scope_as = $NEW_HO_SCOPE$
}
# Struggle Catalysts.
$FOUNDER$ = {
if = {
limit = {
any_character_struggle = {
involvement = involved
phase_has_catalyst = catalyst_creating_a_holy_order
}
}
every_character_struggle = {
involvement = involved
limit = { phase_has_catalyst = catalyst_creating_a_holy_order }
activate_struggle_catalyst = {
catalyst = catalyst_creating_a_holy_order
character = $FOUNDER$
}
}
}
}
}
# Get random faith
get_random_faith_effect = {
if = {
limit = { $FORBIDROOTFAITH$ = yes }
random_religion_global = {
limit = { any_faith = { this != root.faith } }
random_faith = {
limit = { this != root.faith }
save_scope_as = random_faith
}
}
}
else = {
random_religion_global = {
random_faith = { save_scope_as = random_faith }
}
}
}
set_up_dynamic_spiritual_hof_title_existing_hof_effect = {
$RELIGIOUS_HEAD$ = { save_scope_as = new_religious_head }
# Sort scopes & starting processes.
faith = { save_scope_as = my_faith }
create_dynamic_title = {
tier = duchy
name = REL_HEAD_TITLE_NAME
}
create_title_and_vassal_change = {
type = created
save_scope_as = change
add_claim_on_loss = no
}
# Nab a suitable character.
# The decision already chose one.
# Try to land the new title.
scope:my_faith = {
random_holy_site = {
limit = { county.holder = $CREATOR$ }
alternative_limit = {
county.holder = { target_is_liege_or_above = $CREATOR$ }
}
alternative_limit = {
county.holder = {
faith = $CREATOR$.faith
is_ai = yes
}
}
save_scope_as = holy_site
}
}
if = {
limit = { exists = scope:holy_site }
scope:new_title = { set_capital_county = scope:holy_site.county }
}
# Configure final effects.
hidden_effect = {
scope:new_title = {
set_landless_title = yes
set_destroy_if_invalid_heir = yes
set_no_automatic_claims = yes
set_definitive_form = yes
set_always_follows_primary_heir = yes
change_title_holder = {
holder = scope:new_religious_head
change = scope:change
}
}
}
resolve_title_and_vassal_change = scope:change
faith = { set_religious_head_title = scope:new_title }
scope:new_title = { generate_coa = religious_title }
# We enclose the law safeguard in an if statement to prevent errors when this is only _about_ to be fired.
hidden_effect = {
if = {
limit = { exists = scope:new_religious_head }
scope:new_religious_head = {
if = {
limit = {
NOT = { has_realm_law = same_faith_theocratic_succession_law }
}
add_realm_law_skip_effects = same_faith_theocratic_succession_law
}
}
}
}
}
### SECRET FAITH ###
# Openly convert
secret_faith_openly_convert_character = {
if = {
limit = { exists = secret_faith }
set_character_faith_with_conversion = secret_faith # Gets vassals too, if they like you enough
remove_character_secret_faith = yes
}
}
# Openly convert all secret faith counties in your realm
secret_faith_openly_convert_all_in_realm = {
if = {
limit = { any_sub_realm_county = { has_variable = false_convert } }
save_scope_value_as = { # Keeping track how many counties convert
name = num_false_converts_counties
value = 0
}
every_sub_realm_county = {
limit = { has_variable = false_convert }
set_county_faith = var:false_convert # Convert them
remove_county_modifier = false_convert_modifier # Remove modifier too
remove_variable = false_convert # No longer mark them as converts
add_county_modifier = { # Everyone likes practicing their faith in the open!
modifier = relieved_cryptos_modifier
years = 25
}
save_scope_value_as = { # Updating how many counties convert
name = num_false_converts_counties
value = {
value = scope:num_false_converts_counties
add = 1
}
}
}
if = { # Include counties in the message if there are any
limit = { scope:num_false_converts_counties > 0 }
root = { # There is an edgecase where root has a link to realm, but is not a character themselves!
send_interface_message = {
type = event_religious_good_text
title = event_false_converts.t
desc = event_false_converts_plus_counties.desc
}
}
}
}
}
# Openly convert all secret faith counties of your faith in your realm
secret_faith_openly_convert_all_in_realm_specific = {
if = {
limit = {
any_sub_realm_county = {
has_variable = false_convert
var:false_convert = root.faith
faith != root.faith # Discount them if they've already been switched by the conversion action.
}
}
save_scope_value_as = { # Keeping track how many counties convert
name = num_false_converts_counties
value = 0
}
every_sub_realm_county = {
limit = {
has_variable = false_convert
var:false_convert = root.faith
faith != root.faith # Discount them if they've already been switched by the conversion action.
}
set_county_faith = var:false_convert # Change faith
remove_county_modifier = false_convert_modifier
remove_variable = false_convert # Cleanup
add_county_modifier = { # Everyone likes practicing their faith in the open!
modifier = relieved_cryptos_modifier
years = 25
}
save_scope_value_as = { # Updating how many counties convert
name = num_false_converts_counties
value = {
value = scope:num_false_converts_counties
add = 1
}
}
}
if = { # Include counties in the message if there are any
limit = { scope:num_false_converts_counties > 0 }
root = {
send_interface_message = {
type = event_religious_good_text
title = event_false_converts.t
desc = event_false_converts_plus_counties.desc
}
}
}
}
}
add_heresiarch_trait_effect = { # Flag is need to prevent trait being removed when gaining it close to conversion
add_character_flag = {
flag = new_heresiarch
days = 3
}
if = {
limit = {
NOT = { has_trait = heresiarch }
}
add_trait = heresiarch
}
}
self_mutilation_minor_piety_gain_effect = {
if = {
limit = {
faith = { has_doctrine_parameter = self_mutilation_active }
}
custom_tooltip = {
text = self_mutilation_minor_piety_gain_tt
add_piety = minor_piety_gain
}
}
}
self_mutilation_medium_piety_gain_effect = {
if = {
limit = {
faith = { has_doctrine_parameter = self_mutilation_active }
}
custom_tooltip = {
text = self_mutilation_medium_piety_gain_tt
add_piety = medium_piety_gain
}
}
}
self_mutilation_major_piety_gain_effect = {
if = {
limit = {
faith = { has_doctrine_parameter = self_mutilation_active }
}
custom_tooltip = {
text = self_mutilation_major_piety_gain_tt
add_piety = major_piety_gain
}
}
}

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more