diff --git a/N3OW/common/council_tasks/00_court_chaplain_tasks.txt b/N3OW/common/council_tasks/00_court_chaplain_tasks.txt new file mode 100644 index 00000000..e9052fe1 --- /dev/null +++ b/N3OW/common/council_tasks/00_court_chaplain_tasks.txt @@ -0,0 +1,1846 @@ +task_religious_relations = { + default_task = yes + position = councillor_court_chaplain + + task_type = task_type_general + task_progress = task_progress_infinite + + asset = { + icon = "gfx/interface/icons/council_task_types/task_religious_relations.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + effect_desc = { + ### Piety tooltip + desc = task_religious_relations_piety_effect_desc + triggered_desc = { + trigger = { + scope:councillor_liege = { has_perk = clerical_justifications_perk } + } + desc = task_religious_relations_effect_desc_perk_bonus_piety + } + triggered_desc = { + trigger = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + desc = task_religious_relations_effect_desc_legacy_bonus_piety + } + triggered_desc = { + trigger = { + councillor_liege_has_family_business_bonus = yes + } + desc = task_religious_relations_effect_desc_family_business_bonus_piety + } + triggered_desc = { + trigger = { + councillor_liege_has_consulted_house_bonus = yes + } + desc = task_religious_relations_effect_desc_consulted_house_bonus_piety + } + + first_valid = { + triggered_desc = { + trigger = { + scope:councillor.faith = { + OR = { + has_doctrine_parameter = no_head_of_faith + NOT = { exists = religious_head } + } + has_doctrine = doctrine_theocracy_lay_clergy + } + } + desc = task_religious_relations_effect_no_hof_layman_clergy_desc_opinion + } + desc = task_religious_relations_effect_desc_opinion + } + + + triggered_desc = { + trigger = { + scope:councillor_liege = { has_perk = clerical_justifications_perk } + } + desc = task_religious_relations_effect_desc_perk_bonus_opinion + } + triggered_desc = { + trigger = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + desc = task_religious_relations_effect_desc_legacy_bonus_opinion + } + triggered_desc = { + trigger = { + councillor_liege_has_family_business_bonus = yes + } + desc = task_religious_relations_effect_desc_family_business_bonus_opinion + } + triggered_desc = { + trigger = { + councillor_liege_has_consulted_house_bonus = yes + } + desc = task_religious_relations_effect_desc_consulted_house_bonus_opinion + } + desc = line_break + + desc = { + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + learning > mediocre_skill_rating + } + desc = task_religious_relations_opinion_gain + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_religious_relations_piety_loss + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_religious_relations_opinion_loss + } + } + } + + on_start_task = { + liege = { + set_variable = { + name = court_chaplain_religious_relations_opinion_value + value = 0 + } + } + } + + on_cancel_task = { + if = { + limit = { + is_alive = yes + has_variable = court_chaplain_religious_relations_opinion_value + } + remove_variable = court_chaplain_religious_relations_opinion_value + } + } + + council_owner_modifier = { + name = court_chaplain_religious_relations_modifier + monthly_piety = 1 + scale = court_chaplain_religious_relations_total_piety_gain + } + + council_owner_modifier = { + name = court_chaplain_religious_relations_opinion_modifier + theocracy_government_opinion_same_faith = 1 + scale = court_chaplain_religious_relations_opinion_modifier + } + + council_owner_modifier = { + name = court_chaplain_religious_relations_no_hof_opinion_modifier + same_faith_opinion = 1 + scale = court_chaplain_religious_relations_no_hof_opinion_modifier + } + + monthly_on_action = task_religious_relations_side_effects + + on_monthly = { + if = { + limit = { + liege = { is_ai = no } + } + if = { + limit = { + liege = { + has_variable = court_chaplain_religious_relations_opinion_value + } + } + liege = { + if = { + limit = { + var:court_chaplain_religious_relations_opinion_value < root.court_chaplain_religious_relations_opinion_max + } + change_variable = { + name = court_chaplain_religious_relations_opinion_value + add = root.court_chaplain_religious_relations_monthly_increase + } + } + if = { + limit = { + var:court_chaplain_religious_relations_opinion_value > root.court_chaplain_religious_relations_opinion_max + } + set_variable = { + name = court_chaplain_religious_relations_opinion_value + value = root.court_chaplain_religious_relations_opinion_max + } + } + } + } + else = { + liege = { + set_variable = { + name = court_chaplain_religious_relations_opinion_value + value = 0 + } + } + } + } + } + + ai_will_do = { + value = 1 # Always a good backup + + } +} + +task_conversion = { + position = councillor_court_chaplain + + task_type = task_type_county + county_target = realm + ai_county_target = realm + task_progress = task_progress_percentage + highlight_own_realm = yes + + asset = { + icon = "gfx/interface/icons/council_task_types/task_conversion.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + effect_desc = { + #China changes the faith to the Huangdi's faith + triggered_desc = { + trigger = { + scope:councillor_liege = { + highest_held_title_tier >= tier_hegemony + government_has_flag = government_has_merit + } + } + desc = task_conversion_china_effect_desc + } + #Otherwise it's councillor's faith + triggered_desc = { + trigger = { + NOT = { + scope:councillor_liege = { + highest_held_title_tier >= tier_hegemony + government_has_flag = government_has_merit + } + } + } + desc = task_conversion_effect_desc + } + desc = task_conversion_development_loss_desc + triggered_desc = { + trigger = { + scope:councillor_liege = { + any_vassal = { + vassal_stance = minority + } + } + } + desc = minority_disapproves_conversion_tooltip + } + desc = { + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + learning > mediocre_skill_rating + } + desc = task_conversion_opinion_gain + } + triggered_desc = { + trigger = { + learning > mediocre_skill_rating + } + desc = task_conversion_development_gain + } + triggered_desc = { + trigger = { + learning > mediocre_skill_rating + } + desc = task_conversion_levy_gain + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_conversion_resistance_to_conversion + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_conversion_opinion_loss + } + } + } + + progress = { + value = 0 + #Base conversion speed + add = { + value = court_chaplain_conversion_base + desc = COURT_CHAPLAIN_PROGRESS_BASE + } + add = { + value = scope:councillor.court_chaplain_conversion_monthly_increase + desc = SCALED_COUNCILLOR_LEARNING_VALUE + } + #Fervor of Court Chaplain's Faith + if = { + limit = { # Conditional in order to not mess up the preview-tooltip + exists = scope:county + exists = scope:councillor.faith + exists = scope:county.faith + } + add = { + add = { + add = scope:councillor.court_chaplain_progress_percentage + multiply = scope:councillor.faith.fervor + multiply = convert_faith_fervor_modifier_scale + } + subtract = { + add = scope:councillor.court_chaplain_progress_percentage + multiply = scope:county.faith.fervor + multiply = convert_faith_fervor_modifier_scale + } + if = { + limit = { + scope:councillor_liege = { has_perk = religious_icon_perk } + } + min = 0 + } + desc = COURT_CHAPLAIN_CONVERSION_FERVOR_IMPACT + } + } + add = court_chaplain_conversion_contextual_bonuses + + # Faster conversion for certain special doctrines + if = { + limit = { + scope:councillor_liege.faith = { has_doctrine_parameter = adoptionists_attractively_intuitive_theology } + exists = scope:county + OR = { + scope:county.faith.religion = religion:eastern_orthodox_religion + scope:county.faith.religion = religion:catholic_religion + scope:county.faith.religion = religion:protestant_religion + } + } + add = { + value = fp2_lyonese_monk_conversion_bonus_actual_value + desc = fp2_lyonese_monk_faith_conversion_task_desc + } + } + + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.faith + scope:county.faith = { + fervor > 80 + } + } + multiply = { + value = 0.2 + desc = STEWARD_CONVERT_FAITH_ZEALOT_FERVOUR_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.faith + scope:county.faith = { + fervor <= 80 + fervor > 60 + } + } + multiply = { + value = 0.4 + desc = STEWARD_CONVERT_FAITH_HIGH_FERVOUR_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.faith + scope:county.faith = { + fervor <= 60 + fervor > 40 + } + } + multiply = { + value = 0.6 + desc = STEWARD_PROMOTE_FAITH_MEDIUM_FERVOUR_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.faith + scope:county.faith = { + fervor <= 40 + fervor > 20 + } + } + multiply = { + value = 0.8 + desc = STEWARD_PROMOTE_CULTURE_LOW_FERVOUR_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.faith + scope:county.faith = { + fervor <= 20 + fervor >= 0 + } + } + multiply = { + value = 1.2 + desc = STEWARD_PROMOTE_CULTURE_LOW_FERVOUR_BONUS + } + } + #### + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 25 + county_control >= 0 + } + } + multiply = { + value = 0.5 + desc = STEWARD_PROMOTE_CULTURE_LOW_CONTROL_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 50 + county_control > 25 + } + } + multiply = { + value = 0.7 + desc = STEWARD_PROMOTE_CULTURE_MEDIUM_CONTROL_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 75 + county_control > 50 + } + } + multiply = { + value = 0.9 + desc = STEWARD_PROMOTE_CULTURE_HIGH_CONTROL_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control > 75 + } + } + multiply = { + value = 1.1 + desc = STEWARD_PROMOTE_CULTURE_HIGH_CONTROL_BONUS + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 100 + county_control > 75 + } + } + multiply = { + value = 1.3 + desc = STEWARD_PROMOTE_CULTURE_HIGH_CONTROL_BONUS + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control > 100 + } + } + multiply = { + value = 1.5 + desc = STEWARD_PROMOTE_CULTURE_ABSOLUTE_CONTROL_BONUS + } + } + ##### + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.title_province + scope:county.title_province = { + OR = { + terrain = jungle + terrain = mountains + terrain = desert + terrain = desert_mountains + terrain = taiga + terrain = wetlands + } + } + } + multiply = { + value = 0.6 + desc = STEWARD_PROMOTE_CULTURE_HIGH_TERRAIN_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.title_province + scope:county.title_province = { + OR = { + terrain = floodplains + terrain = drylands + terrain = steppe + terrain = forest + terrain = hills + terrain = tells + } + } + } + multiply = { + value = 0.8 + desc = STEWARD_PROMOTE_CULTURE_LOW_TERRAIN_PENALTY + } + } + # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + if = { + limit = { + exists = scope:county + scope:county = { + development_level > 0 + } + } + add = { + value = scope:county.convert_faith_development_penalty + desc = STEWARD_PROMOTE_CULTURE_DEVELOPMENT_PENALTY + } + } + + if = { + limit = { + scope:councillor.faith = { + has_doctrine_parameter = unreformed + } + } + multiply = { + value = conversion_unreformed_faith_penalty + desc = COURT_CHAPLAIN_CONVERSION_UNREFORMED_FAITH_PENALTY + } + } + + # Faster conversion for FP2 Hostility ending, if county is in Iberia and faith was involved + if = { + limit = { + exists = scope:councillor.liege.house + scope:councillor.liege.house = { + OR = { + has_house_modifier = fp2_struggle_hostility_house_faith_modifier + has_house_modifier = fp2_struggle_hostility_house_combined_modifier + } + } + any_in_global_list = { + variable = fp2_struggle_ending_faith_list + this = scope:county.faith + } + scope:county.title_province = { geographical_region = world_europe_west_iberia } + } + multiply = { + value = fp2_struggle_hostility_conversion_value + desc = fp2_struggle_hostility_faith_conversion_task_desc + } + } + # Faster conversion of infidels for FP2 Council Toledo Conversion + if = { + limit = { + scope:councillor.liege = { has_character_modifier = fp2_council_conversion_modifier } + scope:county.religion != scope:councillor.liege.religion + } + multiply = { + value = council_toledo_conversion_modifier_value + desc = council_toledo_conversion_task_desc + } + } + # Faster conversion of heretics for FP2 Council Toledo Heresies + if = { + limit = { + scope:councillor.liege = { has_character_modifier = fp2_council_conversion_modifier } + scope:county.faith = { + religion = scope:councillor.liege.religion + NOT = { + portrait_religious_faith_or_foundational_trigger = { FAITH = faith:mozarabic_church } + } + NOT = { exists = religious_head } + } + } + multiply = { + value = council_toledo_conversion_modifier_value + desc = council_toledo_heresies_task_desc + } + } + + # Faster conversion of Persian counties with the FP3 Promote Persian Scripture decision + if = { + limit = { + scope:councillor.liege = { + has_character_modifier = fp3_promoted_persian_scripture_modifier + is_ai = no #this is so that we don't get AI converting and homogenizing Persia too quickly + } + scope:county.culture = { has_cultural_pillar = heritage_iranian } + } + multiply = { + value = promote_persian_scripture_conversion_modifier_value + desc = fp3_promote_persian_scripture_task_desc + } + } + + # FP3 faster conversion struggle ending rewards + if = { + limit = { + exists = global_var:fp3_struggle_ending_assertion_school + switch = { + trigger = global_var:fp3_struggle_ending_assertion_school + flag:sunni = { + scope:councillor.liege.faith = { has_doctrine = muhammad_succession_sunni_doctrine } + } + flag:shia = { + scope:councillor.liege.faith = { has_doctrine = muhammad_succession_shia_doctrine } + } + flag:muhakkima = { + scope:councillor.liege.faith = { has_doctrine = muhammad_succession_muhakkima_doctrine } + } + flag:zandaqa = { + scope:councillor.liege.faith = { has_doctrine = muhammad_succession_zandaqa_doctrine } + } + } + } + multiply = { + value = fp3_struggle_ending_conversion_modifier_value + desc = fp3_struggle_ending_conversion_modifier_desc + } + } + # Court events + if = { #court.6010 + limit = { + scope:councillor.liege = { + var:6010_harsh_conversion ?= scope:county.faith + } + } + multiply = { + value = 1.2 + desc = court_6010_harsh_conversions + } + } + if = { #court.6010 + limit = { + scope:councillor.liege = { + var:6010_tolerant_conversion ?= scope:county.faith + } + } + multiply = { + value = 0.8 + desc = court_6010_tolerant_conversions + } + } + #If someone has done some buddhist teaching in this province + if = { + limit = { + scope:county ?= { + has_county_modifier = buddhist_teachings_conversion_modifier + } + scope:councillor.liege.religion = religion:buddhism_religion + } + multiply = { + value = 2 + desc = buddhist_teachings_conversion_modifier + } + } + # State Faith Boost + if = { + limit = { + scope:councillor.top_liege.primary_title.state_faith ?= { + this != scope:county.faith + this = scope:councillor.top_liege.faith + } + } + multiply = { + value = ep3_state_faith_conversion_mult_value + desc = ep3_convert_county_to_state_faith + } + } + + # Conversion speed game rules + if = { + limit = { + has_game_rule = slower_faith_conversion_speed + } + multiply = { + value = slower_game_rule_value + desc = GAME_RULE_SLOWER_REASON + } + } + if = { + limit = { + has_game_rule = significantly_slower_faith_conversion_speed + } + multiply = { + value = significantly_slower_game_rule_value + desc = GAME_RULE_SIGNIFICANTLY_SLOWER_REASON + } + } + if = { + limit = { + has_game_rule = faster_faith_conversion_speed + } + multiply = { + value = faster_game_rule_value + desc = GAME_RULE_FASTER_REASON + } + } + if = { + limit = { + has_game_rule = significantly_faster_faith_conversion_speed + } + multiply = { + value = significantly_faster_game_rule_value + desc = GAME_RULE_SIGNIFICANTLY_FASTER_REASON + } + } + if = { + limit = { + exists = scope:county + OR = { + AND = { + scope:councillor.faith = { has_doctrine_parameter = unreformed_syncretic_actor_opinion_active } + scope:county.faith = { has_doctrine_parameter = unreformed } + } + AND = { + scope:councillor.faith = { has_doctrine_parameter = christian_syncretic_actor_opinion_active } + scope:county.faith = { religion_tag = eastern_orthodox_religion } + } + AND = { + scope:councillor.faith = { has_doctrine_parameter = christian_syncretic_actor_opinion_active } + scope:county.faith = { religion_tag = protestant_religion } + } + AND = { + scope:councillor.faith = { has_doctrine_parameter = christian_syncretic_actor_opinion_active } + scope:county.faith = { religion_tag = catholic_religion } + } + AND = { + scope:councillor.faith = { has_doctrine_parameter = islamic_syncretic_actor_opinion_active } + scope:county.faith = { religion_tag = islam_religion } + } + AND = { + scope:councillor.faith = { has_doctrine_parameter = jewish_syncretic_actor_opinion_active } + scope:county.faith = { religion_tag = judaism_religion } + } + } + } + } + min = { + value = 0.1 + desc = minimum_conversion + } + } + + potential_county = { + scope:county = { + is_landless_type_title = no + #China changes the faith to the Huangdi's faith + trigger_if = { + limit = { + scope:councillor_liege = { + highest_held_title_tier >= tier_hegemony + government_has_flag = government_has_merit + } + } + faith != scope:councillor_liege.faith + } + #Otherwise it's councillor's faith + trigger_else = { faith != scope:councillor.faith } + 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 = { + text = "is_protected_via_contract_self_or_liege" + subject = holder + NAND = { # Vassal Contract forbids meddling by liege + exists = holder.liege + holder = { + OR = { + AND = { + liege = scope:councillor_liege + is_ruler = yes + top_liege != this + vassal_contract_has_flag = religiously_protected + } + any_liege_or_above = { + liege ?= scope:councillor_liege + is_ruler = yes + top_liege != this + vassal_contract_has_flag = religiously_protected + } + } + } + } + } + trigger_if = { + limit = { + AND = { + has_variable = cannot_be_converted_by_value + var:cannot_be_converted_by_value = scope:councillor_liege + } + } + custom_tooltip = { + text = promised_to_not_convert_county + NOR = { + has_variable = cannot_be_converted_by_value + var:cannot_be_converted_by_value = scope:councillor_liege + } + } + } + # Unreformed Pagans do not tend to even try conversion of non-unreformed faiths unless zealous + trigger_if = { + limit = { + scope:councillor_liege = { + is_ai = yes + 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.faith = { has_doctrine_parameter = unreformed } + scope:county = { # 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 = { + is_ai = yes + faith = { + faith_hostility_level = { + target = scope:county.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 = { # 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 = { + is_ai = yes + faith = { + faith_hostility_level = { + target = scope:county.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 = { county_opinion <= -25 } + scope:county = { # Always convert holy sites + any_county_province = { + barony = { + is_holy_site_of = scope:councillor_liege.faith + } + } + } + } + } + trigger_else_if = { + limit = { + scope:councillor_liege = { + faith = { 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 = { county_opinion <= -10 } + scope:county = { # 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 = { county_opinion <= -15 } + scope:county = { # 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 = { + is_ai = yes + faith = faith:ashari + capital_province ?= { geographical_region = world_europe_west_iberia } + scope:county.faith = faith:muwalladi + } + scope:county = { + 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 = { county_opinion <= -20 } + scope:county = { # 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 = { + is_ai = yes + faith = { + OR = { + has_doctrine = tenet_tax_nonbelievers + has_doctrine = special_doctrine_jizya + } + } + } + OR = { + AND = { + scope:councillor_liege.religion = { is_in_family = rf_pagan } + scope:county.religion = { is_in_family = rf_pagan } + } + AND = { + scope:councillor_liege.religion = { is_in_family = rf_eastern } + scope:county.religion = { is_in_family = rf_eastern } + } + AND = { + scope:councillor_liege.religion = { is_in_family = rf_abrahamic } + scope:county.religion = { is_in_family = rf_abrahamic } + } + } + } + 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.faith = { has_doctrine_parameter = unreformed } + scope:councillor_liege.faith = { + any_holy_site = { + county = { + kingdom = scope:county.kingdom + } + } + } + #scope:county.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.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 = { 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 + } + } + } + } + } + } + } + } + + on_start_task_county = { + # Message for vassals + scope:county = { save_scope_as = set_county } + trigger_event = { + id = court_chaplain_task.8000 + days = 2 # To ensure it fires after the halted message + } + #spawn a task contract to counter the missionary, if a nearby adventurer has the same faith as the county + if = { + limit = { + any_pool_character = { + province = scope:county.title_province + faith = scope:county.faith + is_adult = yes + save_temporary_scope_as = employer + } + any_ruler = { + has_government = landless_adventurer_government + is_within_diplo_range = { CHARACTER = scope:councillor } + any_character_task_contract = { + task_contract_type = laamp_fight_faith_conversion_contract + count <= council_task_contracts_limit_value + } + NOT = { + any_task_contract = { + task_contract_type = laamp_fight_faith_conversion_contract + task_contract_location = scope:employer.location + } + } + save_temporary_scope_as = player_laamp + } + } + scope:player_laamp = { + create_task_contract = { + task_contract_type = laamp_fight_faith_conversion_contract + task_contract_tier = scope:employer.task_contract_tier_value + location = scope:county.title_province + task_contract_employer = scope:employer + target = scope:councillor + destination = scope:county.title_province + } + } + } + } + + on_cancel_task_county = { + # Message for vassals + trigger_event = { + id = court_chaplain_task.8001 + days = 1 # To ensure it does not fire at the same time as the finish message (both cancel and finish are fired on_finish_task_county) + } + } + + on_finish_task_county = { + scope:county.faith = { save_scope_as = old_faith } + scope:councillor_liege = { + if = { + limit = { + any_vassal = { + vassal_stance = minority + } + } + custom_tooltip = minority_disapproves_conversion + hidden_effect = { + every_vassal = { + vassal_stance = minority + add_opinion = { + target = scope:councillor_liege + modifier = minority_disapproves_of_conversion_opinion + } + } + } + } + add_to_variable_list = { + name = faiths_converted_in_counties + target = scope:old_faith + } + } + scope:county = { + add_to_variable_list = { + name = faiths_converted_in_the_county + target = scope:old_faith + years = 40 + } + scope:old_faith = { + if = { + limit = { + OR = { + NOT = { has_variable = associated_county } + AND = { + has_variable = converted_development + var:converted_development <= 0 + } + } + } + set_variable = { + name = associated_county + value = scope:county + } + } + if = { + limit = { + OR = { + NOT = { has_variable = associated_culture } + AND = { + has_variable = converted_development + var:converted_development <= 0 + } + } + } + set_variable = { + name = associated_culture + value = scope:county.culture + } + } + if = { + limit = { + NOT = { has_variable = converted_development } + } + set_variable = { + name = converted_development + value = scope:county.convert_faith_development_value + } + } + else = { + change_variable = { + name = converted_development + add = scope:county.convert_faith_development_value + } + } + } + change_development_level = convert_faith_development_loss + if = { + limit = { + scope:councillor_liege = { + highest_held_title_tier >= tier_hegemony + government_has_flag = government_has_merit + } + } + set_county_faith = scope:councillor_liege.faith + } + else = { set_county_faith = scope:councillor.faith } + + } + if = { + limit = { + scope:councillor_liege = { + OR = { + NOT = { has_variable_list = converted_faiths } + NOT = { + is_target_in_variable_list = { + name = converted_faiths + target = scope:old_faith + } + } + } + } + } + scope:councillor_liege = { + add_to_variable_list = { + name = converted_faiths + target = scope:old_faith + } + } + } + if = { + limit = { + scope:councillor = { + has_council_position = councillor_court_chaplain + } + } + scope:councillor = { + start_default_task = yes + } + } + + # Struggle parameters + scope:councillor_liege = { + if = { + limit = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = piety_from_converting_county + } + } + add_piety = medium_piety_gain + } + } + # Message for vassals + trigger_event = court_chaplain_task.8002 + } + + monthly_on_action = task_convert_side_effects + + ai_will_do = { + value = 1000 # Always convert if possible + + if = { #Unless you're a crypto-religionist. + limit = { + scope:councillor_liege = { + any_secret = { type = secret_crypto_religionist } + } + } + multiply = 0 + } + + # AI directive + if = { + limit = { + scope:councillor_liege = { + has_character_flag = vassal_directive_convert_faith + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + } + add = 10000 + } + } +} + +task_fabricate_claim = { + position = councillor_court_chaplain + + task_type = task_type_county + county_target = all + ai_county_target = neighbor_land + task_progress = task_progress_percentage + restart_on_finish = yes + + asset = { + icon = "gfx/interface/icons/council_task_types/task_fabricate_claim.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + is_shown = { + trigger_if = { + limit = { + scope:councillor_liege = { tgp_has_access_to_ministry_trigger = yes } + } + has_council_position = minister_justice + } + } + + effect_desc = { + desc = task_fabricate_claim_effect_desc + + desc = { + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + learning > mediocre_skill_rating + } + desc = task_fabricate_claim_duchy_claim + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_fabricate_claim_vassal_opinion_loss + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_fabricate_claim_piety_loss + } + triggered_desc = { + trigger = { + learning < high_skill_rating + } + desc = task_fabricate_claim_upset_target + } + } + } + + progress = { + value = 0 + add = { + value = court_chaplain_fabricate_claim_base + desc = COURT_CHAPLAIN_PROGRESS_BASE + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_monthly_increase_base + desc = SCALED_COUNCILLOR_LEARNING_VALUE + } + # Relation Bonuses/Penalties + if = { # Friend + limit = { + scope:councillor_liege = { + has_relation_friend = scope:councillor + NOT = { has_relation_best_friend = scope:councillor } + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_monthly_increase_friend_bonus + desc = COUNCILLOR_IS_YOUR_FRIEND + } + } + if = { # Best Friend + limit = { + scope:councillor_liege = { + has_relation_best_friend = scope:councillor + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_monthly_increase_best_friend_bonus + desc = COUNCILLOR_IS_YOUR_BEST_FRIEND + } + } + if = { # Rival + limit = { + scope:councillor_liege = { + has_relation_rival = scope:councillor + NOT = { has_relation_nemesis = scope:councillor } + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_monthly_increase_rival_bonus + desc = COUNCILLOR_IS_YOUR_RIVAL + } + } + if = { # Nemesis + limit = { + scope:councillor_liege = { + has_relation_nemesis = scope:councillor + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_monthly_increase_nemesis_bonus + desc = COUNCILLOR_IS_YOUR_NEMESIS + } + } + + # Perk Bonuses + if = { + limit = { + scope:councillor_liege = { has_perk = accomplished_forger_perk } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_perk_bonus_monthly_increase + desc = FABRICATE_CLAIM_PERK_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_dynasty_perk_bonus + desc = FABRICATE_CLAIM_DYNASTY_PERK_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_family_business_bonus = yes + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_family_business_bonus + desc = FAMILY_BUSINESS_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_consulted_house_bonus = yes + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_consulted_house_bonus + desc = FAMILY_BUSINESS_BONUS_VALUE + } + } + + # Tradition Bonuses + if = { + limit = { + scope:councillor.liege = { + culture = { + has_cultural_parameter = languages_speed_up_claims + } + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_tradition_language_scholars_bonus + desc = FABRICATE_CLAIM_LANGUAGE_SCHOLARS_BONUS + } + } + + if = { # Inspection Reward + limit = { + scope:councillor_liege = { + has_character_modifier = inspection_reward_focused_claims_modifier + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_inspection_reward_bonus + desc = FABRICATE_CLAIM_INSPECTION_BONUS + } + } + + # Innovation Bonuses + if = { + limit = { + scope:councillor.liege = { + culture = { + has_innovation = innovation_land_grants + } + } + } + add = { + value = scope:councillor.court_chaplain_fabricate_claim_innovation_bonus_land_grants + desc = COURT_CHAPLAIN_FABRICATE_CLAIM_INNOVATION_BONUS_LAND_GRANTS + } + } + if = { + limit = { + exists = scope:county + scope:county.holder.faith != scope:councillor.liege.faith + } + multiply = { + value = scope:councillor.court_chaplain_heretic_bonus + desc = "COURT_CHAPLAIN_FABRICATE_CLAIM_HERETIC_BONUS" + } + } + if = { + limit = { + exists = scope:county + NOT = { + scope:county = { + is_neighbor_to_realm = scope:councillor_liege + } + } + } + multiply = { + value = scope:councillor.court_chaplain_fabricate_claim_not_adjacent_penalty + desc = "COURT_CHAPLAIN_FABRICATE_CLAIM_NOT_ADJACENT" + } + } + if = { #Progress penalty when fabricating on vassals + limit = { + exists = scope:county + scope:county.holder = { + target_is_liege_or_above = scope:councillor.liege + } + } + multiply = { + value = scope:councillor.court_chaplain_fabricate_claim_vassal_penalty + desc = "COURT_CHAPLAIN_FABRICATE_CLAIM_VASSAL_COUNTY" + } + } + # Misc Bonuses + if = { # FP3 + limit = { + scope:councillor_liege = { + any_character_struggle = { + is_struggle_type = persian_struggle + is_struggle_phase = struggle_persia_phase_unrest + } + } + } + add = { # +25% of total + value = scope:councillor.court_chaplain_fabricate_claim_base_total + divide = 4 + desc = FABRICATE_CLAIM_ANY_STRUGGLE_BONUS + } + } + if = { + limit = { + scope:councillor_liege = { + has_title = title:c_byzantion + title:c_byzantion = { has_county_modifier = pandidakterion_university_modifier } + } + } + multiply = { + value = 1.3 + desc = pandidakterion_university_modifier + } + } + } + + potential_county = { + scope:county.holder.top_liege = { + in_diplomatic_range = scope:councillor_liege + } + scope:county = { + is_landless_type_title = no + NOR = { + holder = scope:councillor_liege + scope:councillor_liege = { + has_claim_on = scope:county + } + } + } + } + + on_start_task_county = { + #spawn a task contract to counter the missionary, if a nearby adventurer has the same faith as the county + if = { + limit = { + any_task_contract = { + task_contract_type = laamp_help_fabricate_claim_contract + NOT = { task_contract_location = scope:county.title_province } + } + any_player = { + has_government = landless_adventurer_government + is_within_diplo_range = { CHARACTER = scope:councillor } + any_character_task_contract = { + task_contract_type = laamp_help_fabricate_claim_contract + count <= council_task_contracts_limit_value + } + can_create_task_contract = { + type_name = laamp_help_fabricate_claim_contract + employer = scope:councillor + } + save_temporary_scope_as = player_laamp + } + } + scope:player_laamp = { + create_task_contract = { + task_contract_type = laamp_help_fabricate_claim_contract + task_contract_tier = scope:councillor.task_contract_tier_value + location = scope:county.title_province + task_contract_employer = scope:councillor + target = scope:county.holder + destination = scope:county.title_province + } + } + } + } + + on_finish_task_county = { + scope:county = { + holder = { + save_scope_as = county_holder + } + } + scope:councillor_liege = { + trigger_event = { + on_action = task_fabricate_claim_success_effect + } + } + } + + monthly_on_action = task_fabricate_claim_side_effects + + ai_target_score = { + value = 1000 + + if = { + limit = { # Vassals in the same realm + scope:councillor_liege = { + top_liege != this + } + scope:county.holder = { + top_liege != this + } + scope:county.holder.top_liege = scope:councillor_liege.top_liege + } + + if = { + limit = { + exists = scope:county.holder.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege + } + } + scope:county.holder.max_military_strength > scope:councillor_liege.council_task_fabricate_claim_relative_strength + } + subtract = 10000 + } + else_if = { + limit = { + exists = scope:county.holder.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege + } + } + } + multiply = { + value = scope:councillor_liege.max_military_strength + divide = { value = scope:county.holder.max_military_strength min = 1 } + } + } + + else_if = { + limit = { + exists = scope:county.holder.liege.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege.liege + } + } + scope:county.holder.liege.max_military_strength > scope:councillor_liege.council_task_fabricate_claim_relative_strength + } + subtract = 10000 + } + else_if = { + limit = { + exists = scope:county.holder.liege.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege.liege + } + } + } + multiply = { + value = scope:councillor_liege.max_military_strength + divide = { value = scope:county.holder.liege.max_military_strength min = 1 } + } + } + + else_if = { + limit = { + exists = scope:county.holder.liege.liege.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege.liege.liege + } + } + scope:county.holder.liege.liege.max_military_strength > scope:councillor_liege.council_task_fabricate_claim_relative_strength + } + subtract = 10000 + } + else_if = { + limit = { + exists = scope:county.holder.liege.liege.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege.liege.liege + } + } + } + multiply = { + value = scope:councillor_liege.max_military_strength + divide = { value = scope:county.holder.liege.liege.max_military_strength min = 1 } + } + } + + else_if = { + limit = { + exists = scope:county.holder.liege.liege.liege.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege.liege.liege.liege + } + } + scope:county.holder.liege.liege.liege.max_military_strength > scope:councillor_liege.council_task_fabricate_claim_relative_strength + } + subtract = 10000 + } + else_if = { + limit = { + exists = scope:county.holder.liege.liege.liege.liege + scope:councillor_liege = { + any_liege_or_above = { + this = scope:county.holder.liege.liege.liege.liege + } + } + } + multiply = { + value = scope:councillor_liege.max_military_strength + divide = { value = scope:county.holder.liege.liege.liege.max_military_strength min = 1 } + } + } + } + else_if = { + limit = { + scope:county.holder.top_liege.max_military_strength > scope:councillor_liege.council_task_fabricate_claim_relative_strength + } + subtract = 10000 + } + else = { + multiply = { + value = scope:councillor_liege.max_military_strength + divide = { value = scope:county.holder.top_liege.max_military_strength min = 1 } + } + } + } + + ai_will_do = { + value = 0 + if = { + limit = { + scope:councillor = { + is_performing_council_task = task_fabricate_claim + } + } + add = 10000 # Always keep going if this is already chosen + } + else_if = { + limit = { + OR = { + ai_greed <= ai_honor + ai_greed <= 0 + is_at_war = yes + gold < 100 + } + } + subtract = 1000 + } + else_if = { # If AI has good war, don't fabricate + limit = { + any_neighboring_and_across_water_top_liege_realm_owner = { + scope:councillor_liege = { + tier_difference = { + target = prev + value >= -1 + } + NOR = { + is_allied_to = prev + has_truce = prev + has_relation_friend = prev + has_relation_lover = prev + } + current_military_strength > prev.current_military_strength + has_any_cb_on = prev + } + } + } + subtract = 1000 + } + else = { + add = 100 + } + + # Agenda impact + if = { + limit = { + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + } + } + add = { + value = 0 + if = { + limit = { + any_character_struggle = { + phase_has_catalyst = catalyst_gain_claim_on_title_fp2 + } + has_character_flag = agenda_towards_escalation + } + add = 200 + } + else_if = { + limit = { + any_character_struggle = { + phase_has_catalyst = catalyst_gain_claim_on_title_fp2 + } + } + add = -100 + } + } + } + + if = { + limit = { + any_character_struggle = { + involvement = involved + is_struggle_type = persian_struggle + } + } + add = { + value = 0 + if = { + limit = { + any_character_struggle = { + phase_has_catalyst = catalyst_gain_claim_on_title_fp3 + } + has_trait = fp3_struggle_detractor + } + add = 200 + } + else_if = { + limit = { + any_character_struggle = { + phase_has_catalyst = catalyst_gain_claim_on_title_fp3 + } + } + add = -100 + } + } + } + } +} diff --git a/N3OW/common/council_tasks/00_steward_tasks.txt b/N3OW/common/council_tasks/00_steward_tasks.txt new file mode 100644 index 00000000..8f29c838 --- /dev/null +++ b/N3OW/common/council_tasks/00_steward_tasks.txt @@ -0,0 +1,2339 @@ +task_collect_taxes = { + default_task = yes + position = councillor_steward + + task_type = task_type_general + task_progress = task_progress_infinite + + asset = { + icon = "gfx/interface/icons/council_task_types/task_collect_taxes.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + effect_desc = { + desc = task_collect_taxes_effect_desc + triggered_desc = { + trigger = { liege = { has_perk = tax_man_perk } } + desc = task_collect_taxes_tax_man_bonus_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + desc = task_collect_taxes_erudition_bonus_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_family_business_bonus = yes + } + desc = task_collect_taxes_family_business_bonus_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_consulted_house_bonus = yes + } + desc = task_collect_taxes_consulted_house_bonus_desc + } + triggered_desc = { + trigger = { liege.culture = { has_cultural_parameter = bookkeeping_collect_taxes_bonus } } + desc = task_collect_taxes_innovation_double_entry_bookkeeping_bonus_desc + } + desc = { + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + } + desc = task_collect_taxes_extra_taxes + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + liege = { + any_sub_realm_county = { + steward_task_county_corruption_county_trigger = yes + } + } + } + desc = task_collect_taxes_county_corruption + } + } + } + + is_valid_showing_failures_only = { + tgp_natural_disaster_councillor_available_for_task_trigger = yes + } + + council_owner_modifier = { + name = task_collect_taxes_modifier + domain_tax_mult = 1 + scale = steward_collect_taxes_total_scale + } + + monthly_on_action = task_collect_taxes_side_effects + + ai_will_do = { + value = 1 # Always a good backup + + if = { # Very greedy rulers prefer this over increasing Acceptance, in most cases + limit = { + scope:councillor_liege.ai_greed > 0 + } + add = { + value = scope:councillor_liege.ai_greed + divide = 5 + } + } + + if = { + # Wealth Focused characters like this + limit = { + scope:councillor_liege = { + has_focus = stewardship_wealth_focus + } + } + add = 15 + } + + if = { + # And those with the Tax Man perk + limit = { + scope:councillor_liege = { + has_perk = tax_man_perk + } + } + add = 15 + } + if = { + limit = { + scope:councillor_liege.primary_title.tier >= tier_duchy + scope:councillor_liege.gold < 100 + } + add = 500 + } + else_if = { + limit = { + scope:councillor_liege.gold < 10 + } + add = 500 + } + if = { # Conquerors want more money + limit = { + scope:councillor_liege = { + has_variable = conqueror + } + } + add = 500 + } + } +} + +task_develop_county = { + position = councillor_steward + + task_type = task_type_county + county_target = realm + ai_county_target = domain + task_progress = task_progress_value + task_current_value = scope:councillor_liege.steward_develop_county_current_progress + task_max_value = 100 + highlight_own_realm = yes + + asset = { + icon = "gfx/interface/icons/council_task_types/task_develop_county.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + is_shown = { + trigger_if = { + limit = { + scope:councillor_liege = { tgp_has_access_to_ministry_trigger = yes } + } + has_council_position = minister_works + } + } + + effect_desc = { + desc = task_develop_county_complete_effect_desc + desc = task_develop_county_effect_desc + desc = { + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + trigger_if = { + limit = { + exists = scope:county + } + scope:county = { + NOT = { has_county_modifier = steward_task_efficient_taxation_modifier } + } + } + } + desc = task_develop_county_efficient_taxation + } + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + county_control < full_county_control + } + } + } + desc = task_develop_county_increased_control + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_settler_resistance_modifier } + } + } + } + desc = task_develop_county_increased_control + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_construction_slowdown_modifier } + } + } + } + desc = task_develop_county_slow_construction + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_population_mismanaged_modifier } + } + } + } + desc = task_develop_county_loss_of_opinion + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + county_control > low_county_control + } + } + } + desc = task_develop_county_loss_of_control + } + } + } + + is_valid_showing_failures_only = { + tgp_natural_disaster_councillor_available_for_task_trigger = yes + } + + # TOTAL PROGRESS MUST MATCH THE TOTAL OF THE COUNTY MODIFIERS BELOW + # Add all new progress values to the script value steward_develop_county_total + # Note that for Develop County, the County Modifiers apply the actual values, while progress is for player info only + progress = { + value = 0 + add = { + value = steward_develop_county_base + desc = STEWARD_PROGRESS_BASE + } + add = { + value = scope:councillor.steward_develop_county_monthly_increase + desc = SCALED_COUNCILLOR_STEWARDSHIP_VALUE + } + if = { + limit = { + scope:councillor_liege = { has_perk = planned_cultivation_perk } + } + add = { + value = scope:councillor.steward_develop_county_perk_bonus_monthly_increase + desc = DEVELOP_COUNTY_PERK_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + add = { + value = scope:councillor.steward_develop_county_erudition_bonus_monthly_increase + desc = ERUDITION_DYNASTY_PERK_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_family_business_bonus = yes + } + add = { + value = scope:councillor.steward_develop_county_family_business_monthly_increase + desc = FAMILY_BUSINESS_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_consulted_house_bonus = yes + } + add = { + value = scope:councillor.steward_develop_county_consulted_house_monthly_increase + desc = CONSULTED_HOUSE_BONUS_VALUE + } + } + + # Relation Bonuses/Penalties + if = { # Friend + limit = { + scope:councillor_liege = { + has_relation_friend = scope:councillor + NOT = { has_relation_best_friend = scope:councillor } + } + } + add = { + value = scope:councillor.steward_develop_county_monthly_increase_friend_bonus + desc = COUNCILLOR_IS_YOUR_FRIEND + } + } + if = { # Best Friend + limit = { + scope:councillor_liege = { + has_relation_best_friend = scope:councillor + } + } + add = { + value = scope:councillor.steward_develop_county_monthly_increase_best_friend_bonus + desc = COUNCILLOR_IS_YOUR_BEST_FRIEND + } + } + if = { # Rival + limit = { + scope:councillor_liege = { + has_relation_rival = scope:councillor + NOT = { has_relation_nemesis = scope:councillor } + } + } + add = { + value = scope:councillor.steward_develop_county_monthly_increase_rival_bonus + desc = COUNCILLOR_IS_YOUR_RIVAL + } + } + if = { # Nemesis + limit = { + scope:councillor_liege = { + has_relation_nemesis = scope:councillor + } + } + add = { + value = scope:councillor.steward_develop_county_monthly_increase_nemesis_bonus + desc = COUNCILLOR_IS_YOUR_NEMESIS + } + } + if = { #Tribal penalty + limit = { + scope:councillor_liege = { + should_apply_tribal_development_penalty_trigger = yes + } + } + add = { + value = scope:councillor.steward_develop_county_tribal_penalty + desc = DEVELOP_COUNTY_TRIBAL_PENALTY_VALUE + } + } + if = { # Development reduces the speed. + limit = { + exists = scope:county + scope:county = { + development_level > 0 + } + } + add = { + value = scope:county.current_development_penalty + desc = STEWARD_CURRENT_DEVELOPMENT_PENALTY + } + } + + if = { + limit = { exists = scope:county } + multiply = { + value = scope:county.development_rate_modifier + desc = STEWARD_COUNTY_SPEED_MODIFIERS + } + } + + # Royal Architect + if = { + limit = { + scope:councillor_liege = { has_character_modifier = employer_booner_royal_architect_2_modifier } + OR = { + target_is_vassal_or_below = scope:target_character + this = scope:target_character + } + } + multiply = { + value = 1.1 + desc = employer_booner_royal_architect_2_modifier + } + } + else_if = { + limit = { + scope:councillor_liege = { has_character_modifier = employer_booner_royal_architect_3_modifier } + OR = { + target_is_vassal_or_below = scope:target_character + this = scope:target_character + } + } + multiply = { + value = 1.1 + desc = employer_booner_royal_architect_3_modifier + } + } + } + full_progress = steward_develop_county_full_progress + custom_other_loc = STEWARD_COUNTY_SPEED_OTHER + + potential_county = { + scope:county = { + is_landless_type_title = no + development_level < max_development_level + trigger_if = { + limit = { + scope:councillor_liege = { + is_ai = yes + exists = capital_county + } + } + OR = { + this = scope:councillor_liege.capital_county + AND = { + holder = scope:councillor_liege + title_province = { + OR = { + terrain = oasis + terrain = farmlands + terrain = floodplains + } + } + } + } + OR = { + scope:councillor_liege = { + has_character_flag = vassal_directive_improve_development + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + culture = scope:councillor_liege.culture + culture = { + cultural_acceptance = { target = scope:councillor_liege.culture value >= 50 } + } + scope:councillor_liege = { + primary_title.tier < tier_duchy + } + AND = { + scope:councillor_liege = { + has_character_flag = agenda_towards_deescalation + } + culture != scope:councillor_liege.culture + } + } + } + } + } + + county_modifier = { + name = steward_develop_county_modifier + development_growth = 100 + holding_build_speed = -7 + #holding_build_gold_cost = -1 + build_speed = -7 + #build_gold_cost = -1 + scale = { value = steward_develop_county_total divide = 100 } + } + + county_modifier = { + name = steward_develop_county_current_development_modifier + development_growth = 100 + scale = { value = scope:councillor.current_development_penalty divide = 100 } + } + + county_modifier = { + name = steward_develop_county_tribal_penalty_modifier + development_growth = 100 + scale = { + value = 0 + if = { + limit = { + scope:councillor_liege = { + should_apply_tribal_development_penalty_trigger = yes + } + } + value = scope:councillor.steward_develop_county_tribal_penalty + divide = 100 + } + } + } + + on_start_task_county = { + # save current development_level for catalyst purpose + if = { + limit = { exists = scope:county } + scope:county = { + set_variable = { + name = current_development_level + value = development_level + } + } + } + } + + on_finish_task_county = { + if = { + limit = { + OR = { + AND = { + exists = scope:county + scope:county = { + development_level = max_development_level + } + } + scope:councillor_liege = { + is_ai = yes + } + } + } + start_default_task = yes + } + } + + monthly_on_action = task_develop_county_side_effects + + on_monthly_county = { + scope:councillor_liege = { + # Check development level progress + if = { + limit = { + exists = scope:county + exists = scope:county.var:current_development_level + scope:county = { + floored_development_value > floored_current_development_value + } + } + scope:county = { + set_variable = { + name = current_development_level + value = development_level + } + } + + scope:councillor_liege = { + if = { # Try to make relevant AI's focus on Acceptance + limit = { + exists = primary_title + primary_title.tier >= tier_kingdom + any_sub_realm_county = { + culture = { + cultural_acceptance = { target = scope:councillor_liege.culture value < 52 } + } + } + NOT = { + has_focus = stewardship_domain_focus + } + } + add_character_flag = { + flag = no_ai_increase_development + years = 15 + } + } + else = { + add_character_flag = { + flag = no_ai_increase_development + years = 5 + } + } + } + + # Struggle Catalyst + if = { + limit = { + exists = scope:county + # target someone from diff faith or culture + scope:county = { + NAND = { + faith = scope:councillor_liege.faith + culture = scope:councillor_liege.culture + } + } + + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_improve_development_vassal_diff_faith_culture + } + } + scope:councillor_liege = { + every_character_struggle = { + involvement = involved + activate_struggle_catalyst = { + catalyst = catalyst_improve_development_vassal_diff_faith_culture + character = scope:councillor_liege + } + } + } + # Struggle Parameter + if = { + limit = { + scope:county.culture != scope:councillor_liege.culture + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = gain_acceptance_when_developing_other_culture_county + } + } + scope:county.culture = { + save_scope_as = current_culture + change_cultural_acceptance = { + target = scope:councillor_liege.culture + value = miniscule_cultural_acceptance_value + desc = cultural_acceptance_gain_from_phase_effects + } + } + } + + } + } + else_if = { # fallback for previous save: the effect would trigger a month later + limit = { + exists = scope:county + } + scope:county = { + set_variable = { + name = current_development_level + value = development_level + } + } + } + } + } + + ai_will_do = { + value = 0 + if = { + limit = { + scope:councillor = { + is_performing_council_task = task_develop_county + } + } + add = 10000 # Always keep going if this is already chosen + } + if = { + # Don't do this too often + limit = { + scope:councillor_liege = { has_character_flag = no_ai_increase_development } + } + multiply = 0 + } + else_if = { + limit = { + scope:councillor_liege.gold >= steward_increase_development_value + } + add = 300 + } + if = { + limit = { + scope:councillor_liege.gold < 10 + } + multiply = 0 + } + + # AI directive + if = { + limit = { + scope:councillor_liege = { + has_character_flag = vassal_directive_improve_development + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + } + add = 50000 + } + } +} + +task_promote_culture = { + position = councillor_steward + + task_type = task_type_county + county_target = realm + ai_county_target = realm + task_progress = task_progress_percentage + restart_on_finish = yes + highlight_own_realm = yes + + asset = { + icon = "gfx/interface/icons/council_task_types/task_promote_culture.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + effect_desc = { + desc = { + desc = task_promote_culture_effect_desc + triggered_desc = { + trigger = { + scope:councillor_liege = { + any_vassal = { + vassal_stance = minority + } + } + } + desc = minority_disapproves_conversion_tooltip + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { exists = scope:county } + scope:county = { + culture != scope:councillor_liege.culture + } + NOT = { + scope:councillor_liege.culture = { + is_hybrid_culture = yes + any_parent_culture = { + this = scope:county.culture + } + } + } + } + trigger_else = { always = no } + } + desc = task_promote_culture_acceptance_effect_desc + } + } + desc = { + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_task_efficient_taxation_modifier } + } + } + } + desc = task_promote_culture_improve_county_opinion + } + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_task_efficient_taxation_modifier } + } + } + } + desc = task_promote_culture_increased_taxes + } + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_task_efficient_taxation_modifier } + } + } + } + desc = task_promote_culture_increased_levies + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_settler_resistance_modifier } + } + } + } + desc = task_promote_culture_resistance_to_settlers + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_settler_resistance_modifier } + } + } + } + desc = task_promote_culture_resistance_to_administration + } + } + } + + is_valid_showing_failures_only = { + tgp_natural_disaster_councillor_available_for_task_trigger = yes + } + + progress = { + value = 0 + add = { + value = steward_promote_culture_base + desc = STEWARD_PROGRESS_BASE + } + add = { + value = scope:councillor.steward_promote_culture_monthly_increase + desc = SCALED_COUNCILLOR_STEWARDSHIP_VALUE + } + + add = steward_promote_culture_contextual_bonuses + + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + development_level > 0 + } + } + add = { + value = scope:county.promote_culture_development_penalty + desc = STEWARD_PROMOTE_CULTURE_DEVELOPMENT_PENALTY + } + } + + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 25 + county_control >= 0 + } + } + multiply = { + value = 0.3 + desc = STEWARD_PROMOTE_CULTURE_LOW_CONTROL_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 50 + county_control > 25 + } + } + multiply = { + value = 0.5 + desc = STEWARD_PROMOTE_CULTURE_MEDIUM_CONTROL_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 75 + county_control > 50 + } + } + multiply = { + value = 0.7 + desc = STEWARD_PROMOTE_CULTURE_HIGH_CONTROL_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control <= 100 + county_control > 75 + } + } + multiply = { + value = 1.2 + desc = STEWARD_PROMOTE_CULTURE_HIGH_CONTROL_BONUS + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county + scope:county = { + county_control > 100 + } + } + multiply = { + value = 1.5 + desc = STEWARD_PROMOTE_CULTURE_ABSOLUTE_CONTROL_BONUS + } + } + ##### + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.title_province + scope:county.title_province = { + OR = { + terrain = jungle + terrain = mountains + terrain = desert + terrain = desert_mountains + terrain = taiga + terrain = wetlands + } + } + } + multiply = { + value = 0.4 + desc = STEWARD_PROMOTE_CULTURE_HIGH_TERRAIN_PENALTY + } + } + if = { # Development reduces the speed. Should be the last non-multiply modifier applied to avoid negative values + limit = { + exists = scope:county.title_province + scope:county.title_province = { + OR = { + terrain = floodplains + terrain = drylands + terrain = steppe + terrain = forest + terrain = hills + terrain = tells + } + } + } + multiply = { + value = 0.5 + desc = STEWARD_PROMOTE_CULTURE_LOW_TERRAIN_PENALTY + } + } + # Conversion speed game rules + if = { + limit = { + has_game_rule = slower_culture_conversion_speed + } + multiply = { + value = slower_game_rule_value + desc = GAME_RULE_SLOWER_REASON + } + } + if = { + limit = { + has_game_rule = significantly_slower_culture_conversion_speed + } + multiply = { + value = significantly_slower_game_rule_value + desc = GAME_RULE_SIGNIFICANTLY_SLOWER_REASON + } + } + if = { + limit = { + has_game_rule = significantly_faster_culture_conversion_speed + } + multiply = { + value = significantly_faster_game_rule_value + desc = GAME_RULE_SIGNIFICANTLY_FASTER_REASON + } + } + if = { + limit = { + has_game_rule = faster_culture_conversion_speed + } + multiply = { + value = faster_game_rule_value + desc = GAME_RULE_FASTER_REASON + } + } + # Faster conversion for FP2 Hostility ending, if county is in Iberia and culture was involved + if = { + limit = { + any_in_global_list = { + variable = fp2_struggle_ending_culture_list + this = scope:county.culture + } + scope:county.title_province = { geographical_region = world_europe_west_iberia } + scope:councillor.liege.house = { + OR = { + has_house_modifier = fp2_struggle_hostility_house_culture_modifier + has_house_modifier = fp2_struggle_hostility_house_combined_modifier + } + } + } + multiply = { + value = fp2_struggle_hostility_conversion_value + desc = fp2_struggle_hostility_culture_conversion_task_desc + } + } + if = { + limit = { + scope:councillor_liege = { + has_character_modifier = devoted_to_tradition_modifier + } + } + multiply = { + value = 1.25 + desc = bp2_devoted_to_tradition_modifier_conversion_task_desc + } + } + if = { + limit = { + scope:councillor_liege = { + has_title = title:c_byzantion + title:c_byzantion = { has_county_modifier = pandidakterion_university_modifier } + } + } + multiply = { + value = 1.25 + desc = pandidakterion_university_modifier + } + } + if = { + limit = { + scope:county = { has_county_modifier = improve_promote_culture_modifier } + scope:councillor_liege = scope:county.holder.top_liege + } + multiply = { + value = 1.20 + desc = improve_promote_culture_modifier + } + } + } + + potential_county = { + scope:county = { + is_landless_type_title = no + culture != scope:councillor_liege.culture + trigger_if = { + limit = { + scope:councillor_liege = { has_variable = hold_court_8130_culture_block } + } + custom_tooltip = { + text = hold_court_8130_conversion_tt + culture != scope:councillor_liege.var:hold_court_8130_culture_block + } + } + } + trigger_if = { + limit = { + scope:councillor_liege = { + is_ai = yes + NAND = { # AI Directives override this + has_character_flag = vassal_directive_convert_culture + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + } + } + NAND = { # Princes in the HRE tend to not convert each other's cultures + exists = title:e_hre.holder + scope:councillor_liege.top_liege = title:e_hre.holder + OR = { + scope:councillor_liege.culture = culture:czech + scope:councillor_liege.culture = { has_cultural_pillar = heritage_central_germanic } + } + OR = { + scope:county.culture = culture:czech + scope:county.culture = { has_cultural_pillar = heritage_central_germanic } + } + } + NOT = { # Do not eliminate the Basques + scope:county.culture = { + this = culture:basque + any_culture_county = { + count <= 5 + } + } + } + scope:councillor_liege = { + OR = { + NOT = { + scope:county.culture = { + cultural_acceptance = { target = scope:councillor_liege.culture value >= 50 } + } + } + scope:county = { + this = title:c_maragha + culture = culture:turkish + } + culture = { # All AI's are motivated to spread new Hybrid/Divergent cultures + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + NOT = { # Leave the Welsh alone! + this = culture:anglo_saxon + } + any_parent_culture = { + this = scope:county.culture + } + } + culture = { # Small cultures want to grow a bit + any_culture_county = { + count < 10 + } + } + scope:county.culture = { # 'dead' small cultures can go away + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + any_culture_county = { + count < 10 + } + OR = { + NOT = { exists = culture_head } + any_culture_county = { + count < 5 + } + } + } + AND = { + # Scottish rulers should convert counties of 'old' cultures to the new one. + culture = culture:scottish + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:gaelic + scope:county.culture = culture:cumbrian + scope:county.culture = culture:pictish + } + } + AND = { + # English rulers should convert counties of 'old' cultures to the new one. + culture = culture:english + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:norman + } + } + AND = { + # German rulers want to convert the polabians + culture = { has_cultural_pillar = heritage_central_germanic } + scope:county.culture = culture:polabian + NOT = { scope:councillor_liege.primary_title = title:e_hre } + } + + AND = { + # Japanese rulers should convert Emishi counties + culture = culture:japanese + scope:county.culture = culture:emishi + } + } + OR = { + is_independent_ruler = yes + primary_title.tier > tier_county + culture = { # All AI's are motivated to spread new Hybrid/Divergent cultures + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + any_parent_culture = { + this = scope:county.culture + } + } + culture = { # Small cultures want to grow a bit + any_culture_county = { + count < 10 + } + } + scope:county.culture = { # 'dead' small cultures can go away + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + any_culture_county = { + count < 10 + } + OR = { + NOT = { exists = culture_head } + any_culture_county = { + count < 5 + } + } + } + culture = { # Imperious cultures want to grow to a certain size + culture_head ?= { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + sub_realm_size >= 30 + } + any_culture_county = { + count < 35 + } + } + AND = { + # Scottish rulers should convert counties of 'old' cultures to the new one. + culture = culture:scottish + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:gaelic + scope:county.culture = culture:cumbrian + scope:county.culture = culture:pictish + } + } + AND = { + # English rulers should convert counties of 'old' cultures to the new one. + culture = culture:english + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:norman + } + } + AND = { + # German rulers want to convert the polabians + culture = { has_cultural_pillar = heritage_central_germanic } + scope:county.culture = culture:polabian + NOT = { scope:councillor_liege.primary_title = title:e_hre } + } + AND = { + # Japanese rulers should convert Emishi counties + culture = culture:japanese + scope:county.culture = culture:emishi + } + } + } + OR = { + scope:county = { + any_neighboring_county = { + culture = scope:councillor_liege.culture # The AI only wants to convert counties bordering their own culture + } + } + AND = { # The English want to convert the Anglo Saxons and Cumbrians + scope:councillor_liege.culture = culture:english + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:cumbrian + } + } + AND = { # The Scots want to convert the Anglo Saxons, Cumbrians and Gaelic + scope:councillor_liege.culture = culture:scottish + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:gaelic + scope:county.culture = culture:cumbrian + scope:county.culture = culture:pictish + } + } + AND = { # The Gaels want to convert the Picts and Cumbrians + scope:councillor_liege.culture = culture:gaelic + OR = { + scope:county.culture = culture:cumbrian + scope:county.culture = culture:pictish + } + } + AND = { # The modern scandinavians want to convert the Norse + OR = { + scope:councillor_liege.culture = culture:swedish + scope:councillor_liege.culture = culture:danish + scope:councillor_liege.culture = culture:norwegian + } + scope:county.culture = culture:norse + } + AND = { # The Portuguese should want to convert Suebi + scope:councillor_liege.culture = culture:portuguese + scope:county.culture = culture:suebi + } + AND = { # The Iberians want to convert Visigothic + scope:councillor_liege.culture = { has_cultural_pillar = heritage_iberian } + NOT = { scope:councillor_liege.culture = culture:portuguese } + scope:county.culture = culture:visigothic + } + AND = { + # German rulers want to convert the polabians + scope:councillor_liege.culture = { has_cultural_pillar = heritage_central_germanic } + scope:county.culture = culture:polabian + NOT = { scope:councillor_liege.primary_title = title:e_hre } + } + AND = { + # Japanese rulers should convert Emishi counties + scope:councillor_liege.culture = culture:japanese + scope:county.culture = culture:emishi + } + } + } + trigger_else_if = { # But AI Directives should still try to look pretty + limit = { + scope:councillor_liege = { + is_ai = yes + has_character_flag = vassal_directive_convert_culture + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + } + trigger_if = { + limit = { + scope:county = { + any_neighboring_county = { + culture = scope:councillor_liege.culture + } + } + } + scope:county = { + any_neighboring_county = { + culture = scope:councillor_liege.culture # The AI only wants to convert counties bordering their own culture + } + } + } + trigger_else = { + always = yes + } + } + trigger_else = { + } + } + + on_finish_task_county = { + scope:councillor_liege = { + if = { + limit = { + NOT = { + culture = { + is_hybrid_culture = yes + any_parent_culture = { + this = scope:county.culture + } + } + } + } + if = { + limit = { + top_liege != this + } + add_character_flag = { + flag = no_ai_culture_convert + years = 60 + } + } + else = { + add_character_flag = { + flag = no_ai_culture_convert + years = 30 + } + } + } + } + scope:county = { + if = { + limit = { + NOT = { + scope:councillor_liege.culture = { + is_hybrid_culture = yes + any_parent_culture = { + this = scope:county.culture + } + } + } + } + culture = { + change_cultural_acceptance = { + target = scope:councillor_liege.culture + value = culture_conversion_acceptance_impact + desc = cultural_acceptance_loss_promote_culture + } + } + } + set_county_culture = scope:councillor_liege.culture + } + scope:councillor = { + start_default_task = yes + } + } + + monthly_on_action = task_promote_culture_side_effects + + ai_will_do = { + value = 0 + if = { + limit = { + scope:councillor = { + is_performing_council_task = task_promote_culture + } + } + add = 10000 # Always keep going if this is already chosen + } + else_if = { + limit = { + scope:councillor_liege = { + gold > 0 + OR = { + gold >= steward_convert_culture_value + AND = { + culture = culture:scottish + top_liege.primary_title = title:k_scotland + capital_county.kingdom = title:k_scotland + } + AND = { + culture = culture:english + top_liege.primary_title = title:k_england + capital_county.kingdom = title:k_england + } + AND = { + culture = { has_cultural_pillar = heritage_central_germanic } + top_liege.primary_title = title:e_hre + OR = { + capital_county.kingdom = title:k_sorbia + capital_county.kingdom = title:k_east_francia + capital_county.kingdom = title:k_saxony + capital_county.kingdom = title:k_pomerania + } + } + AND = { + culture = culture:japanese + capital_county.empire = title:e_japan + } + AND = { + culture = { + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + } + any_realm_county = { + culture = { + save_temporary_scope_as = culture_check + scope:councillor_liege.culture = { + any_parent_culture = { + this = scope:culture_check + } + } + } + } + } + culture = { # Small cultures want to grow a bit + any_culture_county = { + count < 10 + } + } + culture = { # Imperious cultures want to grow to a certain size + culture_head ?= { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + sub_realm_size >= 30 + } + NOR = { + has_cultural_pillar = ethos_egalitarian + has_cultural_tradition = tradition_xenophilic + } + any_culture_county = { + count < 35 + } + } + } + } + } + add = 500 + } + if = { + limit = { + scope:councillor_liege.culture = { + has_cultural_parameter = less_likely_to_promote_culture + } + } + add = -250 + } + if = { + limit = { + scope:councillor_liege = { + culture = { + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + } + any_sub_realm_county = { + culture = { + save_temporary_scope_as = culture_check + scope:councillor_liege.culture = { + any_parent_culture = { + this = scope:culture_check + } + } + } + } + } + } + add = 200 + } + # Motivate the AI with an escalation agenda to take this task + if = { + limit = { + has_character_flag = agenda_towards_escalation + } + add = 500 + } + else_if = { + limit = { + has_character_flag = agenda_towards_deescalation + } + add = -250 + } + if = { + # Don't do this too often + limit = { + scope:councillor_liege = { + has_character_flag = no_ai_culture_convert + NAND = { # ignore it if in Hostility with escalation + has_character_flag = agenda_towards_escalation + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + is_struggle_phase = struggle_iberia_phase_hostility + } + } + } + } + multiply = 0 + } + if = { + # Interrupt this task if you're bankrupt + limit = { + scope:councillor_liege = { + gold < -50 + } + } + multiply = 0 + } + + # AI directive + if = { + limit = { + scope:councillor_liege = { + has_character_flag = vassal_directive_convert_culture + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + } + add = 50000 + } + } +} + +# This task is referenced from code so as to hook into the culture acceptance gain +# Its progress rate will be applied between the owner's culture and the culture of the county +task_accept_culture = { + position = councillor_steward + + task_type = task_type_county + county_target = realm + ai_county_target = realm + highlight_own_realm = yes + task_progress = task_progress_infinite + + asset = { + icon = "gfx/interface/icons/council_task_types/task_accept_culture.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + effect_desc = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:province } + desc = task_accept_culture_desc + } + desc = task_accept_culture_base_desc + } + desc = task_accept_culture_base_value_desc + triggered_desc = { + trigger = { + scope:councillor_liege = { + top_liege = this + } + } + desc = task_accept_culture_independent_desc + } + triggered_desc = { + trigger = { + scope:councillor_liege = { + has_royal_court = yes + has_dlc_feature = royal_court + has_court_type = court_administrative + court_grandeur_current_level >= 4 + } + } + desc = task_accept_culture_court_type_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_customs_legacy_perk = yes + } + desc = task_accept_culture_customs_bonus_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + desc = task_accept_culture_erudition_bonus_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_family_business_bonus = yes + } + desc = task_accept_culture_family_business_bonus_desc + } + triggered_desc = { + trigger = { + councillor_liege_has_consulted_house_bonus = yes + } + desc = task_accept_culture_consulted_house_bonus_desc + } + triggered_desc = { + trigger = { + exists = scope:county + culture = scope:county.culture + } + desc = task_accept_culture_same_culture_desc + } + desc = task_accept_culture_other_desc + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + + } + desc = task_accept_culture_loss_of_control + } + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + trigger_if = { + limit = { + exists = scope:county + } + scope:county = { + NOT = { has_county_modifier = steward_accept_culture_reduced_taxes_modifier } + } + } + } + desc = task_accept_culture_reduced_tax_income + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOR = { + has_county_modifier = steward_accept_culture_reduced_development_spread_modifier + has_county_modifier = steward_accept_culture_increased_development_spread_modifier + } + } + } + } + desc = task_accept_culture_reduced_development_growth + } + triggered_desc = { + trigger = { + stewardship > average_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOR = { + has_county_modifier = steward_accept_culture_reduced_development_spread_modifier + has_county_modifier = steward_accept_culture_increased_development_spread_modifier + } + } + } + } + desc = task_accept_culture_increased_development_growth + } + triggered_desc = { + trigger = { + stewardship > average_skill_rating + trigger_if = { + limit = { exists = scope:county } + scope:county = { + NOT = { has_county_modifier = steward_accept_culture_increased_opinion_modifier } + } + } + } + desc = task_accept_culture_increased_opinion + } + triggered_desc = { + trigger = { + stewardship > average_skill_rating + } + desc = task_accept_culture_acceptance_boost + } + } + + is_valid_showing_failures_only = { + scope:councillor_liege = { + highest_held_title_tier >= tier_duchy + } + tgp_natural_disaster_councillor_available_for_task_trigger = yes + } + + progress = { + value = 0 + add = { + value = task_accept_culture_base_progress + desc = STEWARD_PROGRESS_BASE + } + add = { + value = scope:councillor.steward_accept_culture_yearly_increase + desc = SCALED_COUNCILLOR_STEWARDSHIP_VALUE + } + + if = { + limit = { + scope:councillor.culture = scope:county.culture + } + add = { + value = scope:councillor.steward_accept_culture_yearly_increase_same_culture_bonus + desc = COUNCILLOR_SAME_CULTURE_AS_TARGET + } + } + + if = { + limit = { + councillor_liege_has_customs_legacy_perk = yes + } + add = { + value = scope:councillor.steward_accept_culture_customs_bonus_yearly_increase + desc = CUSTOMS_DYNASTY_PERK_BONUS_VALUE + } + } + + if = { + limit = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + add = { + value = scope:councillor.steward_accept_culture_erudition_bonus_yearly_increase + desc = ERUDITION_DYNASTY_PERK_BONUS_VALUE + } + } + + if = { + limit = { + councillor_liege_has_family_business_bonus = yes + } + add = { + value = scope:councillor.steward_promote_culture_family_business_bonus + desc = FAMILY_BUSINESS_BONUS_VALUE + } + } + + # Relation Bonuses/Penalties + if = { # Friend + limit = { + scope:councillor_liege = { + has_relation_friend = scope:councillor + NOT = { has_relation_best_friend = scope:councillor } + } + } + add = { + value = scope:councillor.steward_accept_culture_yearly_increase_friend_bonus + desc = COUNCILLOR_IS_YOUR_FRIEND + } + } + if = { # Best Friend + limit = { + scope:councillor_liege = { + has_relation_best_friend = scope:councillor + } + } + add = { + value = scope:councillor.steward_accept_culture_yearly_increase_best_friend_bonus + desc = COUNCILLOR_IS_YOUR_BEST_FRIEND + } + } + if = { # Rival + limit = { + scope:councillor_liege = { + has_relation_rival = scope:councillor + NOT = { has_relation_nemesis = scope:councillor } + } + } + add = { + value = scope:councillor.steward_accept_culture_yearly_increase_rival_bonus + desc = COUNCILLOR_IS_YOUR_RIVAL + } + } + if = { # Nemesis + limit = { + scope:councillor_liege = { + has_relation_nemesis = scope:councillor + } + } + add = { + value = scope:councillor.steward_accept_culture_yearly_increase_nemesis_bonus + desc = COUNCILLOR_IS_YOUR_NEMESIS + } + } + if = { # Independent Ruler + limit = { + scope:councillor_liege = { + top_liege = this + } + } + add = { + value = steward_accept_culture_yearly_increase_independent_bonus + desc = COUNCILLOR_LIEGE_IS_INDEPENDENT + } + } + + if = { # Court Type bonus + limit = { + scope:councillor_liege = { + has_royal_court = yes + has_dlc_feature = royal_court + has_court_type = court_administrative + court_grandeur_current_level >= 4 + } + } + add = { + value = steward_accept_culture_court_type_bonus + desc = COUNCILLOR_LIEGE_HAS_COURT_TYPE_BONUS + } + } + + if = { # Wayfarer Bonus + limit = { + liege = { has_perk = of_the_people_perk } + } + multiply = 1.3 + } + } + + potential_county = { + scope:county = { + is_landless_type_title = no + culture != scope:councillor_liege.culture + NOT = { + culture = { + cultural_acceptance = { target = scope:councillor_liege.culture value >= 100 } + } + } + trigger_if = { + limit = { + scope:councillor_liege = { is_ai = yes } + } + NAND = { + # Scottish rulers should convert counties of 'old' cultures to the new one. + scope:councillor_liege.culture = culture:scottish + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:gaelic + scope:county.culture = culture:cumbrian + scope:county.culture = culture:pictish + } + } + NAND = { + # English rulers should convert counties of 'old' cultures to the new one. + scope:councillor_liege.culture = culture:english + OR = { + scope:county.culture = culture:anglo_saxon + scope:county.culture = culture:norman + } + } + NAND = { + # German rulers want to convert the polabians + scope:councillor_liege.culture = { has_cultural_pillar = heritage_central_germanic } + scope:county.culture = culture:polabian + NOT = { scope:councillor_liege.primary_title = title:e_hre } + } + NAND = { + # Japanese rulers should convert Emishi counties + scope:councillor_liege.culture = culture:japanese + scope:county.culture = culture:emishi + } + OR = { + scope:councillor_liege = { + has_character_flag = vassal_directive_improve_cultural_acceptance + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + this = scope:councillor_liege.capital_county + scope:councillor_liege.capital_county = { + OR = { + culture = scope:councillor_liege.culture + culture = { + cultural_acceptance = { target = scope:councillor_liege.culture value >= 50 } + } + } + } + } + } + } + } + + monthly_on_action = task_accept_culture_side_effects + + ai_will_do = { + value = 1 + + if = { + # Prefer this over Collecting Taxes if you have some money + limit = { + scope:councillor_liege.gold >= steward_increase_development_value + } + add = 1 + } + + if = { + # Compassionate rulers like doing this + limit = { + scope:councillor_liege.ai_compassion > 0 + } + add = { + value = scope:councillor_liege.ai_compassion + divide = 5 + } + } + + if = { + # And those with the Open Minded perk + limit = { + scope:councillor_liege = { + has_perk = open_minded_perk + } + } + add = 15 + } + + if = { + # And the norse! + limit = { + scope:councillor_liege = { + culture = culture:norse + } + } + add = 15 + } + + if = { + # Rulers with a capital culture that isn't particularly accepted like this if they have some more counties in their realm of the culture + limit = { + scope:councillor_liege = { + capital_county ?= { + save_temporary_scope_as = county_check + NOR = { + culture = scope:councillor_liege.culture + scope:councillor_liege.culture = { + OR = { + is_hybrid_culture = yes + is_divergent_culture = yes + } + any_parent_culture = { + this = scope:county_check.culture + } + } + culture = { + cultural_acceptance = { target = scope:councillor_liege.culture value >= 50 } + } + } + } + any_sub_realm_county = { + count >= 3 + culture = scope:councillor_liege.capital_county.culture + } + } + } + add = 300 + } + + if = { + # More likely for independent rulers + limit = { + scope:councillor_liege = { + top_liege = this + } + } + multiply = 2 + } + if = { + # More likely for xenophiles + limit = { + scope:councillor_liege = { + culture = { + OR = { + has_cultural_tradition = tradition_xenophilic + has_cultural_tradition = tradition_fp2_malleable_subjects + } + } + } + } + multiply = 2 + } + if = { + # Interrupt this task if you're bankrupt + limit = { + scope:councillor_liege = { + gold < -50 + } + } + multiply = 0 + } + + # AI directive + if = { + limit = { + scope:councillor_liege = { + has_character_flag = vassal_directive_improve_cultural_acceptance + vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } + } + } + add = 50000 + } + } +} + +task_convince_dejure = { + position = councillor_steward + + task_type = task_type_county + county_target = neighbor_land + ai_county_target = neighbor_land + task_progress = task_progress_percentage + + asset = { + icon = "gfx/interface/icons/council_task_types/task_convince_dejure.dds" + background = "gfx/interface/buttons/button_round_bg.dds" + frame = "gfx/interface/buttons/button_round_frame.dds" + glow = "gfx/particles/halo.dds" + } + + effect_desc = { + desc = { + desc = task_convince_dejure_effect_desc + desc = council_task_possible_side_effects + triggered_desc = { + trigger = { + stewardship > mediocre_skill_rating + } + desc = task_convince_dejure_gain_prestige + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + } + desc = task_convince_dejure_lose_prestige + } + triggered_desc = { + trigger = { + stewardship < high_skill_rating + } + desc = task_convince_dejure_diplomatic_blunder + } + } + } + + is_shown = { + has_dlc_feature = royal_court + } + + progress = { + value = 0 + add = { + value = steward_convince_dejure_base + desc = STEWARD_PROGRESS_BASE + } + add = { + value = scope:councillor.steward_convince_dejure_monthly_increase + desc = SCALED_COUNCILLOR_STEWARDSHIP_VALUE + } + #CGV bonuses/maluses + if = { + limit = { + scope:councillor_liege = { + court_grandeur_current_level = 7 + } + } + add = { + value = 0.1 + desc = steward_convince_dejure_cg_bonus_desc + } + } + if = { + limit = { + scope:councillor_liege = { + court_grandeur_current_level = 8 + } + } + add = { + value = 0.2 + desc = steward_convince_dejure_cg_bonus_desc + } + } + if = { + limit = { + scope:councillor_liege = { + court_grandeur_current_level = 9 + } + } + add = { + value = 0.3 + desc = steward_convince_dejure_cg_bonus_desc + } + } + if = { + limit = { + scope:councillor_liege = { + court_grandeur_current_level = 10 + } + } + add = { + value = 0.4 + desc = steward_convince_dejure_cg_bonus_desc + } + } + if = { + limit = { + scope:county.holder.top_liege = { + court_grandeur_current_level = 7 + } + } + add = { + value = -0.1 + desc = steward_convince_dejure_cg_malus_desc + } + } + if = { + limit = { + scope:county.holder.top_liege = { + court_grandeur_current_level = 8 + } + } + add = { + value = -0.2 + desc = steward_convince_dejure_cg_malus_desc + } + } + if = { + limit = { + scope:county.holder.top_liege = { + court_grandeur_current_level = 9 + } + } + add = { + value = -0.3 + desc = steward_convince_dejure_cg_malus_desc + } + } + if = { + limit = { + scope:county.holder.top_liege = { + court_grandeur_current_level = 10 + } + } + add = { + value = -0.4 + desc = steward_convince_dejure_cg_malus_desc + } + } + # Relation Bonuses/Penalties + if = { # Friend + limit = { + scope:councillor_liege = { + has_relation_friend = scope:councillor + NOT = { has_relation_best_friend = scope:councillor } + } + } + add = { + value = scope:councillor.steward_convince_dejure_monthly_increase_friend_bonus + desc = COUNCILLOR_IS_YOUR_FRIEND + } + } + if = { # Best Friend + limit = { + scope:councillor_liege = { + has_relation_best_friend = scope:councillor + } + } + add = { + value = scope:councillor.steward_convince_dejure_monthly_increase_best_friend_bonus + desc = COUNCILLOR_IS_YOUR_BEST_FRIEND + } + } + if = { # Rival + limit = { + scope:councillor_liege = { + has_relation_rival = scope:councillor + NOT = { has_relation_nemesis = scope:councillor } + } + } + add = { + value = scope:councillor.steward_convince_dejure_monthly_increase_rival_bonus + desc = COUNCILLOR_IS_YOUR_RIVAL + } + } + if = { # Nemesis + limit = { + scope:councillor_liege = { + has_relation_nemesis = scope:councillor + } + } + add = { + value = scope:councillor.steward_convince_dejure_monthly_increase_nemesis_bonus + desc = COUNCILLOR_IS_YOUR_NEMESIS + } + } + if = { + limit = { + councillor_liege_has_erudition_legacy_5_perk = yes + } + add = { + value = steward_convince_dejure_erudition_bonus + desc = ERUDITION_DYNASTY_PERK_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_family_business_bonus = yes + } + add = { + value = steward_convince_dejure_family_business_bonus + desc = FAMILY_BUSINESS_BONUS_VALUE + } + } + if = { + limit = { + councillor_liege_has_consulted_house_bonus = yes + } + add = { + value = steward_convince_dejure_consulted_house_bonus + desc = CONSULTED_HOUSE_BONUS_VALUE + } + } + } + + is_valid_showing_failures_only = { + scope:councillor_liege = { + #Unlocked at Court Grandeur level 6 + court_grandeur_current_level >= 6 + } + tgp_natural_disaster_councillor_available_for_task_trigger = yes + } + + potential_county = { + scope:county = { is_landless_type_title = no } + custom_tooltip = { + text = steward_convince_dejure_potential_county_tt + scope:councillor_liege = { + any_held_title = { + any_in_de_jure_hierarchy = { + tier = tier_county + NOT = { + has_county_modifier = steward_de_jure_denied_modifier + } + this = scope:county + holder = { + NOT = { + target_is_liege_or_above = scope:councillor_liege + } + } + } + } + } + } + custom_tooltip = steward_convince_dejure_potential_county_tt_2 + trigger_if = { + limit = { + scope:councillor_liege = { is_ai = yes } + } + OR = { + top_liege = this + scope:councillor_liege.primary_title.tier > tier_county + } + scope:county = { + any_neighboring_county = { + holder.top_liege = scope:councillor_liege # The AI only wants to convince counties bordering their own land + } + } + } + } + + on_finish_task_county = { + scope:councillor = { + start_default_task = yes + } + scope:councillor_liege = { + if = { + limit = { + top_liege != this + } + add_character_flag = { + flag = no_de_jure_convince + years = 50 + } + } + else = { + add_character_flag = { + flag = no_de_jure_convince + years = 20 + } + } + } + scope:county.holder.top_liege = { + trigger_event = steward_task.0001 + } + } + + monthly_on_action = task_convince_dejure_side_effects + + ai_will_do = { + value = 0 + if = { + limit = { + scope:councillor = { + is_performing_council_task = task_convince_dejure + } + } + add = 10000 # Always keep going if this is already chosen + } + # increase likelyhood with court grandeur level + if = { + limit = { + scope:councillor_liege = { + has_character_modifier = court_grandeur_level_6 + } + } + add = 100 + } + else_if = { + limit = { + scope:councillor_liege = { + has_character_modifier = court_grandeur_level_7 + } + } + add = 150 + } + else_if = { + limit = { + scope:councillor_liege = { + has_character_modifier = court_grandeur_level_8 + } + } + add = 200 + } + else_if = { + limit = { + scope:councillor_liege = { + has_character_modifier = court_grandeur_level_9 + } + } + add = 250 + } + else_if = { + limit = { + scope:councillor_liege = { + has_character_modifier = court_grandeur_level_10 + } + } + add = 300 + } + if = { + # Don't do this too often + limit = { + scope:councillor_liege = { has_character_flag = no_de_jure_convince } + } + multiply = 0 + } + } +}