N3OW/common/scripted_triggers/00_councillor_triggers.txt
2026-10-09 16:36:59 -03:00

1533 lines
37 KiB
Text

###TRIGGER LIST
# councillor_loyalty_trigger
#Spouse councillor:
#
#TRIGGERS
can_be_councillor_basics_trigger = {
is_available_quick = {
adult = yes
incapable = no
imprisoned = no
}
is_at_war_with_liege = no
trigger_if = {
limit = { has_variable = block_hire_councillor }
NOT = { var:block_hire_councillor = liege }
}
custom_tooltip = {
text = not_travel_option_character
NOT = { has_character_flag = travel_option_added_character }
}
}
can_be_councillor_gender_trigger = {
OR = {
is_ruler = yes
has_variable = can_be_councillor_override
AND = {
is_female = yes
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } }
}
}
AND = {
is_female = yes
$COURT_OWNER$ = {
has_personal_tenet_flag = tenet_hyperdulia_women_can_be_councillors
}
}
AND = {
is_male = yes
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } }
}
}
}
}
can_be_chancellor_trigger = {
can_be_councillor_basics_trigger = yes
$COURT_OWNER$ ?= {
NOT = { government_has_flag = government_is_nomadic }
}
NAND = {
has_council_position = councillor_court_chaplain
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
AND = {
this = liege.diarch
liege = { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
can_be_councillor_gender_trigger = { COURT_OWNER = $COURT_OWNER$ }
}
can_be_steward_trigger = {
can_be_councillor_basics_trigger = yes
$COURT_OWNER$ ?= {
NOT = { government_has_flag = government_is_nomadic }
}
NAND = {
has_council_position = councillor_court_chaplain
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
AND = {
this = liege.diarch
liege = { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
can_be_councillor_gender_trigger = { COURT_OWNER = $COURT_OWNER$ }
}
can_be_marshal_trigger = {
can_be_councillor_basics_trigger = yes
$COURT_OWNER$ ?= {
NOT = { government_has_flag = government_is_nomadic }
}
is_hostage = no
NAND = {
has_council_position = councillor_court_chaplain
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
AND = {
this = liege.diarch
liege = { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
OR = {
can_be_councillor_gender_trigger = { COURT_OWNER = $COURT_OWNER$ }
AND = {
has_trait = shieldmaiden
$COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens }
}
}
}
can_be_spymaster_trigger = {
can_be_councillor_basics_trigger = yes
NAND = {
has_council_position = councillor_court_chaplain
rite ?= { rite_has_parameter = clerical_appointment_fixed }
}
NOR = {
has_council_position = councillor_spouse
AND = {
this = liege.diarch
liege = { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
exists = $COURT_OWNER$ #so we can have the argument but get no errors
}
can_be_court_chaplain_trigger = {
save_temporary_scope_as = court_chaplain_check
can_be_councillor_basics_trigger = yes
$COURT_OWNER$ ?= {
NOT = { government_has_flag = government_is_nomadic }
}
NOR = {
has_council_position = councillor_spouse
AND = {
this = liege.diarch
liege = { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { rite_has_allowed_gender_for_clergy = scope:court_chaplain_check }
}
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
rite = $COURT_OWNER$.rite
}
trigger_if = {
limit = {
rite ?= { rite_has_doctrine = doctrine_theocracy_temporal }
}
OR = {
is_ruler = no
government_has_flag = government_is_theocracy
}
}
trigger_if = {
limit = {
exists = var:escaped_imprisonment_from
}
NOT = { var:escaped_imprisonment_from = $COURT_OWNER$ }
}
trigger_if = { # An excommunicated ruler tolerate excommunicated bishops
limit = {
$COURT_OWNER$ ?= { NOT = { has_trait = excommunicated } }
}
NOT = { has_trait = excommunicated }
}
trigger_if = { # Married characters are excluded if the doctrine is not there
limit = {
rite ?= {
NOT = { rite_has_parameter = clergy_can_marry }
}
}
is_married = no
}
}
# Shared with the chaplain position's can_fire, can_reassign and can_change_once
can_appoint_own_court_chaplain_trigger = {
OR = {
religious_head_or_challenger ?= this # The appointment authority itself has no one to request a chaplain from
rite ?= {
NOT = { rite_has_parameter = clerical_appointment_fixed }
}
tgp_has_access_to_ministry_trigger = yes
}
}
# Whether this character is a suitable landed Realm Priest for $COURT_OWNER$.
can_be_landed_realm_priest_trigger = {
is_vassal_of = $COURT_OWNER$ # liege resolves to self for independent rulers, so don't compare lieges here
is_physically_able_adult = yes
government_has_flag = government_is_theocracy
rite = $COURT_OWNER$.rite
can_be_court_chaplain_trigger = { COURT_OWNER = $COURT_OWNER$ }
}
court_chaplain_endorse_override_trigger = {
trigger_if = {
limit = { exists = scope:ruler }
OR = {
scope:ruler = { has_strong_hook = scope:lessee }
puppeteer ?= scope:ruler
}
}
trigger_else = {
liege = { has_strong_hook = prev }
puppeteer ?= liege
}
}
can_be_spouse_councillor_trigger = {
save_temporary_scope_as = spouse_councillor_check
can_be_councillor_basics_trigger = yes
#NOT = { # We allow spouses to both be regents and do their spouse job
# this = liege.diarch
#}
trigger_if = {
limit = { is_ruler = yes }
liege ?= $COUNCIL_OWNER$
$COUNCIL_OWNER$ = { primary_spouse = scope:spouse_councillor_check }
}
trigger_else = {
$COUNCIL_OWNER$ ?= { primary_spouse = scope:spouse_councillor_check }
}
}
can_be_vizier_councillor_trigger = {
can_be_councillor_basics_trigger = yes
save_temporary_scope_as = confidant
$COUNCIL_OWNER$ = {
OR = {
scope:confidant = diarch
any_consort = {
scope:confidant = this
}
}
}
}
can_be_kurultai_trigger = {
can_be_councillor_basics_trigger = yes
exists = $COURT_OWNER$
NOT = { government_has_flag = government_is_herder }
NOR = {
has_council_position = councillor_spouse
has_court_position = court_astrologer_court_position
AND = {
this = $COURT_OWNER$.diarch
$COURT_OWNER$ ?= { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
NOR = {
has_council_position = $CP1$
has_council_position = $CP2$
has_council_position = $CP3$
}
OR = {
is_landed = yes
is_knight_of = $COURT_OWNER$
is_courtier_of = $COURT_OWNER$
is_ruler = yes
is_powerful_vassal = yes
}
OR = {
is_ruler = yes
AND = {
is_female = yes
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } }
}
}
AND = {
is_male = yes
exists = $COURT_OWNER$.rite
trigger_if = {
limit = { exists = $COURT_OWNER$.rite }
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } }
}
}
AND = {
has_trait = shieldmaiden
$COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens }
}
}
}
can_be_any_kurultai_trigger = {
can_be_councillor_basics_trigger = yes
$COURT_OWNER$ ?= {
OR = {
has_council_position = councillor_kurultai_1
has_council_position = councillor_kurultai_2
has_council_position = councillor_kurultai_3
has_council_position = councillor_kurultai_4
}
}
NOR = {
has_council_position = councillor_spouse
AND = {
this = $COURT_OWNER$.diarch
$COURT_OWNER$ ?= { has_diarchy_active_parameter = diarchy_is_vizierate }
}
}
NOR = {
has_council_position = councillor_kurultai_1
has_council_position = councillor_kurultai_2
has_council_position = councillor_kurultai_3
has_council_position = councillor_kurultai_4
}
OR = {
is_landed = yes
is_knight_of = $COURT_OWNER$
is_courtier_of = $COURT_OWNER$
is_ruler = yes
is_powerful_vassal = yes
}
OR = {
is_ruler = yes
AND = {
is_female = yes
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } }
}
AND = {
is_male = yes
$COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } }
}
AND = {
has_trait = shieldmaiden
$COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens }
}
}
}
is_kurultai_trigger = {
OR = {
has_council_position = councillor_kurultai_1
has_council_position = councillor_kurultai_2
has_council_position = councillor_kurultai_3
has_council_position = councillor_kurultai_4
}
}
has_any_kurultai_trigger = {
OR = {
exists = cp:councillor_kurultai_1
exists = cp:councillor_kurultai_2
exists = cp:councillor_kurultai_3
exists = cp:councillor_kurultai_4
}
}
councillor_loyalty_trigger = {
weighted_calc_true_if = {
amount >= 50
20 = {
NOT = { has_trait = ambitious }
}
20 = {
opinion = {
target = liege
value > 0
}
}
20 = {
opinion = {
target = liege
value > 20
}
}
20 = {
opinion = {
target = liege
value > 40
}
}
20 = {
opinion = {
target = liege
value > 60
}
}
}
}
councillor_spouse_can_fire = { always = no }
councillor_spouse_can_reassign = { always = no }
councillor_spouse_valid_position = {
AND = {
NOT = {
has_diarchy_type = vizierate
}
any_spouse = {
OR = {
court_owner = root
AND = {
is_ruler = yes
liege ?= root
}
}
}
}
NOT = { government_has_flag = government_is_landless_adventurer }
# Celestial hegemons have access to the ministry instead, so no spouse
tgp_has_access_to_ministry_trigger = no
}
councillor_vizier_can_fire = { always = yes }
councillor_vizier_can_reassign = { always = yes }
############################
#SPOUSE COUNCILLOR TRIGGERS#
############################
valid_spouse_councillor_trigger = {
scope:councillor = { is_available = yes }
cp:councillor_spouse ?= scope:councillor
}
is_blocked_from_being_fired_from_council_trigger = {
custom_description = {
text = "is_blocked_from_being_fired_from_council"
subject = this
object = $COURT_OWNER$
OR = {
# Check in code if the court owner is prevented from firing the councilor
# can_fire_position must take a council task as input, but checks the councilor behind the task.
council_task ?= { can_fire_position = no }
# Check for variable preventing the firing of a councilor set by script
var:block_fire_councillor ?= $COURT_OWNER$
}
}
}
can_be_fired_from_council_trigger = {
NOT = {
is_blocked_from_being_fired_from_council_trigger = { COURT_OWNER = $COURT_OWNER$ }
}
trigger_if = {
limit = {
has_council_position = councillor_court_chaplain
liege = { tgp_has_access_to_ministry_trigger = no }
}
rite ?= {
OR = {
rite_has_doctrine = doctrine_clerical_succession_temporal_appointment
rite_has_doctrine = doctrine_clerical_succession_spiritual_appointment
}
}
}
}
#Faith/culture triggers
same_faith_or_culture_as_councillor_trigger = {
OR = {
culture = scope:councillor.culture
faith = scope:councillor.faith
}
}
different_faith_and_or_culture_from_councillor_trigger = {
OR = {
culture != scope:councillor.culture
faith != scope:councillor.faith
}
}
character_same_faith_as_councillor_but_different_from_root_trigger = {
faith = scope:councillor.faith
faith != root.faith
}
character_same_culture_as_councillor_but_different_from_root_trigger = {
culture = scope:councillor.culture
culture != root.culture
}
character_same_faith_or_culture_as_councillor_but_different_from_root_trigger = {
OR = {
character_same_faith_as_councillor_but_different_from_root_trigger = yes
character_same_culture_as_councillor_but_different_from_root_trigger = yes
}
}
character_different_culture_than_councillor_and_root_trigger = {
NOR = {
culture = scope:councillor.culture
culture = root.culture
}
}
character_different_faith_than_councillor_and_root_trigger = {
NOR = {
faith = scope:councillor.faith
faith = root.faith
}
}
character_different_faith_or_culture_than_councillor_and_root_trigger = {
OR = {
character_different_culture_than_councillor_and_root_trigger = yes
character_different_faith_than_councillor_and_root_trigger = yes
}
}
province_same_faith_or_culture_as_councillor_but_different_from_root_trigger = {
OR = {
AND = {
culture = scope:councillor.culture
culture != root.culture
}
AND = {
faith = scope:councillor.faith
faith != root.faith
}
}
}
#End of faith/culture triggers
#Councillor Spouse threshold triggers
#Intrigue
spouse_intrigue_tier_1_trigger = {
scope:councillor = {
OR = {
has_character_modifier = councillor_spouse_intrigue_2_modifier
has_character_modifier = councillor_spouse_intrigue_1_modifier
has_trait = schemer
intrigue >= spouse_skill_rating_1
is_performing_council_task = task_court_intrigue
}
}
}
spouse_intrigue_tier_2_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 30
}
OR = {
has_character_modifier = councillor_spouse_intrigue_2_modifier
has_trait = schemer
intrigue >= spouse_skill_rating_3
AND = {
is_performing_council_task = task_court_intrigue
OR = {
intrigue >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_intrigue_2_modifier
has_character_modifier = councillor_spouse_intrigue_1_modifier
has_trait = schemer
}
}
}
}
}
spouse_intrigue_tier_3_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 50
}
OR = {
has_trait = schemer
intrigue >= spouse_skill_rating_4
AND = {
is_performing_council_task = task_court_intrigue
OR = {
intrigue >= high_skill_rating
has_character_modifier = councillor_spouse_intrigue_2_modifier
has_trait = schemer
}
}
}
}
}
#Diplomacy
spouse_diplomacy_tier_1_trigger = {
scope:councillor = {
OR = {
has_character_modifier = councillor_spouse_diplomacy_2_modifier
has_character_modifier = councillor_spouse_diplomacy_1_modifier
has_trait = diplomat
diplomacy >= spouse_skill_rating_1
is_performing_council_task = task_court_politics
}
}
}
spouse_diplomacy_tier_2_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 30
}
OR = {
has_character_modifier = councillor_spouse_diplomacy_2_modifier
has_trait = diplomat
diplomacy >= spouse_skill_rating_3
AND = {
is_performing_council_task = task_court_politics
OR = {
diplomacy >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_diplomacy_2_modifier
has_character_modifier = councillor_spouse_diplomacy_1_modifier
has_trait = diplomat
}
}
}
}
}
spouse_diplomacy_tier_3_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 50
}
OR = {
has_trait = diplomat
diplomacy >= spouse_skill_rating_4
AND = {
is_performing_council_task = task_court_politics
OR = {
diplomacy >= spouse_skill_rating_2
has_trait = diplomat
has_character_modifier = councillor_spouse_diplomacy_2_modifier
}
}
}
}
}
#Martial
spouse_martial_tier_1_trigger = {
scope:councillor = {
OR = {
has_character_modifier = councillor_spouse_martial_2_modifier
has_character_modifier = councillor_spouse_martial_1_modifier
has_trait = strategist
martial >= spouse_skill_rating_1
is_performing_council_task = task_chivalry
}
}
}
spouse_martial_tier_2_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 30
}
OR = {
has_character_modifier = councillor_spouse_martial_2_modifier
has_trait = strategist
martial >= spouse_skill_rating_3
AND = {
is_performing_council_task = task_chivalry
OR = {
martial >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_martial_2_modifier
has_character_modifier = councillor_spouse_martial_1_modifier
has_trait = strategist
}
}
}
}
}
spouse_martial_tier_3_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 50
}
OR = {
has_trait = strategist
martial >= spouse_skill_rating_4
AND = {
is_performing_council_task = task_chivalry
OR = {
martial >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_martial_2_modifier
has_trait = strategist
}
}
}
}
}
#Stewardship
spouse_stewardship_tier_1_trigger = {
scope:councillor = {
OR = {
has_character_modifier = councillor_spouse_stewardship_2_modifier
has_character_modifier = councillor_spouse_stewardship_1_modifier
has_trait = architect
stewardship >= spouse_skill_rating_1
is_performing_council_task = task_manage_domain
}
}
}
spouse_stewardship_tier_2_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 30
}
OR = {
has_character_modifier = councillor_spouse_stewardship_2_modifier
has_trait = architect
stewardship >= spouse_skill_rating_3
AND = {
is_performing_council_task = task_manage_domain
OR = {
stewardship >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_stewardship_2_modifier
has_character_modifier = councillor_spouse_stewardship_1_modifier
has_trait = architect
}
}
}
}
}
spouse_stewardship_tier_3_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 50
}
OR = {
has_trait = architect
stewardship >= spouse_skill_rating_4
AND = {
is_performing_council_task = task_manage_domain
OR = {
stewardship >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_stewardship_2_modifier
has_trait = architect
}
}
}
}
}
#Learning
spouse_learning_tier_1_trigger = {
scope:councillor = {
OR = {
has_character_modifier = councillor_spouse_learning_2_modifier
has_character_modifier = councillor_spouse_learning_1_modifier
has_trait = erudite
learning >= spouse_skill_rating_1
is_performing_council_task = task_patronage
}
}
}
spouse_learning_tier_2_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 30
}
OR = {
has_character_modifier = councillor_spouse_learning_2_modifier
has_trait = erudite
learning >= spouse_skill_rating_3
AND = {
is_performing_council_task = task_patronage
OR = {
learning >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_learning_2_modifier
has_character_modifier = councillor_spouse_learning_1_modifier
has_trait = erudite
}
}
}
}
}
spouse_learning_tier_3_trigger = {
scope:councillor = {
opinion = {
target = liege
value > 50
}
OR = {
has_trait = erudite
learning >= spouse_skill_rating_4
AND = {
is_performing_council_task = task_patronage
OR = {
learning >= spouse_skill_rating_2
has_character_modifier = councillor_spouse_learning_2_modifier
has_trait = erudite
}
}
}
}
}
# Court Espionage task triggers
spymaster_task_find_secrets_interesting_secret_type_trigger = {
save_temporary_scope_as = suitable_secret
trigger_if = {
limit = {
secret_type = secret_disputed_heritage
exists = secret_target
}
NOT = { secret_target = { has_trait = legitimized_bastard } }
}
OR = {
secret_is_always_interesting_trigger = yes
is_blackmailable_secret_trigger = { BLACKMAILER = scope:councillor_liege PARTICIPANT = scope:suitable_secret.secret_owner }
}
}
spymaster_task_find_secrets_block_spymaster_self_reveal_trigger = {
# Spymaster should not reveal secrets targeting themselves unless it is a murder attempt
trigger_if = {
limit = {
exists = secret_target
NOT = { secret_type = secret_murder_attempt }
}
secret_target != scope:councillor
}
# If the spymaster is the father of a secret bastard, don't reveal that
trigger_if = {
limit = {
OR = {
secret_type = secret_disputed_heritage
secret_type = secret_unmarried_illegitimate_child
}
exists = secret_target.real_father
}
secret_target.real_father != scope:councillor
}
}
spymaster_task_find_secrets_suitable_minor_secret_trigger = {
OR = {
is_shunned_for = secret_owner
AND = {
NOT = {
is_blackmailable_secret_trigger = {
PARTICIPANT = secret_owner
BLACKMAILER = scope:councillor_liege
}
}
secret_is_always_interesting_trigger = yes
}
}
NOT = { is_known_by = scope:councillor_liege }
spymaster_task_find_secrets_block_spymaster_self_reveal_trigger = yes
NOT = {
any_secret_participant = {
OR = {
this = scope:councillor
this = scope:councillor_liege
}
}
}
spymaster_task_find_secrets_interesting_secret_type_trigger = yes
}
spymaster_task_find_secrets_suitable_major_secret_trigger = {
is_criminal_for = secret_owner
NOT = { is_known_by = scope:councillor_liege }
spymaster_task_find_secrets_block_spymaster_self_reveal_trigger = yes
NOT = {
any_secret_participant = {
OR = {
this = scope:councillor
this = scope:councillor_liege
}
}
}
spymaster_task_find_secrets_interesting_secret_type_trigger = yes
}
spymaster_task_find_secrets_court_has_minor_secrets_trigger = {
OR = {
AND = {
has_any_secrets = yes
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
any_vassal = {
has_any_secrets = yes
this != scope:councillor_liege
this != scope:councillor
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
any_courtier_or_guest = {
has_any_secrets = yes
this != scope:councillor_liege
this != scope:councillor
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
}
}
spymaster_task_find_secrets_court_has_major_secrets_trigger = {
OR = {
AND = {
has_any_secrets = yes
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
any_vassal = {
has_any_secrets = yes
this != scope:councillor_liege
this != scope:councillor
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
any_courtier_or_guest = {
has_any_secrets = yes
this != scope:councillor_liege
this != scope:councillor
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
}
}
spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = {
scope:councillor_liege = {
save_temporary_scope_as = me
}
scope:secret_holder ?= {
OR = {
is_ruler = yes
is_close_or_extended_family_of = scope:me
is_courtier_of = scope:me
has_relation_rival = scope:me
has_relation_lover = scope:me
is_player_heir_of = scope:me
}
}
}
spymaster_find_secrets_secret_target_is_interesting_to_me_trigger = {
scope:councillor_liege = {
save_temporary_scope_as = me
}
trigger_if = {
limit = {
exists = secret_target
}
secret_target = {
OR = {
is_close_or_extended_family_of = scope:me
is_courtier_of = scope:me
has_relation_rival = scope:me
has_relation_lover = scope:me
is_player_heir_of = scope:me
}
}
}
trigger_else = {
always = no
}
}
# Event triggers
# Defined here because they need to be used in event + council task desc
marshal_task_1101_county_trigger = {
holder = root
NOT = {
has_county_modifier = marshal_task_organized_service_modifier
}
}
marshal_task_1102_county_trigger = {
NOT = {
has_county_modifier = marshal_task_military_presence_modifier
}
}
marshal_task_1003_county_trigger = {
is_valid_for_county_corruption_trigger = yes
OR = {
NOT = { has_county_modifier = county_corruption_unsafe_highways_modifier }
NOT = { has_county_modifier = county_corruption_thieves_guild_modifier }
NOT = { has_county_modifier = county_corruption_bandits_rampant_modifier }
}
}
steward_task_county_corruption_county_trigger = {
holder = {
OR = {
is_ai = yes
this = root
}
}
}
# expect scope:councillor_liege, scope:councillor
task_conversion_valid_county_trigger = {
is_landless_type_title = no
save_temporary_scope_as = county_check
# Liege rite when the county will convert into the liege's faith
trigger_if = {
limit = {
OR = {
scope:councillor_liege = {
tgp_has_access_to_ministry_trigger = yes
}
faith = scope:councillor_liege.faith
scope:councillor.faith = scope:councillor_liege.faith
}
}
custom_tooltip = {
text = task_conversion.tt.county_rite_already_matches_liege
rite != scope:councillor_liege.rite
}
}
trigger_else = {
custom_tooltip = {
text = task_conversion.tt.county_rite_already_matches_chaplain
rite != scope:councillor.rite
}
}
trigger_if = {
limit = {
scope:councillor_liege = {
is_alive = yes
has_variable = hold_court_8120_religion_block
}
}
custom_tooltip = {
text = hold_court_8120_conversion_tt
faith != scope:councillor_liege.var:hold_court_8120_religion_block
}
}
custom_description = { # Vassal Contract forbids meddling by liege
text = "is_protected_via_contract_self_or_liege"
subject = holder
# don't "protect" same faith in edge cases
trigger_if = {
limit = {
scope:county_check.holder = { is_vassal_or_below_of = scope:councillor_liege }
scope:councillor_liege.faith != scope:county_check.holder.faith
}
holder = {
NOR = {
vassal_contract_has_flag = religiously_protected
any_liege_or_above = {
is_vassal_or_below_of = scope:councillor_liege
vassal_contract_has_flag = religiously_protected
}
}
}
}
}
trigger_if = {
limit = {
var:cannot_be_converted_by_value ?= scope:councillor_liege
}
custom_tooltip = {
text = promised_to_not_convert_county
NOT = {
var:cannot_be_converted_by_value ?= scope:councillor_liege
}
}
}
trigger_if = {
limit = {
scope:councillor_liege = { is_ai = yes }
OR = {
faith = scope:councillor_liege.faith
faith = scope:councillor.faith
}
}
NOT = {
rite ?= { has_variable = pam_rite_grace_period }
}
}
trigger_if = {
limit = { scope:councillor_liege = { is_ai = yes } }
# Unreformed Pagans do not tend to even try conversion of non-unreformed faiths unless zealous
trigger_if = {
limit = {
scope:councillor_liege = {
faith ?= {
has_doctrine_parameter = unreformed
}
}
}
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 50 }
scope:county_check.faith ?= { has_doctrine_parameter = unreformed }
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
is_holy_site_of = scope:councillor_liege.faith
}
}
}
}
}
# Do not convert Righteous faiths, unless disturbingly zealous
trigger_if = {
limit = {
scope:councillor_liege = {
faith ?= {
faith_hostility_level = {
target = scope:county_check.faith
value <= faith_fully_accepted_level
}
}
}
}
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = {
ai_zeal >= 100
ai_rationality <= -50
}
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
is_holy_site_of = scope:councillor_liege.faith
}
}
}
}
}
# Converting Astray faiths only happens during certain circumstances
trigger_if = {
limit = {
scope:councillor_liege = {
faith ?= {
faith_hostility_level = {
target = scope:county_check.faith
value <= faith_astray_level
}
}
}
}
trigger_if = {
limit = {
scope:councillor_liege = {
has_tolerant_faith_or_culture_trigger = yes
}
}
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 100 }
scope:county_check = { county_opinion <= -25 }
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
is_holy_site_of = scope:councillor_liege.faith
}
}
}
}
}
trigger_else_if = {
limit = {
scope:councillor_liege = {
rite ?= { rite_has_doctrine = doctrine_pluralism_fundamentalist }
}
}
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 0 }
scope:county_check = { county_opinion <= -10 }
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
is_holy_site_of = scope:councillor_liege.faith
}
}
}
}
}
trigger_else = {
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 25 }
scope:county_check = { county_opinion <= -15 }
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
is_holy_site_of = scope:councillor_liege.faith
}
}
}
}
}
}
# Ash'ari in Spain tend to not convert Muwhalladi often
trigger_if = {
limit = {
scope:councillor_liege = {
faith = faith:sunni
capital_province ?= { geographical_region = world_europe_west_iberia }
scope:county_check.rite = rite:maliki
}
scope:county_check = {
title_province = { geographical_region = world_europe_west_iberia }
}
}
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 50 }
scope:county_check = { county_opinion <= -20 }
scope:county_check = { # Always convert holy sites
any_county_province = {
barony = {
is_holy_site_of = scope:councillor_liege.faith
}
}
}
}
}
# If a ruler has Jizya tax, they'll only convert the same *religious family* when ai_zeal is really high, they're converting unreformed pagans, counties in a kingdom with a Holy Site, or others of the same religion
trigger_if = {
limit = {
scope:councillor_liege = {
OR = {
rite ?= { rite_has_tenet = tenet_tax_nonbelievers }
faith ?= { has_doctrine = special_doctrine_jizya }
}
}
scope:councillor_liege.faith ?= { faith_is_in_same_rf = { FAITH = scope:county_check.faith } }
}
OR = {
scope:councillor_liege = {
has_character_flag = vassal_directive_convert_faith
vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege }
}
scope:councillor_liege = { ai_zeal >= 50 }
scope:county_check.faith ?= { has_doctrine_parameter = unreformed }
scope:councillor_liege.faith ?= {
any_holy_site_barony = {
kingdom = scope:county_check.kingdom
}
}
#scope:county_check.religion = scope:councillor_liege.religion # Excluded, as tax nonbelievers actually works for different faiths within the same religion
AND = { # Islamic heartlands, to help fend off encroaching faiths
scope:councillor_liege.religion = religion:islam_religion
scope:county_check.title_province = {
geographical_region = islamic_heartlands
}
}
}
}
}
# Struggle phases may sometimes restrict targets for involved characters.
trigger_if = {
# Give an exception for pre-existing conversions: these can take a while and it's not fair to lose years or decades of progress to a phase change.
limit = {
NOT = {
scope:county_check = { is_target_of_council_task = task_conversion }
}
}
NOT = {
scope:councillor_liege = {
custom_tooltip = {
text = task_conversion.tt.forbidden.due_to_struggle_phase
any_character_struggle = {
involvement = involved
is_struggle_parameter_active_secondary_county_trigger = {
PARAMETER = county_conversion_disabled_for_involved_faiths_within_region
COUNTY = scope:county_check
}
}
}
}
}
}
}
councillor_spouse_learning_2603_valid_councillor_trigger = {
is_available_ai_adult = yes
this != scope:councillor
}
councillor_liege_has_erudition_legacy_5_perk = {
scope:councillor_liege.dynasty ?= { has_dynasty_perk = erudition_legacy_5 }
}
councillor_liege_has_customs_legacy_perk = {
scope:councillor_liege.dynasty ?= { has_dynasty_perk = ep1_culture_legacy_2 }
}
councillor_liege_has_family_business_bonus = {
scope:councillor_liege.culture ?= { has_cultural_parameter = close_family_better_councillors }
scope:councillor ?= {
is_close_family_of = scope:councillor_liege
}
}
councillor_liege_has_consulted_house_bonus = {
scope:councillor_liege ?= { has_character_flag = fp3_consulted_house }
scope:councillor.house ?= scope:councillor_liege.house
}
councillor_is_unskilled_trigger = {
trigger_if = {
limit = { $EMPLOYER$.cp:councillor_chancellor ?= this }
diplomacy < mediocre_skill_rating
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_steward ?= this }
stewardship < mediocre_skill_rating
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_marshal ?= this }
martial < mediocre_skill_rating
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_spymaster ?= this }
intrigue < mediocre_skill_rating
}
trigger_else = { learning < mediocre_skill_rating }
}
councillor_is_skilled_trigger = {
trigger_if = {
limit = { $EMPLOYER$.cp:councillor_chancellor ?= this }
diplomacy > decent_skill_rating
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_steward ?= this }
stewardship > decent_skill_rating
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_marshal ?= this }
martial > decent_skill_rating
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_spymaster ?= this }
intrigue > decent_skill_rating
}
trigger_else = { learning > decent_skill_rating }
}
kurultai_is_skilled_trigger = {
trigger_if = {
limit = { $EMPLOYER$.cp:councillor_kurultai_1 ?= this }
OR = {
average_skill_rating >= sum_of_all_skills_threshold_average
has_any_high_skill_rating = yes
}
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_kurultai_2 ?= this }
OR = {
average_skill_rating >= sum_of_all_skills_threshold_average
has_any_high_skill_rating = yes
}
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_kurultai_3 ?= this }
OR = {
average_skill_rating >= sum_of_all_skills_threshold_average
has_any_high_skill_rating = yes
}
}
trigger_else_if = {
limit = { $EMPLOYER$.cp:councillor_kurultai_4 ?= this }
OR = {
average_skill_rating >= sum_of_all_skills_threshold_average
has_any_high_skill_rating = yes
}
}
trigger_else = { intrigue > decent_skill_rating } # Spymaster
}
#FP3 Legacy Track:
councillor_liege_has_khvarenah_legacy_perk = {
exists = scope:councillor_liege.dynasty
scope:councillor_liege.dynasty = { has_dynasty_perk = fp3_khvarenah_legacy_4 }
}
can_be_knight_now_light_trigger = {
is_available_quick = {
ai = yes # Players can't be knights
imprisoned = no
adult = yes
alive = yes
}
}
can_be_trained_as_knight_now_light_trigger = {
can_be_knight_now_light_trigger = yes
is_in_army = no
has_contagious_deadly_disease_trigger = no
is_incapable = no
is_in_activity = yes
}
teacher_has_trait_that_student_does_not_trigger = {
OR = {
AND = {
$TEACHER$ = { has_trait = logistician }
$STUDENT$ = { NOT = { has_trait = logistician } }
}
AND = {
$TEACHER$ = { has_trait = military_engineer }
$STUDENT$ = { NOT = { has_trait = military_engineer } }
}
AND = {
$TEACHER$ = { has_trait = aggressive_attacker }
$STUDENT$ = { NOT = { has_trait = aggressive_attacker } }
}
AND = {
$TEACHER$ = { has_trait = unyielding_defender }
$STUDENT$ = { NOT = { has_trait = unyielding_defender } }
}
AND = {
$TEACHER$ = { has_trait = forder }
$STUDENT$ = { NOT = { has_trait = forder } }
}
AND = {
$TEACHER$ = { has_trait = flexible_leader }
$STUDENT$ = { NOT = { has_trait = flexible_leader } }
}
AND = {
$TEACHER$ = { has_trait = desert_warrior }
$STUDENT$ = { NOT = { has_trait = desert_warrior } }
}
AND = {
$TEACHER$ = { has_trait = jungle_stalker }
$STUDENT$ = { NOT = { has_trait = jungle_stalker } }
}
AND = {
$TEACHER$ = { has_trait = winter_soldier }
$STUDENT$ = { NOT = { has_trait = winter_soldier } }
}
AND = {
$TEACHER$ = { has_trait = reaver }
$STUDENT$ = { NOT = { has_trait = reaver } }
}
AND = {
$TEACHER$ = { has_trait = reckless }
$STUDENT$ = { NOT = { has_trait = reckless } }
}
AND = {
$TEACHER$ = { has_trait = holy_warrior }
$STUDENT$ = { NOT = { has_trait = holy_warrior } }
}
AND = {
$TEACHER$ = { has_trait = open_terrain_expert }
$STUDENT$ = { NOT = { has_trait = open_terrain_expert } }
}
AND = {
$TEACHER$ = { has_trait = rough_terrain_expert }
$STUDENT$ = { NOT = { has_trait = rough_terrain_expert } }
}
AND = {
$TEACHER$ = { has_trait = forest_fighter }
$STUDENT$ = { NOT = { has_trait = forest_fighter } }
}
AND = {
$TEACHER$ = { has_trait = cautious_leader }
$STUDENT$ = { NOT = { has_trait = cautious_leader } }
}
AND = {
$TEACHER$ = { has_trait = organizer }
$STUDENT$ = { NOT = { has_trait = organizer } }
}
}
}