diff --git a/ChangeLog.txt b/ChangeLog.txt index 1bc8e4837c..a5432f2d90 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +YYYY-MM-DD v0.1.8.3 +----------- + + 2025-11-26 v0.1.8.2 ----------- Culture: @@ -77,6 +81,7 @@ Mechanics: - A new, (currently) decision-driven CB available to the character creating the Frankish Kingdom - Enables the conquest of a neighboring centralized state, seizing all landed titles from the liege and destroying any titular title - Models the Frankish conquest of Soissons in 486 +- "The Matter of Britain" Situation Map and History: - Changes to Germania: diff --git a/WtWSMS/common/casus_belli_types/00_conquest_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/00_conquest_BP_overwrite.txt new file mode 100644 index 0000000000..5064c77185 --- /dev/null +++ b/WtWSMS/common/casus_belli_types/00_conquest_BP_overwrite.txt @@ -0,0 +1,534 @@ +##### Changed from Vanilla: Added situation parameter for cb_lower_prestige_level_requirement +duchy_conquest_cb = { + icon = duchy_conquest_cb + group = conquest + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + + attacker_score_from_occupation_scale = 150 + attacker_score_from_battles_scale = 150 + defender_score_from_battles_scale = 150 + + allowed_for_character = { + can_use_conquest_cbs_trigger = yes + NOT = { + government_has_flag = government_is_landless_adventurer + } + } + + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + highest_held_title_tier >= tier_kingdom + } + prestige_level > -1 + } + trigger_else = { + trigger_if = { + limit = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + ##### Changed from Vanilla vvvvv + OR = { + culture = { has_cultural_parameter = cb_lower_prestige_level_requirement } + #Both have the phase parameter and share a situation + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = scope:defender + TARGET = scope:attacker + } + } + ##### Changed from Vanilla ^^^^^ + } + prestige_level >= 1 + } + trigger_else_if = { + limit = { + OR = { + AND = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + } + ##### Changed from Vanilla vvvvv + OR = { + culture = { has_cultural_parameter = cb_lower_prestige_level_requirement } + #Both have the phase parameter and share a situation + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = scope:defender + TARGET = scope:attacker + } + } + ##### Changed from Vanilla ^^^^^ + } + } + prestige_level >= 2 + } + trigger_else = { + prestige_level >= 3 + } + } + + # Struggle constraint + custom_tooltip = { + text = struggle_involvement_cb_check_failure + struggle_blocks_invasion_conquest_cb_trigger = yes + } + } + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + trigger_if = { + limit = { + government_has_flag = government_is_nomadic + } + scope:defender = { + NOT = { + government_has_flag = government_is_nomadic + } + } + } + } + } + target_titles = all + target_title_tier = duchy + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + ai_can_target_all_titles = { + can_use_viking_invasion_cbs_trigger = yes + } + ai_score_mult = { + value = viking_conquest_ai_score_value + + # As a feudal gov, do not attack tribal + add = { + every_in_list = { + list = target_titles + if = { + limit = { feudal_clan_tribal_conquest_constraints = yes } + add = -1000 + } + } + } + + # AI in struggles act insularly for wars that don't have a familial or legal basis. + multiply = struggle_wars_prioritise_struggle_targets_value + # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. + multiply = byzantium_conquests_ai_score_value + multiply = muslim_invasions_prefer_nonmuslims_ai_score_value + + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + any_in_de_jure_hierarchy = { + tier = tier_county + neighboring_county_or_viking_conquest_trigger = { CHARACTER = root } + } + } + scope:target = { + trigger_if = { + limit = { + scope:attacker = { + is_ai = yes + } + } + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + count >= 2 + tier = tier_county + holder ?= { + OR = { + this = scope:defender + is_vassal_or_below_of = scope:defender + } + } + } + } + } + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + target_is_same_character_or_above = scope:defender + } + } + } + } + } + + on_invalidated_desc = msg_religious_war_invalidation_region_message + + on_invalidated = { + } + + cost = { + piety = { + add = common_cb_impious_piety_cost + if = { + limit = { + scope:defender.faith = scope:attacker.faith + } + add = { + value = 100 + desc = CB_SAME_FAITH_COST + } + add = { + value = 10 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 800 + } + } + multiply = common_cb_piety_cost_multiplier + } + prestige = { + value = 0 + if = { + limit = { + NOT = { scope:defender.faith = scope:attacker.faith } + } + add = { + value = 150 + desc = CB_COST_DIFFERENT_FAITH + } + add = { + value = 10 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 800 + } + } + multiply = common_cb_prestige_cost_multiplier + if = { + limit = { + scope:attacker.house = { + OR = { + has_house_modifier = fp2_struggle_hostility_house_culture_modifier + has_house_modifier = fp2_struggle_hostility_house_combined_modifier + } + } + any_in_global_list = { + variable = fp2_struggle_ending_culture_list + this = scope:attacker.culture + } + any_in_global_list = { + variable = fp2_struggle_ending_culture_list + this = scope:defender.culture + } + } + divide = { + value = 2 + desc = CB_COST_FP2_STRUGGLE_HOSTILITY_CULTURE_DISCOUNT + } + } + if = { + limit = { + has_global_variable = fp2_struggle_compromise_ending + any_in_global_list = { + variable = fp2_struggle_ending_culture_list + this = scope:attacker.culture + } + any_in_global_list = { + variable = fp2_struggle_ending_culture_list + this = scope:defender.culture + } + } + multiply = { + value = 2 + desc = CB_COST_FP2_STRUGGLE_COMPROMISE_MULTIPLIER + } + } + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + # EP3 Laamp possibility warning + scope:defender = { ep3_war_loss_adventurer_tt_effect = yes } + + # go through the dejure hierarchy under target titles, transfer eligible vassals and sieze counties from ineligible ones + every_in_list = { + list = target_titles + custom_tooltip = CONQUEST_CB_TITLE + + conquest_cb_title_transfer = { + RELIGIOUS_WAR = no + } + } + + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:attacker + change = scope:change + } + } + + every_in_list = { + list = titles_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + if = { # Warning that only counties are changing hands + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + } + } + random_in_list = { + list = target_titles + limit = { tier = tier_duchy } + save_scope_as = de_jure_target + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + holder = scope:defender + } + } + if = { + limit = { + scope:defender = { + any_held_title = { + tier = tier_county + NOT = { target_is_de_jure_liege_or_above = scope:de_jure_target } + } + } + } + custom_tooltip = conquest_title_not_transferred_tt + } + else = { custom_tooltip = conquest_title_destroyed_tt } + } + else = { + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + is_title_created = yes + } + } + custom_tooltip = conquest_title_usurp_tt + } + else = { custom_tooltip = conquest_title_create_tt } + } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + # Prestige loss for the attacker + + #EP2 accolade glory gain for doing pretty good against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not impactful as the scale are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "CONQUEST_WAR_NAME" + war_name_base = "CONQUEST_WAR_NAME_BASE" + cb_name = "CONQUEST_DUCHY_CB_NAME" + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} diff --git a/WtWSMS/common/casus_belli_types/00_invasion_war_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/00_invasion_war_BP_overwrite.txt index e3281234e0..088a52ad4a 100644 --- a/WtWSMS/common/casus_belli_types/00_invasion_war_BP_overwrite.txt +++ b/WtWSMS/common/casus_belli_types/00_invasion_war_BP_overwrite.txt @@ -1,4 +1,969 @@ -##### Changed from Vanilla: Made unavailable +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +invasion_war = { + icon = invasion + group = invasion + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + allow_hostages = no + + allowed_for_character = { + OR = { + government_has_flag = government_is_tribal + government_has_flag = government_is_nomadic + faith = { + has_doctrine_parameter = invasion_cb_enabled + } + has_character_flag = bp2_inspired_culture_for_conquest + has_variable = mpo_desperate_stance_invasion_cb_enable_var + ai_should_get_extreme_conqueror_bonuses = yes + } + trigger_if = { + limit = { + NOT = { ai_should_get_extreme_conqueror_bonuses = yes } + } + NOT = { + has_character_flag = used_lifetime_invasion + } + } + NOT = { + government_has_flag = government_is_landless_adventurer + } + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + has_character_flag = bp2_inspired_culture_for_conquest + NOT = { ai_should_get_extreme_conqueror_bonuses = yes } + } + prestige_level >= 0 + } + trigger_else_if = { + limit = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + NOT = { ai_should_get_extreme_conqueror_bonuses = yes } + } + prestige_level >= 2 + } + trigger_else_if = { + limit = { + OR = { + AND = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + } + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + NOT = { ai_should_get_extreme_conqueror_bonuses = yes } + } + prestige_level >= 3 + } + trigger_else_if = { + limit = { + ai_should_get_extreme_conqueror_bonuses = yes + } + } + trigger_else = { + prestige_level >= 4 + } + + custom_tooltip = { + text = struggle_involvement_cb_check_failure + struggle_blocks_invasion_conquest_cb_trigger = yes + } + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + } + } + target_titles = all + target_title_tier = kingdom + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + ai_can_target_all_titles = { + can_use_viking_invasion_cbs_trigger = yes + } + ai_score_mult = { + value = viking_conquest_ai_score_value + + # AI in struggles act insularly for wars that don't have a familial or legal basis. + multiply = struggle_wars_prioritise_struggle_targets_value + # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. + multiply = byzantium_conquests_ai_score_value + multiply = muslim_invasions_prefer_nonmuslims_ai_score_value + + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + any_in_de_jure_hierarchy = { + tier = tier_county + neighboring_county_or_viking_conquest_trigger = { CHARACTER = root } + } + } + scope:target = { + trigger_if = { + limit = { + scope:attacker = { + is_ai = yes + } + } + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + count >= 4 + tier = tier_county + holder ?= { + OR = { + this = scope:defender + is_vassal_or_below_of = scope:defender + } + } + } + } + } + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + target_is_same_character_or_above = scope:defender + } + } + } + } + } + + on_invalidated_desc = msg_invasion_war_invalidated_message + + on_invalidated = { + scope:attacker = { + if = { + limit = { + is_alive = yes + } + remove_character_flag = used_lifetime_invasion # If the war is invalidated, you should be permitted to try again + } + } + } + + cost = { + piety = { + value = 0 + add = common_cb_impious_piety_cost + } + prestige = { + add = { + value = 2000 + desc = CB_BASE_COST + } + + multiply = common_cb_prestige_cost_multiplier + } + } + + on_declaration = { + on_declared_war = yes + scope:attacker = { + add_character_flag = used_lifetime_invasion + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = invasion_war_victory_desc_attacker + } + desc = invasion_war_victory_desc + } + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = invasion_war_warning_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + # Influence + add_influence_attacker_victory_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + show_as_tooltip = { + every_in_list = { + list = target_titles + custom_tooltip = invasion_title_transfer_tt + custom_tooltip = invasion_title_transfer_2_tt + every_in_de_jure_hierarchy = { + limit = { holder.top_liege = scope:defender } + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + } + scope:defender = { + every_sub_realm_county = { + limit = { + county_controller = scope:attacker + } + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + } + } + + hidden_effect = { + setup_invasion_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + change = scope:change + take_occupied = yes + } + resolve_title_and_vassal_change = scope:change + } + + # Attacker gets Prestige Experience, Defender loses Prestige, all other participants gain Prestige based on their war contribution. + modify_all_participants_fame_values = { + WINNER = scope:attacker + LOSER = scope:defender + FAME_BASE = scope:cb_prestige_factor # Set by 'setup_invasion_cb' + IS_RELIGIOUS_WAR = no + WINNER_FAME_SCALE = 10 + LOSER_FAME_SCALE = -10 + WINNER_ALLY_FAME_SCALE = 10 + LOSER_ALLY_FAME_SCALE = 10 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = invasion_war_white_peace_desc_defender + } + desc = invasion_war_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # Not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_white_peace_effect = yes + + scope:attacker = { + add_prestige = mongol_invasion_cb_prestige_white_peace + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = invasion_war_white_peace_desc_defender + } + desc = invasion_war_white_peace_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + # Influence + add_influence_attacker_defeat_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_high_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 5 + } + add_prestige = { + value = massive_prestige_value + multiply = -1.0 + } + } + + setup_invasion_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + claimant = scope:claimant + victory = no + } + + # Attacker loses Prestige, all other war participants gain Prestige (Defender gains full prestige, all allies on both sides gain based on war contribution). + modify_all_participants_fame_values = { + WINNER = scope:defender + LOSER = scope:attacker + FAME_BASE = scope:cb_prestige_factor # Set by 'setup_claim_cb' + IS_RELIGIOUS_WAR = no + WINNER_FAME_SCALE = scale_10_war_defender_win + LOSER_FAME_SCALE = -10 + WINNER_ALLY_FAME_SCALE = 10 + LOSER_ALLY_FAME_SCALE = 10 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "INVASION_WAR_NAME" + war_name_base = "INVASION_WAR_NAME_BASE" + cb_name = "INVASION_CB_NAME" + + interface_priority = 100 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} + +clan_invasion_war = { + icon = vassalization + group = invasion + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + + allow_hostages = no + allowed_for_character = { + government_has_flag = government_is_clan + NAND = { + exists = house + house = { + has_house_unity_parameter = unity_disable_invasions + } + } + trigger_if = { + limit = { + exists = house + house = { + has_house_unity_parameter = unity_multiple_invasions + } + } + NOT = { has_character_flag = unity_invasion_cooldown } + } + trigger_else_if = { + limit = { + exists = house + house = { + has_house_unity_parameter = unity_unlimited_invasions + } + } + always = yes + } + trigger_else = { + NOR = { + has_character_flag = used_lifetime_invasion + has_character_flag = pending_lifetime_invasion + } + } + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 2 + } + trigger_else_if = { + limit = { + OR = { + AND = { + government_has_flag = government_is_clan + house ?= { + has_house_unity_stage = antagonistic + } + } + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + } + prestige_level >= 3 + } + trigger_else = { + prestige_level >= 4 + } + + custom_tooltip = { + text = struggle_involvement_cb_check_failure + struggle_blocks_invasion_conquest_cb_trigger = yes + } + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + } + } + target_titles = all + target_title_tier = all + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + ai_only_against_neighbors = yes + + ai_score_mult = { + value = 1 + + # AI in struggles act insularly for wars that don't have a familial or legal basis. + multiply = struggle_wars_prioritise_struggle_targets_value + # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. + multiply = byzantium_conquests_ai_score_value + multiply = muslim_invasions_prefer_nonmuslims_ai_score_value + + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + tier = tier_kingdom + } + scope:target = { + trigger_if = { + limit = { + scope:attacker = { + is_ai = yes + } + } + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + count >= 5 + tier = tier_county + holder ?= { + OR = { + this = scope:defender + is_vassal_or_below_of = scope:defender + } + } + } + } + } + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + OR = { + this = scope:defender + target_is_liege_or_above = scope:defender + } + } + } + } + } + } + + on_invalidated_desc = msg_invasion_war_invalidated_message + + on_invalidated = { + scope:attacker = { + remove_character_flag = pending_lifetime_invasion # If the war is invalidated, you should be permitted to try again + remove_character_flag = unity_invasion_cooldown # Reset cooldown as well + } + } + + cost = { + piety = { + value = 0 + add = common_cb_impious_piety_cost + } + prestige = { + add = { + value = 200 + desc = CB_BASE_COST + } + add = { + value = 20 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 5000 + } + + multiply = common_cb_prestige_cost_multiplier + } + } + + on_declaration = { + on_declared_war = yes + scope:attacker = { + add_character_flag = pending_lifetime_invasion + add_character_flag = { + flag = unity_invasion_cooldown + years = unity_antagonistic_invasion_cooldown_value + } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = clan_invasion_war_victory_desc_attacker + } + desc = clan_invasion_war_victory_desc + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + #Let's not display this warning if you have unlimited invasions + NOT = { + house ?= { has_house_unity_parameter = unity_unlimited_invasions } + } + } + } + desc = invasion_war_warning_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + hidden_effect = { + setup_invasion_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + change = scope:change + take_occupied = yes + } + } + + show_as_tooltip = { + every_in_list = { + list = target_titles + if = { + limit = { + scope:defender.primary_title.tier >= scope:attacker.primary_title.tier + } + custom_tooltip = invasion_title_transfer_tt + custom_tooltip = invasion_title_transfer_2_tt + } + every_in_de_jure_hierarchy = { + limit = { + holder.top_liege = scope:defender + } + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + } + scope:defender = { + every_sub_realm_county = { + limit = { + county_controller = scope:attacker + } + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + # Vassal transfer tooltip for display + every_vassal = { + limit = { + primary_title = { + any_this_title_or_de_jure_above = { + is_in_list = target_titles + } + } + } + custom = invasion_vassal_transfer_tt + change_liege = { + liege = scope:attacker + change = scope:change + } + } + } + } + + #If target is lower tier, vassalise them. + if = { + limit = { + scope:defender.primary_title.tier < scope:attacker.primary_title.tier + } + scope:defender = { + change_liege = { + liege = scope:attacker + change = scope:change + } + } + } + + #If target has any personally-held titles of equal tier, excepting empires take them. + #If target is equal tier, + if = { + limit = { + #Conquering, or indirectly butchering, an entire empire in one war is a bit much. + NOT = { scope:defender.primary_title.tier = tier_empire } + scope:defender.primary_title.tier = scope:attacker.primary_title.tier + } + every_in_list = { + list = target_titles + limit = { + holder.top_liege = scope:defender + } + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + } + + hidden_effect = { resolve_title_and_vassal_change = scope:change } + + # Attacker gets Prestige Experience, Defender loses Prestige, all other participants gain Prestige based on their war contribution. + # Prestige level progress for the attacker + scope:attacker = { + add_prestige_experience = { + value = major_prestige_value + } + add_character_flag = used_lifetime_invasion + remove_character_flag = pending_lifetime_invasion + } + + # Prestige loss for the defender + scope:defender = { + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = invasion_war_white_peace_desc_defender + } + desc = invasion_war_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + + #EP2 accolade glory gain for doing ok against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes } + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # Not important as the scales are identical + FAME_BASE = major_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_white_peace_effect = yes + + scope:attacker = { + add_prestige = mongol_invasion_cb_prestige_white_peace + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + add_character_flag = used_lifetime_invasion + remove_character_flag = pending_lifetime_invasion + } + + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = invasion_war_white_peace_desc_defender + } + desc = invasion_war_white_peace_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_high_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 5 + } + add_prestige = { + value = massive_prestige_value + multiply = -1.0 + } + } + + setup_invasion_cb = { + titles = target_titles + attacker = scope:attacker + defender = scope:defender + claimant = scope:claimant + victory = no + } + + # Attacker loses Prestige, all other war participants gain Prestige (Defender gains full prestige, all allies on both sides gain based on war contribution). + modify_all_participants_fame_values = { + WINNER = scope:defender + LOSER = scope:attacker + FAME_BASE = scope:cb_prestige_factor # Set by 'setup_claim_cb' + IS_RELIGIOUS_WAR = no + WINNER_FAME_SCALE = scale_10_war_defender_win + LOSER_FAME_SCALE = -10 + WINNER_ALLY_FAME_SCALE = 10 + LOSER_ALLY_FAME_SCALE = 10 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + add_character_flag = used_lifetime_invasion + remove_character_flag = pending_lifetime_invasion + } + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "INVASION_WAR_NAME" + war_name_base = "INVASION_WAR_NAME_BASE" + cb_name = "CLAN_INVASION_CB_NAME" + + interface_priority = 100 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 + + max_ai_diplo_distance_to_title = 500 +} + +##### Changed from Vanilla: Made unavailable pax_romana_invasion_war = { icon = invasion group = invasion diff --git a/WtWSMS/common/casus_belli_types/00_subjugation_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/00_subjugation_BP_overwrite.txt index 2fdc952eec..645894af6d 100644 --- a/WtWSMS/common/casus_belli_types/00_subjugation_BP_overwrite.txt +++ b/WtWSMS/common/casus_belli_types/00_subjugation_BP_overwrite.txt @@ -1,5 +1,6 @@ ##### Changed from Vanilla: Increased count of lifetime subjugations allowed ##### Changed from Vanilla: Destroys any captured titular titles +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect tribal_subjugation_cb = { icon = vassalization group = subjugation @@ -29,6 +30,8 @@ tribal_subjugation_cb = { } } + ##### Changed from Vanilla vvvvv + # Root is the title # scope:attacker is the attacker # scope:defender is the defender @@ -55,8 +58,15 @@ tribal_subjugation_cb = { } trigger_if = { limit = { - culture = { - has_cultural_parameter = cb_lower_prestige_level_requirement + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } } } prestige_level >= 1 @@ -102,8 +112,15 @@ tribal_subjugation_cb = { house ?= { has_house_unity_stage = antagonistic } - culture = { - has_cultural_parameter = cb_lower_prestige_level_requirement + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } } } prestige_level >= 2 @@ -117,8 +134,15 @@ tribal_subjugation_cb = { has_house_unity_stage = antagonistic } } - culture = { - has_cultural_parameter = cb_lower_prestige_level_requirement + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } } } } @@ -128,7 +152,6 @@ tribal_subjugation_cb = { prestige_level >= 4 } } - ##### Changed from Vanilla vvvvv custom_description = { text = has_used_lifetime_subjugation subject = scope:attacker @@ -139,10 +162,10 @@ tribal_subjugation_cb = { } ##### Changed from Vanilla ^^^^^ } - ##### Changed from Vanilla ^^^^^ } } } + ##### Changed from Vanilla ^^^^^ allowed_against_character = { scope:attacker = { diff --git a/WtWSMS/common/casus_belli_types/01_fp1_wars_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/01_fp1_wars_BP_overwrite.txt index 9affad0430..588868bafc 100644 --- a/WtWSMS/common/casus_belli_types/01_fp1_wars_BP_overwrite.txt +++ b/WtWSMS/common/casus_belli_types/01_fp1_wars_BP_overwrite.txt @@ -4,6 +4,8 @@ # fp1_scandi_adventurer_conquest is kept in event wars due to being AI-only & for performance reasons. +##### Changed from Vanilla: Added some additional restrictions to allow_for_character +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect fp1_varangian_adventurer_conquest = { icon = fp1_varangian_adventurer_conquest group = conquest @@ -55,6 +57,7 @@ fp1_varangian_adventurer_conquest = { } ##### Changed from Vanilla ^^^^^ + ##### Changed from Vanilla vvvvv allowed_for_character_display_regardless = { # Ensure that this is only done every now and then. top_liege = this @@ -63,8 +66,15 @@ fp1_varangian_adventurer_conquest = { limit = { is_ai = no } trigger_if = { limit = { - culture = { - has_cultural_parameter = cb_lower_prestige_level_requirement + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } } } prestige_level >= 1 @@ -76,8 +86,15 @@ fp1_varangian_adventurer_conquest = { trigger_else = { trigger_if = { limit = { - culture = { - has_cultural_parameter = cb_lower_prestige_level_requirement + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } } } prestige_level >= 0 @@ -89,6 +106,7 @@ fp1_varangian_adventurer_conquest = { is_at_war = no tgp_japan_offensive_wars_ban_trigger = yes } + ##### Changed from Vanilla ^^^^^ allowed_against_character = { # Cannot adventure against other adventuring cultures. diff --git a/WtWSMS/common/casus_belli_types/03_fp2_wars_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/03_fp2_wars_BP_overwrite.txt index 253ea14727..dd1154bf24 100644 --- a/WtWSMS/common/casus_belli_types/03_fp2_wars_BP_overwrite.txt +++ b/WtWSMS/common/casus_belli_types/03_fp2_wars_BP_overwrite.txt @@ -24,11 +24,21 @@ fp2_border_raid = { always = yes } trigger_else = { - can_use_struggle_cbs_trigger = yes - # Attacker must be Involved in Struggle during correct phase - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = unlocks_border_raid_casus_belli + OR = { + # Attacker must be Involved in Struggle during correct phase + AND = { + can_use_struggle_cbs_trigger = yes + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_border_raid_casus_belli + } + } + #Attacker must be in situation with correct phase + any_character_situation ?= { + any_situation_sub_region = { + has_sub_region_phase_parameter = unlocks_border_raid_casus_belli + } + } } NOT = { government_has_flag = government_is_landless_adventurer @@ -46,12 +56,50 @@ fp2_border_raid = { scope:attacker.culture = { has_innovation = innovation_tribal_warfare } NOT = { scope:attacker.culture = { has_innovation = innovation_ius_ad_bellum } } } - AND = { - can_use_struggle_cbs_trigger = yes - # Defender must be Involved in Struggle during correct phase - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = unlocks_border_raid_casus_belli + trigger_if = { + limit = { scope:attacker.primary_title.tier = tier_empire } + OR = { + scope:defender.primary_title.tier = tier_empire + scope:defender.primary_title.tier = tier_kingdom + } + } + trigger_else_if = { + limit = { scope:attacker.primary_title.tier = tier_kingdom } + OR = { + scope:defender.primary_title.tier = tier_empire + scope:defender.primary_title.tier = tier_kingdom + scope:defender.primary_title.tier = tier_duchy + } + } + trigger_else_if = { + limit = { scope:attacker.primary_title.tier = tier_duchy } + OR = { + scope:defender.primary_title.tier = tier_empire + scope:defender.primary_title.tier = tier_kingdom + scope:defender.primary_title.tier = tier_duchy + scope:defender.primary_title.tier = tier_county + } + } + trigger_else_if = { + limit = { scope:attacker.primary_title.tier = tier_county } + OR = { + scope:defender.primary_title.tier = tier_empire + scope:defender.primary_title.tier = tier_kingdom + scope:defender.primary_title.tier = tier_duchy + scope:defender.primary_title.tier = tier_county + } + } + trigger_else = { always = no } + } + trigger_else = { + # Defender must be Involved in Struggle during correct phase + OR = { + AND = { + can_use_struggle_cbs_trigger = yes + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_border_raid_casus_belli + } } } } diff --git a/WtWSMS/common/casus_belli_types/07_ep3_admin_cbs_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/07_ep3_admin_cbs_BP_overwrite.txt new file mode 100644 index 0000000000..b21567ae95 --- /dev/null +++ b/WtWSMS/common/casus_belli_types/07_ep3_admin_cbs_BP_overwrite.txt @@ -0,0 +1,920 @@ +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +duchy_expansion_cb = { + icon = duchy_expansion + group = conquest + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + + attacker_score_from_occupation_scale = 150 + attacker_score_from_battles_scale = 150 + defender_score_from_battles_scale = 150 + + allowed_for_character = { + government_allows = administrative + vassal_contract_has_flag = admin_duchy_expansion_unlocked + NOT = { + government_has_flag = government_is_landless_adventurer + } + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 2 + } + trigger_else = { + prestige_level >= 3 + } + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + } + } + target_titles = neighbor_land + target_title_tier = duchy + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + ai_only_against_neighbors = yes + + ai_score_mult = { + value = viking_conquest_ai_score_value + + # As a feudal gov, do not attack tribal + add = { + every_in_list = { + list = target_titles + if = { + limit = { feudal_clan_tribal_conquest_constraints = yes } + add = -1000 + } + } + } + + # AI in struggles act insularly for wars that don't have a familial or legal basis. + multiply = struggle_wars_prioritise_struggle_targets_value + # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. + multiply = byzantium_conquests_ai_score_value + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + target_is_same_character_or_above = scope:defender + } + } + } + } + } + + on_invalidated_desc = msg_religious_war_invalidation_region_message + + on_invalidated = { + } + + cost = { + influence = { + add = { + value = 50 + desc = CB_BASE_COST + } + add = { + value = 1 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 250 + } + multiply = common_cb_cost_multiplier + } + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + add = { + value = 5 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 500 + } + multiply = common_cb_prestige_cost_multiplier + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + # Influence + add_influence_attacker_victory_effect = yes + + # EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + # Go through the dejure hierarchy under target titles, transfer eligible vassals and sieze counties from ineligible ones + every_in_list = { + list = target_titles + custom_tooltip = CONQUEST_CB_TITLE + + expansion_cb_title_transfer = yes + } + + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:attacker + change = scope:change + } + } + + every_in_list = { + list = titles_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + # If applicable, take the target title (i.e. duchy) as well + every_in_list = { + list = target_title_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + if = { # Warning that only counties are changing hands + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + } + } + random_in_list = { + list = target_titles + limit = { tier = tier_duchy } + save_scope_as = de_jure_target + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + holder = scope:defender + } + } + if = { + limit = { + scope:defender = { + any_held_title = { + tier = tier_county + NOT = { target_is_de_jure_liege_or_above = scope:de_jure_target } + } + } + } + custom_tooltip = conquest_title_not_transferred_tt + } + } + else = { + if = { + limit = { + any_in_list = { + list = target_titles + tier >= scope:attacker.highest_held_title_tier + is_title_created = yes + holder = { + NOT = { + any_sub_realm_county = { + NOT = { target_is_de_jure_liege_or_above = scope:de_jure_target } + } + } + } + } + } + custom_tooltip = expansion_take_target_title_tt + } + else_if = { + limit = { + any_in_list = { + list = target_titles + tier >= scope:attacker.highest_held_title_tier + is_title_created = yes + } + } + custom_tooltip = conquest_title_usurp_tt + } + else_if = { + limit = { + any_in_list = { + list = target_titles + tier >= scope:attacker.highest_held_title_tier + is_title_created = no + any_de_jure_county = { + percent > 0.5 + holder ?= { + OR = { + this = scope:defender + any_liege_or_above = { this = scope:defender } + } + } + } + } + } + custom_tooltip = expansion_create_target_title_tt + } + } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + # Prestige loss for the attacker + + # EP2 accolade glory gain for doing pretty good against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not impactful as the scale are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + # Influence + add_influence_attacker_defeat_effect = yes + + # EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "EXPANSION_WAR_NAME" + war_name_base = "EXPANSION_WAR_NAME_BASE" + cb_name = "EXPANSION_DUCHY_CB_NAME" + + interface_priority = 84 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} + +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +naval_duchy_expansion_cb = { + icon = naval_duchy_expansion + group = conquest + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + + attacker_score_from_occupation_scale = 150 + attacker_score_from_battles_scale = 150 + defender_score_from_battles_scale = 150 + + allowed_for_character = { + government_allows = administrative + any_sub_realm_county = { + is_coastal_county = yes + } + vassal_contract_has_flag = admin_naval_duchy_expansion_unlocked + NOT = { + government_has_flag = government_is_landless_adventurer + } + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 2 + } + trigger_else = { + prestige_level >= 3 + } + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { + scope:attacker = { + ALL_FALSE = { + top_liege = scope:defender.top_liege + liege = scope:defender + } + } + } + target_titles = neighbor_land_or_water + target_title_tier = duchy + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + ai_only_against_neighbors = yes + + ai_score_mult = { + value = viking_conquest_ai_score_value + + # As a feudal gov, do not attack tribal + add = { + every_in_list = { + list = target_titles + if = { + limit = { feudal_clan_tribal_conquest_constraints = yes } + add = -1000 + } + } + } + + # AI in struggles act insularly for wars that don't have a familial or legal basis. + multiply = struggle_wars_prioritise_struggle_targets_value + # Tell the Romans to stop going adventuring into the steppe for no gods-damned reason. + multiply = byzantium_conquests_ai_score_value + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + # Target duchy must have counties that are coastal and doesn't border you. + valid_to_start = { + scope:target = { + any_in_de_jure_hierarchy = { + tier = tier_county + is_coastal_county = yes + + NOT = { + any_neighboring_county = { + OR = { + holder = root + holder = { + any_liege_or_above = { this = root } + } + } + } + } + } + } + } + + should_invalidate = { + NOT = { + any_in_list = { + list = target_titles + any_in_de_jure_hierarchy = { + tier = tier_county + holder = { + target_is_same_character_or_above = scope:defender + } + } + } + } + } + + on_invalidated_desc = msg_religious_war_invalidation_region_message + + on_invalidated = { + } + + cost = { + influence = { + add = { + value = 50 + desc = CB_BASE_COST + } + add = { + value = 1 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 250 + } + multiply = common_cb_cost_multiplier + } + prestige = { + add = { + value = 100 + desc = CB_BASE_COST + } + add = { + value = 5 + multiply = scope:attacker.realm_size + desc = CB_REALM_SIZE_COST + max = 500 + } + multiply = common_cb_prestige_cost_multiplier + } + } + + on_declaration = { + on_declared_war = yes + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:attacker = { is_local_player = yes } } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + } + + on_victory = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_victory_effect = yes + + # Influence + add_influence_attacker_victory_effect = yes + + # EP2 accolade glory gain for winning against higher ranked enemy + scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes } + + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = yes + } + + # Go through the dejure hierarchy under target titles, transfer eligible vassals and sieze counties from ineligible ones + every_in_list = { + list = target_titles + custom_tooltip = CONQUEST_CB_TITLE + + expansion_cb_title_transfer = yes + } + + every_in_list = { + list = vassals_taken + change_liege = { + liege = scope:attacker + change = scope:change + } + } + + every_in_list = { + list = titles_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + take_baronies = yes + } + } + + # If applicable, take the target title (i.e. duchy) as well + every_in_list = { + list = target_title_taken + change_title_holder = { + holder = scope:attacker + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + # Prestige Progress for the Attacker + every_in_list = { + list = target_titles + scope:attacker = { + add_prestige_experience = medium_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + if = { # Warning that only counties are changing hands + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + } + } + random_in_list = { + list = target_titles + limit = { tier = tier_duchy } + save_scope_as = de_jure_target + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_duchy + holder = scope:defender + } + } + if = { + limit = { + scope:defender = { + any_held_title = { + tier = tier_county + NOT = { target_is_de_jure_liege_or_above = scope:de_jure_target } + } + } + } + custom_tooltip = conquest_title_not_transferred_tt + } + } + else = { + if = { + limit = { + any_in_list = { + list = target_titles + tier >= scope:attacker.highest_held_title_tier + is_title_created = yes + holder = { + NOT = { + any_sub_realm_county = { + NOT = { target_is_de_jure_liege_or_above = scope:de_jure_target } + } + } + } + } + } + custom_tooltip = expansion_take_target_title_tt + } + else_if = { + limit = { + any_in_list = { + list = target_titles + tier >= scope:attacker.highest_held_title_tier + is_title_created = yes + } + } + custom_tooltip = conquest_title_usurp_tt + } + else_if = { + limit = { + any_in_list = { + list = target_titles + tier >= scope:attacker.highest_held_title_tier + is_title_created = no + any_de_jure_county = { + percent > 0.5 + holder ?= { + OR = { + this = scope:defender + any_liege_or_above = { this = scope:defender } + } + } + } + } + } + custom_tooltip = expansion_create_target_title_tt + } + } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { show_pow_release_message_effect = yes } + # Prestige loss for the attacker + + # EP2 accolade glory gain for doing pretty good against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # not impactful as the scale are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { show_pow_release_message_effect = yes } + + # Legitimacy + add_legitimacy_attacker_defeat_effect = yes + + # Influence + add_influence_attacker_defeat_effect = yes + + # EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "EXPANSION_WAR_NAME" + war_name_base = "EXPANSION_WAR_NAME_BASE" + cb_name = "NAVAL_EXPANSION_DUCHY_CB_NAME" + + interface_priority = 82 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} diff --git a/WtWSMS/common/casus_belli_types/07_ep3_wars_BP_overwrite.txt b/WtWSMS/common/casus_belli_types/07_ep3_wars_BP_overwrite.txt new file mode 100644 index 0000000000..3b71fa5011 --- /dev/null +++ b/WtWSMS/common/casus_belli_types/07_ep3_wars_BP_overwrite.txt @@ -0,0 +1,2410 @@ +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +ep3_laamp_adventurer_county_invasion = { + icon = invasion + group = invasion + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + allow_hostages = no + + allowed_for_character = { + ep3_adventurer_invasion_allowed_for_character_trigger = yes + scope:defender.highest_held_title_tier >= tier_county + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 1 + } + trigger_else = { + prestige_level >= 2 + } + ep3_adventurer_invasion_allowed_for_character_display_regardless_trigger = yes + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { ep3_adventurer_landless_allowed_against_character_trigger = yes } + + target_titles = all + target_title_tier = county + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + ai_can_target_all_titles = { always = yes } + ai_score_mult = { + value = ep3_laamp_invasion_ai_targeting_value + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + # Also make sure you can't war for, like, the Papal States + trigger_if = { + limit = { holder.faith ?= root.faith } + NOT = { + holder ?= { is_theocratic_lessee = yes } + } + } + } + } + + should_invalidate = { ep3_adventurer_landless_should_invalidate_trigger = yes } + + on_invalidated_desc = msg_duchy_conquest_war_invalidated_message #Re-use + + on_invalidated = {} + + cost = { + piety = { + add = ep3_laamp_invasion_base_piety_cost + multiply = common_cb_piety_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + multiply = 0.5 #Half it for Counties + } + prestige = { + value = ep3_laamp_invasion_cb_cost + multiply = common_cb_prestige_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + } + + on_declaration = { + on_declared_war = yes + scope:attacker.var:adventurer_invasion_supporter ?= { save_scope_as = supporter } + if = { + limit = { ep3_adventurer_sponsorship_valid_trigger = yes } + scope:attacker = { + # Save scopes and cleanup variables + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + scope:war ?= { + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + } + scope:attacker.var:adventurer_invasion_supporter ?= { + set_variable = { + name = adventurer_invasion_supportee + value = scope:attacker + } + } + # Opinion loss + reverse_add_opinion = { + target = scope:defender + modifier = sponsored_laamp_invasion_against_me_opinion + } + # Support + send_interface_toast = { + type = msg_troops_gained + title = ep3_laamp_sponsor_troops_tt + left_icon = scope:supporter + right_icon = scope:defender + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_request_soldiers } + capital_barony = { save_scope_as = capital_barony } + spawn_army = { + men_at_arms = { + type = armored_footmen + stacks = 3 + } + men_at_arms = { + type = accolade_maa_archers + stacks = 4 + } + men_at_arms = { + type = armored_horsemen + stacks = 2 + } + levies = 100 + inheritable = yes + location = scope:attacker.capital_province + war = scope:war + war_keep_on_attacker_victory = yes + save_scope_as = new_army + name = ep3_laamp_invasion_event_army + } + scope:supporter = { remove_variable = adventurer_invasion_request_soldiers } + } + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_join_war } + scope:war ?= { add_attacker = scope:supporter } + scope:supporter = { remove_variable = adventurer_invasion_join_war } + } + } + } + } + else_if = { + limit = { + OR = { + scope:supporter ?= scope:defender + scope:supporter.top_liege ?= scope:defender.top_liege + } + } + scope:attacker = { ep3_laamp_supporter_invalidated_effect = yes } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { is_local_player = yes } + } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = no + } + desc = { + desc = ep3_laamp_sponsor_no_support_tt + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { var:adventurer_invasion_target != scope:defender } + } + desc = ep3_laamp_sponsor_target_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + this = scope:defender + top_liege = scope:defender.top_liege + } + } + } + desc = ep3_laamp_sponsor_defender_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_allied_to = scope:defender } + } + desc = ep3_laamp_sponsor_ally_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_spouse_of = scope:defender } + } + desc = ep3_laamp_sponsor_spouse_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { this = scope:defender } + is_close_family_of = scope:defender + opinion = { + target = scope:defender + value >= -25 + } + } + } + desc = ep3_laamp_sponsor_family_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + has_relation_friend = scope:defender + has_relation_lover = scope:defender + } + } + } + desc = ep3_laamp_sponsor_relation_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + any_character_war = { + primary_attacker = scope:attacker.var:adventurer_invasion_supporter + primary_defender = scope:defender + } + } + } + desc = ep3_laamp_sponsor_attacking_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { in_diplomatic_range = scope:defender } + } + } + desc = ep3_laamp_sponsor_range_tt + } + } + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers + } + desc = ep3_laamp_sponsor_support_both_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war } + desc = ep3_laamp_sponsor_support_join_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers } + desc = ep3_laamp_sponsor_support_soldiers_tt + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = yes + } + desc = ep3_laamp_sponsor_support_tt + } + } + } + + on_victory = { + scope:attacker = { + add_character_flag = { + flag = domicile_culture_and_faith_check + days = 1 + } + # Save target + ordered_in_list = { + list = target_titles + order_by = tier + save_scope_as = target + } + scope:defender = { + every_held_title = { + limit = { duchy ?= scope:target } + add_to_list = target_titles + } + } + # Organise general results for the attacker. + if = { + limit = { ep3_adventurer_invasion_sponsorship_applies_trigger = yes } + var:adventurer_invasion_supporter = { save_scope_as = supporter } + ep3_laamp_support_variable_cleanup_effect = yes + conquest_supporter_memory_variable_effect = yes + } + ep3_landless_invasion_titles_taken_effect = { + TITLE_GIVER = scope:defender + TITLE_RECEIVER = scope:attacker + TITLE = scope:target + TITLE_LIST = target_titles + } + ### Set a new capital. + #### We prefer the de jure capital of the other. + if = { + limit = { + scope:target.title_capital_county = { is_in_list = target_titles } + } + scope:target.title_capital_county = { + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Otherwise, tribals go by pure levy count. + else_if = { + limit = { + scope:attacker = { government_has_flag = government_is_tribal } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = total_county_levies + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### If nomadic, they will prefer county fertility + else_if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + uses_county_fertility = yes + } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = county_fertility + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Generally everyone prefers the highest development. + else = { + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = development_level + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ## Seizing control so things *vaguely* work. + custom_tooltip = fp1_varangian_adventurer_conquest.summaries.control_rebate + scope:attacker = { trigger_event = fp1_varangian_adventures.0001 } + ## And giving them a gold bounty to keep them afloat. + scope:attacker = { + add_gold = { + value = varangian_adventures_bounty_amount_value + multiply = 0.5 #Half it for counties + } + } + # Finally, general cleanup. + ep3_become_landed_cleanup_effect = yes + # Prestige Progress for the Attacker + add_prestige_experience = minor_prestige_value + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Break alliances now out of diplo range + scope:attacker = { + every_ally = { + limit = { + NOT = { in_diplomatic_range = scope:attacker } + } + break_alliance = scope:attacker + } + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + debug_log_scopes = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + add_prestige = { + value = miniscule_prestige_value #Less for counties + multiply = -1.0 + } + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # Not important as the scales are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 2 #Less for counties + } + add_prestige = { + value = medium_prestige_value #Less for counties + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = medium_prestige_value #Less for counties + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "EP3_LAAMP_INVASION_WAR_NAME" + war_name_base = "EP3_LAAMP_INVASION_WAR_NAME_BASE" + cb_name = "EP3_LAAMP_INVASION_CB_COUNTY_NAME" + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 75 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} + +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +ep3_laamp_adventurer_duchy_invasion = { + icon = invasion + group = invasion + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + allow_hostages = no + + allowed_for_character = { + ep3_adventurer_invasion_allowed_for_character_trigger = yes + scope:defender.highest_held_title_tier >= tier_duchy + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 1 + } + trigger_else = { + prestige_level >= 2 + } + ep3_adventurer_invasion_allowed_for_character_display_regardless_trigger = yes + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { ep3_adventurer_landless_allowed_against_character_trigger = yes } + + target_titles = all + target_title_tier = duchy + target_de_jure_regions_above = yes + ignore_effect = change_title_holder + + ai_can_target_all_titles = { always = yes } + ai_score_mult = { + value = ep3_laamp_invasion_ai_targeting_value + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + any_in_de_jure_hierarchy = { + count >= 1 + tier = tier_county + } + # Also make sure you can't war for, like, the Papal States + trigger_if = { + limit = { holder.faith ?= root.faith } + NOT = { + holder ?= { is_theocratic_lessee = yes } + } + } + trigger_if = { + limit = { + scope:attacker = { is_ai = yes } + } + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + count >= 2 + tier = tier_county + holder ?= { + OR = { + this = scope:defender + is_vassal_or_below_of = scope:defender + } + } + } + } + } + } + + should_invalidate = { ep3_adventurer_landless_should_invalidate_trigger = yes } + + on_invalidated_desc = msg_county_conquest_war_invalidated_message + + on_invalidated = {} + + cost = { + piety = { + add = ep3_laamp_invasion_base_piety_cost + multiply = common_cb_piety_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + prestige = { + value = ep3_laamp_invasion_cb_cost + multiply = common_cb_prestige_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + } + + on_declaration = { + on_declared_war = yes + scope:attacker.var:adventurer_invasion_supporter ?= { save_scope_as = supporter } + if = { + limit = { ep3_adventurer_sponsorship_valid_trigger = yes } + scope:attacker = { + # Save scopes and cleanup variables + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + scope:war ?= { + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + } + scope:attacker.var:adventurer_invasion_supporter ?= { + set_variable = { + name = adventurer_invasion_supportee + value = scope:attacker + } + } + # Opinion loss + reverse_add_opinion = { + target = scope:defender + modifier = sponsored_laamp_invasion_against_me_opinion + } + # Support + send_interface_toast = { + type = msg_troops_gained + title = ep3_laamp_sponsor_troops_tt + left_icon = scope:supporter + right_icon = scope:defender + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_request_soldiers } + capital_barony = { save_scope_as = capital_barony } + spawn_army = { + men_at_arms = { + type = armored_footmen + stacks = 3 + } + men_at_arms = { + type = accolade_maa_archers + stacks = 4 + } + men_at_arms = { + type = armored_horsemen + stacks = 2 + } + levies = 100 + inheritable = yes + location = scope:attacker.capital_province + war = scope:war + war_keep_on_attacker_victory = yes + save_scope_as = new_army + name = ep3_laamp_invasion_event_army + } + scope:supporter = { remove_variable = adventurer_invasion_request_soldiers } + } + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_join_war } + scope:war ?= { add_attacker = scope:supporter } + scope:supporter = { remove_variable = adventurer_invasion_join_war } + } + } + } + } + else_if = { + limit = { + OR = { + scope:supporter ?= scope:defender + scope:supporter.top_liege ?= scope:defender.top_liege + } + } + scope:attacker = { ep3_laamp_supporter_invalidated_effect = yes } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { is_local_player = yes } + } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = no + } + desc = { + desc = ep3_laamp_sponsor_no_support_tt + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { var:adventurer_invasion_target != scope:defender } + } + desc = ep3_laamp_sponsor_target_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + this = scope:defender + top_liege = scope:defender.top_liege + } + } + } + desc = ep3_laamp_sponsor_defender_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_allied_to = scope:defender } + } + desc = ep3_laamp_sponsor_ally_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_spouse_of = scope:defender } + } + desc = ep3_laamp_sponsor_spouse_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { this = scope:defender } + is_close_family_of = scope:defender + opinion = { + target = scope:defender + value >= -25 + } + } + } + desc = ep3_laamp_sponsor_family_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + has_relation_friend = scope:defender + has_relation_lover = scope:defender + } + } + } + desc = ep3_laamp_sponsor_relation_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + any_character_war = { + primary_attacker = scope:attacker.var:adventurer_invasion_supporter + primary_defender = scope:defender + } + } + } + desc = ep3_laamp_sponsor_attacking_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { in_diplomatic_range = scope:defender } + } + } + desc = ep3_laamp_sponsor_range_tt + } + } + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers + } + desc = ep3_laamp_sponsor_support_both_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war } + desc = ep3_laamp_sponsor_support_join_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers } + desc = ep3_laamp_sponsor_support_soldiers_tt + } + } + } + + on_victory = { + scope:attacker = { + add_character_flag = { + flag = domicile_culture_and_faith_check + days = 1 + } + # Save target + ordered_in_list = { + list = target_titles + order_by = tier + save_scope_as = target + } + ep3_become_landed_warning_effect = { + TITLE_RECEIVER = scope:attacker + #TITLE_GIVER = scope:defender + TITLE = scope:target + } + scope:defender = { + every_held_title = { + limit = { duchy ?= scope:target } + add_to_list = target_titles + } + # Ensure that the target's capital county and counties within the target held directly by the defender are taken + if = { + limit = { + NOT = { + any_in_list = { + list = target_titles + tier = tier_county + } + } + } + every_sub_realm_county = { + limit = { + OR = { + AND = { + duchy = scope:target + holder = scope:target.holder + } + scope:target.title_capital_county = this + AND = { + duchy = scope:target + holder = { + government_allows = administrative + } + } + } + } + add_to_list = target_titles + } + } + } + # Organise general results for the attacker. + if = { + limit = { ep3_adventurer_invasion_sponsorship_applies_trigger = yes } + var:adventurer_invasion_supporter = { save_scope_as = supporter } + ep3_laamp_support_variable_cleanup_effect = yes + conquest_supporter_memory_variable_effect = yes + } + ep3_landless_invasion_titles_taken_effect = { + TITLE_GIVER = scope:defender + TITLE_RECEIVER = scope:attacker + TITLE = scope:target + TITLE_LIST = target_titles + } + ### Set a new capital. + #### We prefer the de jure capital of the other. + if = { + limit = { + scope:target.title_capital_county = { is_in_list = target_titles } + } + scope:target.title_capital_county = { + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Otherwise, tribals go by pure levy count. + else_if = { + limit = { + scope:attacker = { government_has_flag = government_is_tribal } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = total_county_levies + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### If nomadic, they will prefer county fertility + else_if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + uses_county_fertility = yes + } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = county_fertility + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Generally everyone prefers the highest development. + else = { + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = development_level + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ## Seizing control so things *vaguely* work. + custom_tooltip = fp1_varangian_adventurer_conquest.summaries.control_rebate + scope:attacker = { trigger_event = fp1_varangian_adventures.0001 } + ## And giving them a gold bounty to keep them afloat. + scope:attacker = { + add_gold = { + value = varangian_adventures_bounty_amount_value + multiply = 0.5 #Half it for counties + } + } + # Finally, general cleanup. + ep3_become_landed_cleanup_effect = yes + # Prestige Progress for the Attacker + add_prestige_experience = medium_prestige_value + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Break alliances now out of diplo range + scope:attacker = { + every_ally = { + limit = { + NOT = { in_diplomatic_range = scope:attacker } + } + break_alliance = scope:attacker + } + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + add_prestige = { + value = minor_prestige_value + multiply = -1.0 + } + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # Not important as the scales are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 3 + } + add_prestige = { + value = major_prestige_value + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = major_prestige_value + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "EP3_LAAMP_INVASION_WAR_NAME" + war_name_base = "EP3_LAAMP_INVASION_WAR_NAME_BASE" + cb_name = "EP3_LAAMP_INVASION_CB_DUCHY_NAME" + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 75 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} + +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +ep3_laamp_adventurer_kingdom_invasion = { + icon = invasion + group = invasion + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + allow_hostages = no + + allowed_for_character = { + ep3_adventurer_invasion_allowed_for_character_trigger = yes + #Ensure they actually have a kingdom title + scope:defender.highest_held_title_tier >= tier_kingdom + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 1 + } + trigger_else = { + prestige_level >= 2 + } + ep3_adventurer_invasion_allowed_for_character_display_regardless_trigger = yes + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { ep3_adventurer_landless_allowed_against_character_trigger = yes } + + allowed_against_character_display_regardless = { + scope:attacker = { + trigger_if = { + limit = { + ep3_adventurer_invasion_sponsorship_applies_trigger = yes + var:adventurer_invasion_supporter.highest_held_title_tier < tier_empire + } + scope:defender.primary_title = { tier < tier_kingdom } + } + } + } + + target_titles = all + target_title_tier = kingdom + target_de_jure_regions_above = no #Don't want to try to take de jure Kingdoms + ignore_effect = change_title_holder + + ai_can_target_all_titles = { always = yes } + ai_score_mult = { + value = ep3_laamp_invasion_ai_targeting_value + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + any_in_de_jure_hierarchy = { + count >= 1 + tier = tier_county + } + # Also make sure you can't war for, like, the Papal States + trigger_if = { + limit = { holder.faith ?= root.faith } + NOT = { + holder ?= { is_theocratic_lessee = yes } + } + } + trigger_if = { + limit = { + scope:attacker = { is_ai = yes } + } + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + count >= 8 + tier = tier_county + holder ?= { + OR = { + this = scope:defender + is_vassal_or_below_of = scope:defender + } + } + } + } + } + } + + should_invalidate = { ep3_adventurer_landless_should_invalidate_trigger = yes } + + on_invalidated_desc = msg_duchy_conquest_war_invalidated_message #Re-use + + on_invalidated = {} + + cost = { + piety = { + add = ep3_laamp_invasion_base_piety_cost + multiply = common_cb_piety_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + prestige = { + value = ep3_laamp_invasion_cb_cost + multiply = common_cb_prestige_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + } + + on_declaration = { + on_declared_war = yes + scope:attacker.var:adventurer_invasion_supporter ?= { save_scope_as = supporter } + if = { + limit = { ep3_adventurer_sponsorship_valid_trigger = yes } + scope:attacker = { + # Save scopes and cleanup variables + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + scope:war ?= { + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + } + scope:attacker.var:adventurer_invasion_supporter ?= { + set_variable = { + name = adventurer_invasion_supportee + value = scope:attacker + } + } + # Opinion loss + reverse_add_opinion = { + target = scope:defender + modifier = sponsored_laamp_invasion_against_me_opinion + } + # Support + send_interface_toast = { + type = msg_troops_gained + title = ep3_laamp_sponsor_troops_tt + left_icon = scope:supporter + right_icon = scope:defender + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_request_soldiers } + capital_barony = { save_scope_as = capital_barony } + spawn_army = { + men_at_arms = { + type = armored_footmen + stacks = 3 + } + men_at_arms = { + type = accolade_maa_archers + stacks = 4 + } + men_at_arms = { + type = armored_horsemen + stacks = 2 + } + levies = 100 + inheritable = yes + location = scope:attacker.capital_province + war = scope:war + war_keep_on_attacker_victory = yes + save_scope_as = new_army + name = ep3_laamp_invasion_event_army + } + scope:supporter = { remove_variable = adventurer_invasion_request_soldiers } + } + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_join_war } + scope:war ?= { add_attacker = scope:supporter } + scope:supporter = { remove_variable = adventurer_invasion_join_war } + } + } + } + } + else_if = { + limit = { + OR = { + scope:supporter ?= scope:defender + scope:supporter.top_liege ?= scope:defender.top_liege + } + } + scope:attacker = { ep3_laamp_supporter_invalidated_effect = yes } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { is_local_player = yes } + } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = no + } + desc = { + desc = ep3_laamp_sponsor_no_support_tt + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { var:adventurer_invasion_target != scope:defender } + } + desc = ep3_laamp_sponsor_target_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + this = scope:defender + top_liege = scope:defender.top_liege + } + } + } + desc = ep3_laamp_sponsor_defender_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_allied_to = scope:defender } + } + desc = ep3_laamp_sponsor_ally_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_spouse_of = scope:defender } + } + desc = ep3_laamp_sponsor_spouse_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { this = scope:defender } + is_close_family_of = scope:defender + opinion = { + target = scope:defender + value >= -25 + } + } + } + desc = ep3_laamp_sponsor_family_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + has_relation_friend = scope:defender + has_relation_lover = scope:defender + } + } + } + desc = ep3_laamp_sponsor_relation_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + any_character_war = { + primary_attacker = scope:attacker.var:adventurer_invasion_supporter + primary_defender = scope:defender + } + } + } + desc = ep3_laamp_sponsor_attacking_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { in_diplomatic_range = scope:defender } + } + } + desc = ep3_laamp_sponsor_range_tt + } + } + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers + } + desc = ep3_laamp_sponsor_support_both_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war } + desc = ep3_laamp_sponsor_support_join_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers } + desc = ep3_laamp_sponsor_support_soldiers_tt + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = yes + } + desc = ep3_laamp_sponsor_support_tt + } + } + } + + on_victory = { + scope:attacker = { + add_character_flag = { + flag = domicile_culture_and_faith_check + days = 1 + } + # Save target + ordered_in_list = { + list = target_titles + order_by = tier + save_scope_as = target + } + ep3_become_landed_warning_effect = { + TITLE_RECEIVER = scope:attacker + #TITLE_GIVER = scope:defender + TITLE = scope:target + } + scope:defender = { + every_held_title = { + limit = { kingdom ?= scope:target } + add_to_list = target_titles + } + # Ensure that the target's capital county and counties within the target held directly by the defender are taken + if = { + limit = { + NOT = { + any_in_list = { + list = target_titles + tier = tier_county + } + } + } + every_sub_realm_county = { + limit = { + OR = { + AND = { + kingdom = scope:target + holder = scope:target.holder + } + scope:target.title_capital_county = this + } + } + add_to_list = target_titles + } + } + } + # Organise general results for the attacker. + if = { + limit = { ep3_adventurer_invasion_sponsorship_applies_trigger = yes } + var:adventurer_invasion_supporter = { save_scope_as = supporter } + ep3_laamp_support_variable_cleanup_effect = yes + conquest_supporter_memory_variable_effect = yes + } + ep3_landless_invasion_titles_taken_effect = { + TITLE_GIVER = scope:defender + TITLE_RECEIVER = scope:attacker + TITLE = scope:target + TITLE_LIST = target_titles + } + ### Set a new capital. + #### We prefer the de jure capital of the other. + if = { + limit = { + scope:target.title_capital_county = { is_in_list = target_titles } + } + scope:target.title_capital_county = { + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Otherwise, tribals go by pure levy count. + else_if = { + limit = { + scope:attacker = { government_has_flag = government_is_tribal } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = total_county_levies + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### If nomadic, they will prefer county fertility + else_if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + uses_county_fertility = yes + } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = county_fertility + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Generally everyone prefers the highest development. + else = { + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = development_level + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ## Seizing control so things *vaguely* work. + custom_tooltip = fp1_varangian_adventurer_conquest.summaries.control_rebate + scope:attacker = { trigger_event = fp1_varangian_adventures.0001 } + ## And giving them a gold bounty to keep them afloat. + scope:attacker = { + add_gold = { + value = varangian_adventures_bounty_amount_value + multiply = 0.5 #Half it for counties + } + } + # Finally, general cleanup. + ep3_become_landed_cleanup_effect = yes + # Prestige Progress for the Attacker + add_prestige_experience = major_prestige_value #More for kingdoms + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Break alliances now out of diplo range + scope:attacker = { + every_ally = { + limit = { + NOT = { in_diplomatic_range = scope:attacker } + } + break_alliance = scope:attacker + } + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + add_prestige = { + value = medium_prestige_value #More for kingdoms + multiply = -1.0 + } + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # Not important as the scales are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 4 #More for kingdoms + } + add_prestige = { + value = massive_prestige_value #More for kingdoms + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = massive_prestige_value #More for kingdoms + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "EP3_LAAMP_INVASION_WAR_NAME" + war_name_base = "EP3_LAAMP_INVASION_WAR_NAME_BASE" + cb_name = "EP3_LAAMP_INVASION_CB_KINGDOM_NAME" + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 75 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} + +##### Changed from Vanilla: Applied cb_lower_prestige_level_requirement for situation effect +ep3_laamp_adventurer_empire_invasion = { + icon = invasion + group = invasion + + combine_into_one = yes + should_show_war_goal_subview = yes + mutually_exclusive_titles = { always = yes } + allow_hostages = no + + allowed_for_character = { + ep3_adventurer_invasion_allowed_for_character_trigger = yes + #Ensure they actually have an empire title + scope:defender.highest_held_title_tier >= tier_empire + } + + ##### Changed from Vanilla vvvvv + allowed_for_character_display_regardless = { + trigger_if = { + limit = { + OR = { + culture = { + has_cultural_parameter = cb_lower_prestige_level_requirement + } + bp_have_same_situation_and_parameter_trigger = { + PARAMETER = cb_lower_prestige_level_requirement + ACTOR = this + TARGET = scope:defender + } + } + } + prestige_level >= 1 + } + trigger_else = { + prestige_level >= 2 + } + ep3_adventurer_invasion_allowed_for_character_display_regardless_trigger = yes + } + ##### Changed from Vanilla ^^^^^ + + allowed_against_character = { ep3_adventurer_landless_allowed_against_character_trigger = yes } + + allowed_against_character_display_regardless = { + scope:attacker = { + trigger_if = { + limit = { ep3_adventurer_invasion_sponsorship_applies_trigger = yes } + scope:defender.primary_title = { tier < tier_empire } + } + } + } + + target_titles = all + target_title_tier = empire + target_de_jure_regions_above = no #Don't want to try to take de jure Empires + ignore_effect = change_title_holder + + ai_can_target_all_titles = { always = yes } + ai_score_mult = { + value = ep3_laamp_invasion_ai_targeting_value + #Declaring war on the frankokratia leader can really ruin the whole thing + if = { + limit = { + scope:defender = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + } + multiply = 0 + } + } + + valid_to_start = { + scope:target = { + any_in_de_jure_hierarchy = { + count >= 1 + tier = tier_county + } + # Also make sure you can't war for, like, the Papal States + trigger_if = { + limit = { holder.faith ?= root.faith } + NOT = { + holder ?= { is_theocratic_lessee = yes } + } + } + trigger_if = { + limit = { + scope:attacker = { is_ai = yes } + } + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + count >= 16 + tier = tier_county + holder ?= { + OR = { + this = scope:defender + is_vassal_or_below_of = scope:defender + } + } + } + } + } + } + + should_invalidate = { ep3_adventurer_landless_should_invalidate_trigger = yes } + + on_invalidated_desc = msg_duchy_conquest_war_invalidated_message #Re-use + + on_invalidated = {} + + cost = { + piety = { + add = ep3_laamp_invasion_base_piety_cost + multiply = common_cb_piety_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + prestige = { + value = ep3_laamp_invasion_cb_cost + multiply = common_cb_prestige_cost_multiplier + multiply = common_claim_reduction_cost_multiplier_core + } + } + + on_declaration = { + on_declared_war = yes + scope:attacker.var:adventurer_invasion_supporter ?= { save_scope_as = supporter } + if = { + limit = { ep3_adventurer_sponsorship_valid_trigger = yes } + scope:attacker = { + # Save scopes and cleanup variables + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + scope:war ?= { + set_variable = { + name = adventurer_invasion_supporter + value = scope:attacker.var:adventurer_invasion_supporter + } + } + scope:attacker.var:adventurer_invasion_supporter ?= { + set_variable = { + name = adventurer_invasion_supportee + value = scope:attacker + } + } + # Opinion loss + reverse_add_opinion = { + target = scope:defender + modifier = sponsored_laamp_invasion_against_me_opinion + } + # Support + send_interface_toast = { + type = msg_troops_gained + title = ep3_laamp_sponsor_troops_tt + left_icon = scope:supporter + right_icon = scope:defender + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_request_soldiers } + capital_barony = { save_scope_as = capital_barony } + spawn_army = { + men_at_arms = { + type = armored_footmen + stacks = 3 + } + men_at_arms = { + type = accolade_maa_archers + stacks = 4 + } + men_at_arms = { + type = armored_horsemen + stacks = 2 + } + levies = 100 + inheritable = yes + location = scope:attacker.capital_province + war = scope:war + war_keep_on_attacker_victory = yes + save_scope_as = new_army + name = ep3_laamp_invasion_event_army + } + scope:supporter = { remove_variable = adventurer_invasion_request_soldiers } + } + if = { + limit = { exists = scope:supporter.var:adventurer_invasion_join_war } + scope:war ?= { add_attacker = scope:supporter } + scope:supporter = { remove_variable = adventurer_invasion_join_war } + } + } + } + } + else_if = { + limit = { + OR = { + scope:supporter ?= scope:defender + scope:supporter.top_liege ?= scope:defender.top_liege + } + } + scope:attacker = { ep3_laamp_supporter_invalidated_effect = yes } + } + } + + on_victory_desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:attacker = { is_local_player = yes } + } + desc = county_conquest_cb_victory_desc_attacker + } + desc = county_conquest_cb_victory_desc + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = no + } + desc = { + desc = ep3_laamp_sponsor_no_support_tt + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { var:adventurer_invasion_target != scope:defender } + } + desc = ep3_laamp_sponsor_target_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + this = scope:defender + top_liege = scope:defender.top_liege + } + } + } + desc = ep3_laamp_sponsor_defender_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_allied_to = scope:defender } + } + desc = ep3_laamp_sponsor_ally_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { is_spouse_of = scope:defender } + } + desc = ep3_laamp_sponsor_spouse_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { this = scope:defender } + is_close_family_of = scope:defender + opinion = { + target = scope:defender + value >= -25 + } + } + } + desc = ep3_laamp_sponsor_family_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + OR = { + has_relation_friend = scope:defender + has_relation_lover = scope:defender + } + } + } + desc = ep3_laamp_sponsor_relation_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + any_character_war = { + primary_attacker = scope:attacker.var:adventurer_invasion_supporter + primary_defender = scope:defender + } + } + } + desc = ep3_laamp_sponsor_attacking_tt + } + triggered_desc = { + trigger = { + scope:attacker.var:adventurer_invasion_supporter ?= { + NOT = { in_diplomatic_range = scope:defender } + } + } + desc = ep3_laamp_sponsor_range_tt + } + } + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war + exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers + } + desc = ep3_laamp_sponsor_support_both_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_join_war } + desc = ep3_laamp_sponsor_support_join_tt + } + triggered_desc = { + trigger = { exists = scope:attacker.var:adventurer_invasion_supporter.var:adventurer_invasion_request_soldiers } + desc = ep3_laamp_sponsor_support_soldiers_tt + } + triggered_desc = { + trigger = { + exists = scope:attacker.var:adventurer_invasion_supporter + ep3_adventurer_sponsorship_valid_trigger = yes + } + desc = ep3_laamp_sponsor_support_tt + } + } + } + + on_victory = { + scope:attacker = { + add_character_flag = { + flag = domicile_culture_and_faith_check + days = 1 + } + # Save target + ordered_in_list = { + list = target_titles + order_by = tier + save_scope_as = target + } + ep3_become_landed_warning_effect = { + TITLE_RECEIVER = scope:attacker + #TITLE_GIVER = scope:defender + TITLE = scope:target + } + scope:defender = { + every_held_title = { + limit = { empire ?= scope:target } + add_to_list = target_titles + } + # Ensure that the target's capital county and counties within the target held directly by the defender are taken + if = { + limit = { + NOT = { + any_in_list = { + list = target_titles + tier = tier_county + } + } + } + every_sub_realm_county = { + limit = { + OR = { + AND = { + empire = scope:target + holder = scope:target.holder + } + scope:target.title_capital_county = this + } + } + add_to_list = target_titles + } + } + } + # Organise general results for the attacker. + if = { + limit = { ep3_adventurer_invasion_sponsorship_applies_trigger = yes } + var:adventurer_invasion_supporter = { save_scope_as = supporter } + ep3_laamp_support_variable_cleanup_effect = yes + conquest_supporter_memory_variable_effect = yes + } + ep3_landless_invasion_titles_taken_effect = { + TITLE_GIVER = scope:defender + TITLE_RECEIVER = scope:attacker + TITLE = scope:target + TITLE_LIST = target_titles + } + ### Set a new capital. + #### We prefer the de jure capital of the other. + if = { + limit = { + scope:target.title_capital_county = { is_in_list = target_titles } + } + scope:target.title_capital_county = { + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Otherwise, tribals go by pure levy count. + else_if = { + limit = { + scope:attacker = { government_has_flag = government_is_tribal } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = total_county_levies + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### If nomadic, they will prefer county fertility + else_if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + uses_county_fertility = yes + } + } + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = county_fertility + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ### Generally everyone prefers the highest development. + else = { + ordered_in_list = { + list = target_titles + limit = { tier = tier_county } + order_by = development_level + save_temporary_scope_as = new_capital + scope:attacker = { set_realm_capital = scope:new_capital } + } + } + ## Seizing control so things *vaguely* work. + custom_tooltip = fp1_varangian_adventurer_conquest.summaries.control_rebate + scope:attacker = { trigger_event = fp1_varangian_adventures.0001 } + ## And giving them a gold bounty to keep them afloat. + scope:attacker = { + add_gold = { + value = varangian_adventures_bounty_amount_value + multiply = 0.5 #Half it for counties + } + } + # Finally, general cleanup. + ep3_become_landed_cleanup_effect = yes + # Prestige Progress for the Attacker + add_prestige_experience = massive_prestige_value #More for empires + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + # Break alliances now out of diplo range + scope:attacker = { + every_ally = { + limit = { + NOT = { in_diplomatic_range = scope:attacker } + } + break_alliance = scope:attacker + } + } + + # Truce + add_truce_attacker_victory_effect = yes + + # FP1: note the victory for future memorialisation via stele (if applicable). + scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes } + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_white_peace_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_white_peace_desc_defender + } + desc = county_conquest_cb_white_peace_desc + } + } + + on_white_peace = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_low_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + add_prestige = { + value = major_prestige_value #More for empires + multiply = -1.0 + } + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:attacker # Not important as the scales are identical + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + scope:defender = { + stress_impact = { + arrogant = medium_stress_impact_gain + } + } + + add_truce_white_peace_effect = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + on_defeat_desc = { + first_valid = { + triggered_desc = { + trigger = { scope:defender = { is_local_player = yes } } + desc = county_conquest_cb_defeat_desc_defender + } + triggered_desc = { + trigger = { + scope:attacker = { + is_local_player = yes + has_targeting_faction = yes + } + } + desc = county_conquest_cb_defeat_desc_attacker + } + desc = county_conquest_cb_defeat_desc + } + } + + on_defeat = { + scope:attacker = { ep3_laamp_support_variable_cleanup_effect = yes } + + #EP2 accolade glory gain for winning against higher ranked enemy + scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes } + + # Prestige loss for the attacker + scope:attacker = { + pay_short_term_gold_reparations_effect = { + GOLD_VALUE = 5 #More for empires + } + add_prestige = { + value = monumental_prestige_value #More for empires + multiply = -1.0 + } + } + + # Prestige for Defender + scope:defender = { + add_prestige_war_defender_effect = { + PRESTIGE_VALUE = monumental_prestige_value #More for empires + } + } + + # Allies on both sides get full prestige value for helping in the war, based on their war participation. + modify_allies_of_participants_fame_values = { + WINNER = scope:defender + FAME_BASE = medium_prestige_value + IS_RELIGIOUS_WAR = no + WINNER_ALLY_FAME_SCALE = 1 + LOSER_ALLY_FAME_SCALE = 1 + } + + add_truce_attacker_defeat_effect = yes + + scope:attacker = { + save_temporary_scope_as = loser + } + + on_lost_aggression_war_discontent_loss = yes + + # EP3: note gold gained from military assistance/join war contracts and their war contribution threshold + laamp_as_mercenary_payout_tooltip_effect = yes + } + + transfer_behavior = transfer + + on_primary_attacker_death = inherit + on_primary_defender_death = inherit + + attacker_allies_inherit = yes + defender_allies_inherit = yes + + war_name = "EP3_LAAMP_INVASION_WAR_NAME" + war_name_base = "EP3_LAAMP_INVASION_WAR_NAME_BASE" + cb_name = "EP3_LAAMP_INVASION_CB_EMPIRE_NAME" + + interface_priority = 79 + + use_de_jure_wargoal_only = yes + + attacker_wargoal_percentage = 0.8 + + max_attacker_score_from_battles = 75 + + max_defender_score_from_occupation = 150 + max_attacker_score_from_occupation = 150 +} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WtWSMS/common/character_interactions/06_ep3_laamp_interactions_BP_overwrite.txt b/WtWSMS/common/character_interactions/06_ep3_laamp_interactions_BP_overwrite.txt new file mode 100644 index 0000000000..59778d9ff7 --- /dev/null +++ b/WtWSMS/common/character_interactions/06_ep3_laamp_interactions_BP_overwrite.txt @@ -0,0 +1,890 @@ +##### Changed from Vanilla: Applied cheaper_easier_to_purchase_land_in_same_heritage_group_outside_situation effects +purchase_land_interaction = { + category = interaction_category_laamp + interface_priority = 30 + icon = purchase_land_interaction + + desc = purchase_land_interaction_desc + target_type = title + target_filter = recipient_de_jure_titles + + cooldown_against_recipient = { years = 10 } + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:recipient = { is_independent_ruler = no } + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:recipient.highest_held_title_tier = tier_duchy + } + trigger_else = { scope:recipient.highest_held_title_tier = tier_county } + } + } + desc = PURCHASE_LAND_PROPOSAL_FELLOW_VASSAL + } + triggered_desc = { + trigger = { + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:recipient.highest_held_title_tier >= tier_kingdom + } + trigger_else = { scope:recipient.highest_held_title_tier >= tier_duchy } + } + } + desc = PURCHASE_LAND_PROPOSAL_LIEGE + } + desc = PURCHASE_LAND_PROPOSAL + } + } + + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 60 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + send_options_exclusive = no + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + government_has_flag = government_is_landless_adventurer + } + scope:recipient = { + is_landed = yes + # Need to own the land/cannot directly buy a governorship (procure estate first) + NOR = { + government_has_flag = government_is_administrative + government_has_flag = government_is_nomadic + } + } + NOT = { scope:recipient = scope:actor } + } + + has_valid_target = { + custom_tooltip = { #prevent unwanted trigger tooltip + text = blank_line + scope:target = { + is_title_created = yes + holder = { + is_ai = yes + this = scope:recipient + } + OR = { #flatten the selection + tier = tier_duchy + tier = tier_county + } + NOR = { + this = scope:recipient.capital_county + this = scope:recipient.capital_county.duchy + } + } + } + } + + send_option = { + flag = offer_gold + localization = purchase_land_interaction_offer_gold + current_description = purchase_land_interaction_offer_gold_desc + } + + send_option = { + flag = hook + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + localization = GENERIC_SPEND_A_HOOK + } + + send_option = { + flag = offer_hook + is_valid = { + NOT = { + scope:recipient = { + has_usable_hook = scope:actor + } + } + } + localization = purchase_land_interaction_offer_hook + current_description = purchase_land_interaction_offer_hook_desc + } + + send_option = { + flag = vassal_obligation + is_shown = { + scope:recipient = { + government_has_flag = government_is_feudal + } + } + localization = purchase_land_interaction_offer_obligations + current_description = purchase_land_interaction_offer_obligations_desc + } + + ##### NB: We keep the prestige_level 3 for duchies because of how valuable duchies are + can_be_picked_title = { + custom_tooltip = { + text = purchase_land_tier_tt + scope:target = { + tier >= tier_county + tier <= tier_duchy + } + } + custom_tooltip = { + text = purchase_land_capital_tt + NOT = { scope:target = scope:recipient.capital_county } + } + custom_tooltip = { + text = purchase_land_primary_tt + NOT = { scope:target = scope:recipient.primary_title } + } + custom_tooltip = { + text = purchase_land_duchy_tt + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:actor = { + prestige_level >= 3 + } + } + } + } + trigger_if = { + limit = { exists = scope:target.holder } + scope:target.holder = scope:recipient + } + } + + is_valid_showing_failures_only = { + scope:actor = { is_independent_ruler = yes } + ##### Changed from Vanilla vvvvv + trigger_if = { + limit = { + #In a situation with the parameter + scope:actor = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = scope:actor + PARAMETER = easier_to_purchase_land_in_same_heritage_group_outside_situation + } + } + #Recipient not in the same situation + bp_do_not_share_situation_trigger = { + CHAR_1 = scope:actor + CHAR_2 = scope:recipient + } + #Same heritage group + scope:actor.culture = { + has_same_heritage_group_as_trigger = { TARGET = scope:recipient.culture } + } + } + scope:actor = { prestige_level >= 1 } + } + trigger_else = { + scope:actor = { + prestige_level >= 2 + } + } + ##### Changed from Vanilla ^^^^^ + scope:actor = { + NOT = { + has_trait = gallowsbait + } + } + scope:actor = { + NOT = { + has_trait = gallivanter + } + } + scope:recipient = { is_at_war = no } + trigger_if = { # Can't purchase Baronies + limit = { + scope:target ?= { tier = tier_barony } + } + custom_description = { + text = purchase_land_barony_tt + always = no + } + } + trigger_if = { # Can't purchase Kingdoms or Empires + limit = { + scope:target ?= { tier >= tier_kingdom } + } + custom_description = { + text = purchase_land_kingdom_tt + always = no + } + } + trigger_if = { # Can't purchase HoF titles + limit = { + scope:target ?= { is_head_of_faith = yes } + } + custom_description = { + text = purchase_land_religious_tt + always = no + } + } + trigger_if = { # Can't purchase nf titles + limit = { + scope:target ?= { is_noble_family_title = yes } + } + custom_description = { + text = purchase_land_noble_family_tt + always = no + } + } + trigger_if = { # Can't purchase laamp titles + limit = { + scope:target ?= { has_variable = adventurer_creation_reason } + } + custom_description = { + text = purchase_land_landless_adventurer_tt + always = no + } + } + trigger_if = { + limit = { + scope:recipient = { + any_held_county = { count < 2 } + } + } + custom_description = { + text = purchase_land_minimum_county_tt + object = scope:recipient + always = no + } + } + scope:recipient = { + is_busy_in_events_localised = yes + NOT = { has_strong_hook = scope:actor } + } + ##### Changed from Vanilla vvvvv + trigger_if = { + limit = { + #In a situation with the parameter + OR = { + scope:actor = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = scope:actor + PARAMETER = cheaper_to_purchase_land_in_same_heritage_group_outside_situation + } + } + scope:actor = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = scope:actor + PARAMETER = easier_to_purchase_land_in_same_heritage_group_outside_situation + } + } + } + #Recipient not in the same situation + bp_do_not_share_situation_trigger = { + CHAR_1 = scope:actor + CHAR_2 = scope:recipient + } + #Same heritage group + scope:actor.culture = { + has_same_heritage_group_as_trigger = { TARGET = scope:recipient.culture } + } + } + scope:actor = { in_diplomatic_range = scope:recipient } + } + #Has to be used instead of diplo range checks in laamp to landed interactions + trigger_else = { + ep3_laamp_diplo_range_trigger = { + TARGET = scope:recipient + LAAMP = scope:actor + } + } + ##### Changed from Vanilla ^^^^^ + + # Adventurers can't join wars in places they're exiled from. + custom_tooltip = { + text = the_wake_1 + NOT = { + is_laamp_exiled_from_province_trigger = { + PROVINCE = scope:recipient.capital_province + LAAMP = scope:actor + } + } + } + } + + ##### Changed from Vanilla vvvvv + cost = { + gold = { + if = { + limit = { scope:target.tier = tier_county } + add = purchase_land_county_cost_value + } + else = { + add = purchase_land_duchy_cost_value + scope:target = { + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add = purchase_land_county_cost_value + } + } + } + if = { + limit = { scope:offer_gold = yes } + multiply = 2 + } + ##### Changed from Vanilla vvvvv + if = { + limit = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = scope:actor + PARAMETER = cheaper_to_purchase_land_in_same_heritage_group_outside_situation + } + scope:actor.culture = { + has_same_heritage_group_as_trigger = { TARGET = scope:recipient.culture } + } + #*NOT* in the same situation + bp_do_not_share_situation_trigger = { + CHAR_1 = scope:actor + CHAR_2 = scope:recipient + } + } + multiply = 0.25 + } + ##### Changed from Vanilla ^^^^^ + } + } + ##### Changed from Vanilla ^^^^^ + + on_accept = { + scope:actor = { save_scope_as = adventurer } + scope:target = { + add_to_list = purchased_titles + if = { + limit = { tier = tier_duchy } + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add_to_list = purchased_titles + } + } + } + ordered_in_list = { + list = purchased_titles + save_scope_as = new_primary_title + } + ##### Changed from Vanilla vvvvv + save_scope_value_as = { + name = purchase_land_cost + value = { + every_in_list = { + list = purchased_titles + if = { + limit = { tier = tier_county } + add = purchase_land_county_cost_value + } + else_if = { + limit = { tier = tier_duchy } + add = purchase_land_duchy_cost_value + } + } + if = { + limit = { + scope:actor = { has_variable = ep3_grace_to_the_family_var } + } + multiply = 0.5 + } + if = { + limit = { + scope:offer_gold = yes + } + multiply = 2 + } + ##### Changed from Vanilla vvvvv + if = { + limit = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = scope:actor + PARAMETER = cheaper_to_purchase_land_in_same_heritage_group_outside_situation + } + scope:actor.culture = { + has_same_heritage_group_as_trigger = { TARGET = scope:recipient.culture } + } + #*NOT* in the same situation + bp_do_not_share_situation_trigger = { + CHAR_1 = scope:actor + CHAR_2 = scope:recipient + } + } + multiply = 0.25 + } + ##### Changed from Vanilla ^^^^^ + } + } + ##### Changed from Vanilla ^^^^^ + save_scope_value_as = { + name = purchase_land_legitimacy_cost + value = { + value = 0 + if = { + limit = { + NOT = { + scope:target.holder = scope:recipient + } + } + every_in_list = { + list = purchased_titles + if = { + limit = { tier = tier_county } + add = minor_legitimacy_loss + } + else = { add = medium_legitimacy_loss } + } + } + } + } + show_as_tooltip = { purchase_land_interaction_shortened_effect = yes } + if = { + limit = { always = scope:hook } + scope:actor = { use_hook = scope:recipient } + } + scope:actor = { trigger_event = ep3_laamps.0100 } + } + + on_decline = { + scope:actor = { + save_scope_as = adventurer + trigger_event = ep3_laamps.0102 + } + } + + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = contacts + } + ai_frequency = 120 + + ##### Changed from Vanilla vvvvv + ai_accept = { + base = 0 # Try to make it 0 for most interactions + + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + modifier = { # Num of counties/duchy + add = { + value = 0 + scope:target = { + if = { + limit = { tier = tier_county } + add = -30 + } + else = { + add = -60 + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add = -30 + } + } + } + } + desc = PURCHASE_LAND_NUM_TITLES_REASON + } + modifier = { # Too close to capital + add = -50 + desc = PURCHASE_LAND_DE_JURE_DUCHY_REASON + scope:target.duchy = scope:recipient.capital_county.duchy + } + modifier = { # Province value + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = scope:target.development_level + scope:target = { + every_county_province = { add = num_buildings } + } + } + else = { + scope:target = { + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add = development_level + every_county_province = { add = num_buildings } + } + } + } + multiply = -2 + } + #add = 1 + desc = PURCHASE_LAND_VALUE_REASON + } + modifier = { # Land is foreign + add = 10 + desc = PURCHASE_LAND_FOREIGN_COUNTY_CULTURE_REASON + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = 10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + culture != scope:recipient.culture + } + add = 10 + } + } + } + max = 30 + } + desc = PURCHASE_LAND_FOREIGN_CULTURE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.culture != scope:recipient.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture != scope:recipient.culture + } + } + } + } + modifier = { # Different faith + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = 10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + faith != scope:recipient.faith + } + add = 10 + } + } + } + max = 30 + } + desc = PURCHASE_LAND_DIFFERENT_FAITH_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith != scope:recipient.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + faith != scope:recipient.faith + } + } + } + } + modifier = { # My culture's lands + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -40 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + culture != scope:recipient.culture + } + add = -40 + } + } + } + if = { + limit = { scope:acceptance != 0 } + divide = scope:acceptance + } + multiply = 2 + min = -200 + } + desc = PURCHASE_LAND_MY_CULTURE_REASON + scope:actor.culture != scope:recipient.culture + trigger_if = { + limit = { + scope:target.tier = tier_county + } + scope:target.culture = scope:recipient.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture = scope:recipient.culture + } + } + } + scope:recipient.culture = { + save_temporary_scope_value_as = { + name = acceptance + value = { + value = "cultural_acceptance(scope:actor.culture)" + divide = 25 + ceiling = yes + } + } + } + } + modifier = { # My faith's lands + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -40 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + faith != scope:recipient.faith + } + add = -40 + } + } + } + if = { + limit = { scope:hostility != 0 } + multiply = scope:hostility + } + multiply = 2 + min = -200 + } + desc = PURCHASE_LAND_MY_FAITH_REASON + scope:actor.faith != scope:recipient.faith + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith = scope:recipient.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + faith = scope:recipient.faith + } + } + } + scope:recipient.faith = { + save_temporary_scope_value_as = { + name = hostility + value = "faith_hostility_level(scope:actor.faith)" + } + } + } + modifier = { # Too close + add = { + value = 0 + add = scope:distance + divide = scope:recipient.highest_held_title_tier + if = { + limit = { scope:distance <= squared_distance_medium } + multiply = -0.01 + } + else = { multiply = 0.0005 } + min = -25 + max = 50 + } + desc = PURCHASE_LAND_DISTANCE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target = { save_temporary_scope_as = distance_target } + } + trigger_else = { + scope:target.title_capital_county = { save_temporary_scope_as = distance_target } + } + scope:recipient.capital_county = { + save_temporary_scope_value_as = { + name = distance + value = "squared_distance(scope:distance_target)" + } + } + } + opinion_modifier = { # Opinion Factor of title holder + trigger = { + NOT = { + scope:target.holder ?= scope:recipient + } + } + who = scope:recipient + opinion_target = scope:target.holder + multiplier = -1 + desc = AI_OPINION_REASON + } + modifier = { + add = { + value = scope:actor.prestige_level + multiply = 20 + } + scope:actor.prestige_level >= 4 + desc = PURCHASE_LAND_PRESTIGE_LEVEL_REASON + } + modifier = { + add = 40 + trigger = { + scope:actor.culture != scope:recipient.culture + OR = { + AND = { + scope:target.tier = tier_county + scope:target.culture = scope:recipient.culture + } + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture = scope:recipient.culture + } + } + } + } + scope:actor.primary_spouse ?= { + culture = scope:recipient.culture + dynasty ?= { + dynasty_prestige_level >= 2 + } + } + desc = PURCHASE_LAND_MARRIED_TO_CULTURE_NOBLE_REASON + } + modifier = { + add = 40 + trigger = { + scope:actor.faith != scope:recipient.faith + } + scope:actor.primary_spouse ?= { + faith = scope:recipient.faith + dynasty ?= { + dynasty_prestige_level >= 2 + } + } + desc = PURCHASE_LAND_MARRIED_TO_FAITH_NOBLE_REASON + } + modifier = { + add = 80 + scope:actor.primary_spouse ?= { + house ?= scope:recipient.house + } + desc = PURCHASE_LAND_MARRIED_TO_HOUSE_REASON + } + modifier = { + add = 20 + trigger = { + OR = { + AND = { + scope:target.tier = tier_county + scope:target.culture = scope:recipient.culture + } + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture = scope:recipient.culture + } + } + } + } + scope:actor = { + knows_language_of_culture = scope:recipient.culture + NOT = { + culture = scope:recipient.culture + } + } + desc = PURCHASE_LAND_SPEAKS_LANGUAGE_REASON + } + modifier = { + add = -40 + scope:actor = { + NOT = { + knows_language_of_culture = scope:recipient.culture + culture = scope:recipient.culture + } + } + desc = PURCHASE_LAND_DOES_NOT_SPEAK_LANGUAGE_REASON + } + modifier = { + add = { + value = 40 + multiply = scope:recipient.debt_level + } + trigger = { + scope:recipient = { + debt_level > 0 + } + } + desc = PURCHASE_LAND_IS_IN_DEBT_REASON + } + modifier = { + add = 60 + scope:actor = { + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + desc = PURCHASE_LAND_RELATIONSHIP_REASON + } + modifier = { + add = 80 + scope:offer_gold = yes + desc = PURCHASE_LAND_DOUBLE_GOLD_REASON + } + modifier = { + add = 160 + scope:hook = yes + desc = YOU_HAVE_HOOK_REASON + } + modifier = { + add = 60 + scope:offer_hook = yes + desc = PURCHASE_LAND_OFFER_HOOK_REASON + } + modifier = { + add = 80 + scope:vassal_obligation = yes + desc = PURCHASE_LAND_OBLIGATIONS_REASON + } + ##### Changed from Vanilla vvvvv + modifier = { + add = 100 + desc = OUR_KIN_FLEEING_PERSECUTION + character_is_in_situation_region_with_parameter_trigger = { + CHAR = scope:actor + PARAMETER = cheaper_to_purchase_land_in_same_heritage_group_outside_situation + } + scope:actor.culture = { + has_same_heritage_group_as_trigger = { TARGET = scope:recipient.culture } + } + } + ##### Changed from Vanilla ^^^^^ + } + ##### Changed from Vanilla ^^^^^ + + ai_will_do = { + base = -25 + ai_value_modifier = { + ai_boldness = -0.5 + ai_energy = -0.5 + ai_greed = 0.5 + } + modifier = { #This seems janked + gold < 1000 + factor = 0 + } + modifier = { + gold > 2000 + add = 50 + } + } +} \ No newline at end of file diff --git a/WtWSMS/common/council_tasks/00_court_chaplain_tasks_BP_overwrite.txt b/WtWSMS/common/council_tasks/00_court_chaplain_tasks_BP_overwrite.txt index c51fdb50f9..ba267d496d 100644 --- a/WtWSMS/common/council_tasks/00_court_chaplain_tasks_BP_overwrite.txt +++ b/WtWSMS/common/council_tasks/00_court_chaplain_tasks_BP_overwrite.txt @@ -162,8 +162,21 @@ task_conversion = { has_doctrine_parameter = unreformed } ##### Changed from Vanilla vvvvv - exists = scope:county - NOT = { scope:county.faith = { has_doctrine_parameter = unreformed } } + NOT = { scope:county.faith ?= { has_doctrine_parameter = unreformed } } + NOT = { + scope:councillor_liege = { + any_character_situation = { + count > 0 + any_situation_sub_region = { + has_sub_region_phase_parameter = faster_convert_speed + any_situation_sub_region_participant_group = { + participant_group_type = interloper + participant_group_has_character = scope:councillor_liege + } + } + } + } + } ##### Changed from Vanilla ^^^^^ } multiply = { @@ -173,6 +186,51 @@ task_conversion = { } ##### Changed from Vanilla ^^^^^ + #### Changed from Vanilla vvvv + if = { + limit = { + scope:councillor_liege = { + any_character_situation = { + count > 0 + any_situation_sub_region = { + has_sub_region_phase_parameter = faster_convert_speed + any_situation_sub_region_participant_group = { + participant_group_type = interloper + participant_group_has_character = scope:councillor_liege + } + } + } + } + } + multiply = { + value = 1.0 + add = mob_migration_convert_faith_bonus + desc = mob_migration_convert_faith_bonus_task_desc + } + } + if = { + limit = { + scope:councillor_liege = { + any_character_situation = { + count > 0 + any_situation_sub_region = { + has_sub_region_phase_parameter = slower_convert_speed + any_situation_sub_region_participant_group = { + participant_group_type = involved + participant_group_has_character = scope:councillor_liege + } + } + } + } + } + multiply = { + value = 1.0 + add = mob_migration_convert_faith_malus + desc = mob_migration_convert_faith_malus_task_desc + } + } + #### Changed from Vanilla ^^^^ + # Faster conversion for FP2 Hostility ending, if county is in Iberia and faith was involved if = { limit = { diff --git a/WtWSMS/common/council_tasks/00_steward_tasks_BP_overwrite.txt b/WtWSMS/common/council_tasks/00_steward_tasks_BP_overwrite.txt index 9485a2c5ba..9b13919d98 100644 --- a/WtWSMS/common/council_tasks/00_steward_tasks_BP_overwrite.txt +++ b/WtWSMS/common/council_tasks/00_steward_tasks_BP_overwrite.txt @@ -1,4 +1,4 @@ -##### Changed from Vanilla: Added New Rule Effects +##### Changed from Vanilla: Added New Rule Effects, Situation Effects task_promote_culture = { position = councillor_steward @@ -194,6 +194,51 @@ task_promote_culture = { } #### Changed from Vanilla ^^^^^ + #### Changed from Vanilla vvvv + if = { + limit = { + scope:councillor_liege = { + any_character_situation = { + count > 0 + any_situation_sub_region = { + has_sub_region_phase_parameter = faster_promote_culture_speed + any_situation_sub_region_participant_group = { + participant_group_type = interloper + participant_group_has_character = scope:councillor_liege + } + } + } + } + } + multiply = { + value = 1.0 + add = mob_migration_promote_culture_bonus + desc = mob_migration_promote_culture_bonus_task_desc + } + } + if = { + limit = { + scope:councillor_liege = { + any_character_situation = { + count > 0 + any_situation_sub_region = { + has_sub_region_phase_parameter = slower_promote_culture_speed + any_situation_sub_region_participant_group = { + participant_group_type = involved + participant_group_has_character = scope:councillor_liege + } + } + } + } + } + multiply = { + value = 1.0 + add = mob_migration_promote_culture_malus + desc = mob_migration_promote_culture_malus_task_desc + } + } + #### Changed from Vanilla ^^^^ + # Faster conversion for FP2 Hostility ending, if county is in Iberia and culture was involved if = { limit = { diff --git a/WtWSMS/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions_BP_overwrite.txt b/WtWSMS/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions_BP_overwrite.txt new file mode 100644 index 0000000000..74cb7ccdbe --- /dev/null +++ b/WtWSMS/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions_BP_overwrite.txt @@ -0,0 +1,187 @@ +##### Changed from Vanilla: Extended to Situation Parameters unlock_voluntary_laampdom +become_landless_adventurer_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/ep3_decision_laamp_neutral_mountain.dds" + } + sort_order = 82 + ai_check_interval = 120 + + desc = become_landless_adventurer_decision_desc + selection_tooltip = become_landless_adventurer_decision_tooltip + + ##### Changed from Vanilla vvvvv + is_shown = { + #DLC check. + has_ep3_dlc_trigger = yes + OR = { + ai_can_valid_to_create_laamp_trigger = yes + is_ai = no + } + #Standard filter checks. + is_landed = yes + # Relevant cultures/faiths + OR = { + any_character_situation = { has_situation_top_phase_parameter = unlock_voluntary_laampdom } + culture = { has_cultural_parameter = unlock_voluntary_laampdom } + faith = { has_doctrine_parameter = unlock_voluntary_laampdom_faith } + has_trait = nomadic_philosophy + } + save_temporary_scope_as = potential_laamp_temp + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:potential_laamp_temp } # Registered fighting license + } + ##### Changed from Vanilla ^^^^^ + + ##### Changed from Vanilla vvvvv + is_valid = { + is_valid_for_laampdom = yes + # Is not HOF + custom_tooltip = { + text = become_landless_adventurer_decision_hof_tt + NOT = { faith.religious_head_title.holder = root } + } + # Counts and dukes only + custom_tooltip = { + text = become_landless_adventurer_decision_tier_tt + highest_held_title_tier >= tier_county + highest_held_title_tier <= tier_duchy + } + # Not too big + custom_tooltip = { + text = become_landless_adventurer_decision_domain_size_tt + domain_size <= 3 + } + # Relevant cultures/faiths + OR = { + any_character_situation = { has_situation_top_phase_parameter = unlock_voluntary_laampdom } + culture = { has_cultural_parameter = unlock_voluntary_laampdom } + faith = { has_doctrine_parameter = unlock_voluntary_laampdom_faith } + has_trait = nomadic_philosophy + custom_tooltip = { + text = nomadic_government_tt + government_has_flag = government_is_nomadic + } + } + } + ##### Changed from Vanilla ^^^^^ + + is_valid_showing_failures_only = { + is_at_war = no + is_alive = yes + is_available_adult = yes + has_contagious_deadly_disease_trigger = no + } + + effect = { + save_scope_as = adventurer + if = { + limit = { + player_heir ?= { + NOT = { this = root } + is_adult = yes + } + } + player_heir = { + save_scope_as = laamp_heir + save_scope_as = laamp_inheritor + custom_tooltip = become_landless_adventurer_decision_title_scope_tt + } + } + else_if = { + limit = { is_independent_ruler = no } + liege = { + save_scope_as = laamp_liege + save_scope_as = laamp_inheritor + custom_tooltip = become_landless_adventurer_decision_title_scope_tt + } + } + else = { + custom_tooltip = become_landless_adventurer_decision_title_created_tt + if = { + limit = { + NOT = { exists = scope:laamp_inheritor } + } + hidden_effect_new_object = { + create_character = { + template = laamp_inheritor_template + culture = root.capital_county.culture + faith = root.capital_county.faith + dynasty = generate + location = root.capital_province + after_creation = { + save_scope_as = laamp_inheritor + add_character_flag = new_laamp_inheritor + } + } + } + } + } + create_landless_adventurer_title_tooltip_effect = yes + show_as_tooltip = { + add_prestige = medium_prestige_gain + add_character_modifier = { + modifier = ep3_voluntary_laamp_character_modifier + years = 5 + } + } + trigger_event = { id = ep3_laamps.0030 } + # Debug tracking + if = { + limit = { + is_ai = yes + debug_only = yes + } + if = { + limit = { exists = global_var:ai_voluntary_laamp_count } + change_global_variable = { + name = ai_voluntary_laamp_count + add = 1 + } + } + else = { + set_global_variable = { + name = ai_voluntary_laamp_count + value = 1 + } + } + debug_log = "AI became adventurer voluntarily" + debug_log_scopes = yes + } + stress_impact = { + craven = minor_stress_impact_gain + content = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + } + + ai_potential = { + is_valid_for_laampdom = yes + trigger_if = { # Temujun stays, he needs to become Genghis Khan after all! + limit = { + exists = character:125501 + } + NOT = { this = character:125501 } + } + } + + ai_will_do = { + base = -75 + modifier = { add = ep3_laamp_chance_score_value } + modifier = { # If we don't have this, everyone will leave your realm constantly + add = -45 + culture = { has_cultural_parameter = much_more_likely_to_be_laamps } + } + modifier = { # If we don't have this, everyone will leave your realm constantly + add = -20 + culture = { has_cultural_parameter = more_likely_to_be_laamps } + } + modifier = { + factor = 0 + OR = { + #Stahp it, John de Courcy + this = character:214000 + #No adventurer should want to be one again... right? + has_variable = adventurer_creation_reason + } + } + } +} diff --git a/WtWSMS/common/decisions/dlc_decisions/mpo/mpo_decisions_BP_overwrite.txt b/WtWSMS/common/decisions/dlc_decisions/mpo/mpo_decisions_BP_overwrite.txt index e44af284ba..418f8f7930 100644 --- a/WtWSMS/common/decisions/dlc_decisions/mpo/mpo_decisions_BP_overwrite.txt +++ b/WtWSMS/common/decisions/dlc_decisions/mpo/mpo_decisions_BP_overwrite.txt @@ -1,4 +1,403 @@ -##### Changed from Vanilla: Blocked before innovation_leges_barbarorum & +##### Changed from Vanilla: Extended to High Tribal Authority, legendary_leader +call_for_confederation_decision = { + picture = { + reference = "gfx/interface/illustrations/decisions/mpo_decision_confederation.dds" + } + decision_group_type = major + ai_check_interval = 8 + + desc = call_for_confederation_decision_desc + selection_tooltip = call_for_confederation_decision_tooltip + + is_shown = { + highest_held_title_tier <= tier_duchy + OR = { + government_has_flag = government_is_tribal + government_has_flag = government_is_nomadic + } + is_playable_character = yes + is_independent_ruler = yes + NOR = { + has_character_flag = forming_confederation + is_confederation_member = yes + } + } + + is_valid = { + is_independent_ruler = yes + highest_held_title_tier <= tier_duchy + is_tributary = no + custom_tooltip = { + OR = { + government_has_flag = government_is_tribal + government_has_flag = government_is_nomadic + } + text = is_nomadic_or_tribal_tt + } + trigger_if = { + limit = { + government_has_flag = government_is_nomadic + } + OR = { + has_realm_law = nomadic_authority_1 + has_realm_law = nomadic_authority_2 + } + } + ##### Changed from Vanilla vvvvv + trigger_if = { + limit = { government_has_flag = government_uses_high_tribal_organization } + OR = { + has_realm_law = high_tribal_organization_0 + has_realm_law = high_tribal_organization_1 + has_realm_law = high_tribal_organization_2 + } + } + ##### Changed from Vanilla ^^^^^ + trigger_else = { + OR = { + has_realm_law = tribal_authority_0 + has_realm_law = tribal_authority_1 + has_realm_law = tribal_authority_2 + } + } + NOR = { + has_trait = conqueror + has_trait = greatest_of_khans + ##### Changed from Vanilla vvvvv + has_trait = legendary_leader + ##### Changed from Vanilla ^^^^^ + } + OR = { + has_trait = diplomat + has_trait = family_first + confederation_foe_trigger = { CHARACTER = root } + } + #This is just meant to stop player exploits + trigger_if = { + limit = { + is_ai = no + } + custom_tooltip = { + text = recently_took_leave_confederation_decision_tt + NOT = { has_variable = left_confederation } + } + } + } + cooldown = { years = 5 } + + is_valid_showing_failures_only = { + age >= 6 + trigger_if = { + limit = { + is_ai = no + } + NOT = { exists = involved_activity } + NOT = { has_trait = infirm } + is_physically_able = yes + is_travelling = no + } + trigger_else = { + is_imprisoned = no + is_incapable = no + is_alive = yes + is_migrating = no + NOT = { has_trait = infirm } + } + } + + cost = { + prestige = { + value = { + add = 100 + if = { + limit = { + highest_held_title_tier = tier_duchy + } + add = 200 + } + if = { + limit = { + max_military_strength > 0 + any_neighboring_top_liege_realm_owner = { + NOT = { is_allied_to = root } + max_military_strength > 0 + confederation_worthy_foe_strength_ratio_value_root <= 0.5 + } + } + add = -50 + } + if = { + limit = { + max_military_strength > 0 + any_neighboring_top_liege_realm_owner = { + NOT = { is_allied_to = root } + max_military_strength > 0 + confederation_worthy_foe_strength_ratio_value_root <= 0.25 + } + } + add = -50 + } + } + } + piety = { + value = { + add = 250 + } + } + } + + effect = { + custom_tooltip = enables_offer_confederation_tt + custom_tooltip = offer_confederation_members_tt + custom_tooltip = confederation_join_defensive_wars_tt + custom_tooltip = confederation_raiding_attacking_tt + if = { + limit = { + government_has_flag = government_is_nomadic + } + custom_tooltip = confederation_modifier_tt + } + custom_tooltip = offer_confederation_5_year_warning_tt + if = { + limit = { + government_has_flag = government_is_nomadic + } + custom_tooltip = confederation_restrictions_warning_tt + } + else = { + custom_tooltip = confederation_restrictions_tribe_warning_tt + } + if = { + limit = { + government_has_flag = government_is_nomadic + } + custom_tooltip = confederation_migrating_leaving_warning_tt + } + else = { + custom_tooltip = confederation_leaving_warning_tt + } + trigger_event = mpo_decisions_events.0001 + } + + ai_potential = { + OR = { + government_has_flag = government_is_tribal + government_has_flag = government_is_nomadic + } + is_independent_ruler = yes + highest_held_title_tier <= tier_duchy + is_tributary = no + is_playable_character = yes + is_confederation_member = no + is_alive = yes + #Culture friends + any_land_neighboring_realm_with_tributaries_owner = { + count >= 2 + culture = root.culture + OR = { + faith = root.faith + AND = { + faith = { + has_doctrine_parameter = unreformed + } + root.faith = { + has_doctrine_parameter = unreformed + } + } + faith = { + faith_hostility_level = { + target = root.faith + value < faith_hostile_level + } + } + } + valid_confederation_member_trigger = { CHARACTER = root } + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + } + } + + ai_will_do = { + base = 0 + modifier = { + ai_compassion >= low_positive_ai_value + add = 5 + } + modifier = { + ai_honor >= low_positive_ai_value + add = 5 + } + modifier = { + ai_boldness <= low_negative_ai_value + add = 5 + } + modifier = { + ai_sociability >= low_positive_ai_value + add = 5 + } + modifier = { + ai_greed <= low_negative_ai_value + add = 5 + } + modifier = { + ai_energy <= low_negative_ai_value + add = 5 + } + modifier = { + ai_rationality >= low_positive_ai_value + add = 5 + } + modifier = { + ai_compassion <= low_negative_ai_value + add = -5 + } + modifier = { + ai_honor <= low_negative_ai_value + add = -5 + } + modifier = { + ai_boldness >= low_positive_ai_value + add = -5 + } + modifier = { + ai_sociability <= low_negative_ai_value + add = -5 + } + modifier = { + ai_greed >= low_positive_ai_value + add = -5 + } + modifier = { + ai_energy >= low_positive_ai_value + add = -5 + } + modifier = { + ai_rationality <= low_negative_ai_value + add = -5 + } + modifier = { + OR = { + any_land_neighboring_realm_with_tributaries_owner = { + is_confederation_member = no + confederation_worthy_foe_strength_ratio_value_root <= 0.25 + } + any_land_neighboring_realm_with_tributaries_owner = { + is_confederation_member = no + is_tributary = yes + top_suzerain = { + confederation_worthy_foe_strength_ratio_value_root <= 0.25 + } + } + any_land_neighboring_realm_with_tributaries_owner = { + is_confederation_member = no + is_tributary = yes + suzerain ?= { + confederation_worthy_foe_strength_ratio_value_root <= 0.25 + } + } + } + add = 25 + } + modifier = { + confederation_neighboring_foe_trigger = { CHARACTER = root } + add = 30 + } + modifier = { + OR = { + any_land_neighboring_realm_with_tributaries_owner = { + OR = { + has_trait = greatest_of_khans + has_trait = conqueror + any_owned_story = { + OR = { + story_type = story_greatest_of_khans + story_type = story_mongol_invasion + } + } + } + } + any_land_neighboring_realm_with_tributaries_owner = { + is_tributary = yes + top_suzerain = { + OR = { + has_trait = greatest_of_khans + has_trait = conqueror + any_owned_story = { + OR = { + story_type = story_greatest_of_khans + story_type = story_mongol_invasion + } + } + } + } + } + any_land_neighboring_realm_with_tributaries_owner = { + is_tributary = yes + suzerain ?= { + OR = { + has_trait = greatest_of_khans + has_trait = conqueror + any_owned_story = { + OR = { + story_type = story_greatest_of_khans + story_type = story_mongol_invasion + } + } + } + } + } + } + add = 50 + } + modifier = { + add = 10 + culture = { + OR = { + has_cultural_pillar = ethos_stoic + has_cultural_pillar = ethos_communal + has_cultural_pillar = ethos_egalitarian + } + } + } + modifier = { + add = -20 + culture = { + OR = { + has_cultural_pillar = ethos_bellicose + has_cultural_pillar = ethos_courtly + has_cultural_pillar = ethos_bureaucratic + } + } + } + modifier = { + add = -100 + prestige <= medium_prestige_value # You cannot afford this + } + #Another confederation of your culture already exists + modifier = { + any_in_global_list = { + variable = confederations + has_variable = confederation_culture + var:confederation_culture = root.culture + } + factor = 0.05 + } + #There's already another confederation nearby + modifier = { + any_in_global_list = { + variable = confederations + any_confederation_member = { + in_diplomatic_range = root + } + } + factor = 0.1 + } + } +} + +##### Changed from Vanilla: Blocked before innovation_leges_barbarorum & innovation_social_stratification +##### Changed from Vanilla: Blocked for situations that block confederate elevation confederation_kingdom_decision = { picture = { reference = "gfx/interface/illustrations/decisions/mpo_decision_confederation.dds" @@ -62,6 +461,13 @@ confederation_kingdom_decision = { ##### Changed from Vanilla vvvvv culture = { has_innovation = innovation_leges_barbarorum } culture = { has_innovation = innovation_social_stratification } + trigger_if = { + limit = { any_character_situation = { count > 0 } } + any_character_situation = { + count >= 1 + has_situation_top_phase_parameter = cannot_elevate_confederations + } + } ##### Changed from Vanilla ^^^^^ } diff --git a/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_feb.txt b/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_feb.txt index f3c46f7682..d2f8c58c67 100644 --- a/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_feb.txt +++ b/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_feb.txt @@ -20,6 +20,8 @@ bp_game_start_476 = { BP_setup_confederations_476_feb #Capitals BP_setup_capitals_476_feb + #Situations + BP_setup_situations_476_feb } } @@ -988,10 +990,18 @@ BP_reduce_hunnic_herd_476 = { } } } + BP_setup_capitals_476_feb = { effect = { title:d_werle = { set_capital_county = title:c_mecklenburg } } +} + +#Situations +BP_setup_situations_476_feb = { + effect = { + start_matter_of_britain_situation_effect = yes + } } \ No newline at end of file diff --git a/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_oct.txt b/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_oct.txt index 1a9b8c5a5c..a9c40cb08a 100644 --- a/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_oct.txt +++ b/WtWSMS/common/on_action/BP_game_starts/476/BP_476_start_oct.txt @@ -18,6 +18,8 @@ bp_game_start_476_oct = { BP_setup_confederations_476_oct #Capitals BP_setup_capitals_476_oct + #Situations + BP_setup_situations_476_feb } } @@ -655,10 +657,18 @@ BP_reduce_hunnic_herd_476_oct = { } } } + BP_setup_capitals_476_oct = { effect = { title:d_werle = { set_capital_county = title:c_mecklenburg } } +} + +#Situations +BP_setup_situations_476_feb = { + effect = { + start_matter_of_britain_situation_effect = yes + } } \ No newline at end of file diff --git a/WtWSMS/common/script_values/00_war_values_BP_overwrite.txt b/WtWSMS/common/script_values/00_war_values_BP_overwrite.txt index 22b2649044..ff2d302ef0 100644 --- a/WtWSMS/common/script_values/00_war_values_BP_overwrite.txt +++ b/WtWSMS/common/script_values/00_war_values_BP_overwrite.txt @@ -1,4 +1,4 @@ -##### Changed from Vanilla: swapped out first innovation +##### Changed from Vanilla: swapped out first innovation vassalization_size_limit = { value = vassalize_default_size scope:attacker = { @@ -44,4 +44,80 @@ vassalization_size_limit = { } } } +} + +##### Changed from Vanilla: Extended to situations + +# Truce Durations +## Since we want these to work out to nice, even numbers, we calc them manually rather than use multipliers. +standard_truce_duration_days = { + value = 1825 + # Deductions. + ## Flexible truces perk. + if = { + limit = { + scope:attacker = { has_perk = flexible_truces_perk } + } + add = -450 + } + ## Certain struggle phases. + if = { + limit = { + ##### Changed from Vanilla vvvvv + OR = { + scope:attacker = { + any_character_struggle = { + is_struggle_parameter_active_secondary_character_involvement_either_trigger = { + PARAMETER = truces_by_involved_or_interlopers_within_region_shorter + CHAR = scope:defender + } + } + } + scope:attacker = { + any_character_situation = { + has_situation_top_phase_parameter = truces_by_involved_or_interlopers_within_region_shorter + save_temporary_scope_as = situation_temp + scope:defender = { any_character_situation = { this = scope:situation_temp } } + } + } + } + ##### Changed from Vanilla ^^^^^ + } + add = -900 + } + if = { + limit = { + scope:attacker = { + any_character_struggle = { + is_struggle_parameter_active_secondary_character_involvement_either_trigger = { + PARAMETER = truces_by_involved_or_interlopers_within_region_longer + CHAR = scope:defender + } + } + } + } + add = 900 + } + ## Shorter truce if both sides are nomads + if = { + limit = { + scope:attacker = { government_has_flag = government_is_nomadic } + scope:defender = { government_has_flag = government_is_nomadic } + } + subtract = 730 + } + # A truce should at least give a 2-year breather. + min = 730 + if = { + limit = { + scope:attacker = { + any_character_war = { + primary_attacker = scope:attacker + primary_defender = scope:defender + using_cb = fp2_border_raid + } + } + } + multiply = 2 + } } \ No newline at end of file diff --git a/WtWSMS/common/script_values/BP_culture_values.txt b/WtWSMS/common/script_values/BP_culture_values.txt index 9ce4507c3c..8bac57150a 100644 --- a/WtWSMS/common/script_values/BP_culture_values.txt +++ b/WtWSMS/common/script_values/BP_culture_values.txt @@ -38,6 +38,11 @@ conversion_culture_very_difficult_to_convert_or_promote_steward_value = { } } +culture_divergence_cooldown_halved = { + value = culture_divergence_cooldown + multiply = 0.5 +} + #Acceptance values heritage_tradition_acceptance_value = 5 greco_roman_tradition_acceptance_value = 10 diff --git a/WtWSMS/common/script_values/BP_situation_values.txt b/WtWSMS/common/script_values/BP_situation_values.txt new file mode 100644 index 0000000000..6018996d12 --- /dev/null +++ b/WtWSMS/common/script_values/BP_situation_values.txt @@ -0,0 +1,9 @@ +mob_involved_minimum_counties = 5 +mob_involved_percentage = 0.25 +mob_interloper_minimum_counties = 1 + +mob_migration_promote_culture_bonus = 0.5 +mob_migration_promote_culture_malus = -0.5 + +mob_migration_convert_faith_bonus = 0.5 +mob_migration_convert_faith_malus = -0.5 \ No newline at end of file diff --git a/WtWSMS/common/scripted_effects/BP_game_start_effects.txt b/WtWSMS/common/scripted_effects/BP_game_start_effects.txt index 495c69ce82..11078372d7 100644 --- a/WtWSMS/common/scripted_effects/BP_game_start_effects.txt +++ b/WtWSMS/common/scripted_effects/BP_game_start_effects.txt @@ -459,3 +459,11 @@ create_starting_confederation_476_effect = { } } } + +#Situation Start Effects +start_matter_of_britain_situation_effect = { + start_situation = { + type = bp_matter_of_britain_situation + start_phase = mob_migration + } +} \ No newline at end of file diff --git a/WtWSMS/common/scripted_rules/00_rules_BP_overwrite.txt b/WtWSMS/common/scripted_rules/00_rules_BP_overwrite.txt index c2cca08148..5407bd9a7b 100644 --- a/WtWSMS/common/scripted_rules/00_rules_BP_overwrite.txt +++ b/WtWSMS/common/scripted_rules/00_rules_BP_overwrite.txt @@ -96,7 +96,20 @@ faith_conversion = { # Is this character allowed to diverge their culture? # root: Character can_diverge_culture = { - culture = { culture_age >= culture_divergence_cooldown } + ##### Changed from Vanilla vvvvv + trigger_if = { #We do this here because culture_divergence_cooldown has no scope attached + limit = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = root + PARAMETER = culture_divergence_is_shorter + } + } + culture = { culture_age >= culture_divergence_cooldown_halved } + } + trigger_else = { + culture = { culture_age >= culture_divergence_cooldown } + } + ##### Changed from Vanilla ^^^^^ custom_description = { text = culture_present_in_realm_for_divergence any_sub_realm_county = { @@ -109,6 +122,12 @@ can_diverge_culture = { limit = { NOT = { root.culture = { has_cultural_parameter = can_diverge_if_culture_head } } NOT = { root.culture = { has_cultural_parameter = easier_cheaper_divergence_early_slavs } } #Early Slavs get to ignore this rule + NOT = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = root + PARAMETER = can_diverge_if_culture_head + } + } } custom_description = { text = head_of_culture_cannot_diverge @@ -118,7 +137,7 @@ can_diverge_culture = { ##### Changed from Vanilla ^^^^^ } -##### Changed from Vanilla: Tied in with limitation_on_divergence_hybridization_culture_head +##### Changed from Vanilla: Tied in with limitation_on_divergence_hybridization_culture_head, add hybridization block via situation # Is this character allowed to hybridize their culture with the target culture? # root: Character @@ -141,5 +160,14 @@ can_hybridize_culture = { } } } + custom_description = { + text = current_situation_phase_blocks_hybridization + NOT = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = root + PARAMETER = culture_hybridization_is_blocked + } + } + } ##### Changed from Vanilla ^^^^^ } \ No newline at end of file diff --git a/WtWSMS/common/scripted_triggers/BP_matter_of_britain_triggers.txt b/WtWSMS/common/scripted_triggers/BP_matter_of_britain_triggers.txt new file mode 100644 index 0000000000..12f7d6831e --- /dev/null +++ b/WtWSMS/common/scripted_triggers/BP_matter_of_britain_triggers.txt @@ -0,0 +1,43 @@ +mob_playable_governments_trigger = { + OR = { + highest_held_title_tier >= tier_county + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_nomadic + } +} +mob_involved_trigger = { + scope:situation = { + #Must have a minimal involvement + any_situation_county = { + count >= mob_involved_minimum_counties + this.culture = root.culture + } + any_situation_county = { + count >= mob_involved_minimum_counties + this.faith = { faith_hostility_level = { target = root.faith value <= faith_astray_level } } + } + + #And sufficiently involved globally + any_situation_county = { + percent >= mob_involved_percentage + this.culture = { has_same_heritage_group_as_trigger = { TARGET = root.culture } } + } + any_situation_county = { + percent >= mob_involved_percentage + this.faith = { faith_hostility_level = { target = root.faith value <= faith_astray_level } } + } + } +} +mob_interloper_trigger = { + #Not involved (handled externally), but at least one county of your faith and culture + scope:situation = { + any_situation_county = { + count >= mob_interloper_minimum_counties + this.culture = root.culture + } + any_situation_county = { + count >= mob_interloper_minimum_counties + this.faith = { faith_hostility_level = { target = root.faith value <= faith_astray_level } } + } + } +} diff --git a/WtWSMS/common/scripted_triggers/bp_generic_situation_triggers.txt b/WtWSMS/common/scripted_triggers/bp_generic_situation_triggers.txt new file mode 100644 index 0000000000..fb4d691dcd --- /dev/null +++ b/WtWSMS/common/scripted_triggers/bp_generic_situation_triggers.txt @@ -0,0 +1,79 @@ +bp_do_not_share_situation_trigger = { + NOT = { + bp_share_situation_trigger = { + CHAR_1 = $CHAR_1$ + CHAR_2 = $CHAR_2$ + } + } +} +bp_share_situation_trigger = { + custom_description = { + text = do_share_situations + object = $CHAR_2$ + $CHAR_1$ ?= { + any_character_situation = { + save_temporary_scope_as = the_situation + $CHAR_2$ ?= { any_character_situation = { this = scope:the_situation } } + } + } + } +} +bp_share_sub_region_phase_parameter = { + $CHAR_1$ ?= { + any_character_situation = { + any_situation_sub_region = { has_sub_region_phase_parameter = $PARAMETER$ } + } + } + $CHAR_2$ ?= { + any_character_situation = { + any_situation_sub_region = { has_sub_region_phase_parameter = $PARAMETER$ } + } + } +} +#Actor is who we're acting on, target is who their relating to +bp_have_same_situation_and_parameter_trigger = { #TODO: May need to also scope to participant groups... + bp_share_sub_region_phase_parameter = { + CHAR_1 = $ACTOR$ + CHAR_2 = $TARGET$ + PARAMETER = $PARAMETER$ + } + bp_share_situation_trigger = { + CHAR_1 = $ACTOR$ + CHAR_2 = $TARGET$ + } +} + +#Scope is char in question +character_is_in_situation_region_with_parameter_trigger = { + $CHAR$ = { + any_character_situation = { + any_situation_sub_region = { + has_sub_region_phase_parameter = $PARAMETER$ + any_situation_sub_region_participant = { this = $CHAR$ } + } + } + #Where are you situated? + trigger_if = { + limit = { is_landed = yes } + any_character_situation = { + any_situation_sub_region = { + has_sub_region_phase_parameter = $PARAMETER$ + any_situation_sub_region_county = { this = $CHAR$.capital_county } + } + } + } + trigger_else_if = { + limit = { + is_landless_ruler = yes + has_domicile = yes + } + any_character_situation = { + any_situation_sub_region = { + has_sub_region_phase_parameter = $PARAMETER$ + any_situation_sub_region_county = { this = $CHAR$.domicile.domicile_location.county } + } + } + } + trigger_else = { always = no } + } +} \ No newline at end of file diff --git a/WtWSMS/common/situation/situations/bp_matter_of_britain.txt b/WtWSMS/common/situation/situations/bp_matter_of_britain.txt new file mode 100644 index 0000000000..9098ea5ec5 --- /dev/null +++ b/WtWSMS/common/situation/situations/bp_matter_of_britain.txt @@ -0,0 +1,448 @@ +bp_matter_of_britain_situation = { + + is_unique = yes # It can only exist once in the world + + gui_window_name = "window_situation" + gui_participation_window_name = "window_situation_participation" + + ################################################## + # Regions + ################################################## + sub_regions = { + britain_main = { + icon = "gfx/interface/icons/situations/debug_situation/steppe_west.dds" + geographical_regions = { matter_of_britain_region_britannia } + } + } + + ################################################## + # On Actions + ################################################## + on_start = {} + on_end = {} + on_monthly = {} + on_yearly = {} + on_leave = {} + + ################################################## + # Groups + ################################################## + participant_groups = { + involved = { + icon = "gfx/interface/icons/struggle_types/struggle_iberia_phase_conciliation.dds" + + is_character_valid = { + mob_playable_governments_trigger = yes + mob_involved_trigger = yes + #mob_interloper_trigger = no #Do not include this, for it'll conflict with mob_involved_trigger + } + require_capital_in_sub_region = yes + require_domain_in_sub_region = yes + on_join = {} + on_leave = {} + map_color = { 0.000 0.000 0.750 } + } + interloper = { + icon = "gfx/interface/icons/struggle_types/struggle_iberia_phase_hostility.dds" + + is_character_valid = { + mob_playable_governments_trigger = yes + mob_involved_trigger = no + mob_interloper_trigger = yes + } + require_capital_in_sub_region = yes + require_domain_in_sub_region = yes + on_join = {} + on_leave = {} + map_color = { 0.000 0.750 0.000 } + } + intruder = { + icon = "gfx/interface/icons/struggle_types/struggle_iberia_phase_opportunity.dds" + + is_character_valid = { + mob_playable_governments_trigger = yes + mob_involved_trigger = no + mob_interloper_trigger = no + } + require_capital_in_sub_region = no + require_domain_in_sub_region = no + require_realm_in_sub_region = yes + on_join = {} + on_leave = {} + map_color = { 0.750 0.000 0.000 } + } + } + + ################################################## + # Phases + ################################################## + start_phase = mob_migration + + phases = { + mob_migration = { + icon = "gfx/interface/icons/faith/custom_faith_8.dds" + on_start = {} + on_end = {} + + max_duration = { years = 100 } + max_duration_next_phase = highest_points + + future_phases = { + #MOB migration + mob_strife = { + takeover_type = points + takeover_points = 1000 + catalysts = { + catalyst_win_any_war_within_the_region = 25 + } + } + mob_acculturation = { + takeover_type = points + takeover_points = 1000 + catalysts = { + catalyst_win_any_war_within_the_region = 5 + } + } + } + + modifier_sets = { + #TODO: Common Parameters aren't parsable in the `all` block? + situation_mob_migration_warfare_effects = { + icon = "gfx/interface/icons/struggle_effects/war.dds" + involved = { + character_modifier = { + defender_holding_advantage = 2 + } + county_modifier = {} + parameters = { + claims_in_region_cost_prestige_not_gold_for_involved_parties = yes + truces_by_involved_or_interlopers_within_region_shorter = yes + unlocks_border_raid_casus_belli = yes + } + } + interloper = { + character_modifier = { + attacker_advantage = 2 + men_at_arms_maintenance = -0.25 + men_at_arms_recruitment_cost = -0.25 + } + county_modifier = {} + parameters = { + claims_in_region_cost_prestige_not_gold_for_involved_parties = yes + truces_by_involved_or_interlopers_within_region_shorter = yes + unlocks_border_raid_casus_belli = yes + cb_lower_prestige_level_requirement = yes + } + } + intruder = { + character_modifier = { + attacker_advantage = 5 + men_at_arms_maintenance = -0.50 + men_at_arms_recruitment_cost = -0.50 + } + county_modifier = {} + parameters = { + claims_in_region_cost_prestige_not_gold_for_involved_parties = yes + truces_by_involved_or_interlopers_within_region_shorter = yes + unlocks_border_raid_casus_belli = yes + cb_lower_prestige_level_requirement = yes + } + } + } + situation_mob_migration_culture_effects = { + icon = "gfx/interface/icons/struggle_effects/culture.dds" + involved = { + character_modifier = { + cultural_head_acceptance_gain_mult = -0.5 + } + county_modifier = {} + parameters = { + culture_hybridization_is_blocked = yes + slower_promote_culture_speed = yes + } + } + interloper = { + character_modifier = { + cultural_head_acceptance_gain_mult = -0.5 + } + county_modifier = {} + parameters = { + culture_hybridization_is_blocked = yes + culture_divergence_is_shorter = yes + can_diverge_if_culture_head = yes + faster_promote_culture_speed = yes + } + } + intruder = { + character_modifier = { + cultural_head_acceptance_gain_mult = -0.5 + } + county_modifier = {} + parameters = { + culture_hybridization_is_blocked = yes + } + } + } + situation_mob_migration_faith_effects = { + icon = "gfx/interface/icons/struggle_effects/faith.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = { + slower_convert_speed = yes + } + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = { + faster_convert_speed = yes + } + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_other_effects = { + icon = "gfx/interface/icons/struggle_effects/other.dds" + involved = { + character_modifier = {} + county_modifier = { + development_growth_factor = -0.5 + } + parameters = { + cannot_elevate_confederations = yes + cheaper_to_purchase_land_in_same_heritage_group_outside_situation = yes + easier_to_purchase_land_in_same_heritage_group_outside_situation = yes + unlock_voluntary_laampdom = yes + } + } + interloper = { + character_modifier = {} + county_modifier = { + development_growth_factor = -0.5 + } + parameters = { + cannot_elevate_confederations = yes + } + } + intruder = { + character_modifier = {} + county_modifier = { + development_growth_factor = -0.5 + } + parameters = { + cannot_elevate_confederations = yes + } + } + } + } + } + mob_strife = { + icon = "gfx/interface/icons/situations/debug_situation/plentiful_harvest.dds" + on_start = {} + on_end = {} + + max_duration = { years = 100 } + max_duration_next_phase = highest_points + + future_phases = { + mob_migration = { + takeover_type = points + takeover_points = 1000 + catalysts = { + #Too many interlopers/intruders + } + } + #Strife + mob_acculturation = { + takeover_type = points + takeover_points = 1000 + catalysts = { + #Almost all involved + } + } + } + + modifier_sets = { + #TODO: Common Parameters aren't parsable in the `all` block? + situation_mob_migration_warfare_effects = { + icon = "gfx/interface/icons/struggle_effects/war.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_culture_effects = { + icon = "gfx/interface/icons/struggle_effects/culture.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_faith_effects = { + icon = "gfx/interface/icons/struggle_effects/faith.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_other_effects = { + icon = "gfx/interface/icons/struggle_effects/other.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + } + } + mob_acculturation = { + icon = "gfx/interface/icons/situations/debug_situation/plentiful_harvest.dds" + on_start = {} + on_end = {} + + max_duration = { years = 100 } + max_duration_next_phase = highest_points + + future_phases = { + mob_migration = { + takeover_type = points + takeover_points = 1000 + catalysts = { + #Too many interlopers/intruders + } + } + mob_strife = { + takeover_type = points + takeover_points = 1000 + catalysts = { + #Too many interlopers/intruders + } + } + #Acculturation + } + + modifier_sets = { + #TODO: Common Parameters aren't parsable in the `all` block? + situation_mob_migration_warfare_effects = { + icon = "gfx/interface/icons/struggle_effects/war.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_culture_effects = { + icon = "gfx/interface/icons/struggle_effects/culture.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_faith_effects = { + icon = "gfx/interface/icons/struggle_effects/faith.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + situation_mob_migration_other_effects = { + icon = "gfx/interface/icons/struggle_effects/other.dds" + involved = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + interloper = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + intruder = { + character_modifier = {} + county_modifier = {} + parameters = {} + } + } + } + } + } +} diff --git a/WtWSMS/common/trigger_localization/BP_rule_trigger_localization.txt b/WtWSMS/common/trigger_localization/BP_rule_trigger_localization.txt index c740e6be85..643a3751ad 100644 --- a/WtWSMS/common/trigger_localization/BP_rule_trigger_localization.txt +++ b/WtWSMS/common/trigger_localization/BP_rule_trigger_localization.txt @@ -9,4 +9,8 @@ head_of_culture_cannot_diverge = { must_have_easier_to_hybrdize_parameter_to_hybridize_kulturbund = { first_not = MUST_HAVE_EASIER_TO_HYBRDIZE_PARAMETER_TO_HYBRIDIZE_KULTURBUND third_not = MUST_HAVE_EASIER_TO_HYBRDIZE_PARAMETER_TO_HYBRIDIZE_KULTURBUND +} +current_situation_phase_blocks_hybridization = { + first_not = CURRENT_SITUATION_PHASE_BLOCKS_HYBRIDIZATION + third_not = CURRENT_SITUATION_PHASE_BLOCKS_HYBRIDIZATION } \ No newline at end of file diff --git a/WtWSMS/common/trigger_localization/BP_situation_triggers.txt b/WtWSMS/common/trigger_localization/BP_situation_triggers.txt new file mode 100644 index 0000000000..4816e625f4 --- /dev/null +++ b/WtWSMS/common/trigger_localization/BP_situation_triggers.txt @@ -0,0 +1,5 @@ +do_share_situations = { + global = DO_SHARE_SITUATIONS + first = DO_SHARE_SITUATIONS + third = DO_SHARE_SITUATIONS +} \ No newline at end of file diff --git a/WtWSMS/events/_BP_events/culture_events/BP_culture_emergence.txt b/WtWSMS/events/_BP_events/culture_events/BP_culture_emergence.txt index b3c0d01462..6b831e9a06 100644 --- a/WtWSMS/events/_BP_events/culture_events/BP_culture_emergence.txt +++ b/WtWSMS/events/_BP_events/culture_events/BP_culture_emergence.txt @@ -230,6 +230,13 @@ bp_culture_emergence_events.0001 = { root.culture = { has_cultural_parameter = greco_roman_social_tradition } capital_county.culture = { has_cultural_parameter = greco_roman_social_tradition } } + #Situation Phases may block this + NOT = { + character_is_in_situation_region_with_parameter_trigger = { + CHAR = root + PARAMETER = culture_hybridization_is_blocked + } + } ##### Changed from Vanilla ^^^^^ } ##### Changed from Vanilla ^^^^^ diff --git a/WtWSMS/events/councillor_task_events/court_chaplain_task_events.txt b/WtWSMS/events/councillor_task_events/court_chaplain_task_events.txt new file mode 100644 index 0000000000..b54f7b916d --- /dev/null +++ b/WtWSMS/events/councillor_task_events/court_chaplain_task_events.txt @@ -0,0 +1,1705 @@ +##### Changed from Vanilla: extended to claims_in_region_cost_prestige_not_gold_for_involved_parties to situation parameters + +#Events related to the Court Chaplain's tasks + +namespace = court_chaplain_task + + +#### +#0001-0999: Task outcome events +# by Petter Vilberg +#### +# 0201 - County Converted + +# 0301 - Fabricate Claim? +# 0302 - Fabricate Claim on a Duchy +## Responses to Claim Fabrication: +# 0311 - County Owner +# 0312 - County Owner Lieges +# 0313 - Duchy Holder Claim +# 0314 - Top Liege - Duchy Claim + +#### +#1000-1999: Side effects from Religious Relations +# by Petter Vilberg +#### +# 1001 - Loss of Piety +# 1002 - Loss of Theocratic Vassal Opinion + +# 1101 - Extra Positive Theocratic Vassal Opinion + + +#### +#2000-2999: Side effects from Conversion +# by Petter Vilberg +#### +# 2001 - Resistance to conversion +# 2002 - Upset over conversion + +# 2101 - Improve County Opinion +# 2102 - Increased County Development +# 2103 - Increased County Levies + + +#### +#3000-3999: Side effects from Fabricate Claim +# by Petter Vilberg +#### +# 3001 - Vassals Dislike Claim Fabrication +# 3002 - Loss of Piety +# 3003 - Powerful Vassals upset +# 3004 - Target upset + + + +################## +# Task Outcome Events +# 0001-0999 +################## + + +########### +# Convert Events +# 0201-0299 +########### + + +########### +# Fabricate Claim Events +# 0301-0399 +########### + +scripted_effect court_chaplain_task_0301_charge_prestige_or_gold_effect = { + # Either we charge prestige during certain struggle phases... + if = { + limit = { + OR = { + any_character_struggle = { + involvement = involved + is_struggle_parameter_active_secondary_county_trigger = { + PARAMETER = claims_in_region_cost_prestige_not_gold_for_involved_parties + COUNTY = scope:county + } + } + any_character_situation = { + has_situation_top_phase_parameter = claims_in_region_cost_prestige_not_gold_for_involved_parties + save_temporary_scope_as = situation_temp + scope:county = { any_county_struggle = { this = scope:situation_temp } } + } + } + } + add_prestige = { + value = $COST$ + multiply = -1 + } + } + # ... or else gold the rest of the time. + else = { remove_short_term_gold = $COST$ } +} + +#Fabricate Claim? +# by Petter Vilberg +court_chaplain_task.0301 = { + type = letter_event + opening = { + desc = court_chaplain_task.0201.opening + } + desc = court_chaplain_task.0301.desc + sender = scope:councillor + + option = { + name = court_chaplain_task.0301.a + court_chaplain_task_0301_charge_prestige_or_gold_effect = { COST = scope:councillor.court_chaplain_fabricate_claim_county_cost } + add_unpressed_claim = scope:county + show_as_tooltip = { + scope:county_holder = { + add_opinion = { + target = root + modifier = court_chaplain_fabricated_claim_opinion + days = 3650 + } + } + if = { + limit = { + scope:county_holder = { is_independent_ruler = no } + NOT = { scope:county_holder.top_liege = root.top_liege } + } + scope:county_holder.top_liege = { + add_opinion = { + target = root + modifier = court_chaplain_fabricated_claim_on_vassal_opinion + days = 3650 + } + } + } + } + hidden_effect = { + if = { + limit = { + scope:councillor = { + has_council_position = councillor_court_chaplain + } + } + scope:councillor = { + start_default_task = yes + } + } + scope:county_holder = { + trigger_event = court_chaplain_task.0311 + } + if = { + limit = { + scope:county_holder = { is_independent_ruler = no } + NOT = { scope:county_holder.top_liege = root.top_liege } + } + scope:county_holder.top_liege = { + trigger_event = court_chaplain_task.0312 + } + } + } + ai_chance = { + base = 100 + modifier = { + add = -80 + short_term_gold < scope:councillor.court_chaplain_fabricate_claim_county_cost + } + modifier = { + factor = 0 + short_term_gold < 0 + } + } + } + + option = { + name = court_chaplain_task.0301.b + custom_tooltip = court_chaplain_task.0301.b.tt + ai_chance = { + base = 10 + } + } +} + + +#Fabricate Claim on a Duchy +court_chaplain_task.0302 = { + type = letter_event + opening = { + desc = court_chaplain_task.0201.opening + } + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:county = { + duchy = { + is_title_created = yes + exists = holder + NOT = { + holder.faith = scope:councillor.liege.faith + } + } + } + } + desc = court_chaplain_task.0302.desc_heretic_addition + } + desc = court_chaplain_task.0302.desc + } + } + sender = scope:councillor + + trigger = { + scope:county = { + duchy = { + is_title_created = yes + exists = holder + NOT = { + holder = root + } + holder.top_liege = scope:county.holder.top_liege + save_temporary_scope_as = duchy + root = { + NOT = { + has_claim_on = scope:duchy + } + #The recipient of this event must either hold land in the Duchy, or be Duke or above + OR = { + any_held_title = { + tier = tier_county + duchy = scope:duchy + } + highest_held_title_tier > tier_county + } + } + } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + offset = -10 + multiplier = 0.1 + } + modifier = { + add = 4 + scope:councillor.liege = { + is_independent_ruler = no + } + scope:councillor.liege.faith = scope:councillor.liege.top_liege.faith + scope:county = { + duchy = { + is_title_created = yes + exists = holder + NOT = { + holder.faith = scope:councillor.liege.faith + } + holder.top_liege = scope:councillor.liege.top_liege + } + } + } + modifier = { + add = 1 + scope:county = { + duchy = { + is_title_created = yes + exists = holder + NOT = { + holder.faith = scope:councillor.liege.faith + } + } + } + } + } + + immediate = { + scope:county = { + duchy = { + save_scope_as = duchy + holder = { + save_scope_as = duchy_holder + } + } + } + } + + option = { + name = court_chaplain_task.0302.a + court_chaplain_task_0301_charge_prestige_or_gold_effect = { COST = scope:councillor.court_chaplain_fabricate_claim_county_cost } + add_unpressed_claim = scope:county + show_as_tooltip = { + scope:county_holder = { + add_opinion = { + target = root + modifier = court_chaplain_fabricated_claim_opinion + days = 3650 + } + } + if = { + limit = { + scope:county_holder = { is_independent_ruler = no } + NOT = { scope:county_holder.top_liege = root.top_liege } + } + scope:county_holder.top_liege = { + add_opinion = { + target = root + modifier = court_chaplain_fabricated_claim_on_vassal_opinion + days = 3650 + } + } + } + } + hidden_effect = { + if = { + limit = { + scope:councillor = { + has_council_position = councillor_court_chaplain + } + } + scope:councillor = { + start_default_task = yes + } + } + scope:county_holder = { + trigger_event = court_chaplain_task.0311 + } + if = { + limit = { + scope:county_holder = { is_independent_ruler = no } + NOT = { scope:county_holder.top_liege = root.top_liege } + } + scope:county_holder.top_liege = { + trigger_event = court_chaplain_task.0312 + } + } + } + ai_chance = { + base = 100 + modifier = { + add = -90 + short_term_gold < scope:councillor.court_chaplain_fabricate_claim_county_cost + } + modifier = { + factor = 0 + short_term_gold < 0 + } + } + } + + option = { + name = court_chaplain_task.0302.b + court_chaplain_task_0301_charge_prestige_or_gold_effect = { COST = scope:councillor.court_chaplain_fabricate_claim_duchy_cost } + add_unpressed_claim = scope:duchy + show_as_tooltip = { + scope:duchy_holder = { + add_opinion = { + target = root + modifier = court_chaplain_fabricated_claim_opinion + days = 3650 + } + } + if = { + limit = { + scope:county_holder = { is_independent_ruler = no } + NOT = { scope:duchy_holder.top_liege = root.top_liege } + NOT = { scope:duchy_holder.top_liege = scope:duchy_holder } + } + scope:duchy_holder.top_liege = { + add_opinion = { + target = root + modifier = court_chaplain_fabricated_claim_on_vassal_opinion + days = 3650 + } + } + } + } + hidden_effect = { + if = { + limit = { + scope:councillor = { + has_council_position = councillor_court_chaplain + } + } + scope:councillor = { + start_default_task = yes + } + } + scope:duchy_holder = { + trigger_event = court_chaplain_task.0313 + } + if = { + limit = { + scope:county_holder = { is_independent_ruler = no } + NOT = { scope:duchy_holder.top_liege = root.top_liege } + NOT = { scope:duchy_holder.top_liege = scope:duchy_holder } + } + scope:duchy_holder.top_liege = { + trigger_event = court_chaplain_task.0314 + } + } + } + + # Struggle Catalysts. + if = { + limit = { + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_fabricating_duchy_level_claims + CHAR = scope:duchy_holder + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_fabricating_duchy_level_claims + CHAR = scope:duchy_holder + } + } + activate_struggle_catalyst = { + catalyst = catalyst_fabricating_duchy_level_claims + character = scope:councillor_liege + } + } + } + + ai_chance = { + base = 100 + modifier = { + add = -95 + short_term_gold < scope:councillor.court_chaplain_fabricate_claim_duchy_cost + } + modifier = { + factor = 0 + short_term_gold < 0 + } + } + } + + option = { + name = court_chaplain_task.0301.b + custom_tooltip = court_chaplain_task.0301.b.tt + ai_chance = { + base = 10 + } + } +} + + + +### +# Responses to claim fabrication +# 0311-0314 + +#County Owner +court_chaplain_task.0311 = { + type = character_event + title = court_chaplain_task.0311.t + desc = { + desc = court_chaplain_task.0311.opening + desc = court_chaplain_task.0311.end + } + theme = learning + left_portrait = { + character = scope:councillor_liege + animation = schadenfreude + } + lower_left_portrait = { + character = scope:councillor + animation = scheme + } + + immediate = { + show_as_tooltip = { + scope:councillor_liege = { + add_unpressed_claim = scope:county + } + } + } + + option = { + name = court_chaplain_task.0311.a + add_opinion = { + target = scope:councillor_liege + modifier = court_chaplain_fabricated_claim_opinion + days = 3650 + } + } +} + +#County Owner Lieges +court_chaplain_task.0312 = { + type = character_event + title = court_chaplain_task.0311.t + desc = { + desc = court_chaplain_task.0311.opening + desc = court_chaplain_task.0311.end + } + theme = learning + left_portrait = { + character = scope:county_holder + animation = shock + } + right_portrait = { + character = scope:councillor_liege + animation = scheme + } + lower_right_portrait = scope:councillor + + immediate = { + show_as_tooltip = { + scope:councillor_liege = { + add_unpressed_claim = scope:county + } + } + } + + option = { + name = court_chaplain_task.0312.a + add_opinion = { + target = scope:councillor_liege + modifier = court_chaplain_fabricated_claim_on_vassal_opinion + days = 3650 + } + } +} + +#Holder receives notification about Duchy claim +court_chaplain_task.0313 = { + type = character_event + title = court_chaplain_task.0313.t + desc = { + desc = court_chaplain_task.0311.opening + desc = court_chaplain_task.0311.end + } + theme = learning + left_portrait = { + character = scope:councillor_liege + animation = scheme + } + lower_left_portrait = { + character = scope:councillor + animation = schadenfreude + } + + immediate = { + show_as_tooltip = { + scope:councillor_liege = { + add_unpressed_claim = scope:duchy + } + } + } + + option = { + name = court_chaplain_task.0311.a + add_opinion = { + target = scope:councillor_liege + modifier = court_chaplain_fabricated_claim_opinion + days = 3650 + } + } +} + +#Top liege receives notification about Duchy claim +court_chaplain_task.0314 = { + type = character_event + title = court_chaplain_task.0313.t + desc = { + desc = court_chaplain_task.0311.opening + desc = court_chaplain_task.0311.end + } + theme = learning + left_portrait = { + character = scope:duchy_holder + animation = shock + } + right_portrait = { + character = scope:councillor_liege + animation = scheme + } + lower_right_portrait = scope:councillor + + immediate = { + show_as_tooltip = { + scope:councillor_liege = { + add_unpressed_claim = scope:duchy + } + } + } + + option = { + name = court_chaplain_task.0312.a + add_opinion = { + target = scope:councillor_liege + modifier = court_chaplain_fabricated_claim_on_vassal_opinion + days = 3650 + } + } +} + + +############### +# Side effects from Religious Relations +# 1000-1999 +############### + +###Bad Side Effects + + +#Loss of Piety +# by Petter Vilberg +court_chaplain_task.1001 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + # Half as likely if you can't replace your councillor + modifier = { + factor = 0.5 + faith = { + has_doctrine_parameter = clerical_appointment_head_of_faith + has_doctrine_parameter = clerical_appointment_fixed + } + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_bad + title = court_chaplain_task.1001.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_bad_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_bad_skilled_notification_tooltip + } + } + tooltip = task_religious_relations_notification_tooltip + + left_icon = scope:councillor + + add_piety = minor_piety_loss + } + } +} + +#Loss of Theocratic Vassal Opinion +# by Petter Vilberg + +scripted_trigger court_chaplain_task_1002_vassal_trigger = { + NOR = { + has_opinion_modifier = { + target = root + modifier = bad_religious_relations_opinion + } + has_opinion_modifier = { + target = root + modifier = bonus_religious_relations_opinion + } + } +} + +court_chaplain_task.1002 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + any_theocratic_vassal = { + court_chaplain_task_1002_vassal_trigger = yes + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + random_theocratic_vassal = { + limit = { + court_chaplain_task_1002_vassal_trigger = yes + } + save_scope_as = vassal + } + + send_interface_message = { + type = msg_court_chaplain_task_bad + title = court_chaplain_task.1002.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_bad_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_bad_skilled_notification_tooltip + } + } + tooltip = task_religious_relations_notification_tooltip + + left_icon = scope:vassal + right_icon = scope:councillor + + scope:vassal = { + add_opinion = { + target = root + modifier = bad_religious_relations_opinion + days = court_chaplain_task_modifier_duration + } + } + } + } + +} + +###GOOD Side Effects + +#Gain extra opinion +# by Petter Vilberg +scripted_trigger court_chaplain_task_1101_vassal_trigger = { + save_temporary_scope_as = vassal_temp + NOR = { + scope:vassal_temp = scope:councillor + has_opinion_modifier = { + target = root + modifier = bonus_religious_relations_opinion + } + has_opinion_modifier = { + target = root + modifier = bad_religious_relations_opinion + } + } +} + +court_chaplain_task.1101 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + councillor_positive_event_opinion_trigger = yes + learning > mediocre_skill_rating + } + any_theocratic_vassal = { + court_chaplain_task_1101_vassal_trigger = yes + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = 0.2 + offset = inverted_mediocre_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + random_theocratic_vassal = { + limit = { + court_chaplain_task_1101_vassal_trigger = yes + } + save_scope_as = vassal + } + + send_interface_message = { + type = msg_court_chaplain_task_good + title = court_chaplain_task.1101.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_good_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_good_skilled_notification_tooltip + } + } + tooltip = task_religious_relations_notification_tooltip + + left_icon = scope:vassal + right_icon = scope:councillor + + scope:vassal = { + add_opinion = { + target = root + modifier = bonus_religious_relations_opinion + days = court_chaplain_task_modifier_duration + } + } + } + } +} + + +############### +# Side effects from Conversion +# 2000-2999 +############### + +###Bad Side Effects + + +#Resistance to conversion +# by Petter Vilberg +court_chaplain_task.2001 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + scope:county = { + NOT = { has_county_modifier = court_chaplain_resisted_conversion_modifier } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_bad + title = court_chaplain_task.2001.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_bad_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_bad_skilled_notification_tooltip + } + } + tooltip = task_conversion_notification_tooltip + left_icon = scope:county + right_icon = scope:councillor + + scope:county = { + add_county_modifier = { + modifier = court_chaplain_resisted_conversion_modifier + days = court_chaplain_task_modifier_duration + } + } + } + } +} + +#Upset over conversion +# by Petter Vilberg +court_chaplain_task.2002 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + scope:county = { + NOR = { + has_county_modifier = court_chaplain_county_conversion_upset_modifier + has_county_modifier = court_chaplain_county_conversion_support_modifier + } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_bad + title = court_chaplain_task.2002.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_bad_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_bad_skilled_notification_tooltip + } + } + tooltip = task_conversion_notification_tooltip + + left_icon = scope:county + right_icon = scope:councillor + + scope:county = { + add_county_modifier = { + modifier = court_chaplain_county_conversion_upset_modifier + days = court_chaplain_task_modifier_duration + } + } + } + } +} + + +###Good Side Effects + + + +#Improve County opinion +# by Petter Vilberg + +court_chaplain_task.2101 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + councillor_positive_event_opinion_trigger = yes + learning > mediocre_skill_rating + } + scope:county = { + NOR = { + has_county_modifier = court_chaplain_county_conversion_upset_modifier + has_county_modifier = court_chaplain_county_conversion_support_modifier + } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = 0.2 + offset = inverted_mediocre_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_good + title = court_chaplain_task.2101.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_good_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_good_skilled_notification_tooltip + } + } + tooltip = task_conversion_notification_tooltip + + left_icon = scope:county + right_icon = scope:councillor + + scope:county = { + add_county_modifier = { + modifier = court_chaplain_county_conversion_support_modifier + days = court_chaplain_task_modifier_duration + } + } + } + } +} + + +#Increased County Development +# by Petter Vilberg + +court_chaplain_task.2102 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + councillor_positive_event_opinion_trigger = yes + learning > mediocre_skill_rating + } + scope:county = { + NOT = { has_county_modifier = court_chaplain_religious_construction_modifier } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = 0.2 + offset = inverted_mediocre_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_good + title = court_chaplain_task.2102.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_good_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_good_skilled_notification_tooltip + } + } + tooltip = task_conversion_notification_tooltip + + left_icon = scope:county + right_icon = scope:councillor + + scope:county = { + add_county_modifier = { + modifier = court_chaplain_religious_construction_modifier + days = court_chaplain_task_modifier_duration + } + } + } + } +} + + +#Increased County Levies +# by Petter Vilberg + +court_chaplain_task.2103 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + councillor_positive_event_opinion_trigger = yes + learning > mediocre_skill_rating + } + scope:county = { + NOT = { has_county_modifier = court_chaplain_religious_fervor_modifier } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = 0.2 + offset = inverted_mediocre_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_good + title = court_chaplain_task.2103.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_good_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_good_skilled_notification_tooltip + } + } + tooltip = task_conversion_notification_tooltip + + left_icon = scope:county + right_icon = scope:councillor + + scope:county = { + add_county_modifier = { + modifier = court_chaplain_religious_fervor_modifier + days = court_chaplain_task_modifier_duration + } + } + } + } +} + +#################### +# Fabricate Claim Side Effects +# 3000-3999 +#################### + +###BAD Side Effects + +#Vassals Dislike Claim Fabrication +# by Petter Vilberg +court_chaplain_task.3001 = { + type = character_event + title = court_chaplain_task.3001.t + desc = court_chaplain_task.3001.desc + theme = learning + left_portrait = { + character = scope:councillor + animation = shame + } + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + scope:county = { + holder = { + target_is_liege_or_above = root + } + } + any_vassal = { + highest_held_title_tier >= tier_county + } + NOT = { has_character_modifier = court_chaplain_vassal_claim_upset_modifier } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + } + + immediate = { + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + } + + option = { + name = court_chaplain_task.3001.a + add_character_modifier = { + modifier = court_chaplain_vassal_claim_upset_modifier + days = court_chaplain_task_modifier_duration + } + } +} + +#Loss of Piety +# by Petter Vilberg +court_chaplain_task.3002 = { + hidden = yes + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + } + + immediate = { + cp:councillor_court_chaplain = { + save_scope_as = active_councillor + } + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + send_interface_message = { + type = msg_court_chaplain_task_bad + title = court_chaplain_task.3002.notification + desc = { + triggered_desc = { + trigger = { + scope:active_councillor = { learning <= average_skill_level } + } + desc = task_learning_bad_unskilled_notification_tooltip + } + triggered_desc = { + trigger = { + scope:active_councillor = { learning > average_skill_level } + } + desc = task_learning_bad_skilled_notification_tooltip + } + } + tooltip = task_fabricate_claim_notification_tooltip + + left_icon = scope:councillor + + add_piety = medium_piety_loss + } + } +} + + +#Powerful Vassals upset +# by Petter Vilberg +scripted_trigger court_chaplain_task_3003_powerful_vassal_trigger = { + is_powerful_vassal = yes + NOT = { this = scope:councillor } + save_temporary_scope_as = vassal + scope:county = { + NOT = { + holder = scope:vassal + } + } + NOT = { + has_opinion_modifier = { + target = root + modifier = court_chaplain_upsetting_claim_fabrication_opinion + } + } +} + +court_chaplain_task.3003 = { + type = letter_event + opening = court_chaplain_task.3003.opening + desc = court_chaplain_task.3003.desc + sender = scope:vassal + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + any_vassal = { + court_chaplain_task_3003_powerful_vassal_trigger = yes + } + NOT = { has_character_modifier = court_chaplain_vassal_claim_upset_modifier } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = -0.2 + offset = inverted_high_skill_rating + } + compare_modifier = { + value = dread + multiplier = -0.05 + } + } + + immediate = { + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + random_vassal = { + limit = { + court_chaplain_task_3003_powerful_vassal_trigger = yes + } + weight = { + base = 1 + modifier = { + add = 3 + has_claim_on = scope:county + } + } + if = { + limit = { root = { is_ai = no } } + assign_quirk_effect = yes + } + save_scope_as = vassal + } + } + + option = { + name = court_chaplain_task.3003.a + scope:vassal = { + add_opinion = { + target = root + modifier = court_chaplain_upsetting_claim_fabrication_opinion + days = court_chaplain_task_modifier_duration + } + } + } + + option = { + name = court_chaplain_task.3003.b + trigger = { + OR = { + has_trait = arrogant + has_trait = callous + dread > 50 + } + } + exclusive = yes + scope:vassal = { + add_opinion = { + target = root + modifier = court_chaplain_upsetting_claim_fabrication_opinion + days = court_chaplain_task_modifier_duration + } + } + } +} + + +#Target upset +# by Petter Vilberg +court_chaplain_task.3004 = { + type = letter_event + opening = court_chaplain_task.3004.opening + desc = court_chaplain_task.3004.desc + sender = scope:target + + trigger = { + exists = cp:councillor_court_chaplain + scope:councillor = cp:councillor_court_chaplain + scope:councillor = { + learning < high_skill_rating + } + scope:county = { + holder = { + NOT = { + has_opinion_modifier = { + target = root + modifier = court_chaplain_vassal_claim_target_upset_modifier + } + } + NOT = { target_is_liege_or_above = root } + } + } + } + + weight_multiplier = { + base = 1 + compare_modifier = { + target = scope:councillor + value = learning + multiplier = 0.2 + offset = inverted_mediocre_skill_rating + } + } + + immediate = { + set_variable = { + name = had_court_chaplain_task_side_effect + value = yes + days = court_chaplain_task_side_effect_cooldown + } + scope:county = { + holder = { + save_scope_as = target + } + } + if = { + limit = { + scope:target = { is_independent_ruler = no } + } + scope:target.top_liege = { + save_scope_as = target_liege + } + } + } + + option = { + name = court_chaplain_task.3004.a + add_prestige = minor_prestige_loss + scope:target = { + add_opinion = { + target = root + modifier = court_chaplain_vassal_claim_target_upset_modifier + days = court_chaplain_task_modifier_duration + } + } + if = { + limit = { exists = scope:target_liege } + scope:target_liege = { + add_opinion = { + target = root + modifier = court_chaplain_vassal_claim_target_upset_modifier + days = court_chaplain_task_modifier_duration + } + } + } + } +} + +# Maintenance for vassal conversion messages + +scripted_effect fetch_council_task_affected_vassal_informees_effect = { + scope:county ?= { + holder ?= { + if = { + limit = { + is_ai = no + NOT = { scope:councillor_liege ?= this } + } + add_to_list = informees + } + every_liege_or_above = { + limit = { + is_ai = no + NOT = { scope:councillor_liege ?= this } + highest_held_title_tier < scope:councillor_liege.highest_held_title_tier + } + add_to_list = informees + } + } + } +} + +court_chaplain_task.8000 = { # Started + scope = none + hidden = yes + + trigger = { + # Stop spam if target is changed a lot e.g. on a single tick + exists = scope:councillor.councillor_task_target + scope:set_county.title_province ?= scope:councillor.councillor_task_target + } + + immediate = { + scope:county.faith ?= { save_scope_as = old_faith } + fetch_council_task_affected_vassal_informees_effect = yes + every_in_list = { + list = informees + switch = { + trigger = faith + scope:councillor_liege.faith = { # Good if same faith as liege + send_interface_message = { + type = msg_council_conversion_good + title = liege_converting_county_title + desc = liege_converting_county_desc + left_icon = scope:councillor_liege + right_icon = scope:county + } + } + scope:old_faith = { + send_interface_message = { # Bad if same faith as county + type = msg_council_conversion_bad + title = liege_converting_county_title + desc = liege_converting_county_desc + left_icon = scope:councillor_liege + right_icon = scope:county + } + } + fallback = { + send_interface_message = { # Neutral otherwise + type = msg_council_conversion_neutral + title = liege_converting_county_title + desc = liege_converting_county_desc + left_icon = scope:liege_scope + right_icon = scope:county + } + } + } + } + } +} + +court_chaplain_task.8001 = { # Cancelled + scope = none + hidden = yes + cooldown = { days = 1 } + + trigger = { + NOT = { + scope:county ?= { has_variable = county_conversion_completed } + } + } + + immediate = { + # Message for vassals + scope:county.faith ?= { save_scope_as = old_faith } + fetch_council_task_affected_vassal_informees_effect = yes + every_in_list = { + list = informees + switch = { + trigger = faith + scope:old_faith = { # Good if same faith as county + send_interface_message = { + type = msg_council_conversion_good + title = liege_stopped_converting_county_title + desc = liege_stopped_converting_county_desc + left_icon = scope:councillor_liege + right_icon = scope:county + } + } + scope:councillor_liege.faith = { # Bad if same faith as liege + send_interface_message = { + type = msg_council_conversion_bad + title = liege_stopped_converting_county_title + desc = liege_stopped_converting_county_desc + left_icon = scope:councillor_liege + right_icon = scope:county + } + } + fallback = { + send_interface_message = { # Neutral otherwise + type = msg_council_conversion_neutral + title = liege_converting_county_title + desc = liege_converting_county_desc + left_icon = scope:liege_scope + right_icon = scope:county + } + } + } + } + } +} + +court_chaplain_task.8002 = { # Completed + scope = none + hidden = yes + + immediate = { + scope:county ?= { + set_variable = { + name = county_conversion_completed + weeks = 1 + } + } + fetch_council_task_affected_vassal_informees_effect = yes + every_in_list = { + list = informees + switch = { + trigger = faith + scope:councillor_liege.faith ?= { # Good if same faith as county + send_interface_message = { + type = msg_council_conversion_good + title = liege_converted_county_title + desc = liege_converted_county_desc + left_icon = scope:councillor_liege + right_icon = scope:county + } + } + scope:old_faith ?= { # Bad if same faith as liege + send_interface_message = { + type = msg_council_conversion_bad + title = liege_converted_county_title + desc = liege_converted_county_desc + left_icon = scope:councillor_liege + right_icon = scope:county + } + } + fallback = { + send_interface_message = { # Neutral otherwise + type = msg_council_conversion_neutral + title = liege_converted_county_title + desc = liege_converted_county_desc + left_icon = scope:liege_scope + right_icon = scope:county + } + } + } + } + } +} + diff --git a/WtWSMS/localization/english/situations/BP_matter_of_britain_l_english.yml b/WtWSMS/localization/english/situations/BP_matter_of_britain_l_english.yml new file mode 100644 index 0000000000..251d5ef891 --- /dev/null +++ b/WtWSMS/localization/english/situations/BP_matter_of_britain_l_english.yml @@ -0,0 +1,64 @@ +l_english: + situation_bp_matter_of_britain_situation: "The Matter of Britain" #TODO: Make an encyclopedia entry + situation_bp_matter_of_britain_situation_desc: "The Matter of Britain models the situation that occurred in Post-Roman Britain, wherein the Jutes, Angles, and Saxons displaced the native Romano-British population and severely curtailed the native Briton population before eventually converting to Christianity and evolving into the Heptarchy." + + #Participant Groups + bp_matter_of_britain_situation_participant_group_involved: "Involved" + bp_matter_of_britain_situation_participant_group_involved_desc: "All landed characters with a capital in the [situation_sub_region|E] with at least [EmptyScope.ScriptValue('mob_involved_percentage')|0%] of counties in the [situation_sub_region|E] being their [culture|E] and [faith|E] (considered separately)." + bp_matter_of_britain_situation_participant_group_interloper: "Interloper" + bp_matter_of_britain_situation_participant_group_interloper_desc: "All landed characters with a capital in the [situation_sub_region|E] with less than [EmptyScope.ScriptValue('mob_involved_percentage')|0%] of counties in the [situation_sub_region|E] being their [culture|E] and [faith|E] (considered separately)." + bp_matter_of_britain_situation_participant_group_intruder: "Intruder" + bp_matter_of_britain_situation_participant_group_intruder_desc: "All landed characters in the [situation_sub_region|E] who are neither Involved nor Interlopers." + + #Phases + mob_migration: "Migration" + mob_migration_desc: "Intruders and Interlopers have invaded the isles, forcing the precarious situation into turmoil. From the continent, new peoples arrive, potential displacing current residents and overturning the previous order." + mob_strife: "Strife" + mob_strife_desc: "The situation has evolved into a war between the various Involved factions, each vying for power. Can any one group come to dominate the Isles?" + mob_acculturation: "Acculturation" + mob_acculturation_desc: "Eventually, all conflict must give way to peace. It is a time of flourishing on the Isles, as new cultures form and prosperity begins to return." + + bp_matter_of_britain_situation_mob_migration_situation_phase: "$mob_migration$ Phase" + bp_matter_of_britain_situation_mob_strife_situation_phase: "$mob_strife$ Phase" + bp_matter_of_britain_situation_mob_acculturation_situation_phase: "$mob_acculturation$ Phase" + + #Modifier Sets + situation_mob_migration_warfare_effects: "Warfare Effects" + situation_mob_migration_warfare_effects_concept: "" + situation_mob_migration_culture_effects: "Culture Effects" + situation_mob_migration_culture_effects_concept: "" + situation_mob_migration_faith_effects: "Faith Effects" + situation_mob_migration_faith_effects_concept: "" + situation_mob_migration_other_effects: "Other Effects" + situation_mob_migration_other_effects_concept: "" + + #Struggle Parameters + situation_parameter_claims_in_region_cost_prestige_not_gold_for_involved_parties: "[fabricating_claims|E] in the [situation_sub_region|E] costs [prestige_i][prestige|E] instead of [gold_i][gold|E]" + situation_parameter_truces_by_involved_or_interlopers_within_region_shorter: "Characters have shorter [truces|UE] for [wars|UE] in the [situation_sub_region|EU]" + situation_parameter_unlocks_border_raid_casus_belli: "$struggle_parameter_unlocks_border_raid_casus_belli$" + situation_parameter_cb_lower_prestige_level_requirement: "All [casus_bellis|E] that require a specific [prestige_level|E] require one less" + situation_parameter_unlock_voluntary_laampdom: "[SelectLocalization( HasDlcFeature( 'landless_playable' ), 'culture_parameter_unlock_voluntary_laampdom_DLC', 'culture_parameter_unlock_voluntary_laampdom_NO_DLC' )]" + #New Parameters: Make script values + situation_parameter_cannot_elevate_confederations: "Does not have access to the #V $confederation_kingdom_decision$#! [decision|E]" + situation_parameter_slower_promote_culture_speed: "Promote Culture Speed: #N [EmptyScope.ScriptValue('mob_migration_promote_culture_malus')|0%]#!" + situation_parameter_faster_promote_culture_speed: "Promote Culture Speed: #P [EmptyScope.ScriptValue('mob_migration_promote_culture_bonus')|0%]#!" + situation_parameter_faster_convert_speed: "Convert Faith Speed: #P [EmptyScope.ScriptValue('mob_migration_convert_faith_bonus')|0%]#!, and #V $unreformed_faith_doctrine_name$#! has no impact on conversion speed" + situation_parameter_slower_convert_speed: "Convert Faith Speed: #N [EmptyScope.ScriptValue('mob_migration_convert_faith_malus')|0%]#!" + situation_parameter_cheaper_to_purchase_land_in_same_heritage_group_outside_situation: "Cheaper to use the #V $purchase_land_interaction$#! [interaction|E] #emph outside#! the [situation_sub_region|E], so long as the target is of you [heritage_group|E]" + situation_parameter_easier_to_purchase_land_in_same_heritage_group_outside_situation: "Easier to use the #V $purchase_land_interaction$#! [interaction|E], so long as the target is of you [heritage_group|E] and outside the [situation_sub_region|E]" + + + situation_parameter_culture_divergence_is_shorter: "[divergent_culture|E] creation cooldown time is halved." + situation_parameter_culture_hybridization_is_blocked: "[hybrid_culture|E] creation is blocked" + situation_parameter_can_diverge_if_culture_head: "$culture_parameter_can_diverge_if_culture_head$" + + #Task Descs + mob_migration_task_general_desc: "Situation Impact" + mob_migration_promote_culture_bonus_task_desc: "$mob_migration_task_general_desc$" + mob_migration_promote_culture_malus_task_desc: "$mob_migration_task_general_desc$" + mob_migration_convert_faith_bonus_task_desc: "$mob_migration_task_general_desc$" + mob_migration_convert_faith_malus_task_desc: "$mob_migration_task_general_desc$" + + #Interactions Descs + OUR_KIN_FLEEING_PERSECUTION: "You are our kinfolk involved in a [situation|E]: $VALUE|+=0$" + \ No newline at end of file diff --git a/WtWSMS/localization/english/triggers/BP_rule_trigger_l_english.yml b/WtWSMS/localization/english/triggers/BP_rule_trigger_l_english.yml index 1d9d9de1d2..5609091180 100644 --- a/WtWSMS/localization/english/triggers/BP_rule_trigger_l_english.yml +++ b/WtWSMS/localization/english/triggers/BP_rule_trigger_l_english.yml @@ -2,4 +2,5 @@ MUST_NOT_BE_UNDER_CULTURE_HEAD_TRADITION: "[Character.Custom('HasASpecificTradition')|V] prevents hybridization or divergence if the [culture_head|E] ([Character.GetCulture.GetCultureHead.GetName]) is your fellow vassal or is your [liege|E] or above." INFORM_THE_MODS_THAT_YOUR_TRADITION_IS_NOT_HANDLED_HasASpecificTradition: "#bold Inform the Modders that your cultural tradition is not handled in #V HasASpecificTradition#!#!" HEAD_OF_CULTURE_CANNOT_DIVERGE: "A [culture_head|E] cannot diverge a culture [Character.GetSheHe] heads." - MUST_HAVE_EASIER_TO_HYBRDIZE_PARAMETER_TO_HYBRIDIZE_KULTURBUND: "To hybridize with the same [kulturbund|E], your culture must have a [tradition|E] with the parameter \"#V $culture_parameter_enables_kulturbund_hybridization$#!\"." \ No newline at end of file + MUST_HAVE_EASIER_TO_HYBRDIZE_PARAMETER_TO_HYBRIDIZE_KULTURBUND: "To hybridize with the same [kulturbund|E], your culture must have a [tradition|E] with the parameter \"#V $culture_parameter_enables_kulturbund_hybridization$#!\"." + CURRENT_SITUATION_PHASE_BLOCKS_HYBRIDIZATION: "The current [situation|E] phase prevents creating [hybrid_cultures|E]" \ No newline at end of file diff --git a/WtWSMS/localization/english/triggers/BP_situations_l_english.yml b/WtWSMS/localization/english/triggers/BP_situations_l_english.yml new file mode 100644 index 0000000000..54efefc001 --- /dev/null +++ b/WtWSMS/localization/english/triggers/BP_situations_l_english.yml @@ -0,0 +1,3 @@ +l_english: + DO_SHARE_SITUATIONS: "You and [TARGET_CHARACTER.GetFullNameNoTooltip] share a [situation|E]" + NOT_DO_SHARE_SITUATIONS: "You and [TARGET_CHARACTER.GetFullNameNoTooltip] do not share a [situation|E]" \ No newline at end of file diff --git a/WtWSMS/map_data/geographical_regions/BP_struggle_situation_regions.txt b/WtWSMS/map_data/geographical_regions/BP_struggle_situation_regions.txt new file mode 100644 index 0000000000..efaa27b9a7 --- /dev/null +++ b/WtWSMS/map_data/geographical_regions/BP_struggle_situation_regions.txt @@ -0,0 +1,5 @@ +matter_of_britain_region_britannia = { + regions = { + world_roman_empire_west_britannia + } +} \ No newline at end of file diff --git a/_developer_documentation/_BP_hard_file_overwrites.info b/_developer_documentation/_BP_hard_file_overwrites.info index 226ba3ba37..6f3a76fb3a 100644 --- a/_developer_documentation/_BP_hard_file_overwrites.info +++ b/_developer_documentation/_BP_hard_file_overwrites.info @@ -42,6 +42,7 @@ events/global_culture_events.txt : Remove all these events as we'll use differen events/tutorial_events.txt : Removed tutorial events events/artifacts/historical_artifacts_events.txt : Fixup various ahistorical artifacts events/culture_events/culture_emergence_events.txt : Fix usurpation causing feudal spawn issue +events/councillor_task_events/court_chaplain_task_events.txt : Extend some logic to British Migration Situation events/decisions_events/east_europe_events.txt : Removal of bosnian_church, hungarian migration references events/decisions_events/middle_europe_decisions_events.txt : Removal of k_sorbia references events/decisions_events/british_isles_events.txt : Removal of heritage_goidelic,heritage_brythonic references diff --git a/_developer_documentation/_BP_scratchpad.info b/_developer_documentation/_BP_scratchpad.info index d150058391..95d914efa6 100644 --- a/_developer_documentation/_BP_scratchpad.info +++ b/_developer_documentation/_BP_scratchpad.info @@ -29,6 +29,12 @@ GFX: ========================== 0.1.8: Matter of Britain: +* Need to trigger adventurers getting involved with domicile movement on_action + +* Divergence names in England need overhaul +* Need to be able to diverge without changing a pillar +* Review event driven divergence + Migration Wars: * Migration overhaul; should become easier, minor migrations should become more common * Letting migrants settle should block a realm from further minor migration for a while