diff --git a/common/buildings/NEOW_special_buildings.txt b/common/buildings/NEOW_special_buildings.txt index a7d12167..28d19e66 100644 --- a/common/buildings/NEOW_special_buildings.txt +++ b/common/buildings/NEOW_special_buildings.txt @@ -4650,8 +4650,6 @@ doges_palace_01 = { # Should technically be burnt down/rebuilt, but this is most text = government_is_not_republic_or_admin_desc OR = { government_has_flag = government_is_republic - government_has_flag = government_is_urepublic - government_has_flag = government_is_prepublic government_has_flag = government_is_administrative } } diff --git a/common/character_interactions/00_alliance.txt b/common/character_interactions/00_alliance.txt deleted file mode 100644 index d2fdf175..00000000 --- a/common/character_interactions/00_alliance.txt +++ /dev/null @@ -1,4136 +0,0 @@ -call_ally_interaction = { - category = interaction_category_diplomacy - desc = call_ally_interaction_desc - interface_priority = 60 - interface = call_ally - special_interaction = call_ally_interaction - popup_on_receive = yes - pause_on_receive = yes - icon = alliance - - greeting = positive - notification_text = CALL_ALLY_NOTIFICATION - - is_shown = { - scope:actor = { - is_at_war = yes - trigger_if = { # Avoid calling Adventurers without armies or landed rulers who have been devastated - limit = { - is_ai = yes - } - scope:recipient.current_military_strength >= 100 - } - trigger_if = { - limit = { - liege = scope:recipient # The recipient is actor's liege - } - subject_contract_has_flag = vassal_contract_liege_forced_war_override - } - trigger_if = { - limit = { - scope:recipient = { - is_tributary_of = scope:actor - NOT = { is_allied_to = scope:actor } - } - } - piety >= 50 - has_realm_law_flag = can_call_tributaries_for_piety - } - } - scope:recipient = { - OR = { - is_allied_to = scope:actor - AND = { - this ?= scope:actor.diarch - scope:actor = { - any_character_war = { diarch_callable_in_internal_war_trigger = yes } - } - } - scope:actor = { - is_vassal_of = prev - subject_contract_has_flag = vassal_contract_liege_forced_war_override - } - scope:actor = { - is_tributary_of = prev - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - AND = { - is_tributary_of = scope:actor - scope:actor = { - piety >= 50 - has_realm_law_flag = can_call_tributaries_for_piety - } - } - } - } - scope:actor = { #If you can call them as a House Member then do that - NOT = { - is_character_interaction_valid = { - recipient = scope:recipient - interaction = call_house_member_to_war_interaction - } - } - } - } - - has_valid_target = { - exists = scope:target - } - - has_valid_target_showing_failures_only = { - scope:target = { - is_war_leader = scope:actor - } - - scope:actor = { - trigger_if = { - limit = { # if you're invoking your suzerain's defensive guarantee, it has to be for a defensive war - NOT = { is_allied_to = scope:recipient } - suzerain = scope:recipient - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - scope:target = { - primary_defender = scope:actor - } - } - - trigger_if = { - limit = { - scope:target = { - OR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - } - - trigger_if = { - limit = { - this = scope:target.casus_belli.primary_attacker - } - #if it's a religious war the recipient has to be of the same faith - custom_description = { - text = is_of_wrong_faith_for_holy_war - subject = scope:actor - object = scope:recipient - faith = scope:recipient.faith - } - } - trigger_else = { - custom_description = { - text = is_of_attacker_faith_in_holy_war - subject = scope:actor - object = scope:recipient - scope:target = { primary_attacker.faith != scope:recipient.faith } - } - } - } - } - - joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { - WARRIOR = scope:actor - JOINER = scope:recipient - } - } - - - is_valid_showing_failures_only = { - - scope:recipient = { - is_ruler = yes - - # Only rulers of a high enough rank may call a hegemon into wars - custom_tooltip = { - text = too_low_rank_to_call_hegemon - trigger_if = { - limit = { highest_held_title_tier = tier_hegemony } - scope:actor = { highest_held_title_tier >= tier_empire } - } - } - } - - scope:actor = { - # Only War Leaders can call allies - custom_description = { - text = must_be_war_leader - any_character_war = { - is_war_leader = scope:actor - } - } - - # Cannot call the same character multiple times - custom_description = { - text = cannot_call_same_character_multiple_times - subject = scope:recipient - any_character_war = { - ALL_FALSE = { - was_called = scope:recipient - is_participant = scope:recipient - } - } - } - - # Cannot call a character of the "wrong" religion to a Great Holy War - trigger_if = { - limit = { - faith != scope:recipient.faith - } - custom_description = { - text = is_of_wrong_faith_for_holy_war - subject = scope:actor - object = scope:recipient - any_character_war = { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - } - } - } - - can_potentially_call_ally_trigger = { - WARRIOR = scope:actor - JOINER = scope:recipient - } - } - - can_be_picked = { - can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } - - scope:target = { - is_war_leader = scope:actor - - # not already in target war - custom_description = { - text = join_war_interaction_already_in_target_war - NOR = { - any_war_attacker = { this = scope:recipient } - any_war_defender = { this = scope:recipient } - } - } - - # Diarchs can only be called to internal wars. - custom_tooltip = { - text = call_ally_interaction.tt.diarchs_called_to_internal_wars - trigger_if = { - limit = { scope:recipient ?= scope:actor.diarch } - primary_defender = scope:actor - diarch_callable_in_internal_war_trigger = yes - } - } - } - - # You cannot call a suzerain against their own tributary - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - scope:target.casus_belli.primary_attacker = { is_tributary_of_suzerain_or_above = scope:recipient } - } - NOT = { - scope:target.casus_belli.primary_attacker = { is_tributary_of_suzerain_or_above = scope:recipient } - } - } - trigger_else_if = { - limit = { - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender = { is_tributary_of_suzerain_or_above = scope:recipient } - } - NOT = { - scope:target.casus_belli.primary_defender = { is_tributary_of_suzerain_or_above = scope:recipient } - } - } - trigger_else = {} - - # You cannot call a tributary against their suzerain - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_attacker } - } - NOT = { - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_attacker } - } - } - trigger_else_if = { - limit = { - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_defender } - } - NOT = { - scope:recipient = { is_tributary_of_suzerain_or_above = scope:target.casus_belli.primary_defender } - } - } - trigger_else = {} - } - - on_auto_accept = { - scope:recipient = { - trigger_event = call_ally.0001 - } - scope:target = { - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:recipient = { - add_piety = miniscule_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:recipient = { - add_piety = minor_piety_gain - } - } - } - } - - on_accept = { - call_ally_interaction_effect = yes - - save_scope_value_as = { - name = call_ally_interaction - value = yes - } - - scope:actor = { - hidden_effect = { #To nudge friendship - if = { - limit = { - NOR = { - has_relation_friend = scope:recipient - has_relation_potential_friend = scope:recipient - } - } - set_relation_potential_friend = scope:recipient - } - } - trigger_event = call_ally.0100 - } - scope:target = { - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:recipient = { - add_piety = minor_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:recipient = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:recipient = { - add_piety = medium_piety_gain - } - } - } - } - - on_decline = { - #The war could theoretically end on the day the decline is sent - if = { - limit = { - exists = scope:target - } - scope:target = { - if = { - limit = { - is_attacker = scope:actor - } - scope:actor = { - add_opinion = { - modifier = rejected_call_to_offensive_war - target = scope:recipient - } - } - scope:recipient = { - #Why should Mandalas care about bickering tributaries in an offensive war - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - add_prestige_experience = major_prestige_loss - } - } - } - else = { - scope:actor = { - add_opinion = { - modifier = rejected_call_to_defensive_war - target = scope:recipient - } - } - scope:recipient = { - if = { - limit = { government_has_flag = government_is_mandala } - add_prestige_experience = major_prestige_loss - add_piety_level = -1 - } - else = { add_prestige_experience = massive_prestige_loss } - } - } - if = { - limit = { - scope:actor = { - has_relation_blood_brother = scope:recipient - } - } - scope:recipient = { - add_piety_experience = massive_piety_loss - add_character_modifier = { - modifier = broke_blood_brotherhood_modifier - desc = broke_blood_brotherhood_modifier_acceptance_tt - years = 25 - } - remove_relation_blood_brother = scope:actor - } - scope:actor = { - set_relation_rival = { - target = scope:recipient - reason = rival_blood_brother_refused_call_reason - } - } - } - # Nomad Vassals and Tributaries stop being Obedient if they have the Liege War Support / Suzerain Defensive Guarantee contract right - if = { - limit = { - scope:recipient = scope:actor.obedience_target - scope:actor = { - OR = { - subject_contract_has_flag = vassal_contract_liege_forced_war_override - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - } - } - scope:actor = { - set_variable = { - name = not_obedient_declined_call - value = scope:recipient - years = 5 - } - } - } - if = { - limit = { - scope:recipient = scope:actor.suzerain - is_defender = scope:actor - scope:actor = { - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - } - scope:actor = { - end_tributary = yes - } - } - hidden_effect = { - if = { - limit = { - NOT = { was_called = scope:recipient } - } - set_called_to = scope:recipient - } - } - } - scope:actor = { - trigger_event = call_ally.0101 - } - - # If we're a clan this interaction affects unity - refuse_call_to_arms_add_clan_unity_effect = yes - - scope:recipient = { - if = { - limit = { - exists = house - is_house_head = yes - exists = scope:actor.house - } - house = { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = ally_call_ignored - CHAR = scope:recipient - TARGET_CHAR = scope:actor - TITLE = scope:dummy_gender - } - } - } - } - } - } - - auto_accept = { - OR = { - # Always accept a call from a Spouse - custom_description = { - text = "recipient_is_spouse" - subject = scope:actor - object = scope:recipient - scope:recipient = { - is_spouse_of = scope:actor - is_ai = yes - } - } - # Always accept a call from the Heir - custom_description = { - text = "is_recipients_player_heir" - subject = scope:actor - object = scope:recipient - - exists = scope:recipient.player_heir - scope:recipient = { - player_heir = scope:actor - is_close_or_extended_family_of = scope:actor # Only for family - is_ai = yes - } - } - # Always accept a call from the one you are heir of - custom_description = { - text = "is_player_heir" - subject = scope:recipient - object = scope:actor - - exists = scope:actor.player_heir - scope:actor.player_heir = scope:recipient - scope:actor = { # Shouldn't be able to force your liege to join just because you've not got any family... - is_close_or_extended_family_of = scope:recipient - } - scope:recipient = { - is_ai = yes - } - } - } - } - - ai_accept = { - base = 20 - - modifier = { # Conquerors do not help anyone but themselves - add = -1000 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:recipient = { has_variable = conqueror } - } - - modifier = { # AI's that need to save gold will not help their lesser AI allies, unless it's a player war - add = -1000 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:actor = { - is_ai = yes - primary_title.tier < scope:recipient.primary_title.tier - } - scope:target.casus_belli = { - primary_attacker = { is_ai = yes } - primary_defender = { is_ai = yes } - } - scope:recipient = { ai_should_focus_on_building_in_their_capital = yes } - } - - modifier = { # Refuse call to conflicts of little benefit - add = -1000 - desc = WONT_FIGHT_MEANINGLESS_REASON - trigger_if = { - limit = { exists = scope:target } - scope:target = { using_cb = fp2_border_raid } - scope:recipient = { # Unless they like going on raids - NOR = { - has_trait = viking - has_trait = reaver - } - } - } - trigger_else = { always = no } - } - - modifier = { # Refuse call against Heir - add = -1000 - exists = scope:recipient.player_heir - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - desc = WONT_FIGHT_HEIR_REASON - } - - modifier = { # Refuse call against Spouse - add = -1000 - scope:recipient = { - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - - } - desc = WONT_FIGHT_SPOUSE_REASON - } - - modifier = { # Refuse call against Suzerain if Obedient - add = -1000 - trigger_if = { - limit = { - exists = scope:recipient.suzerain - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:recipient.suzerain = scope:target.casus_belli.primary_attacker - } - trigger_else = { - scope:recipient.suzerain = scope:target.casus_belli.primary_defender - } - scope:recipient = { - exists = obedience_target - is_obedient = yes - } - } - } - trigger_else = { always = no } - desc = WONT_FIGHT_OBEDIENT_REASON - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - # Honor factor - ai_value_modifier = { - ai_honor = 1 - min = 0 - } - - modifier = { # Tends to join defensive wars - add = 50 - scope:target.casus_belli.primary_defender = scope:actor - desc = DEFENSIVE_WAR_REASON - } - - modifier = { # Same language - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - modifier = { # Shared Court Language (non-spoken) - add = 10 - desc = foreign_realm_court_language_non_spoken_interaction_reason - trigger = { - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - NOT = { knows_court_language_of = this } - } - scope:actor.top_liege != scope:recipient.top_liege - OR = { - AND = { - scope:recipient = { - has_royal_court = yes - } - scope:actor = { # You share Court Language - has_same_court_language = scope:recipient - } - } - - scope:recipient = { # The recipient doesn't have a royal court, but their liege does - top_liege != this - has_royal_court = no - liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - scope:recipient = { # The recipient doesn't have a royal court, but their liege's liege does, while their liege doesn't have a royal court - top_liege != this - has_royal_court = no - exists = liege.liege - liege = { - top_liege != this - has_royal_court = no - } - liege.liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - scope:recipient = { # The recipient doesn't have a royal court, but their liege's liege's liege does, while their liege doesn't have a royal court - top_liege != this - has_royal_court = no - exists = liege.liege - exists = liege.liege.liege - liege = { - top_liege != this - has_royal_court = no - } - liege.liege = { - top_liege != this - has_royal_court = no - } - liege.liege.liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - scope:recipient = { # The recipient doesn't have a royal court, but their liege's liege's liege's liege does, while their liege doesn't have a royal court - top_liege != this - has_royal_court = no - exists = liege.liege - exists = liege.liege.liege - exists = liege.liege.liege.liege - liege = { - top_liege != this - has_royal_court = no - } - liege.liege = { - top_liege != this - has_royal_court = no - } - liege.liege.liege = { - top_liege != this - has_royal_court = no - } - liege.liege.liege.liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - } - } - } - - modifier = { # Shared Court Language (spoken) - add = 30 - desc = foreign_realm_court_language_spoken_interaction_reason - trigger = { - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - knows_court_language_of = this - } - scope:actor.top_liege != scope:recipient.top_liege - OR = { - AND = { - scope:recipient = { - has_royal_court = yes - } - scope:actor = { # You share Court Language - has_same_court_language = scope:recipient - } - } - - scope:recipient = { # The recipient doesn't have a royal court, but their liege does - top_liege != this - has_royal_court = no - liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - scope:recipient = { # The recipient doesn't have a royal court, but their liege's liege does, while their liege doesn't have a royal court - top_liege != this - has_royal_court = no - exists = liege.liege - liege = { - top_liege != this - has_royal_court = no - } - liege.liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - scope:recipient = { # The recipient doesn't have a royal court, but their liege's liege's liege does, while their liege doesn't have a royal court - top_liege != this - has_royal_court = no - exists = liege.liege - exists = liege.liege.liege - liege = { - top_liege != this - has_royal_court = no - } - liege.liege = { - top_liege != this - has_royal_court = no - } - liege.liege.liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - scope:recipient = { # The recipient doesn't have a royal court, but their liege's liege's liege's liege does, while their liege doesn't have a royal court - top_liege != this - has_royal_court = no - exists = liege.liege - exists = liege.liege.liege - exists = liege.liege.liege.liege - liege = { - top_liege != this - has_royal_court = no - } - liege.liege = { - top_liege != this - has_royal_court = no - } - liege.liege.liege = { - top_liege != this - has_royal_court = no - } - liege.liege.liege.liege = { - has_royal_court = yes - has_same_court_language = scope:actor - } - } - } - } - } - - modifier = { # Serious diarchs wish to support their liege - add = 50 - desc = ENTRENCHED_REGENT_WILL_SUPPORT_LIEGE - trigger_if = { - limit = { scope:recipient ?= scope:actor.diarch } - scope:actor = { has_diarchy_parameter = diarchy_type_is_entrenched_regency } - } - trigger_else = { always = no } - } - - compare_modifier = { # Likes fighting infidels - trigger = { - scope:recipient.faith = scope:actor.faith - OR = { - AND = { - scope:target.casus_belli.primary_attacker = { - this = scope:actor - faith = { - faith_hostility_level = { - target = scope:target.casus_belli.primary_defender.faith - value >= religious_cb_enabled_hostility_level - } - } - } - } - AND = { - scope:target.casus_belli.primary_defender = { - this = scope:actor - faith = { - faith_hostility_level = { - target = scope:target.casus_belli.primary_defender.faith - value >= religious_cb_enabled_hostility_level - } - } - } - } - } - } - target = scope:recipient - value = ai_zeal - desc = "ZEAL_AGAINST_INFIDELS" - min = 0 - multiplier = 0.5 - } - - modifier = { # Reluctant to attack another ally - add = -50 - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_defender - } - desc = ATTACK_ON_ALLY_REASON - } - - modifier = { # Reluctant to defend against another ally - add = -25 - scope:target.casus_belli.primary_defender = scope:actor - scope:recipient = { - is_allied_to = scope:target.casus_belli.primary_attacker - } - desc = WAR_WITH_ALLY_REASON - } - - modifier = { # Reluctant to join wars against religious brethren. - add = -50 - scope:recipient.faith != scope:actor.faith - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender.faith = scope:recipient.faith - scope:target.casus_belli.war = { - OR = { - using_cb = minor_religious_war - using_cb = religious_war - using_cb = major_religious_war - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - desc = WONT_ATTACK_RELIGIOUS_BRETHREN_REASON - } - - modifier = { # Reluctant to join against Friends - add = -50 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_friend = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_friend = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_FRIEND_REASON - } - - modifier = { # Reluctant to join against Best Friends - add = -100 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_best_friend = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_best_friend = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_BEST_FRIEND_REASON - } - modifier = { # Reluctant to join against Lovers - add = -100 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_lover = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_lover = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_LOVER_REASON - } - modifier = { # Reluctant to join against Soulmate - add = -200 - trigger_if = { - limit = { - scope:target.casus_belli.primary_defender = scope:actor - } - has_relation_soulmate = scope:target.casus_belli.primary_attacker - } - trigger_else = { - has_relation_soulmate = scope:target.casus_belli.primary_defender - } - desc = WONT_FIGHT_SOULMATE_REASON - } - modifier = { # Reluctant to join tributaries - add = -200 - scope:actor = { - is_tributary_of = scope:recipient - NOT = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - } - scope:recipient = { - NOR = { - has_relation_lover = scope:actor - has_relation_friend = scope:actor - is_allied_to = scope:actor - } - } - desc = WONT_FIGHT_MEANINGLESS_REASON - } - modifier = { # Refuse call for hostages' safety - any_home_court_hostage = { - warden = { - OR = { - is_at_war_with = scope:actor - any_ally = { is_at_war_with = scope:actor } - } - } - } - add = { - value = 0 - every_home_court_hostage = { - limit = { - warden = { - OR = { - is_at_war_with = scope:actor - any_ally = { is_at_war_with = scope:actor } - } - } - } - subtract = call_to_arms_hostage_value - } - multiply = 0.25 - } - desc = HOSTAGE_ENEMY_CALL_TO_ARMS_REASON - } - - modifier = { - scope:recipient.house.house_confederation ?= { - trigger_if = { - limit = { scope:actor = { is_defender_in_war = scope:target } } - this = scope:target.casus_belli.primary_attacker.house.house_confederation - } - trigger_else = { this = scope:target.casus_belli.primary_defender.house.house_confederation } - } - add = -100 - desc = BLOC_MEMBER_CALL_TO_ARMS_REASON - } - - modifier = { - add = 200 - scope:actor = { - is_tributary_of = scope:recipient - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - } - desc = MANDALA_GUARANTEE_REASON - } - - fp3_struggle_resist_allied_wars_modifier = yes - } - - # Score above 0 means the AI will call this ally. Note that DESIRED_WAR_SIDE_STRENGTH still applies and can prevent calling the ally - ai_will_do = { - base = 100 - - modifier = { # If the player is at war, do not bother them with offensive calls - scope:target.casus_belli.primary_attacker = scope:actor - scope:recipient = { - is_ai = no - any_character_war = { - primary_defender = scope:recipient - } - } - factor = 0 - } - - modifier = { # Do not call the player if they are in debt - scope:recipient = { - is_ai = no - gold <= -1 - } - factor = 0 - } - - modifier = { # Don't call players in against their heirs (they wouldn't accept the reverse situation... don't be a hypocrite) - exists = scope:recipient.player_heir - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - scope:target.casus_belli.primary_attacker = scope:recipient.player_heir - } - trigger_else = { - scope:target.casus_belli.primary_defender = scope:recipient.player_heir - } - factor = 0 - } - - modifier = { # Same with spouses - scope:recipient = { - is_ai = no - } - trigger_if = { - limit = { scope:target.casus_belli.primary_defender = scope:actor } - any_spouse = { - this = scope:target.casus_belli.primary_attacker - } - } - trigger_else = { - any_spouse = { - this = scope:target.casus_belli.primary_defender - } - } - factor = 0 - } - - modifier = { # Don't call brand-new allies into old wars, at least until some time has elapsed. - has_variable = delay_calling_recent_ally - var:delay_calling_recent_ally = scope:recipient - scope:target = { - war_days >= 30 - } - factor = 0 - - } - - modifier = { # If the recipient is allied to both the attacker and the defender, the attacker shouldn't call - scope:target.casus_belli.primary_attacker = scope:actor - scope:target.casus_belli.primary_defender = { - is_allied_to = scope:recipient - } - factor = 0 - } - - #You're a Mandala Suzerain; you don't get off the hook that easily - modifier = { - scope:actor = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - scope:recipient = scope:actor.suzerain - add = 500 - } - } -} - -negotiate_alliance_interaction = { - category = interaction_category_diplomacy - ai_min_reply_days = 4 - ai_max_reply_days = 9 - icon = alliance - - send_name = negotiate_alliance_interaction - - interface_priority = 60 - desc = negotiate_alliance_interaction_desc - - greeting = positive - notification_text = NEGOTIATE_ALLIANCE_NOTIFICATION - - is_shown = { - scope:recipient = { - this != scope:actor - NOT = { is_allied_to = scope:actor } - is_ruler = yes - } - scope:actor = { - is_ruler = yes - OR = { - is_ai = no - highest_held_title_tier >= 2 - } - #childhood friendship with hostage event, where they swear to be friends forever - OR = { - is_any_family_relation_or_spouse_trigger = { CHARACTER = scope:recipient } - hostage_oath_of_friendship_trigger = yes - #Parents/spouse were blood brothers - has_opinion_modifier = { - modifier = blood_brother_close_family_opinion - target = scope:recipient - } - house ?= { - house_head = scope:actor - any_house_relation = { - any_relation_house = { - exists = house_head - scope:recipient = house_head - } - has_house_relation_parameter = unlocks_house_head_negotiate_alliance - } - } - } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - is_playable_character = yes - is_imprisoned = no - } - scope:actor = { - is_playable_character = yes - is_imprisoned = no - NOT = { - is_at_war_with = scope:recipient - } - } - custom_description = { - text = "has_already_rejected_renegotiation" - subject = scope:recipient - NOT = { - scope:actor = { - has_opinion_modifier = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - } - } - - scope:actor = { highest_held_title_tier < tier_hegemony } - scope:recipient = { highest_held_title_tier < tier_hegemony } - OR = { - #Ruler has the defensive negotiations perk - scope:actor = { has_perk = defensive_negotiations_perk } - #Ruler is married to other ruler. - scope:actor = { is_spouse_of = scope:recipient } - #Ruler is relative of other ruler - scope:actor = { is_parent_of = scope:recipient } - scope:actor = { is_grandparent_of = scope:recipient } - scope:actor = { is_great_grandparent_of = scope:recipient } - scope:actor = { is_child_of = scope:recipient } - scope:actor = { is_grandchild_of = scope:recipient } - scope:actor = { is_great_grandchild_of = scope:recipient } - scope:actor = { is_uncle_or_aunt_of = scope:recipient } - scope:actor = { is_nibling_of = scope:recipient } - scope:actor = { is_sibling_of = scope:recipient } - #Parents/spouse were blood brothers - scope:actor = { - has_opinion_modifier = { - modifier = blood_brother_close_family_opinion - target = scope:recipient - } - } - - custom_description = { - text = rulers_family_is_married_to_other_ruler_trigger - subject = scope:recipient - object = scope:actor - #Ruler's child/parent/sibling/grandchild/grandparent/uncle/aunt/niece/nephew is married to other ruler. - scope:recipient = { - any_spouse = { - OR = { - is_close_family_of = scope:actor - is_nibling_of = scope:actor - is_uncle_or_aunt_of = scope:actor - } - } - } - } - - custom_description = { - text = rulers_family_is_married_to_other_ruler_trigger - subject = scope:actor - object = scope:recipient - #Other ruler's child/parent/sibling/grandchild/grandparent/uncle/aunt/niece/nephew is married to first ruler. - scope:actor = { - any_spouse = { - OR = { - is_close_family_of = scope:recipient - is_nibling_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - } - } - } - } - - custom_description = { - text = rulers_child_parent_sibling_is_married_to_other_rulers_trigger - subject = scope:recipient - object = scope:actor - # Ruler's child/parent/sibling is married to other ruler's child/parent/sibling. - scope:actor = { - any_close_family_member = { - OR = { - is_parent_of = scope:actor - is_child_of = scope:actor - is_sibling_of = scope:actor - } - any_spouse = { - OR = { - is_parent_of = scope:recipient - is_child_of = scope:recipient - is_sibling_of = scope:recipient - } - } - } - } - } - - custom_description = { - text = hostage_oath_of_friendship_trigger - subject = scope:recipient - object = scope:actor - #childhood friendship with hostage event, where they swear to be friends forever - scope:actor = { - hostage_oath_of_friendship_trigger = yes - } - } - - custom_tooltip = { - text = house_relation_alliance_trigger - scope:actor.house ?= { - house_head ?= scope:actor - any_house_relation = { - any_relation_house = { - exists = house_head - scope:recipient = house_head - } - has_house_relation_parameter = unlocks_house_head_negotiate_alliance - } - } - } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0234 - } - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - # Admin Gov can spend Influence to increase AI acceptance towards other same-realm admin characters - send_option = { - is_shown = { - scope:actor = { - government_allows = administrative - } - scope:recipient = { - top_liege = scope:actor.top_liege - government_allows = administrative - } - } - is_valid = { - scope:actor = { - influence >= major_influence_value - } - custom_tooltip = { - text = ALREADY_USING_HOOK - NOT = { scope:hook = yes } - } - } - flag = influence - localization = SPEND_INFLUENCE - } - - send_options_exclusive = no - - on_accept = { - scope:actor = { - trigger_event = char_interaction.0235 - - stress_impact = { - shy = minor_stress_impact_gain - } - - if = { - limit = { - scope:hook = yes - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - if = { - limit = { - scope:influence = yes - } - change_influence = major_influence_loss - } - } - - scope:recipient = { - custom_tooltip = negotiate_alliance_effect_recipient_tooltip - } - - #Set up alliance, depending on relation between rulers. - hidden_effect = { - #Prioritize marriage between rulers and/or direct blood relation between rulers first. - if = { - limit = { - scope:actor = { - OR = { - is_spouse_of = scope:recipient - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - is_grandparent_of = scope:recipient - is_great_grandparent_of = scope:recipient - is_grandchild_of = scope:recipient - is_great_grandchild_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - is_nibling_of = scope:recipient - } - } - } - scope:actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor - allied_through_target = scope:recipient - } - } - } - #...Then marriage between close family members and either actor or recipient. - else_if = { - limit = { - scope:recipient = { - any_spouse = { - OR = { - is_close_family_of = scope:actor - is_nibling_of = scope:actor - is_uncle_or_aunt_of = scope:actor - } - } - } - } - scope:recipient = { - random_spouse = { - limit = { - OR = { - is_close_family_of = scope:actor - is_nibling_of = scope:actor - is_uncle_or_aunt_of = scope:actor - } - } - save_scope_as = recipient_spouse - } - } - scope:actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:recipient_spouse - allied_through_target = scope:recipient - } - } - } - else_if = { - limit = { - scope:actor = { - any_spouse = { - OR = { - is_close_family_of = scope:recipient - is_nibling_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - } - } - } - } - scope:actor = { - random_spouse = { - limit = { - OR = { - is_close_family_of = scope:recipient - is_nibling_of = scope:recipient - is_uncle_or_aunt_of = scope:recipient - } - } - save_scope_as = actor_spouse - } - } - scope:actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor - allied_through_target = scope:actor_spouse - } - } - } - #...And finally marriage between close relatives and close relatives. - else_if = { - limit = { - scope:actor = { - any_close_family_member = { - OR = { - is_child_of = scope:actor - is_parent_of = scope:actor - is_sibling_of = scope:actor - } - any_spouse = { - OR = { - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - } - } - } - } - } - scope:actor = { - random_close_family_member = { - limit = { - OR = { - is_child_of = scope:actor - is_parent_of = scope:actor - is_sibling_of = scope:actor - } - any_spouse = { - OR = { - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - } - } - } - save_scope_as = actor_spouse - random_spouse = { - limit = { - OR = { - is_child_of = scope:recipient - is_parent_of = scope:recipient - is_sibling_of = scope:recipient - } - } - save_scope_as = recipient_spouse - } - } - } - scope:actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor_spouse - allied_through_target = scope:recipient_spouse - } - } - } - else_if = { - limit = { - scope:actor = { has_perk = defensive_negotiations_perk } - } - scope:actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor - allied_through_target = scope:recipient - } - } - scope:recipient = { # This opinion modifier controls the interaction, and is removed when breaking the alliance in any way (though on_actions) - add_opinion = { - modifier = perk_negotiated_alliance_opinion - target = scope:actor - } - } - } - else_if = { - limit = { - scope:actor = { - hostage_oath_of_friendship_trigger = yes - } - } - scope:actor = { - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor - allied_through_target = scope:recipient - } - } - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_alliance.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0236 - } - scope:actor = { - add_opinion = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_alliance_refusal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - ai_accept = { - base = 0 - - # Tier Difference (+/-) - # Inheritance (+) - # Opinion (+/-) - # Dynasty Prestige. (+) - # Different Faith. (-) - # Liege is asking (+) - # Dread (+) - # Power difference (+/-) - # Claimants (+/-) - # Same House (+) - # Declared war opinion - # Actor is at war penalty - - modifier = { - add = 20 - scope:recipient = { - is_close_family_of = scope:actor - } - desc = CLOSE_FAMILY_REASON - } - - modifier = { - add = 10 - scope:recipient = { - NOT = { is_close_family_of = scope:actor } - is_extended_family_of = scope:actor - } - desc = EXTENDED_FAMILY_REASON - } - - modifier = { - add = -20 - scope:recipient = { - NOT = { is_close_or_extended_family_of = scope:actor } - any_spouse = { - NOT = { is_close_family_of = scope:actor } - is_extended_family_of = scope:actor - } - } - desc = DISTANT_FAMILY_CONNECTION_REASON - } - - # Tier Differences - modifier = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 1 - } - } - add = { - value = 30 - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 2 - } - } - add = 30 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 3 - } - } - add = 60 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 4 - } - } - add = 90 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 5 - } - } - add = 120 - } - } - desc = RANK_DIFFERENCE_REASON - } - modifier = { - scope:actor = { - tier_difference = { - target = scope:recipient - value <= -1 - } - } - add = { - value = -30 - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -2 - } - } - add = -30 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -3 - } - } - add = -60 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -4 - } - } - add = -90 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -5 - } - } - add = -120 - } - } - desc = RANK_DIFFERENCE_REASON - } - modifier = { - scope:recipient = { - has_relation_lover = scope:actor - } - add = { - value = 25 - } - desc = WE_ARE_LOVERS - } - modifier = { - scope:recipient = { - has_relation_friend = scope:actor - } - add = { - value = 25 - } - desc = WE_ARE_FRIENDS - } - modifier = { - scope:recipient = { - is_heir_of = scope:actor - } - scope:actor = { - tier_difference = { - target = scope:recipient - value > 0 - } - } - add = { - value = 10 - if = { - limit = { - scope:actor = { player_heir = scope:recipient } - } - add = 10 - } - } - desc = IS_HEIR_REASON - } - opinion_modifier = { # More likely to accept if Recipient likes the Actor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.25 - min = 0 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Less likely to accept if Recipient dislikes the Actor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - max = 0 - desc = AI_OPINION_REASON - } - - modifier = { - add = 20 - scope:recipient = { - has_trait = loyal - } - desc = INTERACTION_LOYAL - } - - modifier = { - add = 20 - scope:recipient = { - has_trait = trusting - } - desc = INTERACTION_TRUSTING - } - - modifier = { - add = 5 - scope:recipient = { - has_trait = craven - } - desc = INTERACTION_CRAVEN - } - - modifier = { - add = -20 - scope:recipient = { - has_trait = paranoid - } - desc = INTERACTION_PARANOID - } - - modifier = { - add = -20 - scope:recipient = { - has_trait = arrogant - } - desc = INTERACTION_ARROGANT - } - - modifier = { - add = -20 - scope:recipient = { - has_trait = ambitious - } - desc = INTERACTION_AMBITIOUS - } - - modifier = { - add = -40 - scope:recipient = { - has_trait = disloyal - } - desc = INTERACTION_DISLOYAL - } - - modifier = { - add = -10 - scope:recipient = { - has_trait = fickle - } - desc = INTERACTION_FICKLE - } - - # Rivalry - modifier = { # Say no to rivals - add = -100 - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - desc = "ACTOR_RIVAL_TO_ME_REASON" - } - modifier = { # Say no to nemesis - add = -300 - scope:recipient = { - has_relation_nemesis = scope:actor - } - desc = "ACTOR_NEMESIS_TO_ME_REASON" - } - - # Dynasty Prestige Levels - modifier = { - add = -5 - desc = AI_DYNASTY_PRESTIGE_REASON - scope:actor = { has_dynasty = yes } - scope:actor.dynasty != scope:recipient.dynasty - scope:actor.dynasty = { dynasty_prestige_level = 0 } - } - modifier = { - desc = AI_DYNASTY_PRESTIGE_REASON - scope:actor = { has_dynasty = yes } - scope:actor.dynasty != scope:recipient.dynasty - scope:actor.dynasty = { dynasty_prestige_level >= 2 } - add = { - value = 10 - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 3 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 4 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 5 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 6 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 7 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 8 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 9 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 10 } - } - add = 5 - } - } - } - modifier = { #Faith compatibility - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value > faith_fully_accepted_level - } - } - NOT = { - scope:recipient.ai_zeal <= -50 - } - add = { - value = -10 - if = { - limit = { - # Exempt certain struggle phases. - NOT = { is_struggle_parameter_active_interfaith_marriages_available_between_involved_characters_trigger = yes } - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_astray_level - } - } - } - subtract = 20 - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_hostile_level - } - } - } - subtract = 20 - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_evil_level - } - } - } - subtract = 50 - } - if = { - limit = { - scope:recipient.ai_zeal <= -25 - } - divide = 2 - } - else_if = { - limit = { - scope:recipient.ai_zeal >= 50 - } - multiply = 2 - } - if = { - limit = { - scope:recipient.faith = { has_doctrine = doctrine_pluralism_pluralistic } - } - divide = 2 - } - } - } - desc = MARRY_DIFFERENT_FAITH_REASON - } - - modifier = { # A Recipient is more likely to agree to an alliance requested by his liege. - add = 20 - scope:recipient = { - target_is_liege_or_above = scope:actor - } - desc = LIEGE_REASON - } - - modifier = { - add = { - value = 1 - subtract = { - value = scope:recipient.max_military_strength # For foreign diplomacy, consider recipients max - divide = { value = scope:actor.current_military_strength min = 1 } - } - multiply = 20 - min = -1000 - max = 100 - } - desc = AI_MILITARY_BALANCE_REASON - } - # Recipient is a Claimant to Actor's titles. - modifier = { - scope:recipient = { - any_claim = { - holder = scope:actor - } - NOR = { - is_heir_of = scope:actor - ai_greed <= -25 - } - } - add = { - value = -50 - if = { - limit = { - scope:recipient.ai_greed >= 25 - } - add = ai_greed - } - if = { - limit = { - scope:recipient.house != scope:actor.house - } - multiply = 2 - } - } - desc = IS_CLAIMANT_TO_ACTORS_TITLES - } - #Actor has claims on recipient's titles. - modifier = { - scope:actor = { - any_claim = { - holder = scope:recipient - } - } - add = 25 - desc = IS_CLAIMANT_TO_RECIPIENT_TITLES - } - modifier = { - scope:recipient = { - NOT = { - any_claim = { - holder = scope:actor - } - } - } - scope:recipient.house = scope:actor.house - add = 15 - desc = IS_SAME_HOUSE_REASON - } - modifier = { - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = declared_war - } - } - add = -100 - desc = DECLARED_WAR_REASON - } - - # Don't form new alliances with people already at war. - modifier = { - scope:actor = { - is_at_war = yes - - # Since vassals and lieges can't call us into wars, this doesn't matter for us if we have that relationship. - NOR = { - target_is_liege_or_above = scope:recipient - target_is_vassal_or_below = scope:recipient - } - } - add = -50 - desc = IS_AT_WAR_REASON - } - - #Bonus from Tradition Astute Diplomats - modifier = { - scope:actor.culture = { has_cultural_parameter = facilitate_alliance_acceptance } - add = 50 #should be in a file 00_traditions_values - desc = TRADITION_ASTUTE_DIPLOMATS_ACCEPTANCE_MODIFIER - } - - # The AI doesn't want to form alliances with AI vassals within its capital duchy, so it can revoke them - modifier = { - scope:actor = { - is_ai = yes - is_vassal_or_below_of = scope:recipient - any_held_title = { - title_tier = county - de_jure_liege = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - scope:recipient = { - is_ai = yes - } - add = -5000 - } - - # Feud - modifier = { - add = -25 - scope:recipient = { - house_has_feud_relation_with_trigger = { TARGET = scope:actor } - } - desc = MARRY_FAMILY_FEUD_REASON - } - - # Existing Alliances - modifier = { - add = { - scope:actor = { - every_ally = { - add = -15 - } - } - } - scope:actor = { - any_ally = { - count >= 2 - } - } - NOT = { - scope:recipient = { - government_has_flag = government_is_clan - is_vassal_or_below_of = scope:actor - } - } - desc = EXISTING_ALLIANCES_REASON - } - - # Existing Alliances - modifier = { - add = { - scope:recipient = { - every_ally = { - add = -15 - } - } - } - scope:recipient = { - any_ally = { - count >= 2 - } - } - NOT = { - scope:recipient = { - government_has_flag = government_is_clan - is_vassal_or_below_of = scope:actor - } - } - desc = THEIR_EXISTING_ALLIANCES_REASON - } - - modifier = { - add = intimidated_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { - add = intimidated_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - fp3_struggle_resist_allied_wars_modifier = yes - - # LOW LEGITIMACY - modifier = { - desc = "LOW_LEGITIMACY_REASON" - scope:actor = { - OR = { - has_legitimacy_flag = reduced_alliance_acceptance - has_legitimacy_flag = very_reduced_alliance_acceptance - has_legitimacy_flag = massively_reduced_alliance_acceptance - } - } - add = { - value = 0 - if = { - limit = { scope:actor = { has_legitimacy_flag = reduced_alliance_acceptance } } - add = -25 - } - if = { - limit = { scope:actor = { has_legitimacy_flag = very_reduced_alliance_acceptance } } - add = -50 - } - if = { - limit = { scope:actor = { has_legitimacy_flag = massively_reduced_alliance_acceptance } } - add = -100 - } - } - } - - # HIGH LEGITIMACY - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - scope:actor = { - OR = { - has_legitimacy_flag = increased_alliance_acceptance - has_legitimacy_flag = very_increased_alliance_acceptance - has_legitimacy_flag = extra_increased_alliance_acceptance - } - } - add = { - value = 0 - if = { - limit = { scope:actor = { has_legitimacy_flag = increased_alliance_acceptance } } - add = 10 - } - if = { - limit = { scope:actor = { has_legitimacy_flag = very_increased_alliance_acceptance } } - add = 25 - } - if = { - limit = { scope:actor = { has_legitimacy_flag = extra_increased_alliance_acceptance } } - add = 50 - } - } - } - - # INFLUENCE - modifier = { - desc = INFLUENCE_REASON - scope:influence = yes - add = { - value = 10 - multiply = scope:actor.influence_level - min = 5 - } - } - - # TGP ALLIANCE WITH NF HOUSE HEAD - modifier = { - add = 750 - scope:actor = { - is_house_head = yes - scope:recipient.house ?= this.house - any_held_title = { is_noble_family_title = yes } - } - desc = JAPANESE_HOUSE_HEAD_ALLIANCE_REASON - } - } - - ai_potential = { - is_at_war = no - } - - ai_targets = { - ai_recipients = dynasty - max = 20 - } - - ai_targets = { - ai_recipients = family - max = 10 - } - - ai_targets = { - ai_recipients = spouses - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - any_ally = { - count < 2 - } - scope:recipient = { # Don't propose alliances to tiny insignificant rulers just because - OR = { - current_military_strength >= scope:actor.eighty_percent_of_current_military_strength - primary_title.tier >= scope:actor.primary_title.tier - AND = { - primary_title.tier >= tier_duchy - scope:actor.primary_title.tier < tier_empire - } - } - } - } - - modifier = { # Clans always want alliances with Vassals - add = 100 - scope:actor = { - government_has_flag = government_is_clan - } - scope:recipient = { - is_vassal_of = scope:actor - } - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # The AI shouldn't propose to their Lieges - factor = 0 - is_liege_or_above_of = scope:recipient - } - - modifier = { # The AI shouldn't propose to their Vassals unless Clan - factor = 0 - scope:actor = { - NOT = { government_has_flag = government_is_clan } - } - scope:recipient = { - is_vassal_of = scope:actor - } - } - } -} - -perk_alliance_interaction = { - category = interaction_category_diplomacy - ai_min_reply_days = 4 - ai_max_reply_days = 9 - icon = alliance - - - interface_priority = 60 - desc = perk_alliance_interaction_desc - - greeting = positive - notification_text = PERK_NEGOTIATE_ALLIANCE_NOTIFICATION - - is_shown = { - scope:recipient = { - NOR = { - this = scope:actor - is_allied_to = scope:actor - target_is_vassal_or_below = scope:actor # Can only sign with external rulers/peer vassals, though the alliance is preserved if they somehow become your vassals - target_is_liege_or_above = scope:actor - government_has_flag = government_is_true_herder - } - is_ruler = yes - primary_title.tier > tier_barony - } - scope:actor = { - has_perk = defensive_negotiations_perk - is_landless_adventurer = no - NOR = { - government_has_flag = government_is_true_herder - # This interaction is harder to push through than Negotiate Alliance, and does the same thing, so don't show both - is_character_interaction_shown = { - recipient = scope:recipient - interaction = negotiate_alliance_interaction - } - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - is_landless_adventurer = no - } - scope:recipient = { - NOT = { target_is_vassal_or_below = scope:actor } # Can only sign with external rulers/peer vassals, though the alliance is preserved if they somehow become your vassals - NOT = { target_is_liege_or_above = scope:actor } - } - - custom_description = { - text = "already_has_an_alliance_deal" - subject = scope:recipient - scope:actor = { - NOT = { - any_ally = { - has_opinion_modifier = { - modifier = perk_negotiated_alliance_opinion - target = scope:actor - } - } - } - } - } - - scope:recipient = { - is_playable_character = yes - is_at_war = no - is_imprisoned = no - } - - scope:actor = { - is_playable_character = yes - is_at_war = no - is_imprisoned = no - } - - custom_description = { - text = "has_already_rejected_renegotiation" - subject = scope:recipient - scope:actor = { - NOT = { - has_opinion_modifier = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - } - } - } - - can_send = { - custom_description = { # Exploit prevention - text = "has_sent_interaction_already" - subject = scope:recipient - scope:actor = { - NOT = { - has_pending_interaction_of_type = perk_alliance_interaction - } - } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0234 - } - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - # Admin Gov can spend Influence to increase AI acceptance towards other same-realm admin characters - send_option = { - is_shown = { - scope:actor = { - government_allows = administrative - } - scope:recipient = { - top_liege = scope:actor.top_liege - government_allows = administrative - } - } - is_valid = { - scope:actor = { - influence >= major_influence_value - } - custom_tooltip = { - text = ALREADY_USING_HOOK - NOT = { scope:hook = yes } - } - } - flag = influence - localization = SPEND_INFLUENCE - } - - send_options_exclusive = no - - on_accept = { - save_scope_value_as = { #So that we can show the opinion gain in the response event - name = perk_alliance_interaction - value = yes - } - scope:actor = { - custom_tooltip = negotiate_alliance_effect_tooltip - trigger_event = char_interaction.0235 - create_alliance = { - target = scope:recipient - allied_through_owner = scope:actor - allied_through_target = scope:recipient - } - - stress_impact = { - shy = minor_stress_impact_gain - } - - if = { - limit = { scope:hook = yes } - use_hook = scope:recipient - } - - if = { - limit = { - scope:influence = yes - } - change_influence = major_influence_loss - } - } - scope:recipient = { # This opinion modifier controls the interaction, and is removed when breaking the alliance in any way (though on_actions) - add_opinion = { - modifier = perk_negotiated_alliance_opinion - target = scope:actor - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_alliance.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0236 - } - scope:actor = { - add_opinion = { - modifier = refused_alliance_opinion - target = scope:recipient - } - } - - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_alliance_refusal.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - - ai_accept = { # Similar to Negotiate Alliance, but without modifiers for Liege, being an heir, etc. - base = -25 - - # Tier Differences - modifier = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 1 - } - } - add = { - value = 30 - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 2 - } - } - add = 30 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 3 - } - } - add = 60 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 4 - } - } - add = 90 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = 5 - } - } - add = 120 - } - } - desc = RANK_DIFFERENCE_REASON - } - modifier = { - scope:recipient = { - has_relation_lover = scope:actor - } - add = { - value = 25 - } - desc = WE_ARE_LOVERS - } - modifier = { - scope:recipient = { - has_relation_friend = scope:actor - } - add = { - value = 25 - } - desc = WE_ARE_FRIENDS - } - modifier = { - scope:actor = { - tier_difference = { - target = scope:recipient - value <= -1 - } - } - add = { - value = -30 - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -2 - } - } - add = -30 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -3 - } - } - add = -60 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -4 - } - } - add = -90 - } - if = { - limit = { - tier_difference = { - target = scope:recipient - value = -5 - } - } - add = -120 - } - } - desc = RANK_DIFFERENCE_REASON - } - opinion_modifier = { # More likely to accept if Recipient likes the Actor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.25 - min = 0 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Less likely to accept if Recipient dislikes the Actor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - max = 0 - desc = AI_OPINION_REASON - } - - modifier = { - add = 20 - scope:recipient = { - has_trait = loyal - } - desc = INTERACTION_LOYAL - } - - modifier = { - add = 20 - scope:recipient = { - has_trait = trusting - } - desc = INTERACTION_TRUSTING - } - - modifier = { - add = 5 - scope:recipient = { - has_trait = craven - } - desc = INTERACTION_CRAVEN - } - - modifier = { - add = -20 - scope:recipient = { - has_trait = paranoid - } - desc = INTERACTION_PARANOID - } - - modifier = { - add = -20 - scope:recipient = { - has_trait = arrogant - } - desc = INTERACTION_ARROGANT - } - - modifier = { - add = -20 - scope:recipient = { - has_trait = ambitious - } - desc = INTERACTION_AMBITIOUS - } - - modifier = { - add = -40 - scope:recipient = { - has_trait = disloyal - } - desc = INTERACTION_DISLOYAL - } - - modifier = { - add = -10 - scope:recipient = { - has_trait = fickle - } - desc = INTERACTION_FICKLE - } - - # Rivalry - modifier = { # Say no to rivals - add = -100 - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - desc = "ACTOR_RIVAL_TO_ME_REASON" - } - modifier = { # Say no to nemesis - add = -300 - scope:recipient = { - has_relation_nemesis = scope:actor - } - desc = "ACTOR_NEMESIS_TO_ME_REASON" - } - - # Dynasty Prestige Levels - modifier = { - add = -5 - desc = AI_DYNASTY_PRESTIGE_REASON - scope:actor = { has_dynasty = yes } - scope:actor.dynasty != scope:recipient.dynasty - scope:actor.dynasty = { dynasty_prestige_level = 0 } - } - modifier = { - desc = AI_DYNASTY_PRESTIGE_REASON - scope:actor = { has_dynasty = yes } - scope:actor.dynasty != scope:recipient.dynasty - scope:actor.dynasty = { dynasty_prestige_level >= 2 } - add = { - value = 10 - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 3 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 4 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 5 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 6 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 7 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 8 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 9 } - } - add = 5 - } - if = { - limit = { - scope:actor.dynasty = { dynasty_prestige_level >= 10 } - } - add = 5 - } - } - } - modifier = { #Faith compatibility - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value > faith_fully_accepted_level - } - } - NOT = { - scope:recipient.ai_zeal <= -50 - } - add = { - value = -10 - if = { - limit = { - # Exempt certain struggle phases. - NOT = { is_struggle_parameter_active_interfaith_marriages_available_between_involved_characters_trigger = yes } - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_astray_level - } - } - } - subtract = 20 - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_hostile_level - } - } - } - subtract = 20 - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_evil_level - } - } - } - subtract = 50 - } - if = { - limit = { - scope:recipient.ai_zeal <= -25 - } - divide = 2 - } - else_if = { - limit = { - scope:recipient.ai_zeal >= 50 - } - multiply = 2 - } - if = { - limit = { - scope:recipient.faith = { has_doctrine = doctrine_pluralism_pluralistic } - } - divide = 2 - } - } - } - desc = MARRY_DIFFERENT_FAITH_REASON - } - - modifier = { # A Recipient is more likely to agree to an alliance requested by his liege. - add = 20 - scope:recipient = { - target_is_liege_or_above = scope:actor - } - desc = LIEGE_REASON - } - - modifier = { - add = { - value = 1 - subtract = { - value = scope:recipient.max_military_strength # For foreign diplomacy, consider recipients max - divide = { value = scope:actor.current_military_strength min = 1 } - } - multiply = 20 - min = -1000 - max = 100 - } - desc = AI_MILITARY_BALANCE_REASON - } - # Recipient is a Claimant to Actor's titles. - modifier = { - scope:recipient = { - any_claim = { - holder = scope:actor - } - NOR = { - is_heir_of = scope:actor - ai_greed <= -25 - } - } - add = { - value = -50 - if = { - limit = { - scope:recipient.ai_greed >= 25 - } - add = ai_greed - } - if = { - limit = { - scope:recipient.house != scope:actor.house - } - multiply = 2 - } - } - desc = IS_CLAIMANT_TO_ACTORS_TITLES - } - #Actor has claims on recipient's titles. - modifier = { - scope:actor = { - any_claim = { - holder = scope:recipient - } - } - add = 25 - desc = IS_CLAIMANT_TO_RECIPIENT_TITLES - } - modifier = { - scope:recipient = { - NOT = { - any_claim = { - holder = scope:actor - } - } - } - scope:recipient.house = scope:actor.house - add = 15 - desc = IS_SAME_HOUSE_REASON - } - modifier = { - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = declared_war - } - } - add = -100 - desc = DECLARED_WAR_REASON - } - - # Don't form new alliances with people already at war. - modifier = { - scope:actor = { - is_at_war = yes - - # Since vassals and lieges can't call us into wars, this doesn't matter for us if we have that relationship. - NOR = { - target_is_liege_or_above = scope:recipient - target_is_vassal_or_below = scope:recipient - } - } - add = -50 - desc = IS_AT_WAR_REASON - } - - #Bonus from Tradition Astute Diplomats - modifier = { - scope:actor.culture = { has_cultural_parameter = facilitate_alliance_acceptance } - add = 50 #should be in a file 00_traditions_values - desc = TRADITION_ASTUTE_DIPLOMATS_ACCEPTANCE_MODIFIER - } - - # The AI doesn't want to form alliances with AI vassals within its capital duchy, so it can revoke them - modifier = { - scope:actor = { - is_ai = yes - is_vassal_or_below_of = scope:recipient - any_held_title = { - title_tier = county - de_jure_liege = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - scope:recipient = { - is_ai = yes - } - add = -5000 - } - - # Feud - modifier = { - add = -25 - scope:recipient = { - house_has_feud_relation_with_trigger = { TARGET = scope:actor } - } - desc = MARRY_FAMILY_FEUD_REASON - } - - # Existing Alliances - modifier = { - add = { - scope:actor = { - every_ally = { - add = -15 - } - } - } - scope:actor = { - any_ally = { - count >= 2 - } - } - desc = EXISTING_ALLIANCES_REASON - } - - # Existing Alliances - modifier = { - add = { - scope:recipient = { - every_ally = { - add = -15 - } - } - } - scope:recipient = { - any_ally = { - count >= 2 - } - } - desc = THEIR_EXISTING_ALLIANCES_REASON - } - - modifier = { - add = intimidated_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { - add = intimidated_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 10 - } - - # INFLUENCE - modifier = { - desc = INFLUENCE_REASON - scope:influence = yes - add = { - value = 10 - multiply = scope:actor.influence_level - min = 5 - } - } - } - - ai_potential = { - is_at_war = no - any_ally = { - count < 2 - } - } - - ai_targets = { - ai_recipients = neighboring_rulers - max = 10 - } - - ai_targets = { - ai_recipients = peer_vassals - max = 5 - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 72 - empire = 72 - hegemony = 72 - } - - ai_will_do = { - base = 100 - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # Don't disturb the player with pointless asks - add = -5000 - scope:recipient = { - is_ai = no - } - NOR = { - scope:actor.current_military_strength >= scope:recipient.current_military_strength - scope:actor.primary_title.tier >= scope:recipient.primary_title.tier - } - } - - modifier = { - add = -5000 - scope:recipient.current_military_strength <= 100 - } - } - -} - -join_war_interaction = { - category = interaction_category_diplomacy - interface = interfere_in_war - special_interaction = interfere_in_war_interaction - popup_on_receive = yes - desc = join_war_interaction_desc - icon = alliance - interface_priority = 29 - - greeting = positive - notification_text = join_war_interaction_notification - - is_shown = { - scope:recipient = { - is_at_war = yes - NOR = { - this = scope:actor - is_at_war_with = scope:actor - } - } - } - - is_valid_showing_failures_only = { - - # recipient is not in (any) war against your liege(s) or suzerain(s) - trigger_if = { - limit = { exists = scope:actor.liege } - custom_description = { - text = join_war_interaction_recipient_warring_with_my_liege - subject = scope:recipient - scope:actor = { - NOT = { - any_liege_or_above = { - is_at_war_with = scope:recipient - } - } - } - } - } - - # special exception for liege trying to put down his vassal's peasant revolt - trigger_if = { - limit = { - scope:actor = { - target_is_vassal_or_below = scope:recipient - } - } - custom_description = { - text = join_war_interaction_recipient_not_fighting_peasant_faction - subject = scope:recipient - scope:recipient = { - any_war_enemy = { - is_leading_faction_type = peasant_faction - } - } - } - } - # if the target is neither a vassal-or-below, nor a liege-or-above, the recipient must either be an ally or defending against a qualifying holy war - unless the character is an adventurer in which case other rules apply - trigger_else_if = { - limit = { - scope:actor = { - NOT = { target_is_liege_or_above = scope:recipient } - } - } - trigger_if = { - limit = { - scope:actor = { has_government = landless_adventurer_government } - } - # bypass the requirements, unless you were invloved in a war and decided to leave it - scope:recipient = { - trigger_if = { - limit = { - any_character_war = { - has_variable_list = left_voluntarily - } - } - custom_tooltip = { - text = laamp_war_change_sides_interaction.left_voluntarily - is_target_in_variable_list = { - name = left_voluntarily - target = scope:actor - } - } - } - } - } - trigger_else_if = { - limit = { - scope:recipient = { - any_character_war = { - OR = { - #Must be either the same faith as the character being holy warred... - scope:recipient.faith = scope:actor.faith - #... Or, same religion, *and* you couldn't holy war them yourself. - AND = { - scope:recipient.faith.religion = scope:actor.faith.religion - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value < religious_cb_enabled_hostility_level - } - } - } - #... Or, the target is your liege and they are being attacked for your held title. - AND = { - scope:recipient = { target_is_liege_or_above = scope:actor } - casus_belli = { - any_target_title = { - holder = { - OR = { - this = scope:actor - is_vassal_or_below_of = scope:actor - } - } - } - - } - } - } - any_war_defender = { this = scope:recipient } - } - } - } - # Deliberately blank; we've passed the trigger and making a desc out of this doesn't make sense - } - # Special case for Iberians helping each other after FP2 Conciliation ending after FP2 Conciliation ending - trigger_else_if = { - limit = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = yes - scope:recipient = { - any_character_war = { - primary_defender = scope:recipient - primary_attacker = { save_temporary_scope_as = attacker_temp } - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:attacker_temp } - } - } - } - # Deliberately blank; we've passed the trigger and making a desc out of this doesn't make sense - } - - # if the actor and recipient is in the same confederation, they can always come to each others' aid - trigger_else_if = { - limit = { - exists = scope:recipient.confederation - scope:actor = { is_member_of_confederation = scope:recipient.confederation } - } - scope:actor = { is_member_of_confederation = scope:recipient.confederation } # for localization only - } - - # suzerains can always join their tributaries' defensive wars - trigger_else_if = { - limit = { - scope:recipient = { - is_tributary_of_suzerain_or_above = scope:actor - } - } - custom_tooltip = { - text = join_war_interaction_recipient_tributary_no_defensive_war - scope:recipient = { - any_character_war = { - primary_defender = scope:recipient - } - } - } - } - # tributaries can always offer to join their direct suzerains' defensive wars - trigger_else_if = { - limit = { - scope:actor = { - is_tributary_of = scope:recipient - } - } - custom_tooltip = { - text = join_war_interaction_recipient_tributary_no_defensive_war - scope:recipient = { - any_character_war = { - primary_defender = scope:recipient - } - } - } - } - - # if we haven't already passed any of the qualified conditions above, then we need to be allies - trigger_else = { - custom_description = { - text = join_war_interaction_recipient_not_ally - subject = scope:recipient - scope:recipient = { - is_allied_to = scope:actor - } - } - } - } - - # recipient is liege - trigger_else = { - custom_description = { - text = join_war_interaction_recipient_not_liege - subject = scope:recipient - scope:actor = { - target_is_liege_or_above = scope:recipient - } - } - } - - scope:actor = { - trigger_if = { - limit = { - has_government = landless_adventurer_government - } - custom_tooltip = { - text = reinforce_soldiers_any_regiment_tt - maa_regiments_count >= 1 - } - } - } - - # 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 - } - } - } - } - - can_be_picked = { - scope:target ?= { - - # recipient is war leader - is_war_leader = scope:recipient - - # special exception for tributaries and suzerains to fight for one another - trigger_if = { - limit = { - OR = { - scope:actor = { - is_tributary_of_suzerain_or_above = scope:recipient - } - scope:recipient = { - is_tributary_of = scope:actor - } - } - } - # if this is directed at a tributary, make sure they're the primary defender - trigger_if = { - limit = { - scope:recipient = { is_tributary_of = scope:actor } - } - custom_tooltip = { - text = join_war_interaction_recipient_tributary_not_primary_defender - primary_defender = scope:recipient - } - } - trigger_else = { always = yes } - } - - #allow targets of a Grand Campaign to bypass the requirements - trigger_else_if = { - limit = { - var:grand_campaign_project ?= { - save_temporary_scope_as = great_project - any_in_list = { - variable = grand_campaign_titles - any_in_de_jure_hierarchy = { - exists = holder - holder.top_overlord = { - OR = { - this = scope:recipient - this = scope:actor - } - } - } - } - } - } - } - - #allow laamp_join_war_contract to bypass the requirements - trigger_else_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - } - - # if holy war, recipient is defender of same faith - # and not too far away - trigger_else_if = { - limit = { is_religious_war = yes } - trigger_if = { #Only if you're not allies - limit = { - NOT = { scope:actor = { is_allied_to = scope:recipient } } - NOR = { - scope:recipient = { target_is_liege_or_above = scope:actor } - casus_belli = { - any_target_title = { - holder ?= { - OR = { - this = scope:actor - is_vassal_or_below_of = scope:actor - } - } - } - } - } - # Special case for Iberians helping each other after FP2 Conciliation ending - AND = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = no - NOT = { - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:target.primary_attacker } - } - } - } - custom_description = { - text = join_war_interaction_recipient_not_def_GHW - subject = scope:recipient - scope:recipient.faith.religion = scope:actor.faith.religion - any_war_defender = { this = scope:recipient } - } - } - casus_belli = { - any_target_title = { save_temporary_scope_as = war_target } - } - custom_description = { - text = join_war_interaction_recipient_too_distant - subject = scope:war_target - object = scope:war_target - scope:actor = { - realm_to_title_distance_squared = { - target = scope:war_target - value <= squared_distance_almost_massive # Approximately 1.5 HREs in distance away. Any further and does it really make sense for you to join what is essentially a regional power struggle? - } - } - } - } - # If not holy war, special exception for liege trying to put down his vassal's peasant revolt. - trigger_else_if = { - limit = { - is_religious_war = no - scope:actor = { target_is_vassal_or_below = scope:recipient } - primary_defender = scope:recipient - primary_attacker = { - is_leading_faction_type = peasant_faction - } - # Special case for Iberians helping each other after FP2 Conciliation ending - AND = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = no - NOT = { - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:target.primary_attacker } - } - } - } - always = yes - } - #Confederation members can choose to join each others' offensive wars - trigger_else_if = { - limit = { - scope:actor = { NOT = { is_allied_to = scope:recipient } } - exists = scope:recipient.confederation - primary_attacker = scope:recipient - } - scope:actor = { - is_member_of_confederation = scope:recipient.confederation - } - } - # ...otherwise, recipient must be an ally... - trigger_else_if = { - limit = { - is_religious_war = no - scope:actor = { NOT = { target_is_liege_or_above = scope:recipient } } - # Special case for Iberians helping each other after FP2 Conciliation ending - AND = { - fp2_struggle_conciliation_recipient_actor_involved_trigger = no - NOT = { - fp2_struggle_conciliation_scope_uninvolved_trigger = { SCOPE = scope:target.primary_attacker } - } - } - } - custom_description = { - text = join_war_interaction_recipient_not_ally - subject = scope:recipient - scope:actor = { - is_allied_to = scope:recipient - } - } - trigger_if = { - limit = { - scope:actor = { - target_is_vassal_or_below = scope:recipient - NOT = { is_allied_to = scope:recipient } - } - } - # If they are an unallied vassal, inform the player that we could have aided them if this was a peasant revolt. - custom_description = { - text = join_war_interaction_recipient_not_fighting_peasant_faction - subject = scope:recipient - primary_defender = scope:recipient - primary_attacker = { - is_leading_faction_type = peasant_faction - } - } - } - } - - # ...or our liege. - trigger_else_if = { - limit = { - is_religious_war = no - scope:actor = { NOT = { is_allied_to = scope:recipient } } - } - # recipient is liege - custom_description = { - text = join_war_interaction_recipient_not_liege - subject = scope:recipient - scope:actor = { - target_is_liege_or_above = scope:recipient - } - } - } - # making the default behavior explicit if no other trigger_(else_)ifs are valid - trigger_else = { - always = yes - } - } - - joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { - WARRIOR = scope:recipient - JOINER = scope:actor - } - - can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:recipient JOINER = scope:actor } - } - - is_highlighted = { - scope:actor = { - any_character_task_contract = { - has_task_contract_type = laamp_join_war_contract - task_contract_employer = scope:recipient - } - } - } - - on_accept = { - scope:target ?= { - hidden_effect = { - set_called_to = scope:actor - } - if = { - limit = { is_attacker = scope:recipient } - add_attacker = scope:actor - if = { - limit = { - OR = { - scope:actor = { - any_home_court_hostage = { - warden ?= { is_defender_in_war = scope:target } - } - } - scope:target = { - any_war_defender = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - } - } - custom_tooltip = hostage_execution_warning_tt - } - } - else = { - add_defender = scope:actor - if = { - limit = { - OR = { - scope:actor = { - any_home_court_hostage = { - warden ?= { is_attacker_in_war = scope:target } - } - } - scope:target = { - any_war_attacker = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - } - } - custom_tooltip = hostage_execution_warning_tt - } - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:actor = { - add_piety = medium_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:actor = { - add_piety = major_piety_gain - } - } - } - scope:actor = { - stress_impact = { - craven = medium_stress_impact_gain - } - add_to_variable_list = { - name = joined_as_ally - target = scope:target - } - } - scope:recipient = { - show_as_tooltip = { - if = { - limit = { - is_ai = yes - } - progress_towards_friend_effect = { - CHARACTER = scope:actor - OPINION = 0 - REASON = friend_alliance - } - } - else = { - hidden_effect = { #To nudge friendship - if = { - limit = { - NOR = { - has_relation_friend = scope:actor - has_relation_potential_friend = scope:actor - } - } - set_relation_potential_friend = scope:actor - } - } - } - } - } - - # If we're a clan this interaction affects unity - but only when we attemp to aid a house member against a non-house member - if = { - limit = { - exists = scope:target - scope:target = { - OR = { - AND = { - primary_attacker = scope:recipient - scope:recipient.house = scope:actor.house - primary_defender = { - house != scope:actor.house - } - } - AND = { - primary_defender = scope:recipient - scope:recipient.house = scope:actor.house - primary_attacker = { - house != scope:actor.house - } - } - } - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_join_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0236 - } - } - - auto_accept = yes - - ai_accept = { - base = 100 # everyone wants help - } -} - -# Referenced in code, do not rename or remove -join_vassal_war_interaction = { - category = interaction_category_diplomacy - interface = interfere_in_war - special_interaction = interfere_in_war_interaction - popup_on_receive = yes - desc = join_vassal_war_interaction_desc - icon = alliance - interface_priority = 29 - common_interaction = yes - - greeting = positive - notification_text = join_war_interaction_notification - - is_shown = { - scope:recipient = { - OR = { - AND = { - is_tributary_of = scope:actor - subject_contract_has_flag = tributary_contract_suzerain_guarantee_override - scope:actor = { - has_realm_law = top_liege_not_redirected_to_border_wars_law - } - } - AND = { - is_vassal_or_below_of = scope:actor - any_liege_or_above = { - has_realm_law = top_liege_not_redirected_to_border_wars_law - } - } - } - is_at_war = yes - NOR = { - this = scope:actor - is_at_war_with = scope:actor - } - any_character_war = { - primary_attacker = { - NOT = { - is_vassal_or_below_of = scope:actor - } - } - } - } - } - is_valid_showing_failures_only = { - scope:actor = { is_at_war = no } - } - - can_be_picked = { - scope:target ?= { - # we don't care about infighting - custom_tooltip = { - text = war_aid_liege_not_my_liege_tt - primary_attacker.top_overlord != scope:actor - } - # only defensive wars - primary_defender = scope:recipient - # only wars that would take titles in your hierarchy - trigger_if = { - limit = { - scope:recipient = { is_vassal_of = scope:actor } - } - custom_tooltip = { - text = war_aid_liege_relevant_titles_tt - casus_belli = { - any_target_title = { - OR = { - target_is_de_facto_liege_or_above = scope:actor.primary_title - is_de_facto_liege_or_above_target = scope:actor.primary_title - } - } - } - } - } - #Unless you're a guaranteed tributary - trigger_else_if = { - limit = { - scope:recipient = { is_tributary_of_suzerain_or_above = scope:actor } - } - custom_tooltip = { - text = suzerain_war_participation_guarantee_tt - scope:recipient = { subject_contract_has_flag = tributary_contract_suzerain_guarantee_override } - } - } - trigger_else = { - always = yes - } - custom_tooltip = { - text = war_aid_liege_cooldown_tt - war_days > border_war_grace_period_days - } - } - } - - on_accept = { - scope:target ?= { - hidden_effect = { - set_called_to = scope:actor - } - add_defender = scope:actor - if = { - limit = { - OR = { - scope:actor = { - any_home_court_hostage = { - warden ?= { is_attacker_in_war = scope:target } - } - } - scope:target = { - any_war_attacker = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - } - } - custom_tooltip = hostage_execution_warning_tt - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle - } - } - } - scope:actor = { - add_piety = medium_piety_gain - } - } - if = { - limit = { - is_religious_war = yes - scope:actor = { - any_active_accolade = { - accolade_parameter = acclaimed_knight_piety_from_battle_high - } - } - } - scope:actor = { - add_piety = major_piety_gain - } - } - scope:actor = { - stress_impact = { - craven = medium_stress_impact_gain - } - add_to_variable_list = { - name = joined_as_ally - target = scope:target - } - } - } - # If we're a clan this interaction affects unity - but only when we attemp to aid a house member against a non-house member - if = { - limit = { - exists = scope:target - scope:target = { - primary_defender = scope:recipient - scope:recipient.house = scope:actor.house - primary_attacker = { - house != scope:actor.house - } - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_gain - DESC = clan_unity_join_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0236 - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = vassals - ai_recipients = tributaries - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 24 - kingdom = 6 - empire = 6 - hegemony = 6 - } - ai_potential = { - is_at_war = no - } - - ai_accept = { - base = 100 #no reason to refuse help - } - - # this value is also evaluated in the declare war interaction screen to decide whether the liege will join the vassal's war. - # as such, scope:target may not be defined, and anything war-related will be instead provided in the same way - # we evaluate the war cost in casus_belli.cost - ai_will_do = { - base = 100 - - modifier = { # Less likely if just one title - scope:actor = { - is_ai = yes - is_liege_or_above_of = scope:recipient - } - OR = { - scope:target ?= { - casus_belli = { - any_target_title = { - tier <= tier_duchy - count = 1 - } - } - } - any_in_list = { - list = target_titles - count = 1 - } - - } - add = -100 - desc = war_aid_vassal_only_one_title - } - modifier = { # Less likely if not kingdoms or above - scope:actor = { - is_ai = yes - is_liege_or_above_of = scope:recipient - } - NOR = { - scope:target ?= { - casus_belli = { - any_target_title = { - tier >= tier_kingdom - } - } - } - any_in_list = { - list = target_titles - tier >= tier_kingdom - } - } - add = -100 - desc = war_aid_vassal_below_kingdom_title - } - modifier = { # Do not join if in debt - scope:actor = { - OR = { - gold <= -1 - AND = { - has_treasury = yes - treasury <= -1 - } - } - is_ai = yes - is_liege_or_above_of = scope:recipient - } - add = -100 - desc = war_aid_liege_is_bankrupt - } - modifier = { # Do not join if at war - scope:actor = { - is_at_war = yes - is_ai = yes - } - add = -100 - desc = war_aid_liege_is_at_war - } - modifier = { # Do not join if recipient is stronger then the enemy - scope:actor = { - is_ai = yes - is_liege_or_above_of = scope:recipient - } - OR = { - scope:attacker ?= { - current_military_strength < scope:recipient.current_military_strength - } - scope:target ?= { - primary_attacker.current_military_strength < scope:recipient.current_military_strength - } - } - add = -100 - desc = war_aid_vassal_can_fend_the_attacker_alone - } - modifier = { # Player decides on it's own - scope:actor = { - is_ai = no - } - add = -100 - desc = war_aid_liege_is_player - } - } -} diff --git a/common/character_interactions/00_ce1_interactions.txt b/common/character_interactions/00_ce1_interactions.txt deleted file mode 100644 index 07a3d1d2..00000000 --- a/common/character_interactions/00_ce1_interactions.txt +++ /dev/null @@ -1,357 +0,0 @@ -# Ask to Promote your Legend -ce1_ask_to_promote_legend_interaction = { - icon = icon_contract_modification_single - category = interaction_category_diplomacy - popup_on_receive = yes - pause_on_receive = yes - can_send_despite_rejection = yes - ai_maybe = yes - interface_priority = 5 - desc = ce1_ask_to_promote_legend_interaction_desc - - greeting = positive - notification_text = PROMOTE_LEGEND_NOTIFICATION - - is_shown = { - scope:actor.promoted_legend.legend_owner ?= scope:actor - scope:actor != scope:recipient - scope:recipient = { - is_landed = yes - age >= 12 - is_physically_able = yes - NOT = { government_has_flag = government_is_true_herder } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_tooltip = { - text = recipient_already_promoting_legend_tt - NOT = { exists = promoted_legend } - } - } - custom_tooltip = { - text = recipient_close_or_neighbor_tt - OR = { - scope:recipient.dynasty = scope:actor.dynasty - scope:recipient = { knows_language_of_culture = scope:actor.culture } - scope:actor = { - has_friendly_relationship_with_character_trigger = { CHARACTER = scope:recipient } - } - scope:recipient = { - any_character_to_title_neighboring_county = { - any_county_province = { - any_province_legend = { - this = scope:actor.promoted_legend - } - } - } - } - } - } - } - - cooldown_against_recipient = { years = 5 } - - ai_min_reply_days = 2 - ai_max_reply_days = 7 - - ai_accept = { - base = -10 - ## Tier - modifier = { - add = -5 - scope:recipient.primary_title = { - tier = 2 - } - desc = TIER_REASON_COUNT - } - modifier = { - add = -10 - scope:recipient.primary_title = { - tier = 3 - } - desc = TIER_REASON_DUKE - } - modifier = { - add = -20 - scope:recipient.primary_title = { - tier = 4 - } - desc = TIER_REASON_KING - } - modifier = { - add = -30 - scope:recipient.primary_title = { - tier = 5 - } - desc = TIER_REASON_EMPEROR - } - ## Legend - # How cool is the legend? - modifier = { - add = 10 - desc = REASON_ILLUSTRIOUS_LEGEND - scope:actor = { - promoted_legend = { - legend_quality = illustrious - } - } - } - modifier = { - add = 20 - desc = REASON_MYTHICAL_LEGEND - scope:actor = { - promoted_legend = { - legend_quality = mythical - } - } - } - # Are you using a hook? - modifier = { - trigger = { - scope:hook ?= yes - } - add = 100 - desc = LEGEND_HOOK_USED - } - # Are you using Gold? - modifier = { - trigger = { - scope:gold_cost ?= yes - } - add = 40 - desc = TRADE_GOLD_FOR_BETTER_AI_ACCEPTANCE_TT - } - ## Opinion - # Do they like you? - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - desc = AI_OPINION_REASON - } - ## Personality - # Are they ambitious? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_AMBITIOUS #re-using these - add = -15 - scope:recipient = { - has_trait = ambitious - } - } - # Are they content? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_CONTENT - add = 5 - scope:recipient = { has_trait = content } - } - # Are they stubborn? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_STUBBORN - add = -10 - scope:recipient = { has_trait = stubborn } - } - # Are they arrogant? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_ARROGANT - add = -10 - scope:recipient = { has_trait = arrogant } - } - # Are they humble? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_HUMBLE - add = 10 - scope:recipient = { has_trait = humble } - } - # Are they trusting? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_TRUSTING - add = 15 - scope:recipient = { has_trait = trusting } - } - # Are they paranoid? - modifier = { - desc = DEMAND_SUBMISSION_RECIPIENT_IS_PARANOID - add = -10 - scope:recipient = { has_trait = paranoid } - } - ## Dread - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - ## War - modifier = { - add = -50 - scope:recipient = { - is_at_war = yes - } - desc = HOSTAGE_AT_WAR_REASON - } - ## Low Gold - modifier = { - add = -100 - scope:actor.promoted_legend = { - legend_quality = famed - } - scope:recipient = { - monthly_character_income < famed_legend_promoter_cost - } - desc = TOO_HIGH_PROMOTER_MAINTENANCE_REASON - } - modifier = { - add = -100 - scope:actor.promoted_legend = { - legend_quality = illustrious - } - scope:recipient = { - monthly_character_income < illustrious_legend_promoter_cost - } - desc = TOO_HIGH_PROMOTER_MAINTENANCE_REASON - } - modifier = { - add = -100 - scope:actor.promoted_legend = { - legend_quality = mythical - } - scope:recipient = { - monthly_character_income < mythical_legend_promoter_cost - } - desc = TOO_HIGH_PROMOTER_MAINTENANCE_REASON - } - modifier = { - add = 25 - scope:recipient = { - is_contact_of = scope:actor - } - desc = IS_CONTACT_REASON - } - } - - on_accept = { - scope:actor.promoted_legend = { - save_scope_as = promoted_legend - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = ce1_ask_to_promote_legend_acceptance_tt - left_icon = scope:actor - right_icon = scope:recipient - - if = { - limit = { scope:hook = yes } - use_hook = scope:recipient - } - if = { - limit = { scope:gold_cost = yes } - pay_short_term_gold = { - target = scope:recipient - gold = medium_gold_value - } - promoted_legend = { # To prevent gold exploits - add_to_variable_list = { - name = accepted_promote_legend_var - target = scope:recipient - years = 10 - } - } - } - scope:recipient = { - set_promoted_legend = scope:actor.promoted_legend - } - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = ce1_ask_to_promote_legend_decline_tt - left_icon = scope:actor - right_icon = scope:recipient - } - } - } - - # Use gold to increase acceptance - send_option = { - flag = gold_cost - localization = TRADE_GOLD_FOR_BETTER_AI_ACCEPTANCE - } - send_option = { - flag = hook - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - localization = GENERIC_SPEND_A_HOOK - } - send_options_exclusive = no - - ai_potential = { - is_physically_able = yes - } - - ai_targets = { - ai_recipients = neighboring_rulers - } - - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 36 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - # Very similar to ai_accept, but ignores effects that are < 10 in value for brevity's sake - ai_will_do = { - base = 0 - ## Legends - modifier = { - add = 25 - exists = promoted_legend - } - modifier = { - add = 25 - promoted_legend = { - legend_quality = mythical - } - } - ## Gold - modifier = { - add = -100 - debt_level >= 0 - } - modifier = { - add = -50 - gold <= major_gold_value - } - ## Personality - modifier = { - add = 25 - has_trait = arrogant - } - } -} diff --git a/common/character_interactions/00_character_interactions.txt b/common/character_interactions/00_character_interactions.txt index e765cb72..85a81400 100644 --- a/common/character_interactions/00_character_interactions.txt +++ b/common/character_interactions/00_character_interactions.txt @@ -45,7 +45,7 @@ offer_vassalization_interaction = { } NOR = { government_has_flag = cannot_be_vassal_or_liege - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } # Temujin cannot make Jamukha his subject once he leaves him diff --git a/common/character_interactions/00_diarch_interactions.txt b/common/character_interactions/00_diarch_interactions.txt deleted file mode 100644 index 982256be..00000000 --- a/common/character_interactions/00_diarch_interactions.txt +++ /dev/null @@ -1,10461 +0,0 @@ -@ai_skill_diff_upper_threshold = 8 -@ai_skill_diff_lower_threshold = 2 -@ai_prestige_bank_threshold = 2 - -@ai_core_loop_base_value = 4000 -@ai_threshold_for_revoke_cyle = 3 -@ai_secondary_powers_base_value = 500 - -############################################### -# #Setup & Misc -# -# CORE DIARCH POWERS -# diarch_revoke_title_interaction - diarch (actor) takes a title from a vassal of their liege (recipient) with an optional veto for the liege (third_party). -# diarch_retract_vassal_interaction - diarch (actor) takes a vassal from a vassal of their liege (recipient) with an optional veto for the liege (third_party). -# diarch_imprison_interaction - diarch (actor) tries to move a character (recipient) within the sub-realm of their liege (third) to their dungeon, with an optional veto for the liege. -# diarch_entrench_regency_interaction - diarch (actor) shifts the diarchy from temporary to entrenched, making it more difficult for their liege (recipient) to get rid of them. -# -# ANCILLARY DIARCH POWERS -# diarch_legal_meddling_interaction - diarch (actor) either tests learning or spends prestige to gain an unpressed claim on a title held by a vassal of their liege (recipient). -# diarch_syphon_treasury_interaction - diarch (actor) either tests stewardship or spends prestige to gain gold at the expense of negative modifiers delivered to the liege (recipient). -# diarch_shift_privileges_interaction - diarch (actor) either tests diplomacy or spends prestige to give negative modifiers to the lands of a vassal of their liege (secondary recipient), who can't resist. -################################################## - - - - - - - - - - -################################################## -# CORE DIARCH POWERS - -# Diarch (actor) takes a title from a vassal (recipient) of their liege with an optional veto for the liege (third_party). -diarch_revoke_title_interaction = { - category = interaction_category_diarch - common_interaction = no - interface_priority = 35 - diarch_interaction = yes - highlighted_reason = HIGHLIGHTED_CAN_DIARCH_REVOKE - notification_text = DIARCH_REVOKE_TITLE_PROPOSAL - intermediary_notification_text = diarch_interaction_requesting_sign_off.tt - intermediary_breakdown_yes = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_YES - intermediary_breakdown_no = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_NO - intermediary_breakdown_maybe = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_MAYBE - intermediary_answer_accept_key = REPLY_ANSWER_ALLOW - intermediary_answer_reject_key = REPLY_ANSWER_VETO - pre_answer_yes_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_YES - pre_answer_no_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_NO - pre_answer_maybe_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_MAYBE - icon = revoke_title - redirect = { - scope:actor.liege ?= { save_scope_as = intermediary } - } - - desc = diarch_revoke_title_interaction_desc - send_name = diarch_revoke_title_interaction.send_name - - special_interaction = diarch_revoke_title - interface = revoke_title - target_type = title - target_filter = recipient_domain_titles - ai_maybe = yes - ai_intermediary_maybe = yes - can_send_despite_rejection = yes - popup_on_receive = yes - pause_on_receive = yes - - ai_min_reply_days = 4 - ai_max_reply_days = 9 - - on_decline_summary = diarch_rebel_or_crime_summary - prompt = RETRACT_VASSAL_SELECT_VASSAL_TO_RETRACT - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - liege = { - has_diarchy_parameter = unlock_diarch_revoke_title_interaction - } - } - # Make sure scope:recipient is suitable. - scope:recipient = { - # We only target vassals of the liege... - liege = scope:actor.liege - this != scope:actor.liege - # ... who are appropriately landed. - is_landed_or_landless_administrative = yes - scope:recipient.highest_held_title_tier >= tier_county - } - } - - is_valid = { - # Here to correct for some dodgy inheritance situations. - scope:actor != scope:intermediary - } - is_valid_showing_failures_only = { - # Standard validity checks. - title_revocation_standard_valid_showing_failures_only_trigger = yes - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Plus make sure there's a legal right to revoke. - scope:actor.liege = { - trigger_if = { - limit = { government_has_flag = government_is_tribal } - custom_description = { - text = "liege_has_law_allowing_title_revocation_tribal" - has_realm_law_flag = title_revocation_allowed - } - } - trigger_else_if = { - limit = { government_has_flag = government_is_administrative } - custom_description = { - text = "cannot_diarch_revoke_administrative_titles" - always = no - } - } - trigger_else = { - custom_description = { - text = "liege_has_law_allowing_title_revocation_crown" - has_realm_law_flag = title_revocation_allowed - } - } - } - trigger_if = { - limit = { - scope:recipient = { vassal_contract_has_flag = vassal_contract_cannot_revoke_titles } - } - custom_description = { - text = liege_vassal_contract_forbids_revocation - object = scope:recipient - scope:recipient = { - NOT = { vassal_contract_has_flag = vassal_contract_cannot_revoke_titles } - } - } - } - # Diarch revocations require a claim. - diarch_revocation_has_claim_check_trigger = yes - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_an_entrenched_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege ?= { has_diarchy_active_parameter = unlock_diarch_revoke_title_interaction } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - cooldown = { years = 1 } - cooldown_against_recipient = { years = 3 } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - is_highlighted = { - # Diarch revocations require a claim - this is uncommon, so we always highlight it. - diarch_revocation_has_claim_check_trigger = yes - } - - can_be_picked_title = { - scope:target = { - title_revocation_standard_can_pick_title_trigger = yes - # Plus, must have scope:actor as a claimant. - custom_description = { - text = "you_must_have_a_claim_on_the_title" - scope:actor = { has_claim_on = scope:target } - } - } - } - - # Hooks can be used to force this through. - ## We don't force-force this on/for the player (so no pain but less benefits), but AI regard weak hooks as compulsory from/for other AI. - send_options_exclusive = no - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - on_send = { - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - } - # Did a landless diarch send this? - log_diarch_send_interaction_as_variable_effect = { INTERACTION = revoke } - } - - on_auto_accept = { - scope:recipient = { trigger_event = char_interaction.0261 } - } - - on_accept = { - # Since this is a confusing interaction, we want to clarify what you're nicking. - scope:actor = { custom_tooltip = diarch_revoke_title_interaction.tt.gain_title } - # To keep some other arcane script working. - save_scope_value_as = { - name = revoke_title_interaction - value = yes - } - scope:actor = { - # Tell them that the revocation went through fine. - trigger_event = char_interaction.0262 - } - # Otherwise, follow the standard flow for revocation. - save_scope_value_as = { - name = use_strife_not_tyranny - value = yes - } - revoke_title_interaction_effect = yes - scope:actor = { - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - # To avoid unlanded regents becoming vassals of the liege's direct vassals, make sure the current liege remains the liege - hidden_effect = { - scope:actor = { - if = { - limit = { - is_landed_or_landless_administrative = no - scope:intermediary != scope:recipient - } - # This has a delay of 1 day (if no delay then the liege change doesn't stick) which really isn't ideal and should be looked into/fixed so that it happens when the action goes into effect - trigger_event = { id = diarchy.0141 days = 1 } - } - } - } - - # Debug logging. - debug_log = debug_log.diarch_revoke_title.accepted - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_revoke_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_accept_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_accept_intermediary_list } - } - } - - on_intermediary_decline = { - # Scope:intermediary eats a prestige cost for their veto. - scope:intermediary = { add_prestige = liege_diarchy_veto_prestige_cost_high } - scope:actor = { - # Inform scope:actor that their liege has vetoed them. - ## First, we log which interaction this is for the event's effects. - save_scope_value_as = { - name = diarch_interaction - value = flag:title_revoke - } - ## Then, fire the event. - trigger_event = char_interaction.0291 - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - # Inform scope:recipient that scope:intermediary has their back. - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_good - title = diarch_action_vetoed.tt - left_icon = scope:actor - right_icon = scope:intermediary - custom_tooltip = diarch_revoke_title_interaction.tt.inform_recipient - } - } - # Flick out some opinions. - diarch_revoke_title_interaction_intermediary_fail_opinions_effect = yes - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_revoke_veto } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_veto_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_veto_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_veto_intermediary_list } - } - } - - on_decline = { - scope:actor = { - # Tell them that the revocation ran into issues. - trigger_event = char_interaction.0263 - # And give a crime reason for both them and the liege. - show_as_tooltip = { - random_list = { - 50 = { - show_chance = no - desc = char_interaction.0263.result.criminal - diarch_declare_recipient_criminal_effect = yes - } - 50 = { - show_chance = no - desc = char_interaction.0263.result.war - diarch_declare_claim_war_effect = yes - } - } - } - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - # Flick out some opinions. - ## Scope:recipient is annoyed with scope:actor. - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = revoked_title - } - } - - # Debug logging. - debug_log = debug_log.diarch_revoke_title.rejected - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_revoke_reject } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_reject_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_reject_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_revoke_reject_intermediary_list } - } - } - - auto_accept = { - scope:recipient = { - calc_true_if = { - amount >= 2 - custom_description = { - text = "prisoner_revocation" - is_imprisoned_by = scope:actor - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - OR = { - # Strong hooks generally. - scope:actor = { has_strong_hook = scope:recipient } - # Weak hooks in inter-AI interactions count as strong hooks. - AND = { - scope:actor = { is_ai = yes } - scope:recipient = { is_ai = yes } - } - } - } - custom_description = { - text = "foreign_prison_revocation" - subject = scope:actor - object = scope:recipient - scope:recipient = { - is_imprisoned = yes - NOT = { is_imprisoned_by = scope:actor } - } - } - } - } - } - - ai_intermediary_accept = { - # The AI should be inclined to trust their regent, at least a little. - base = 0 - modifier = { add = liege_trust_diarch_trilateral_interaction_default_value } - - # Standard modifiers. - intermediary_liege_will_accept_standard_modifiers = { - CURRENCY = prestige - COST = liege_diarchy_veto_prestige_cost_high - } - # Misc important reasons. - ## Revoking own capital. - modifier = { - add = 50 - desc = AI_TITLE_IS_REALM_CAPITAL - exists = scope:actor.primary_title.title_capital_county - OR = { - scope:landed_title = scope:actor.primary_title.title_capital_county - scope:landed_title = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - } - ai_accept = { - # Try to make it 0 for most interactions - base = 0 - - # Weak Hook - modifier = { - add = 40 - desc = SCHEME_WEAK_HOOK_USED - scope:hook = yes - } - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.8 - desc = AI_OPINION_REASON - } - # Refusal is Treason - ## It's always treason, but worth pointing it out. - modifier = { - add = 20 - desc = AI_REFUSAL_IS_TREASON - } - # Revoking own capital. - modifier = { - add = 50 - desc = AI_TITLE_IS_REALM_CAPITAL - exists = scope:actor.primary_title.title_capital_county - OR = { - scope:landed_title = scope:actor.primary_title.title_capital_county - scope:landed_title = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - # We don't buff claimants because you *have* to be a claimant for a diarch revoke. - ## Compensated for by refusal _always_ being treason. - # I am a King! - modifier = { - add = -20 - desc = offer_vassalization_interaction_aibehavior_hightier_tt - scope:recipient = { highest_held_title_tier = tier_kingdom } - } - # Title is part of vassal's primary title de-jure. - modifier = { - add = -25 - desc = AI_REFUSAL_IS_DE_JURE_UNDER - OR = { - scope:recipient.primary_title = { is_de_jure_liege_or_above_target = scope:landed_title } - scope:recipient.primary_title = scope:landed_title - } - } - # Dread - ## Intimidation - modifier = { - add = intimidated_halved_reason_value - desc = INTIMIDATED_REASON - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - } - ## Cowing - modifier = { - add = cowed_halved_reason_value - desc = COWED_REASON - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - } - # Comparative military strength. - modifier = { - add = { - value = 1 - subtract = { - value = scope:recipient.max_military_strength - divide = { value = scope:actor.max_military_strength min = 1 } - } - multiply = 50 - max = 20 - } - desc = offer_vassalization_interaction_aibehavior_power_tt - scope:actor = { is_landed_or_landless_administrative = yes } - } - # Legalistic tradition - modifier = { - add = legalistic_vassal_punishment_acceptance - desc = tradition_legalistic_name - scope:actor = { - has_revoke_title_reason = scope:recipient - culture = { has_cultural_parameter = vassals_more_likely_accept_punishments } - } - } - # Factor for personality. - ai_value_modifier = { - who = scope:recipient - # Greed is always a factor. - ai_greed = { - if = { - limit = { - scope:recipient = { - NOT = { ai_greed = 0 } - } - } - value = -0.75 - } - } - # If AI is honourable and the law compels them to obey the liege, AI will be more likely to obey. - ai_honor = { - if = { - limit = { - scope:recipient = { ai_honor > 0 } - } - value = 0.5 - } - } - } - # Bump up landless diarchs if we could survive the transition. - modifier = { - add = 100 - scope:actor = { is_ruler = no } - scope:recipient = { - any_held_county = { count >= 2 } - } - } - } - - # AI - ai_targets = { ai_recipients = peer_vassals } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_potential = { - is_diarch = yes - liege = { has_realm_law_flag = title_revocation_allowed } - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - # We're generally ruthless here. - base = @ai_core_loop_base_value - - # Additions. - ## Opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = 0.25 - } - ## Personality. - ai_value_modifier = { - ai_boldness = 0.75 - ai_honor = -0.5 - } - ## Traits. - ### +++ Ambitious. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = ambitious - } - ### +++ Greedy. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = greedy - } - ### +++ Vengeful (under certain criteria). - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = vengeful - has_opinion_modifier = { - modifier = revoked_title - target = scope:recipient - } - } - ### ++ Arbitrary. - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = arbitrary - } - ### - Generous. - modifier = { - add = diarch_ai_desire_minus_1_value - has_trait = generous - } - ### -- Just. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = just - } - ### --- Content. - modifier = { - add = diarch_ai_desire_minus_3_value - has_trait = content - } - ## Landless characters want land, but also want to focus on taking from those who might give it up. - ### So we prioritise hooked AI counts. - modifier = { - add = 100 - is_landed = no - has_hook = scope:recipient - scope:recipient = { - highest_held_title_tier = tier_county - is_ai = yes - } - } - ### Then just hooked AI. - modifier = { - add = 50 - is_landed = no - has_hook = scope:recipient - scope:recipient = { is_ai = yes } - } - ## Always revoke preferred capital and capital duchy. - modifier = { - add = 1000 - exists = scope:actor.primary_title.title_capital_county - OR = { - scope:landed_title = scope:actor.primary_title.title_capital_county - scope:landed_title = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - ## Slight preference for higher-tier titles. - modifier = { - add = { - value = scope:landed_title.tier - multiply = 10 - } - } - ## We avoid wars here too, but only in the resulting event. - # Factors. - ## Relationships. - ### + Do pick on people we hate. - modifier = { - factor = 1.5 - should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### - Try not to pick on allies of our liege. - modifier = { - factor = 0.25 - should_avoid_hostile_action_against_due_to_liege_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### x0 Don't pick on our friends or allies. - modifier = { - factor = 0 - should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### x0 Don't pick on players unless they're of at least a decent size. - modifier = { - factor = 0 - scope:recipient = { - is_ai = no - any_held_county = { count <= 3 } - } - } - ### x0 Don't go into prestige debt! - modifier = { - factor = 0 - prestige <= 0 - } - } -} - -# Diarch (actor) takes a vassal from a vassal (recipient) of their liege with an optional veto for the liege (third_party). -diarch_retract_vassal_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - interface_priority = 10 - highlighted_reason = HIGHLIGHTED_CAN_DIARCH_RETRACT - notification_text = RETRACT_VASSAL_PROPOSAL - intermediary_notification_text = diarch_interaction_requesting_sign_off.tt - intermediary_breakdown_yes = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_YES - intermediary_breakdown_no = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_NO - intermediary_breakdown_maybe = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_MAYBE - intermediary_answer_accept_key = REPLY_ANSWER_ALLOW - intermediary_answer_reject_key = REPLY_ANSWER_VETO - pre_answer_yes_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_YES - pre_answer_no_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_NO - pre_answer_maybe_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_MAYBE - icon = icon_liege - redirect = { - scope:actor.liege ?= { save_scope_as = intermediary } - } - - desc = diarch_retract_vassal_interaction_desc - send_name = diarch_retract_vassal_interaction.send_name - - special_interaction = retract_vassal_interaction - interface = transfer_vassal - ai_maybe = yes - ai_intermediary_maybe = yes - can_send_despite_rejection = yes - popup_on_receive = yes - pause_on_receive = yes - - ai_min_reply_days = 4 - ai_max_reply_days = 9 - - on_decline_summary = diarch_rebel_or_crime_summary.retract - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - liege = { has_diarchy_parameter = unlock_diarch_retract_vassal_interaction } - # Plus you need to be landed for this. - is_landed_or_landless_administrative = yes - } - # Make sure scope:recipient is suitable. - scope:recipient = { - # We only target vassals of the liege... - liege = scope:actor.liege - this != scope:actor.liege - # ... who are appropriately landed. - is_landed_or_landless_administrative = yes - scope:recipient.highest_held_title_tier >= tier_duchy - } - } - - is_valid = { - # Here to correct for some dodgy inheritance situations. - scope:actor != scope:intermediary - } - is_valid_showing_failures_only = { - # Standard validity checks. - vassal_retraction_standard_valid_showing_failures_only_trigger = yes - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Scope:recipient must hold at least one of scope:actor's de jure vassals. - scope:actor = { - custom_description = { - text = "you_must_have_a_de_jure_vassal_to_retract" - object = scope:recipient - any_held_title = { - title_tier >= duchy - any_direct_de_jure_vassal_title = { - exists = holder - holder.liege = scope:recipient - } - } - } - } - # Plus make sure there's a legal right to retract. - scope:actor.liege = { - trigger_if = { - limit = { government_has_flag = government_is_tribal } - custom_description = { - text = "liege_has_law_allowing_vassal_retraction_tribal" - has_realm_law_flag = vassal_retraction_allowed - } - } - trigger_if = { - limit = { - NOT = { government_has_flag = government_is_tribal } - } - custom_description = { - text = "liege_has_law_allowing_vassal_retraction_crown" - has_realm_law_flag = vassal_retraction_allowed - } - } - } - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_an_entrenched_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_diarch_retract_vassal_interaction } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - cooldown = { years = 1 } - cooldown_against_recipient = { years = 3 } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - is_highlighted = { - # Diarch retractions require a de jure claim - this is uncommon, so we always highlight it. - diarch_retraction_is_de_jure_liege_trigger = yes - } - - populate_recipient_list = { - scope:actor = { - every_held_title = { - title_tier >= duchy - every_direct_de_jure_vassal_title = { - limit = { exists = holder } - holder = { - if = { - limit = { liege = scope:recipient } - add_to_list = characters - } - } - } - } - } - } - - # Hooks can be used to force this through. - ## We don't force-force this on/for the player (so no pain but less benefits), but AI regard weak hooks as compulsory from/for other AI. - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - on_send = { - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - } - } - - on_auto_accept = { - scope:recipient = { trigger_event = char_interaction.0271 } - } - - on_accept = { - # Follow the standard flow for retraction. - save_scope_value_as = { - name = use_strife_not_tyranny - value = yes - } - retract_vassal_interaction_effect = yes - scope:actor = { - # Tell them that the retraction went through fine. - trigger_event = char_interaction.0272 - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - - # Debug logging. - debug_log = debug_log.diarch_retract_vassal.accepted - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_retract_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_accept_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_accept_intermediary_list } - } - } - - on_intermediary_decline = { - # Scope:intermediary eats a prestige cost for their veto. - scope:intermediary = { add_prestige = liege_diarchy_veto_prestige_cost_high } - scope:actor = { - # Inform scope:actor that their liege has vetoed them. - ## First, we log which interaction this is for the event's effects. - save_scope_value_as = { - name = diarch_interaction - value = flag:vassal_retract - } - ## Then, fire the event. - trigger_event = char_interaction.0291 - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - # Inform scope:recipient that scope:intermediary has their back. - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_good - title = diarch_action_vetoed.tt - left_icon = scope:actor - right_icon = scope:intermediary - custom_tooltip = diarch_retract_vassal_interaction.tt.inform_recipient - } - } - # Flick out some opinions. - diarch_retract_vassal_interaction_intermediary_fail_opinions_effect = yes - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_retract_veto } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_veto_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_veto_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_veto_intermediary_list } - } - } - - on_decline = { - scope:actor = { - # Tell them that the retraction ran into issues. - trigger_event = char_interaction.0273 - # And give a crime reason for both them and their liege. - show_as_tooltip = { - random_list = { - 50 = { - show_chance = no - desc = char_interaction.0273.result.criminal - diarch_declare_recipient_criminal_effect = yes - } - 50 = { - show_chance = no - desc = char_interaction.0273.result.war - diarch_declare_vassalisation_war_effect = yes - } - } - } - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - # Flick out some opinions. - ## Scope:recipient is annoyed with scope:actor. - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = retracted_vassal - } - } - - # Debug logging. - debug_log = debug_log.diarch_retract_vassal.rejected - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_retract_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_decline_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_retract_decline_intermediary_list } - } - } - - auto_accept = { - OR = { - scope:recipient = { - is_imprisoned_by = scope:actor - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - ai_intermediary_accept = { - # The AI should be inclined to trust their regent, at least a little. - base = 0 - modifier = { add = liege_trust_diarch_trilateral_interaction_default_value } - - # Standard modifiers. - intermediary_liege_will_accept_standard_modifiers = { - CURRENCY = prestige - COST = liege_diarchy_veto_prestige_cost_high - } - # Misc important reasons. - ## Retracting vassal with own capital. - modifier = { - add = 50 - desc = AI_VASSAL_HOLDS_REALM_CAPITAL - exists = scope:actor.primary_title.title_capital_county - scope:secondary_recipient = { - OR = { - any_sub_realm_county = { - this = scope:actor.primary_title.title_capital_county - } - any_sub_realm_duchy = { - this = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - } - } - } - ai_accept = { - base = 0 # Try to make it 0 for most interactions - - # Hook used - modifier = { - add = 40 - desc = SCHEME_WEAK_HOOK_USED - scope:hook = yes - } - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - # - modifier = { - add = 25 - desc = AI_REFUSAL_IS_TREASON - scope:actor = { has_realm_law_flag = vassal_refusal_is_treason } - } - - ai_value_modifier = { - who = scope:recipient - ai_greed = { - if = { - limit = { - scope:recipient = { NOT = { ai_greed = 0 } } - } - value = -0.25 - } - } - ai_honor = { - if = { - limit = { - scope:recipient = { #If AI is honorable and the law compels to obey the liege, AI will be more likely to obey. - ai_honor > 0 - } - scope:actor = { - has_realm_law_flag = vassal_refusal_is_treason - } - } - value = 0.75 - } - } - } - modifier = { - add = 50 - desc = AI_VASSAL_HOLDS_REALM_CAPITAL - exists = scope:actor.primary_title.title_capital_county - scope:secondary_recipient = { - OR = { - any_sub_realm_county = { - this = scope:actor.primary_title.title_capital_county - } - any_sub_realm_duchy = { - this = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - } - } - - modifier = { #Sub-Vassal is NOT De jure of current Vassal. - add = 25 - desc = AI_REFUSAL_IS_NOT_DE_JURE_LIEGE - NOT = { - scope:recipient = { - any_held_title = { - is_de_jure_liege_or_above_target = scope:secondary_recipient.primary_title - } - } - } - } - modifier = { #Sub-Vassal is De jure of liege title. - add = 15 - desc = AI_REFUSAL_IS_DE_JURE_LIEGE - scope:actor = { - any_held_title = { - this = scope:secondary_recipient.primary_title.de_jure_liege - } - } - } - modifier = { - add = intimidated_halved_reason_value - desc = INTIMIDATED_REASON - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - } - modifier = { - add = cowed_halved_reason_value - desc = COWED_REASON - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - } - modifier = { #Comparative military strength. - add = { - value = 1 - subtract = { - value = scope:recipient.max_military_strength - divide = { value = scope:actor.max_military_strength min = 1 } - } - multiply = 100 - } - desc = offer_vassalization_interaction_aibehavior_power_tt - } - modifier = { #Different faith, no pluralism. - add = { - value = -25 - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_hostile_level - } - } - } - add = -10 - } - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_evil_level - } - } - } - add = -25 - } - } - desc = AI_REFUSAL_SPLITTING_SAME_FAITH_VASSALS - scope:actor.faith = scope:secondary_recipient.faith #Will not care as much if the vassal being retracted is of a different faith. - scope:actor = { - NOR = { #Of two different faiths AND the potential vassal's faith is not pluralistic. - faith = scope:recipient.faith - faith = { has_doctrine = doctrine_pluralism_pluralistic } - } - } - } - } - - # AI - ai_targets = { ai_recipients = peer_vassals } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 24 - } - - ai_potential = { - is_diarch = yes - has_realm_law_flag = title_revocation_allowed - primary_title.tier > tier_county - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - # We're generally ruthless here. - base = @ai_secondary_powers_base_value - - # Additions. - ## Opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = 0.25 - } - ## Personality. - ai_value_modifier = { - ai_boldness = 0.75 - ai_honor = -0.5 - } - ## Traits. - ### +++ Ambitious. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = ambitious - } - ### +++ Greedy. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = greedy - } - ### +++ Vengeful (under certain criteria). - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = vengeful - has_opinion_modifier = { - modifier = revoked_title - target = scope:recipient - } - } - ### ++ Arbitrary. - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = arbitrary - } - ### - Generous. - modifier = { - add = diarch_ai_desire_minus_1_value - has_trait = generous - } - ### -- Just. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = just - } - ### --- Content. - modifier = { - add = diarch_ai_desire_minus_3_value - has_trait = content - } - ## Always revoke preferred capital and capital duchy - modifier = { - add = 1000 - exists = scope:actor.primary_title.title_capital_county - OR = { - scope:actor = { - any_held_title = { this = scope:actor.primary_title.title_capital_county.de_jure_liege } - } - scope:actor.primary_title.title_capital_county.de_jure_liege = { is_title_created = no } - } - scope:secondary_recipient = { - any_sub_realm_county = { this = scope:actor.primary_title.title_capital_county } - } - } - # Always retract preferred capital duchy - modifier = { - add = 1000 - exists = scope:actor.primary_title.title_capital_county - scope:secondary_recipient = { - any_sub_realm_duchy = { this = scope:actor.primary_title.title_capital_county.de_jure_liege } - } - } - ## Slight preference for higher-tier titles - modifier = { - add = { - value = scope:secondary_recipient.highest_held_title_tier - multiply = 10 - } - } - ## We avoid wars here too, but only in the resulting event. - # Factors. - ## Relationships. - ### + Do pick on people we hate. - modifier = { - factor = 1.5 - should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### - Try not to pick on allies of our liege. - modifier = { - factor = 0.25 - should_avoid_hostile_action_against_due_to_liege_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### x0 Don't pick on our friends or allies. - modifier = { - factor = 0 - should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### x0 Don't pick on players unless they're of at least a decent size. - modifier = { - factor = 0 - scope:recipient = { - is_ai = no - any_held_county = { count <= 3 } - } - } - ### x0 Exempt the party baron. - modifier = { - factor = 0 - scope:recipient = { has_character_flag = is_party_baron } - } - } -} - -# Diarch (actor) imprisons a character (recipient) who's a sub-realm character of their liege, with an optional veto for the liege (third_party). -diarch_imprison_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - interface_priority = 16 - notification_text = DIARCH_IMPRISON_PROPOSAL - intermediary_notification_text = diarch_interaction_requesting_sign_off.tt - intermediary_breakdown_yes = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_YES - intermediary_breakdown_no = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_NO - intermediary_breakdown_maybe = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_MAYBE - intermediary_answer_accept_key = REPLY_ANSWER_ALLOW - intermediary_answer_reject_key = REPLY_ANSWER_VETO - pre_answer_yes_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_YES - pre_answer_no_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_NO - pre_answer_maybe_breakdown_key = ANSWER_TRILATERAL_RECIPIENT_MAYBE - icon = prison - redirect = { - scope:actor.liege ?= { save_scope_as = intermediary } - } - - desc = diarch_imprison_interaction_desc - send_name = diarch_imprison_interaction.send_name - - ai_maybe = yes - ai_intermediary_maybe = yes - can_send_despite_rejection = yes - popup_on_receive = yes - pause_on_receive = yes - - ai_min_reply_days = 4 - ai_max_reply_days = 9 - - on_decline_summary = diarch_rebel_or_crime_summary.crominal - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - liege = { has_diarchy_parameter = unlock_diarch_imprison_interaction } - # The prisoner goes to your dungeon, so we want you to actually have one. - is_landed_or_landless_administrative = yes - } - # Make sure scope:recipient is suitable. - scope:recipient = { is_imprisoned = no } - # Scope:recipient can't be visiting elsewhere. - trigger_if = { - limit = { - scope:recipient = { is_courtier = yes } - } - NOT = { - scope:recipient.host = { - any_foreign_court_guest = { this = scope:recipient } - } - } - } - # Finally, make sure this isn't someone scope:actor could use the conventional interaction on. - scope:actor = { - liege = { - basic_allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } - } - NOT = { - basic_allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } - } - } - } - - is_valid = { - # Here to correct for some dodgy inheritance situations. - scope:actor != scope:intermediary - } - is_valid_showing_failures_only = { - scope:actor = { - advanced_allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } - } - imprison_neutral_is_valid_showing_failures_only_triggers_trigger = yes - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_a_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_diarch_imprison_interaction } - scope:actor.liege = { - trigger_if = { - limit = { has_realm_law_flag = imprisonment_toggle_enable } #Present on all tribal authority to disable imprisonment - has_realm_law_flag = imprisonment_toggle_on #Present from tribal authority level 1 to re-enable imprisonment - } - } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - cooldown = { years = 1 } - cooldown_against_recipient = { years = 3 } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - is_highlighted = { - scope:recipient = { is_imprisoned = no } - scope:actor = { has_imprisonment_reason = scope:recipient } - } - - #Use hook - send_option = { - is_valid = { - exists = scope:recipient - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - on_send = { - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - } - } - - on_auto_accept = { - scope:actor = { trigger_event = char_interaction.0281 } - diarch_imprison_general_accept_effect = yes - } - - on_accept = { - if = { - limit = { scope:hook = yes } - scope:actor = { use_hook = scope:recipient } - } - # Tell them that the imprisonment went through fine. - scope:actor = { trigger_event = char_interaction.0282 } - save_scope_value_as = { - name = use_strife_not_tyranny - value = yes - } - diarch_imprison_general_accept_effect = yes - - # Debug logging. - debug_log = debug_log.diarch_imprison.accepted - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_imprison_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_accept_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_accept_intermediary_list } - } - } - - on_intermediary_decline = { - # Scope:intermediary eats a prestige cost for their veto. - scope:intermediary = { add_prestige = liege_diarchy_veto_prestige_cost_medium } - scope:actor = { - # Inform scope:actor that their liege has vetoed them. - ## First, we log which interaction this is for the event's effects. - save_scope_value_as = { - name = diarch_interaction - value = flag:imprison - } - ## Then, fire the event. - trigger_event = char_interaction.0291 - # Scope:actor can be hostile again. - clear_hostile_actions_lock_flag_effect = yes - } - # Inform scope:recipient that scope:intermediary has their back. - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_good - title = diarch_action_vetoed.tt - left_icon = scope:actor - right_icon = scope:intermediary - custom_tooltip = diarch_imprison_interaction.tt.inform_recipient - } - } - # Flick out some opinions. - diarch_imprison_interaction_intermediary_fail_opinions_effect = yes - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_imprison_veto } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_veto_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_veto_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_veto_intermediary_list } - } - } - - on_decline = { - scope:actor = { - imprison_HoF_consequences_effect = yes - imprison_tyranny_effect = yes - } - # Do we want a war or an escape? - scope:recipient = { - # If target is count or higher, we want the option to start a war. - if = { - limit = { - is_landed_or_landless_administrative = yes - highest_held_title_tier >= tier_county - } - # Send the choosing event. - scope:actor = { trigger_event = char_interaction.0283 } - # Display the choices in advance. - show_as_tooltip = { - random_list = { - 50 = { - show_chance = no - desc = char_interaction.0263.result.criminal - diarch_declare_recipient_criminal_effect = yes - } - 50 = { - show_chance = no - desc = char_interaction.0263.result.war - scope:recipient = { - start_war = { - casus_belli = remove_regent_cb - target = scope:actor - } - } - } - } - } - } - #If target is a baron or unlanded, have them escape. - else = { - if = { #To block them from being instantly rehired - limit = { - is_councillor_of = scope:actor - can_be_fired_from_council_trigger = { COURT_OWNER = scope:actor } - } - set_variable = { - name = escaped_imprisonment_from - value = scope:actor - years = 20 - } - } - if = { - limit = { is_landed_or_landless_administrative = yes } - depose_effect = { DEPOSER = scope:actor } - } - if = { - limit = { - is_playable_character = no - trigger_if = { - limit = { is_councillor = yes } - can_be_fired_from_council_trigger = { COURT_OWNER = scope:recipient.liege } - } - trigger_if = { - limit = { exists = scope:actor.faith.religious_head } - scope:actor.faith.religious_head != scope:recipient - } - } - custom_tooltip = deposed_and_become_wanderer - select_and_move_to_pool_effect = yes - } - add_opinion = { - target = scope:actor - modifier = attempted_imprisonment_opinion - } - } - } - - #Remove them as guardian/ward for any courtier (feedback given in char_interaction.0230) - scope:actor = { - if = { - limit = { - any_courtier = { has_relation_guardian = scope:recipient } - } - every_courtier = { - limit = { has_relation_guardian = scope:recipient } - save_scope_as = ward - remove_guardian_effect = { - GUARDIAN = scope:recipient - WARD = scope:ward - RETURN_WARD = yes - HIDE_OPINION = no - } - add_to_list = ward_children - } - } - if = { - limit = { - any_courtier = { has_relation_ward = scope:recipient } - } - random_courtier = { - limit = { has_relation_ward = scope:recipient } - save_scope_as = guardian - show_as_tooltip = { - remove_guardian_effect = { - GUARDIAN = scope:guardian - WARD = scope:recipient - RETURN_WARD = yes - HIDE_OPINION = no - } - } - add_to_list = guardian_list - } - hidden_effect = { - scope:guardian = { - send_interface_message = { - type = event_childhood_neutral - title = remove_guardian_interaction_notification - left_icon = scope:recipient - right_icon = scope:guardian - remove_guardian_effect = { - GUARDIAN = scope:guardian - WARD = scope:recipient - RETURN_WARD = yes - HIDE_OPINION = no - } - } - } - } - } - } - # Misc clean-up stuff. - scope:actor = { - if = { - limit = { - scope:recipient = { - OR = { - is_playable_character = no - AND = { - is_landed_or_landless_administrative = yes - primary_title.tier = tier_barony - } - } - } - } - trigger_event = char_interaction.0230 - } - } - if = { - limit = { - scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } - } - scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } - } - - # Debug logging. - debug_log = debug_log.diarch_imprison.rejected - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_imprison_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_decline_recipient_list } - } - scope:intermediary = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_imprison_decline_intermediary_list } - } - } - - auto_accept = no - - ai_intermediary_accept = { - # The AI should be inclined to trust their regent, at least a little. - base = 0 - modifier = { add = liege_trust_diarch_trilateral_interaction_default_value } - - # Standard modifiers. - intermediary_liege_will_accept_standard_modifiers = { - CURRENCY = prestige - COST = liege_diarchy_veto_prestige_cost_medium - } - } - ai_accept = { - base = 0 # Try to make it 0 for most interactions - - modifier = { - add = { - value = scope:actor.intrigue - multiply = 1 - } - desc = IMPRISON_INTRIGUE_ACTOR - } - modifier = { - add = { - value = scope:recipient.intrigue - multiply = -2 - } - desc = IMPRISON_INTRIGUE_RECIPIENT - } - - modifier = { - add = 30 - desc = SCHEME_HOOK_USED - scope:hook = yes - } - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - ai_value_modifier = { - who = scope:recipient - ai_boldness = { - if = { - limit = { - scope:recipient = { NOT = { ai_boldness = 0 } } - } - value = -0.5 - } - } - } - modifier = { - add = 20 - desc = AI_REFUSAL_IS_TREASON - scope:actor = { - any_vassal_or_below = { this = scope:recipient } - has_realm_law_flag = vassal_refusal_is_treason - } - } - modifier = { - add = 50 - desc = AI_PRISON_FEUDAL_COMPLEX_PERK - scope:actor = { - has_perk = prison_feudal_complex_perk - } - } - modifier = { #I am a King! - add = -40 - desc = offer_vassalization_interaction_aibehavior_hightier_tt - scope:recipient = { highest_held_title_tier = tier_kingdom } - } - modifier = { #Courtiers. - add = 50 - desc = AI_REFUSAL_COURTIER - scope:recipient = { is_ruler = no } - } - modifier = { # Your young children can't really stop you - add = 200 - desc = AI_REFUSAL_YOUNG_CHILD - scope:recipient = { - is_child_of = scope:actor - is_courtier_of = scope:actor - is_adult = no - } - } - modifier = { #They're a claimant against you - add = -70 - desc = AI_CLAIMANT_PENALTY - scope:actor = { - OR = { - any_targeting_faction = { - faction_type = claimant_faction - faction_is_at_war = yes - special_character ?= scope:recipient - } - AND = { - exists = var:claimant_faction_sent_demand - var:claimant_faction_sent_demand = scope:recipient - } - } - } - } - modifier = { #Rank difference. - add = { - value = -15 - if = { - limit = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 2 - } - } - } - add = 5 - } - if = { - limit = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 3 - } - } - } - add = 5 - } - if = { #King asking Baron, modifier becomes positive. - limit = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 4 - } - } - } - add = 10 - } - } - desc = AI_REFUSAL_RANK_DIFFERENCE - scope:recipient = { - is_ruler = yes - highest_held_title_tier < tier_kingdom - } - } - modifier = { - add = intimidated_external_reason_value - desc = INTIMIDATED_REASON - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - } - modifier = { - add = cowed_external_reason_value - desc = COWED_REASON - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - } - modifier = { #Comparative military strength. - add = { - value = 1 - subtract = { - value = scope:recipient.max_military_strength - divide = { value = scope:actor.max_military_strength min = 1 } - } - multiply = 100 - min = -1000 - # This max needs to match the loc in offer_vassalization_interaction_aibehavior_power_tt - max = 20 - } - desc = offer_vassalization_interaction_aibehavior_power_tt - scope:actor = { is_ruler = yes } - scope:recipient = { is_ruler = yes } - } - modifier = { #Rivalry modifier. - add = -50 - desc = offer_vassalization_interaction_aibehavior_rival_tt - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - modifier = { #Nemesis modifier. - add = -100 - desc = offer_vassalization_interaction_aibehavior_nemesis_tt - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - modifier = { - add = 10 - desc = GRANDEUR_REASON - scope:recipient = { has_royal_court = no } - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level >= 7 - court_grandeur_current_level < 9 - } - } - modifier = { - add = 20 - desc = GRANDEUR_REASON - scope:recipient = { has_royal_court = no } - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level >= 9 - } - } - modifier = { # Legalistic tradition - add = legalistic_vassal_punishment_acceptance - desc = tradition_legalistic_name - scope:actor = { - has_imprisonment_reason = scope:recipient - culture = { has_cultural_parameter = vassals_more_likely_accept_punishments } - } - } - } - - # AI - ai_targets = { - ai_recipients = peer_vassals - ai_recipients = scripted_relations - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_will_do = { - # You should have a _reason_ to try to imprison someone. - base = 0 - - # Additions. - ## Opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = 0.5 - } - ## Personality. - ai_value_modifier = { - ai_vengefulness = 1 - ai_boldness = 0.5 - } - ## Flag Management. - ### Make sure the AI uses hooks for this as it's % based - modifier = { - add = 1 - scope:hook = yes - } - ## Traits. - ### +++ Sadistic. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = greedy - } - ### +++ Vengeful. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = vengeful - } - ### ++ Just (under certain circumstances). - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = just - has_imprisonment_reason = scope:recipient - } - ### -- Compassionate. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = compassionate - } - ### --- Forgiving. - modifier = { - add = diarch_ai_desire_minus_3_value - has_trait = forgiving - } - ## We avoid wars here too, but only in the resulting event. - ## Agenda impact - modifier = { - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { phase_has_catalyst = catalyst_imprison_important } - has_character_flag = agenda_towards_escalation - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { phase_has_catalyst = catalyst_imprison_important } - } - } - add = -100 - } - } - any_character_struggle = { involvement = involved } - } - modifier = { - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { phase_has_catalyst = catalyst_imprison_detractor } - has_trait = fp3_struggle_supporter - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { phase_has_catalyst = catalyst_imprison_detractor } - } - } - add = -100 - } - } - any_character_struggle = { involvement = involved } - } - modifier = { - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { phase_has_catalyst = catalyst_imprison_supporter } - has_trait = fp3_struggle_detractor - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { phase_has_catalyst = catalyst_imprison_supporter } - } - } - add = -100 - } - } - any_character_struggle = { involvement = involved } - } - # Factors. - ## Relationships. - ### + Do pick on people we hate. - modifier = { - factor = 1.5 - should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### - Try not to pick on allies of our liege. - modifier = { - factor = 0.25 - should_avoid_hostile_action_against_due_to_liege_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### x0 Don't pick on our friends or allies. - modifier = { - factor = 0 - should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ### x0 Don't pick on people without due reason unless we really hate them. - #### Doesn't quite double up with the above factor increase for folks we hate - we want to prioritise them, but we also want to enable them for arbitrary punishment. - modifier = { - factor = 0 - NOR = { - has_imprisonment_reason = scope:recipient - has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } - # Sadists wants to torture folks. - has_trait = sadistic - # Agents get a time-out. - any_targeting_scheme = { - hostile_scheme_trigger = yes - is_scheme_agent_exposed = scope:recipient - } - # Prior crimes annoy people. - has_any_major_revenge_opinion_against_character_trigger = { CHARACTER = scope:recipient } - # Vengeful characters can be a pain over even minor matters. - AND = { - OR = { - has_trait = vengeful - ai_vengefulness >= very_high_positive_ai_value - } - has_any_petty_revenge_opinion_against_character_trigger = { CHARACTER = scope:recipient } - } - } - } - } -} - -# Diarch (actor) offers to boost the CA/TA/IB of liege (recipient), taking on the costs and negatives themselves so that they can use their diarch powers. -diarch_subsidise_crown_authority_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - notification_text = DIARCH_SUBSIDISE_AUTHORITY_PROPOSAL - icon = icon_contract_modification_single - - desc = diarch_subsidise_crown_authority_interaction_desc - - popup_on_receive = yes - pause_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - exists = liege - is_diarch_of_target = liege - liege_has_co_emperorship_trigger = no - liege = { has_diarchy_parameter = diarch_can_subsidise_liege_authority } - } - # Same sub-realm only. - OR = { - scope:actor.liege = scope:recipient - scope:recipient = { - any_liege_or_above = { this = scope:actor.liege } - } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = diarch_can_subsidise_liege_authority } - # Can't subisidise past the point needed. - custom_tooltip = { - text = diarch_subsidise_crown_authority_interaction.tt.cannot_subsidise_past_necessary - scope:recipient = { - NOT = { has_realm_law_flag = diarchs_want_to_subsidise_without_this_flag } - } - } - # And the liege can't have the max level of authority. - custom_tooltip = { - text = diarch_subsidise_crown_authority_interaction.tt.liege_cannot_have_max_authority - scope:recipient = { - NOT = { has_realm_law_flag = max_authority_level } - } - } - # Aaaand, if you're not tribal/administrative, we need to check some innovations. - scope:recipient = { - # CA0 -> CA1. - trigger_if = { - limit = { has_realm_law = crown_authority_0 } - can_pass_law_ca1_trigger = yes - } - # CA1 -> CA2. - trigger_if = { - limit = { has_realm_law = crown_authority_1 } - can_pass_law_ca2_trigger = yes - } - # CA2 -> CA3. - trigger_if = { - limit = { has_realm_law = crown_authority_2 } - can_pass_law_ca3_trigger = yes - } - - # If the liege is administrative, they have to be independent. - trigger_if = { - limit = { government_allows = administrative } - is_independent_ruler = yes - } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - # Why the hell not? If your liege dies several times in quick succession, sure, centralise all the power you like. That'll go well. - cooldown_against_recipient = { years = 10 } - - cost = { - prestige = { - value = scope:recipient.increase_crown_authority_prestige_cost - multiply = subsidised_liege_authority_discount_value - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = diarch_subsidise_crown_authority_interaction.tt.accepted - left_icon = scope:recipient - scope:recipient = { - # Try to change authority. - increase_crown_authority_effect = yes - increase_tribal_authority_effect = yes - increase_imperial_bureaucracy_effect = yes - # No one blames the liege for this. - add_character_modifier = { - modifier = liege_authority_boost_has_scapegoat_modifier - years = 10 - } - } - # Aaaaand everyone knows what you did. - change_strife_opinion = massive_strife_gain - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = diarch_subsidise_crown_authority_interaction.tt.declined - left_icon = scope:recipient - add_opinion = { - target = scope:recipient - modifier = refusal_opinion - opinion = -20 - } - } - } - } - - ai_accept = { - base = 0 - - # You want to do _what_? For free? - modifier = { - add = 100 - desc = diarch_subsidise_crown_authority_interaction.tt.absolutely_yes_please - always = yes - } - } - - auto_accept = { - custom_description = { - text = auto_accept_interaction_ai - object = scope:recipient - scope:recipient = { - is_ai = yes - } - } - } - - # AI - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 24 - } - ai_potential = { - is_diarch = yes - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - # You also need prestige left over afterwards to use other interactions, so make sure the AI doesn't bankrupt itself on this. - prestige >= { - value = liege.increase_crown_authority_prestige_cost - multiply = subsidised_liege_authority_discount_value - add = major_prestige_value - } - } - - ai_will_do = { - base = 0 - - # Government situation. - ## Does your liege's gubermint allow you to bully people and take their stuff? No? Then you want to take this interaction; anyone who wouldn't has been pre-filtered. - modifier = { - add = 1000 - liege = { - NOR = { - has_realm_law_flag = title_revocation_allowed - has_realm_law_flag = vassal_retraction_allowed - } - } - } - } -} - -# Diarch (actor) requests an adjustment of liege's (recipient's) IB, taking on the costs and negatives themselves _or_ reducing their strife, depending on whether they boost centralisation or decrease it. -diarch_adjust_bureaucracy_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - interface_priority = 9 - notification_text = { - first_valid = { - # Decentralise. - triggered_desc = { - trigger = { scope:decrease_centralisation = yes } - desc = DIARCH_ADJUST_BUREAUCRACY_PROPOSAL.DECENTRALISE - } - # Centralise. - desc = DIARCH_ADJUST_BUREAUCRACY_PROPOSAL.CENTRALISE - } - } - icon = icon_contract_modification_single - - desc = diarch_adjust_bureaucracy_interaction_desc - - popup_on_receive = yes - pause_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - exists = liege - is_diarch_of_target = liege - liege_has_co_emperorship_trigger = yes - liege = { has_diarchy_parameter = unlock_adjust_imperial_bureaucracy_interaction } - } - # Same sub-realm only. - OR = { - scope:actor.liege = scope:recipient - scope:recipient = { - any_liege_or_above = { this = scope:actor.liege } - } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_adjust_imperial_bureaucracy_interaction } - # And the liege can't have the max level of authority. - custom_tooltip = { - text = diarch_subsidise_crown_authority_interaction.tt.liege_cannot_have_max_authority - scope:recipient = { - NOT = { has_realm_law_flag = max_authority_level } - } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - # Co-emperors can't keep doing this in quick succession. - cooldown = { years = 10 } - - cost = { - prestige = { - value = scope:recipient.increase_crown_authority_prestige_cost - if = { - limit = { scope:increase_centralisation = yes } - multiply = subsidised_liege_authority_discount_value - } - else = { multiply = lowered_liege_authority_discount_value } - } - } - - # Increase IB - send_option = { - flag = increase_centralisation - is_valid = { - scope:recipient = { - NOT = { has_realm_law = imperial_bureaucracy_3 } - } - } - localization = increase_centralisation_name - current_description = increase_centralisation - starts_enabled = { always = yes } - } - # Decrease IB - ## The AI doesn't use this. - send_option = { - flag = decrease_centralisation - is_valid = { - scope:recipient = { - NOT = { has_realm_law = imperial_bureaucracy_0 } - } - } - localization = decrease_centralisation_name - current_description = decrease_centralisation - } - - on_send = { - # Tell the AI to set their only send option. - if = { - limit = { - scope:actor = { is_ai = yes } - } - save_scope_value_as = { - name = increase_centralisation - value = yes - } - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = diarch_subsidise_crown_authority_interaction.tt.accepted - left_icon = scope:recipient - scope:recipient = { - # Try to change authority. - if = { - limit = { scope:increase_centralisation = yes } - increase_imperial_bureaucracy_effect = yes - # No one blames the liege for this. - add_character_modifier = { - modifier = liege_authority_boost_has_scapegoat_modifier - years = 10 - } - } - else = { decrease_imperial_bureaucracy_effect = yes } - } - # Aaaaand everyone knows what you did. - ## For good. - if = { - limit = { scope:increase_centralisation = yes } - change_strife_opinion = massive_strife_gain - } - ## Or for ill. - else = { change_strife_opinion = massive_strife_loss } - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = diarch_subsidise_crown_authority_interaction.tt.declined - left_icon = scope:recipient - add_opinion = { - target = scope:recipient - modifier = refusal_opinion - opinion = -20 - } - } - } - } - - ai_accept = { - base = -25 - - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - # Your level of influence. - ## Impotent - modifier = { - add = -10 - desc = AI_OPINION_INFLUENCE_LEVEL_IMPOTENT - scope:actor.influence_level = 0 - } - ## Influential - ### Would be zero, so it wouldn't appear. - ## Persuasive - modifier = { - add = 10 - desc = AI_OPINION_INFLUENCE_LEVEL_PERSUASIVE - scope:actor.influence_level = 2 - } - ## Controlling - modifier = { - add = 20 - desc = AI_OPINION_INFLUENCE_LEVEL_CONTROLLING - scope:actor.influence_level = 3 - } - ## Authoritative - modifier = { - add = 30 - desc = AI_OPINION_INFLUENCE_LEVEL_AUTHORITATIVE - scope:actor.influence_level = 4 - } - ## Imperious - modifier = { - add = 40 - desc = AI_OPINION_INFLUENCE_LEVEL_IMPERIOUS - scope:actor.influence_level = 5 - } - # Traits. - ## --- Arrogant - modifier = { - add = -30 - desc = ai_acceptance_trait_arrogant - scope:recipient = { has_trait = arrogant } - } - ## --- Ambitious - modifier = { - add = -30 - desc = ai_acceptance_trait_ambitious - scope:recipient = { has_trait = ambitious } - } - ## --- Stubborn - modifier = { - add = -30 - desc = ai_acceptance_trait_stubborn - scope:recipient = { has_trait = stubborn } - } - ## -- Paranoid - modifier = { - add = -20 - desc = ai_acceptance_trait_paranoid - scope:recipient = { has_trait = paranoid } - } - ## + Craven - modifier = { - add = 10 - desc = ai_acceptance_trait_craven - scope:recipient = { has_trait = craven } - } - ## ++ Trusting - modifier = { - add = 20 - desc = ai_acceptance_trait_trusting - scope:recipient = { has_trait = trusting } - } - ## ++ Fickle - modifier = { - add = 20 - desc = ai_acceptance_trait_fickle - scope:recipient = { has_trait = fickle } - } - ## +++ Content - modifier = { - add = 30 - desc = ai_acceptance_trait_content - scope:recipient = { has_trait = content } - } - ## +++ Humble - modifier = { - add = 30 - desc = ai_acceptance_trait_humble - scope:recipient = { has_trait = humble } - } - # Factor for personality. - ai_value_modifier = { - who = scope:recipient - # The meeker they are, the more they'll go along with your wishes. - ai_boldness = { - if = { - limit = { - scope:recipient = { - NOT = { ai_boldness = 0 } - } - } - value = -1 - } - } - # And the lazier. - ai_energy = { - if = { - limit = { - scope:recipient = { ai_energy > 0 } - } - value = 0.5 - } - } - } - } - - auto_accept = { - custom_description = { - text = auto_accept_interaction_ai - object = scope:recipient - scope:recipient = { - is_ai = yes - scope:increase_centralisation = yes - } - } - } - - # AI - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 24 - hegemony = 24 - } - ai_potential = { - is_diarch = yes - liege_has_co_emperorship_trigger = yes - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - # You also need prestige left over afterwards to use other interactions, so make sure the AI doesn't bankrupt itself on this. - prestige >= { - value = liege.increase_crown_authority_prestige_cost - multiply = subsidised_liege_authority_discount_value - add = major_prestige_value - } - } - - ai_will_do = { - base = 0 - - # Government situation. - ## Does your liege's gubermint allow you to bully people and take their stuff? No? Then you want to take this interaction; anyone who wouldn't has been pre-filtered. - modifier = { - add = 1000 - liege = { - NOR = { - has_realm_law_flag = title_revocation_allowed - has_realm_law_flag = vassal_retraction_allowed - } - } - } - # Otherwise, there's just a slight constant chance based on energy. - ai_value_modifier = { - ai_energy = 2 - # Assuming you're the heir, as otherwise... - trigger = { liege.player_heir ?= root } - } - } -} - - - - - - - - - - - -################################################## -# ANCILLARY DIARCH POWERS - -# Diarch (actor) either tests learning or spends prestige to gain an unpressed claim on a title held by a vassal of their liege (recipient). -diarch_legal_meddling_interaction = { - category = interaction_category_diarch - common_interaction = yes - interface_priority = 165 - diarch_interaction = yes - icon = vassal_claim_liege_title_interaction - - desc = diarch_legal_meddling_interaction_desc - - ai_intermediary_maybe = yes - target_type = title - target_filter = recipient_domain_titles - popup_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - liege = { has_diarchy_parameter = unlock_legal_meddling_interaction } - } - # Make sure scope:recipient is suitable. - scope:recipient = { - # We only target vassals of the liege... - liege = scope:actor.liege - this != scope:actor.liege - # ... who are appropriately landed. - is_landed_or_landless_administrative = yes - scope:recipient.highest_held_title_tier >= tier_county - } - } - - is_valid_showing_failures_only = { - # You can't claim a title from someone if you already have claims on all their titles. - custom_tooltip = { - text = diarch_legal_meddling_interaction.tt.they_must_have_at_least_one_unclaimed_title - scope:recipient = { - any_held_title = { - diarch_legal_meddling_claimable_title_trigger = { ACTOR = scope:actor } - } - } - } - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_a_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_legal_meddling_interaction } - } - # Must select something. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = interactions_general.tt.must_select_one_option - OR = { - scope:diarch_legal_meddling_interaction_duel_learning = yes - scope:diarch_legal_meddling_interaction_pay_prestige_partial = yes - scope:diarch_legal_meddling_interaction_pay_prestige_full = yes - } - } - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - cooldown = { months = 6 } - cooldown_against_recipient = { years = 3 } - - can_be_picked_title = { - scope:target = { - # Really anything you don't already have a claim on and which isn't special. - diarch_legal_meddling_claimable_title_trigger = { ACTOR = scope:actor } - } - } - - # Attempt Methods - send_options_exclusive = yes - ## Duel for it. - send_option = { - # You can always try to duel for it. - flag = diarch_legal_meddling_interaction_duel_learning - } - ## Pay partial prestige. - send_option = { - is_valid = { - scope:actor = { - prestige >= { - value = legal_meddling_interaction_title_discounted_cost_value - multiply = -1 - } - } - } - flag = diarch_legal_meddling_interaction_pay_prestige_partial - } - ## Pay full prestige. - send_option = { - is_valid = { - scope:actor = { - prestige >= { - value = legal_meddling_interaction_title_cost_value - multiply = -1 - } - } - } - flag = diarch_legal_meddling_interaction_pay_prestige_full - } - - on_send = { - # Did a landless diarch send this? - log_diarch_send_interaction_as_variable_effect = { INTERACTION = forge_claim } - } - - on_accept = { - scope:actor = { - # Resolution method. - ## If we're duelling, then we duel. - if = { - limit = { scope:diarch_legal_meddling_interaction_duel_learning = yes } - # Now: FIGHT! WITH WORDS! - duel = { - skill = learning - target = scope:recipient - # Victory! A claim for you. - 50 = { - compare_modifier = { - value = scope:duel_value - multiplier = 3.5 - min = -49 - } - desc = diarch_legal_meddling_interaction.tt.success - diarch_legal_meddling_interaction_apply_success_effect = yes - } - # Defeat! Into the loser's bin you go. - 50 = { - compare_modifier = { - value = scope:duel_value - multiplier = -3.5 - min = -49 - } - desc = diarch_legal_meddling_interaction.tt.failure - diarch_legal_meddling_interaction_apply_fail_effect = yes - } - } - } - ## Otherwise we can take an uneven gamble against a reduced prestige cost.. - else_if = { - limit = { scope:diarch_legal_meddling_interaction_pay_prestige_partial = yes } - random_list = { - # Victory! A claim for you. - 100 = { - desc = diarch_legal_meddling_interaction.tt.success - diarch_legal_meddling_interaction_apply_success_effect = yes - } - # Defeat! Into the loser's bin you go. - 100 = { - desc = diarch_legal_meddling_interaction.tt.failure - diarch_legal_meddling_interaction_apply_fail_effect = yes - } - } - } - ## Or pay the full price. - else = { - custom_tooltip = diarch_legal_meddling_interaction.tt.success - diarch_legal_meddling_interaction_apply_success_effect = yes - } - } - - # Debug logging. - debug_log = debug_log.legal_meddling.attempt_made - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = peer_vassals } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_potential = { - is_diarch = yes - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - # We're generally ruthless here. - base = @ai_core_loop_base_value - - # Additions. - ## Weight for opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -1 - } - ## Weight for personality. - ai_value_modifier = { - ai_boldness = 0.25 - ai_greed = 0.5 - ai_honor = 0.5 - } - ## Flag Management. - ### Duel for it if we're massively superior. - modifier = { - add = 100 - scope:diarch_legal_meddling_interaction_duel_learning = yes - learning_diff = { - target = scope:recipient - value >= @ai_skill_diff_upper_threshold - } - } - ### Else we'll try to pay full prestige, if we've got lots to spare. - modifier = { - add = 50 - scope:diarch_legal_meddling_interaction_pay_prestige_full = yes - prestige >= { - value = shift_privileges_interaction_target_cost_value - multiply = @ai_prestige_bank_threshold - } - } - ### Or else we'll to chance it, if we can afford that + some slack. - modifier = { - add = 25 - scope:diarch_legal_meddling_interaction_pay_prestige_partial = yes - prestige < { - value = shift_privileges_interaction_target_cost_value - multiply = @ai_prestige_bank_threshold - } - prestige >= { - value = shift_privileges_interaction_target_discounted_cost_value - multiply = @ai_prestige_bank_threshold - } - } - ### Otherwise we'll risk a regular duel. - ## Weight up for bordering or de jure areas. - modifier = { - add = 50 - is_landed_or_landless_administrative = yes - any_sub_realm_county = { - any_neighboring_county = { - holder = { - OR = { - this = scope:recipient - any_liege_or_above = { this = scope:recipient } - } - } - } - } - } - modifier = { - add = 50 - is_landed_or_landless_administrative = yes - scope:actor = { - any_held_title = { - any_direct_de_jure_vassal_title = { - holder ?= { - OR = { - this = scope:recipient - this = { - any_liege_or_above = { this = scope:recipient } - } - } - } - } - } - } - } - ## Weight down for folks outside of our de jure kingdom. - modifier = { - add = -100 - is_landed_or_landless_administrative = yes - scope:recipient.primary_title.de_jure_liege ?= { - this != scope:actor.primary_title.de_jure_liege - } - } - ## Landless characters want land, but also want to focus on taking from those who might give it up. - ### So we prioritise hooked AI counts. - modifier = { - add = 100 - is_landed = no - has_hook = scope:recipient - scope:recipient = { - highest_held_title_tier = tier_county - is_ai = yes - } - } - ### Then just hooked AI. - modifier = { - add = 50 - is_landed = no - has_hook = scope:recipient - scope:recipient = { is_ai = yes } - } - # Factors. - ## + Weight up if we're lacking valid claims - modifier = { - factor = 1.5 - NOR = { - is_claimant = yes - any_claim = { - exists = holder - exists = holder.liege - holder.liege = scope:actor.liege - } - } - } - ## + Do pick on people we hate. - modifier = { - factor = 1.5 - should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## + If we're landless, turbo charge this when we lack suitable claims. - modifier = { - factor = 3 - scope:actor = { - is_ruler = no - any_claim = { - count < @ai_threshold_for_revoke_cyle - diarch_legal_meddling_claimable_title_trigger = { ACTOR = scope:actor } - } - } - } - ## + If we're landless, try to prioritise anyone we've got a hook on. - modifier = { - factor = 2 - scope:actor = { - is_ruler = no - has_usable_hook = scope:recipient - } - } - ## - Try not to pick on allies of our liege. - modifier = { - factor = 0.25 - should_avoid_hostile_action_against_due_to_liege_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## x0 Don't pick on our friends or allies. - modifier = { - factor = 0 - should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## x0 Don't pick on players unless they're of at least a decent size. - modifier = { - factor = 0 - scope:recipient = { - is_ai = no - any_held_county = { count <= 3 } - } - } - ## x0 If we're landless, don't claim more titles if we've already got enough we can try to action. - modifier = { - factor = 0 - scope:actor = { - is_ruler = no - any_claim = { - count >= @ai_threshold_for_revoke_cyle - diarch_legal_meddling_claimable_title_trigger = { ACTOR = scope:actor } - } - } - } - ## x0 If we're landless, don't pick on people who won't give their lands up. - modifier = { - factor = 0 - scope:actor = { is_ruler = no } - scope:recipient = { - any_held_county = { count <= 1 } - } - } - ### x0 Don't go into prestige debt! - modifier = { - factor = 0 - prestige < 0 - } - } -} - -# Diarch (actor) either tests stewardship or spends prestige to gain gold at the expense of negative modifiers delivered to the liege (recipient). -diarch_syphon_treasury_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - icon = icon_gold - common_interaction = yes - - desc = diarch_syphon_treasury_interaction_desc - - - interface_priority = 60 - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - liege = { has_diarchy_parameter = unlock_syphon_treasury_interaction } - } - # Make sure scope:recipient is suitable. - scope:recipient = { - OR = { - # We only target the liege... - this = scope:actor.liege - # ... but we want to see it for peer-vassals and such. - any_liege_or_above = { this = scope:actor.liege } - } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # If scope:actor's stewardship is too crap, then we need to make sure they haven't somehow managed to riddle scope:recipient's lands with negative modifiers already. - trigger_if = { - limit = { scope:actor.stewardship < syphon_treasury_stewardship_medium } - custom_tooltip = { - text = diarch_syphon_treasury_interaction.tt.not_enough_marks_or_stewardship - scope:recipient = { - any_held_county = { diarch_syphon_treasury_embezzlement_modifiers_trigger = no } - } - } - } - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_a_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_syphon_treasury_interaction } - } - # Must have selected an amount to embezzle. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = diarch_interactions.tt.must_embezzle_something - OR = { - scope:diarch_syphon_treasury_sum_small = yes - scope:diarch_syphon_treasury_sum_medium = yes - scope:diarch_syphon_treasury_sum_large = yes - scope:diarch_syphon_treasury_sum_huge = yes - } - } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - cooldown = { years = 3 } - - # Attempt Methods - send_options_exclusive = yes - ## Steal a small sum. - ### Bonus to scope:actor. - send_option = { - flag = diarch_syphon_treasury_sum_small - # We're doing gross overrides here so that we don't need to relocalise some perfectly good stuff. - localization = diarch_syphon_treasury_sum_small_name - current_description = diarch_syphon_treasury_sum_small - } - ## Steal a moderate sum. - ### No bonus, no malus. - send_option = { - flag = diarch_syphon_treasury_sum_medium - # We're doing gross overrides here so that we don't need to relocalise some perfectly good stuff. - localization = diarch_syphon_treasury_sum_medium_name - current_description = diarch_syphon_treasury_sum_medium - starts_enabled = { always = yes } - } - ## Steal a large sum. - ### Malus to scope:actor - send_option = { - flag = diarch_syphon_treasury_sum_large - # We're doing gross overrides here so that we don't need to relocalise some perfectly good stuff. - localization = diarch_syphon_treasury_sum_large_name - current_description = diarch_syphon_treasury_sum_large - } - ## Steal a _huge_sum. - ### _Huge_ malus to scope:actor. - send_option = { - flag = diarch_syphon_treasury_sum_huge - # We're doing gross overrides here so that we don't need to relocalise some perfectly good stuff. - localization = diarch_syphon_treasury_sum_huge_name - current_description = diarch_syphon_treasury_sum_huge - } - - on_send = { - # Did a landless diarch send this? - log_diarch_send_interaction_as_variable_effect = { INTERACTION = embezzle } - } - - on_accept = { - # Time for a skill duel! - scope:actor = { - duel = { - skill = stewardship - value = syphon_treasury_duel_target_value - # Victory! Gold for scope:actor, maluses for the liege. - 50 = { - compare_modifier = { - value = scope:duel_value - multiplier = 3.5 - min = -49 - } - # Bonus for smaller amounts. - modifier = { - add = 25 - always = scope:diarch_syphon_treasury_sum_small - } - # You always have some kind of a chance. - min = 10 - desc = diarch_syphon_treasury_interaction.tt.success - # Inform scope:actor what type of embezzlement they'll be pursuing. - ## Very high stewardship characters syphon development growth from a few counties. - if = { - limit = { - stewardship >= syphon_treasury_stewardship_very_high - NOT = { government_has_flag = government_is_nomadic } - } - custom_tooltip = diarch_syphon_treasury_interaction.tt.success.syphon_development_growth - } - ## Alternatively, herd for nomadic rulers - else_if = { - limit = { - stewardship >= syphon_treasury_stewardship_very_high - government_has_flag = government_is_nomadic - } - custom_tooltip = diarch_syphon_treasury_interaction.tt.success.syphon_herd - } - ## High stewardship characters syphon some control from various counties. - else_if = { - limit = { stewardship >= syphon_treasury_stewardship_high } - custom_tooltip = diarch_syphon_treasury_interaction.tt.success.syphon_control_several_counties - } - ## Medium stewardship characters syphon lots of control from one county. - else_if = { - limit = { stewardship >= syphon_treasury_stewardship_medium } - custom_tooltip = diarch_syphon_treasury_interaction.tt.success.syphon_control_county - } - ## Low stewardship characters apply county modifiers. - else = { custom_tooltip = diarch_syphon_treasury_interaction.tt.success.apply_county_modifier } - # Now we sort the actual effects. - ## A nice toast to tell us about our new gold. - send_interface_toast = { - type = event_toast_effect_good - title = diarch_syphon_treasury_interaction.tt.success - left_icon = scope:recipient - # Transfer gold. - ## Small amount. - if = { - limit = { always = scope:diarch_syphon_treasury_sum_small } - give_or_update_embezzler_secret_effect = { - TARGET = scope:recipient - STAKE = syphon_treasury_gold_gain_low - } - add_gold = syphon_treasury_gold_gain_low - } - ## Medium amount. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_medium } - give_or_update_embezzler_secret_effect = { - TARGET = scope:recipient - STAKE = syphon_treasury_gold_gain_medium - } - add_gold = syphon_treasury_gold_gain_medium - } - ## Large amount. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_large } - give_or_update_embezzler_secret_effect = { - TARGET = scope:recipient - STAKE = syphon_treasury_gold_gain_high - } - add_gold = syphon_treasury_gold_gain_high - } - ## Huge amount. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_huge } - give_or_update_embezzler_secret_effect = { - TARGET = scope:recipient - STAKE = syphon_treasury_gold_gain_very_high - } - add_gold = syphon_treasury_gold_gain_very_high - } - } - ## Plus the maluses for the liege. - scope:recipient = { - # Very high stewardship characters syphon development growth from a few counties. - if = { - limit = { scope:actor.stewardship >= syphon_treasury_stewardship_very_high } - # Gold transfer was... - ## Very high. - if = { - limit = { always = scope:diarch_syphon_treasury_sum_huge } - diarch_syphon_treasury_interaction_syphon_development_growth_effect = { LOSS = massive_development_progress_loss } - } - ## High. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_large } - diarch_syphon_treasury_interaction_syphon_development_growth_effect = { LOSS = major_development_progress_loss } - } - ## Medium. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_medium } - diarch_syphon_treasury_interaction_syphon_development_growth_effect = { LOSS = medium_development_progress_loss } - } - ## Low. - else = { - diarch_syphon_treasury_interaction_syphon_development_growth_effect = { LOSS = minor_development_progress_loss } - } - } - # Alternatively, for nomadic rulers, we steal some herd - else_if = { - limit = { scope:actor.stewardship >= syphon_treasury_stewardship_very_high government_has_flag = government_is_nomadic } - # Gold transfer was... - ## Very high. - if = { - limit = { always = scope:diarch_syphon_treasury_sum_huge } - scope:recipient = { - domicile ?= { change_herd = monumental_herd_loss } - } - } - ## High. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_large } - scope:recipient = { - domicile ?= { change_herd = massive_herd_loss } - } - } - ## Medium. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_medium } - scope:recipient = { - domicile ?= { change_herd = major_herd_loss } - } - } - ## Low. - else = { - scope:recipient = { - domicile ?= { change_herd = medium_herd_loss } - } - } - } - # High stewardship characters syphon some control from various counties. - else_if = { - limit = { scope:actor.stewardship >= syphon_treasury_stewardship_high } - # Gold transfer was... - ## Very high. - if = { - limit = { always = scope:diarch_syphon_treasury_sum_huge } - diarch_syphon_treasury_interaction_syphon_control_effect = { LOSS = monumental_county_control_loss } - } - ## High. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_large } - diarch_syphon_treasury_interaction_syphon_control_effect = { LOSS = extreme_county_control_loss } - } - ## Medium. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_medium } - diarch_syphon_treasury_interaction_syphon_control_effect = { LOSS = major_county_control_loss } - } - ## Low. - else = { - diarch_syphon_treasury_interaction_syphon_control_effect = { LOSS = medium_county_control_loss } - } - } - # Medium stewardship characters syphon lots of control from one county. - else_if = { - limit = { scope:actor.stewardship >= syphon_treasury_stewardship_medium } - # Gold transfer was... - ## Very high. - if = { - limit = { always = scope:diarch_syphon_treasury_sum_huge } - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { - this != scope:recipient.capital_county - } - alternative_limit = { always = yes } - change_county_control = monumental_county_control_loss - } - } - ## High. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_large } - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { - this != scope:recipient.capital_county - } - alternative_limit = { always = yes } - change_county_control = extreme_county_control_loss - } - } - ## Medium. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_medium } - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { - this != scope:recipient.capital_county - } - alternative_limit = { always = yes } - change_county_control = major_county_control_loss - } - } - ## Low. - else = { - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { - this != scope:recipient.capital_county - } - alternative_limit = { always = yes } - change_county_control = medium_county_control_loss - } - } - } - # Low stewardship characters apply county modifiers. - else = { - # Gold transfer was... - ## Very high. - if = { - limit = { always = scope:diarch_syphon_treasury_sum_huge } - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { diarch_syphon_treasury_embezzlement_modifiers_trigger = no } - add_county_modifier = { - modifier = syphon_treasury_massive_sum_modifier - years = 5 - } - } - } - ## High. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_large } - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { diarch_syphon_treasury_embezzlement_modifiers_trigger = no } - add_county_modifier = { - modifier = syphon_treasury_large_sum_modifier - years = 5 - } - } - } - ## Medium. - else_if = { - limit = { always = scope:diarch_syphon_treasury_sum_medium } - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { diarch_syphon_treasury_embezzlement_modifiers_trigger = no } - add_county_modifier = { - modifier = syphon_treasury_medium_sum_modifier - years = 5 - } - } - } - ## Low. - else = { - random_held_county = { - # Try to prefer against the capital, as that's more noticeable. - limit = { diarch_syphon_treasury_embezzlement_modifiers_trigger = no } - add_county_modifier = { - modifier = syphon_treasury_small_sum_modifier - years = 5 - } - } - } - } - } - } - # Defeat! No gold, just strife & a crime opinion. - 50 = { - compare_modifier = { - value = scope:duel_value - multiplier = -3.5 - min = -49 - } - # Malus for higher amounts. - modifier = { - add = 25 - always = scope:diarch_syphon_treasury_sum_large - } - # Chungus malus for chungus higher amounts. - modifier = { - add = 100 - always = scope:diarch_syphon_treasury_sum_huge - } - # You can always fail. - min = 20 - desc = diarch_syphon_treasury_interaction.tt.failure.actor - send_interface_toast = { - type = event_toast_effect_bad - title = diarch_syphon_treasury_interaction.tt.failure.actor - left_icon = scope:recipient - show_as_tooltip = { diarch_syphon_treasury_interaction_caught_embezzling_effect = yes } - } - hidden_effect = { - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_neutral - title = diarch_syphon_treasury_interaction.tt.failure.recipient - left_icon = scope:actor - diarch_syphon_treasury_interaction_caught_embezzling_effect = yes - } - } - } - } - } - } - - # Debug logging. - debug_log = debug_log.syphon_treasury.attempt_made - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 24 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_potential = { - is_diarch = yes - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - # Honest and generous characters never embezzle. - NOR = { - has_trait = honest - has_trait = generous - } - } - - ai_will_do = { - # Embezzlement is serious, so you need actual reasons for it. - base = 0 - - # Additions. - ## Weight for opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -1 - } - ## Weight for personality. - ai_value_modifier = { - ai_boldness = 0.25 - ai_greed = 1 - ai_honor = -0.5 - } - ## Flag Management. - ### The AI never goes for a huge sum, that's just there to tempt the player. - ### We prefer a large sum if we've got a massive skill disparity. - modifier = { - add = 100 - scope:diarch_syphon_treasury_sum_large = yes - stewardship_diff = { - target = scope:recipient - value >= @ai_skill_diff_upper_threshold - } - } - ### But a moderate sum does well if we're more evenly matched. - modifier = { - add = 50 - scope:diarch_syphon_treasury_sum_medium = yes - stewardship_diff = { - target = scope:recipient - value < @ai_skill_diff_upper_threshold - } - stewardship_diff = { - target = scope:recipient - value >= @ai_skill_diff_lower_threshold - } - } - ### Aaaand otherwise we'll accept a small amount. - modifier = { - add = 25 - scope:diarch_syphon_treasury_sum_small = yes - stewardship_diff = { - target = scope:recipient - value < @ai_skill_diff_lower_threshold - } - } - ## Less likely in tribal societies with less bookwork to hide theft in. - modifier = { - add = -50 - scope:recipient = { government_has_flag = government_is_tribal } - } - ## Debt is a great motivator for theft. - ### Is slightly in debt. - modifier = { - add = 10 - debt_level = 1 - } - ### Is one year in debt. - modifier = { - add = 25 - debt_level = 2 - } - ### Is two years in debt. - modifier = { - add = 40 - debt_level = 3 - } - ### Is three years in debt. - modifier = { - add = 60 - debt_level = 4 - } - ### Is four years in debt. - modifier = { - add = 100 - debt_level = 5 - } - ### Is over five years in debt. - modifier = { - add = 200 - debt_level >= 6 - } - ## Certain traits can affect likelihood directly. - ### It's intentional that these don't sync up value-wise with their opposite traits. - ### Honest/generous excluded because they're hard locked out of the interaction for the AI. - ### +++ Greedy. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = greedy - } - ### ++ Deceitful. - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = deceitful - } - ### + Arbitrary. - modifier = { - add = diarch_ai_desire_plus_1_value - has_trait = arbitrary - } - ### -- Just. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = just - } - ## Skill considerations. - ### Very low negative comparative stewardship. - modifier = { - add = -50 - stewardship_diff = { - target = scope:recipient - value <= 10 - } - # Filter out arrogant characters, who can't believe they suck. - NOT = { has_trait = arrogant } - } - ### Low negative comparative stewardship. - modifier = { - add = -25 - stewardship_diff = { - target = scope:recipient - value <= 5 - } - # Filter out arrogant characters, who can't believe they suck. - NOT = { has_trait = arrogant } - } - ### High positive comparative stewardship. - modifier = { - add = 25 - stewardship_diff = { - target = scope:recipient - value >= 5 - } - # Filter out humble characters, who give their liege too much credit. - NOT = { has_trait = humble } - } - ### Very high positive comparative stewardship. - modifier = { - add = 50 - stewardship_diff = { - target = scope:recipient - value >= 10 - } - # Filter out humble characters, who give their liege too much credit. - NOT = { has_trait = humble } - } - # Factors. - ## + Do pick on people we hate. - modifier = { - factor = 1.5 - should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## x0 Don't pick on our friends or allies. - modifier = { - factor = 0 - should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## We're happy to bully players here, since we're not taking their land. - } -} - -# Diarch (actor) either tests diplomacy or spends prestige to give negative modifiers to the lands of a vassal of their liege (secondary recipient), who can't resist. -diarch_shift_privileges_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - icon = icon_shift_privileges - common_interaction = yes - - ai_intermediary_maybe = yes - desc = diarch_shift_privileges_interaction_desc - - popup_on_receive = yes - - interface_priority = 285 - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - liege = { has_diarchy_parameter = unlock_shift_privileges_interaction } - } - # Make sure scope:recipient is suitable. - scope:recipient = { - # We only target vassals of the liege... - liege = scope:actor.liege - this != scope:actor.liege - # ... who are appropriately landed. - is_landed_or_landless_administrative = yes - scope:recipient.highest_held_title_tier >= tier_county - } - } - - is_valid_showing_failures_only = { - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Diarch revocations require a claim. - custom_tooltip = { - text = diarch_shift_privileges_interaction.tt.no_affectable_counties - scope:recipient = { - any_held_county = { diarch_shift_privileges_valid_target_title_trigger = yes } - } - } - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_an_entrenched_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_shift_privileges_interaction } - } - # Must select something. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = interactions_general.tt.must_select_one_option - OR = { - scope:diarch_shift_privileges_interaction_duel_diplomacy = yes - scope:diarch_shift_privileges_interaction_pay_prestige_partial = yes - scope:diarch_shift_privileges_interaction_pay_prestige_full = yes - } - } - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - cooldown = { months = 6 } - cooldown_against_recipient = { years = 3 } - - # Attempt Methods - send_options_exclusive = yes - ## Duel for it. - send_option = { - # You can always try to duel for it. - flag = diarch_shift_privileges_interaction_duel_diplomacy - } - ## Pay partial prestige. - send_option = { - is_valid = { - scope:actor = { - prestige >= { - value = shift_privileges_interaction_target_discounted_cost_value - multiply = -1 - } - } - } - flag = diarch_shift_privileges_interaction_pay_prestige_partial - } - ## Pay full prestige. - send_option = { - is_valid = { - scope:actor = { - prestige >= { - value = shift_privileges_interaction_target_cost_value - multiply = -1 - } - } - } - flag = diarch_shift_privileges_interaction_pay_prestige_full - } - - on_send = { - # Did a landless diarch send this? - log_diarch_send_interaction_as_variable_effect = { INTERACTION = shift_privileges } - } - - on_accept = { - scope:actor = { - # Resolution method. - ## If we're duelling, then we duel. - if = { - limit = { scope:diarch_shift_privileges_interaction_duel_diplomacy = yes } - # Now: FIGHT! WITH WORDS! - duel = { - skill = diplomacy - target = scope:recipient - # Victory! Cash for you, negative modifier for your opponent. - 50 = { - compare_modifier = { - value = scope:duel_value - multiplier = 3.5 - min = -49 - } - desc = diarch_shift_privileges_interaction.tt.success - diarch_shift_privileges_interaction_apply_success_effect = yes - } - # Defeat! Into the loser's bin you go. - 50 = { - compare_modifier = { - value = scope:duel_value - multiplier = -3.5 - min = -49 - } - desc = diarch_shift_privileges_interaction.tt.failure - diarch_shift_privileges_interaction_apply_fail_effect = yes - } - } - } - ## Otherwise we can take an even gamble against a reduced prestige cost.. - else_if = { - limit = { scope:diarch_shift_privileges_interaction_pay_prestige_partial = yes } - random_list = { - # Victory! A claim for you. - 100 = { - desc = diarch_shift_privileges_interaction.tt.success - diarch_shift_privileges_interaction_apply_success_effect = yes - } - # Defeat! Into the loser's bin you go. - 100 = { - desc = diarch_shift_privileges_interaction.tt.failure - diarch_shift_privileges_interaction_apply_fail_effect = yes - } - } - } - ## Or pay the full price. - else = { - custom_tooltip = diarch_shift_privileges_interaction.tt.success - diarch_shift_privileges_interaction_apply_success_effect = yes - } - # Prestige costs. - ## Point out the lack of cost. - if = { - limit = { scope:diarch_shift_privileges_interaction_duel_diplomacy = yes } - custom_tooltip = diarch_interaction_pay_prestige_none - } - ## Point out the discount. - else_if = { - limit = { scope:diarch_shift_privileges_interaction_pay_prestige_partial = yes } - add_prestige = shift_privileges_interaction_target_discounted_cost_value - } - ## Soz mate, yerr payin' full price. - else = { add_prestige = shift_privileges_interaction_target_cost_value } - tgp_activate_catalyst_against_hegemon_effect = { - HEGEMON = scope:actor.top_liege - CATALYST = catalyst_diarch_mandate - } - } - - # Debug logging. - debug_log = debug_log.shift_privileges.attempt_made - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = peer_vassals } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_potential = { - is_diarch = yes - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - # We're generally ruthless here. - base = @ai_secondary_powers_base_value - - # Additions. - ## Weight for opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -1 - } - ## Weight for personality. - ai_value_modifier = { - ai_boldness = 0.25 - ai_greed = 0.5 - ai_honor = 0.5 - } - ## Flag Management. - ### Duel for it if we're massively superior. - modifier = { - add = 100 - scope:diarch_shift_privileges_interaction_duel_diplomacy = yes - diplomacy_diff = { - target = scope:recipient - value >= @ai_skill_diff_upper_threshold - } - } - ### Else we'll try to pay full prestige, if we've got lots to spare. - modifier = { - add = 50 - scope:diarch_shift_privileges_interaction_pay_prestige_full = yes - prestige >= { - value = shift_privileges_interaction_target_cost_value - multiply = @ai_prestige_bank_threshold - } - } - ### Or else we'll chance it, if we can afford that + some slack. - modifier = { - add = 25 - scope:diarch_shift_privileges_interaction_pay_prestige_partial = yes - prestige < { - value = shift_privileges_interaction_target_cost_value - multiply = @ai_prestige_bank_threshold - } - prestige >= { - value = shift_privileges_interaction_target_discounted_cost_value - multiply = @ai_prestige_bank_threshold - } - } - ### Otherwise we'll risk a regular duel. - ## Landless AI want to do this more. - modifier = { - add = 25 - is_ruler = no - } - ## AI who are in debt seek ways out of it. - modifier = { - add = 100 - debt_level >= 0 - } - ## Certain traits make it either very likely or very unlikely. - ### +++ Arbitrary. - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = arbitrary - } - ### --- Just. - modifier = { - add = diarch_ai_desire_minus_3_value - has_trait = just - } - # Factors. - ## + Do pick on people we hate. - modifier = { - factor = 1.5 - should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## - Try not to pick on allies of our liege. - modifier = { - factor = 0.25 - should_avoid_hostile_action_against_due_to_liege_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## x0 Don't pick on our friends or allies. - modifier = { - factor = 0 - should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - ## x0 Don't pick on players unless they're of at least a decent size. - modifier = { - factor = 0 - scope:recipient = { - is_ai = no - any_held_county = { count <= 3 } - } - } - ### x0 Don't go into prestige debt! - modifier = { - factor = 0 - prestige < 0 - } - } -} - -# Diarch (actor) requests use of a special CB from liege (recipient), allowing them to powerfully expand the empire's borders and harvest influence. -diarch_request_imperial_expedition_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - notification_text = DIARCH_REQUESTS_IMPERIAL_EXPEDITION - icon = invasion - interface_priority = 5 - - desc = diarch_request_imperial_expedition_interaction_desc - - ai_maybe = yes - popup_on_receive = yes - pause_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - exists = liege - is_diarch_of_target = liege - liege = { has_diarchy_parameter = unlock_diarch_requests_military_expedition_interaction } - } - # Same sub-realm only. - OR = { - scope:actor.liege = scope:recipient - scope:recipient = { - any_liege_or_above = { this = scope:actor.liege } - } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_diarch_requests_military_expedition_interaction } - # And you have to have _some_ troops of your own. - custom_tooltip = { - text = diarch_request_imperial_expedition_interaction.tt.minimum_troop_count - scope:actor.max_military_strength >= request_imperial_expedition_minimum_troop_count_value - } - # _And_ you don't already have a charge. - custom_tooltip = { - text = diarch_request_imperial_expedition_interaction.tt.actor_already_has_charge - scope:actor = { - NOT = { has_variable = imperial_expedition_charged } - } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - # Hefty cooldown on this guy, as you shouldn't be able to do these often. - cooldown_against_recipient = { years = 25 } - - cost = { - influence = { - if = { - limit = { scope:influence_major = yes } - add = request_imperial_expedition_influence_stake_major_value - } - else_if = { - limit = { scope:influence_medium = yes } - add = request_imperial_expedition_influence_stake_medium_value - } - else_if = { - limit = { scope:influence_minor = yes } - add = request_imperial_expedition_influence_stake_minor_value - } - } - } - - # How much influence do we want to outlay on this? - ## A cheapy amount. - send_option = { - # Always valid. - flag = influence_minor - localization = diarch_request_imperial_expedition_interaction.tt.influence_minor_name - } - ## A medium amount. - send_option = { - is_valid = { scope:actor.influence >= request_imperial_expedition_influence_stake_medium_value } - flag = influence_medium - localization = diarch_request_imperial_expedition_interaction.tt.influence_medium_name - } - ## A large amount. - send_option = { - is_valid = { scope:actor.influence >= request_imperial_expedition_influence_stake_major_value } - flag = influence_major - localization = diarch_request_imperial_expedition_interaction.tt.influence_major_name - } - ## Use a hook instead. - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - on_auto_accept = { - # Fire the notification event telling scope:recipient what's been done. - scope:recipient = { trigger_event = diarchy.8003 } - } - - on_accept = { - scope:actor = { - # Display effects in the interaction. - show_as_tooltip = { diarch_request_imperial_expedition_accepted_effect = yes } - # Fire the notification event. - trigger_event = diarchy.8001 - } - } - - on_decline = { - scope:actor = { - # Display effects in the interaction. - show_as_tooltip = { diarch_request_imperial_expedition_rejected_effect = yes } - # Fire the notification event. - trigger_event = diarchy.8002 - } - } - - auto_accept = { - scope:recipient = { - trigger_if = { - limit = { scope:hook = yes } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - trigger_else_if = { - limit = { scope:influence_major = yes } - influence < request_imperial_expedition_influence_stake_major_value - } - trigger_else_if = { - limit = { scope:influence_medium = yes } - influence < request_imperial_expedition_influence_stake_medium_value - } - trigger_else_if = { - limit = { scope:influence_minor = yes } - influence < request_imperial_expedition_influence_stake_minor_value - } - trigger_else = { always = no } - } - } - - ai_accept = { - base = -25 - - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - desc = AI_OPINION_REASON - } - # Your level of influence. - ## Impotent - modifier = { - add = -10 - desc = AI_OPINION_INFLUENCE_LEVEL_IMPOTENT - scope:actor.influence_level = 0 - } - ## Influential - ### Would be zero, so it wouldn't appear. - ## Persuasive - modifier = { - add = 10 - desc = AI_OPINION_INFLUENCE_LEVEL_PERSUASIVE - scope:actor.influence_level = 2 - } - ## Controlling - modifier = { - add = 20 - desc = AI_OPINION_INFLUENCE_LEVEL_CONTROLLING - scope:actor.influence_level = 3 - } - ## Authoritative - modifier = { - add = 30 - desc = AI_OPINION_INFLUENCE_LEVEL_AUTHORITATIVE - scope:actor.influence_level = 4 - } - ## Imperious - modifier = { - add = 40 - desc = AI_OPINION_INFLUENCE_LEVEL_IMPERIOUS - scope:actor.influence_level = 5 - } - # Traits. - ## ---- Paranoid - modifier = { - add = -50 - desc = ai_acceptance_trait_paranoid - scope:recipient = { has_trait = paranoid } - } - ## --- Stubborn - modifier = { - add = -30 - desc = ai_acceptance_trait_stubborn - scope:recipient = { has_trait = stubborn } - } - ## --- Content - modifier = { - add = -30 - desc = ai_acceptance_trait_content - scope:recipient = { has_trait = content } - } - ## - Humble - modifier = { - add = -10 - desc = ai_acceptance_trait_humble - scope:recipient = { has_trait = humble } - } - ## + Arrogant - modifier = { - add = 10 - desc = ai_acceptance_trait_arrogant - scope:recipient = { has_trait = arrogant } - } - ## + Ambitious - modifier = { - add = 10 - desc = ai_acceptance_trait_ambitious - scope:recipient = { has_trait = ambitious } - } - ## ++ Trusting - modifier = { - add = 20 - desc = ai_acceptance_trait_trusting - scope:recipient = { has_trait = trusting } - } - ## ++ Fickle - modifier = { - add = 20 - desc = ai_acceptance_trait_fickle - scope:recipient = { has_trait = fickle } - } - ## ++ Lazy - modifier = { - add = 20 - desc = ai_acceptance_trait_lazy - scope:recipient = { has_trait = lazy } - } - ## +++ Craven - modifier = { - add = 30 - desc = ai_acceptance_trait_craven - scope:recipient = { has_trait = craven } - } - # Factor for personality. - ai_value_modifier = { - who = scope:recipient - # The meeker they are, the more they'll go along with your wishes. - ai_boldness = { - if = { - limit = { - scope:recipient = { - NOT = { ai_boldness = 0 } - } - } - value = -1 - } - } - # And the lazier. - ai_energy = { - if = { - limit = { - scope:recipient = { ai_energy > 0 } - } - value = 0.5 - } - } - } - } - - # AI - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 24 - } - ai_potential = { - is_diarch = yes - liege = { has_diarchy_active_parameter = unlock_diarch_requests_military_expedition_interaction } - NOR = { - has_trait = craven - has_trait = lazy - has_trait = content - } - } - - ai_will_do = { - base = -50 - - # Personality. - ai_value_modifier = { - ai_energy = 2 - ai_boldness = 1 - ai_greed = 1 - } - # Traits. - ## Brave - modifier = { - add = 25 - has_trait = brave - } - ## Ambitious - modifier = { - add = 50 - has_trait = ambitious - } - ## Arrogant - modifier = { - add = 25 - has_trait = arrogant - } - ## Loyal & Disloyal (same result, different motivations) - modifier = { - add = 25 - OR = { - has_trait = loyal - has_trait = disloyal - } - } - ## Diligent - modifier = { - add = 25 - has_trait = diligent - } - ## We've already filtered out craven, lazy, & content by this point. - # Military. - ## For every thousand troops we can put in ourselves, make us more likely to ask. - modifier = { - add = { - value = scope:actor.max_military_strength - divide = 100 - floor = yes - } - always = yes - } - # Flag Management. - ## Make sure the AI uses hooks for this as it's % based - modifier = { - add = 1 - scope:hook = yes - } - ## Otherwise, try to spend the most influence possible whenever we can. - modifier = { - add = 3 - scope:influence_minor = yes - } - modifier = { - add = 2 - scope:influence_medium = yes - } - modifier = { - add = 1 - scope:influence_major = yes - } - } -} - -# Diarch (actor) requests a kingdom governor title from liege (recipient). -diarch_demand_despotate_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - notification_text = DIARCH_DEMANDS_DESPOTATE - icon = icon_found_despotate - interface_priority = 15 - - desc = diarch_demand_despotate_interaction_desc - - target_type = title - target_filter = secondary_recipient_de_jure_titles - can_be_picked_title = { - scope:target = { valid_kingdom_for_diarch_to_demand_as_despotate_trigger = yes } - } - has_valid_target_showing_failures_only = { - # Only show kingdoms. - scope:target.tier = tier_kingdom - # Don't show the empire's capital kingdom. - NOT = { - scope:recipient.capital_county = { target_is_de_jure_liege_or_above = scope:target } - } - } - # We do this via redirects because recipient_de_jure_titles did not turn up for work today. - redirect = { - scope:recipient = { save_scope_as = secondary_recipient } - } - ai_maybe = yes - popup_on_receive = yes - pause_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - exists = liege - is_diarch_of_target = liege - liege = { has_diarchy_parameter = unlock_diarch_demand_kingdom_interaction } - } - # Same sub-realm only. - OR = { - scope:actor.liege = scope:recipient - scope:recipient = { - any_liege_or_above = { this = scope:actor.liege } - } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_diarch_demand_kingdom_interaction } - # You do not already have a kingdom tier title - custom_tooltip = { - text = diarch_demand_despotate_interaction.tt.already_have_high_titles - scope:actor.highest_held_title_tier < tier_kingdom - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - # Hefty cooldown on this guy, as you shouldn't be able to pester about this often. - cooldown_against_recipient = { years = 25 } - - cost = { - influence = { - if = { - limit = { scope:influence_major = yes } - add = diarch_demand_despotate_interaction_stake_major_value - } - else_if = { - limit = { scope:influence_medium = yes } - add = diarch_demand_despotate_interaction_stake_medium_value - } - else_if = { - limit = { scope:influence_minor = yes } - add = diarch_demand_despotate_interaction_stake_minor_value - } - } - } - - # How much influence do we want to outlay on this? - ## A cheapy amount. - send_option = { - # Always valid. - flag = influence_minor - localization = diarch_demand_despotate_interaction.tt.influence_minor_name - } - ## A medium amount. - send_option = { - is_valid = { scope:actor.influence >= diarch_demand_despotate_interaction_stake_medium_value } - flag = influence_medium - localization = diarch_demand_despotate_interaction.tt.influence_medium_name - } - ## A large amount. - send_option = { - is_valid = { scope:actor.influence >= diarch_demand_despotate_interaction_stake_major_value } - flag = influence_major - localization = diarch_demand_despotate_interaction.tt.influence_major_name - } - ## Use a hook instead. - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - on_auto_accept = { - # Fire the notification event telling scope:recipient what's been done. - scope:recipient = { trigger_event = diarchy.8033 } - } - - on_accept = { - # Notify the player of how to force their liege's hand. - if = { - limit = { - scope:influence_major = yes - scope:recipient.influence >= diarch_demand_despotate_interaction_stake_to_raise_major_inverted_value - } - custom_tooltip = diarch_demand_despotate_interaction_stake_to_raise_major_value.tt.liege_can_refuse - } - else_if = { - limit = { - scope:influence_medium = yes - scope:recipient.influence >= diarch_demand_despotate_interaction_stake_to_raise_medium_inverted_value - } - custom_tooltip = diarch_demand_despotate_interaction_stake_to_raise_medium_value.tt.liege_can_refuse - } - else_if = { - limit = { - scope:influence_minor = yes - scope:recipient.influence >= diarch_demand_despotate_interaction_stake_to_raise_minor_inverted_value - } - custom_tooltip = diarch_demand_despotate_interaction_stake_to_raise_minor_value.tt.liege_can_refuse - } - scope:actor = { - # Display effects in the interaction. - show_as_tooltip = { diarch_demand_despotate_interaction_accepted_effect = yes } - # Fire the notification event. - trigger_event = diarchy.8031 - } - } - - on_decline = { - scope:actor = { - # Display effects in the interaction. - show_as_tooltip = { diarch_demand_despotate_interaction_rejected_effect = yes } - # Fire the notification event. - trigger_event = diarchy.8032 - } - } - - auto_accept = { - scope:recipient = { - trigger_if = { - limit = { scope:hook = yes } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - trigger_else_if = { - limit = { scope:influence_major = yes } - influence < diarch_demand_despotate_interaction_stake_to_raise_major_inverted_value - } - trigger_else_if = { - limit = { scope:influence_medium = yes } - influence < diarch_demand_despotate_interaction_stake_to_raise_medium_inverted_value - } - trigger_else_if = { - limit = { scope:influence_minor = yes } - influence < diarch_demand_despotate_interaction_stake_to_raise_minor_inverted_value - } - trigger_else = { always = no } - } - } - - ai_accept = { - base = -50 - - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - desc = AI_OPINION_REASON - } - # Your level of influence. - ## Impotent - modifier = { - add = -10 - desc = AI_OPINION_INFLUENCE_LEVEL_IMPOTENT - scope:actor.influence_level = 0 - } - ## Influential - ### Would be zero, so it wouldn't appear. - ## Persuasive - modifier = { - add = 10 - desc = AI_OPINION_INFLUENCE_LEVEL_PERSUASIVE - scope:actor.influence_level = 2 - } - ## Controlling - modifier = { - add = 20 - desc = AI_OPINION_INFLUENCE_LEVEL_CONTROLLING - scope:actor.influence_level = 3 - } - ## Authoritative - modifier = { - add = 30 - desc = AI_OPINION_INFLUENCE_LEVEL_AUTHORITATIVE - scope:actor.influence_level = 4 - } - ## Imperious - modifier = { - add = 40 - desc = AI_OPINION_INFLUENCE_LEVEL_IMPERIOUS - scope:actor.influence_level = 5 - } - # Traits. - ## ---- Paranoid - modifier = { - add = -50 - desc = ai_acceptance_trait_paranoid - scope:recipient = { has_trait = paranoid } - } - ## --- Stubborn - modifier = { - add = -30 - desc = ai_acceptance_trait_stubborn - scope:recipient = { has_trait = stubborn } - } - ## --- Greedy - modifier = { - add = -30 - desc = ai_acceptance_trait_greedy - scope:recipient = { has_trait = greedy } - } - ## -- Arrogant - modifier = { - add = -20 - desc = ai_acceptance_trait_arrogant - scope:recipient = { has_trait = arrogant } - } - ## ++ Humble - modifier = { - add = 20 - desc = ai_acceptance_trait_humble - scope:recipient = { has_trait = humble } - } - ## ++ Trusting - modifier = { - add = 20 - desc = ai_acceptance_trait_trusting - scope:recipient = { has_trait = trusting } - } - ## ++ Fickle - modifier = { - add = 20 - desc = ai_acceptance_trait_fickle - scope:recipient = { has_trait = fickle } - } - ## ++ Lazy - modifier = { - add = 20 - desc = ai_acceptance_trait_lazy - scope:recipient = { has_trait = lazy } - } - ## ++ Generous - modifier = { - add = 20 - desc = ai_acceptance_trait_generous - scope:recipient = { has_trait = generous } - } - # Factor for personality. - ai_value_modifier = { - who = scope:recipient - # The meeker they are, the more they'll go along with your wishes. - ai_boldness = { - if = { - limit = { - scope:recipient = { - NOT = { ai_boldness = 0 } - } - } - value = -1 - } - } - # And the lazier. - ai_energy = { - if = { - limit = { - scope:recipient = { ai_energy > 0 } - } - value = 0.5 - } - } - } - } - - # AI - ai_set_target = { - scope:recipient = { - # Grab our empires. - every_held_title = { - title_tier >= empire - add_to_list = empires_list - } - # Then from that, formulate our kingdoms. - every_in_list = { - list = empires_list - every_in_de_jure_hierarchy = { - limit = { - tier = tier_kingdom - valid_kingdom_for_diarch_to_demand_as_despotate_trigger = yes - } - continue = { tier >= tier_kingdom } - add_to_list = kingdoms_list - } - } - # Now pick our best shot. - ordered_in_list = { - list = kingdoms_list - order_by = { - # Tell the AI to grab its own kingdom first of all. - if = { - limit = { this = scope:actor.capital_county.kingdom } - add = 1000 - } - # Otherwise, go for the biggest within the empire. - else = { - every_de_jure_county_holder = { - limit = { top_liege = scope:recipient } - add = 1 - } - } - } - save_scope_as = target - } - } - } - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 24 - hegemony = 24 - } - ai_potential = { - is_diarch = yes - liege = { has_diarchy_active_parameter = unlock_diarch_demand_kingdom_interaction } - NOR = { - has_trait = humble - has_trait = content - } - # Loyal diarchs don't ask for what their liege could give freely. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - base = 25 - - # Personality. - ai_value_modifier = { - ai_greed = 1 - ai_boldness = 1 - ai_energy = 0.25 - } - # Opinion. - ## The more we like our emperor, the less likely we are to want to interfere in their planned setup. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -0.25 - } - # Traits. - ## +++ Ambitious. - modifier = { - add = 50 - has_trait = ambitious - } - ## +++ Arrogant. - modifier = { - add = 50 - has_trait = arrogant - } - ## ++ Greedy. - modifier = { - add = 25 - has_trait = greedy - } - ## ++ Diligent. - modifier = { - add = 25 - has_trait = diligent - } - ## -- Generous. - modifier = { - add = -25 - has_trait = generous - } - ## --- Lazy. - modifier = { - add = -50 - has_trait = lazy - } - ## Humble & Content have both been pre-filtered out. - # Flag Management. - ## Make sure the AI uses hooks for this as it's % based - modifier = { - add = 4 - scope:hook = yes - } - ## Otherwise, try to spend the most influence possible whenever we can. - modifier = { - add = 3 - scope:influence_minor = yes - } - modifier = { - add = 2 - scope:influence_medium = yes - } - modifier = { - add = 1 - scope:influence_major = yes - } - } -} - - - - - - - - - - -################################################## -# DIARCH COUP LIEGE INTERACTIONS - -diarch_coup_liege_interaction = { - category = interaction_category_diarch - diarch_interaction = yes - icon = icon_scheme_claim_throne - interface_priority = 50 - pre_answer_no_breakdown_key = diarch_coup_liege_interaction_pre_answer_no_breakdown_key - pre_answer_yes_breakdown_key = diarch_coup_liege_interaction_pre_answer_yes_breakdown_key - - desc = diarch_coup_liege_interaction_desc - - # First, grab every other powerful vassal of your liege & plonk them in a list. - populate_recipient_list = { - scope:actor.liege = { - every_powerful_vassal = { - limit = { - this != scope:actor - } - add_to_list = characters - } - every_powerful_family = { - limit = { - NOR = { - house_head = scope:actor - house_head = scope:recipient - } - } - house_head = { add_to_list = characters } - } - } - } - redirect = { - # Turn the old scope:recipient into the target. - if = { - limit = { - NOR = { - scope:recipient = scope:actor - scope:recipient = scope:actor.liege - } - } - scope:recipient = { save_scope_as = secondary_recipient } - } - # Always make sure we're targeting your liege as the recipient for UX consistency. - scope:actor.liege = { save_scope_as = recipient } - } - - is_shown = { - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - OR = { - AND = { - exists = liege - is_diarch_of_target = liege - } - is_designated_diarch = yes - } - } - # Valid on vassals of your liege or your liege themselves. - ## More complex triggers don't generally work because redirect brings the interaction back to targeting the liege as scope:recipient, so we're left with this. - ### Don't try to improve it, it's not worth it, but if you _do_, then test your changes thoroughly. - #### When this breaks (which it does easily), it tends to mean the interaction shows up as valid against _every_ other character in diplomatic range. - OR = { - scope:recipient = scope:actor.liege - scope:secondary_recipient.liege ?= scope:actor.liege - } - } - - is_valid_showing_failures_only = { - # Diarch must be able to act. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - # Loyalty hooks, per the name, will tend to block this. - custom_tooltip = { - text = diarch_coup_liege_interaction.tt.action_blocked_by_loyalty_hook - NOT = { - diarch_loyalty_due_to_hook_trigger = { - LIEGE = scope:recipient - DIARCH = scope:actor - } - } - } - # They can't already be in the list. - custom_tooltip = { - text = diarch_coup_liege_interaction.tt.secondary_recipient_is_already_in_list - NOT = { - scope:actor = { - any_in_list = { - variable = coup_pv_supporters_list - this = scope:secondary_recipient - } - } - } - } - # Must be in an actual diarchy — we show most interactions greyed out for designated diarchs. - custom_tooltip = { - text = diarch_interactions.tt.you_must_be_in_an_entrenched_regency_to_access - scope:actor = { is_diarch = yes } - } - # And, relatedly, there's some checks that we don't show you unless you *are* already in a diarchy. - trigger_if = { - limit = { - scope:actor = { is_diarch = yes } - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege ?= { has_diarchy_active_parameter = regents_can_try_to_overthrow_present_lieges } - } - trigger_if = { - limit = { exists = scope:secondary_recipient } - # Must be available. - ## So no kids. - scope:secondary_recipient = { is_adult = yes } - ## & no one in prison. - scope:secondary_recipient = { is_imprisoned = no } - # Plus, currently, humans can't be part of these plots. - scope:secondary_recipient = { is_ai = yes } - } - # Must select something — tooltips'll knacker otherwise + just for consistency. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = interactions_general.tt.must_select_one_option - OR = { - scope:promise_nothing = yes - scope:promise_hook_weak = yes - scope:promise_hook_strong = yes - scope:promise_gold_medium = yes - scope:promise_gold_large = yes - } - } - } - # Cannot be at war with your liege. - NOT = { - scope:actor = { is_at_war_with = scope:actor.liege } - } - } - - can_send = { - # We check this here to make the interaction generally findable, so you can get at the list easily, but prevent you from inviting randos to the coup. - ## It's actually technically harmless - they won't help but don't get their payout if they're not powerful when the coup hits. - trigger_if = { - limit = { - scope:recipient = { government_has_flag = government_has_powerful_families } - } - scope:secondary_recipient.house = { is_powerful_family = yes } - } - trigger_else = { - scope:secondary_recipient = { is_powerful_vassal = yes } - } - } - - # Promise bugger all. - send_option = { - flag = promise_nothing - localization = PROMISE_NOTHING - } - # Promise hook. - send_option = { - is_valid = { - # Can't offer a hook if they've already got any type of hook on you. - NOT = { - scope:secondary_recipient ?= { has_hook = scope:actor } - } - } - flag = promise_hook_weak - localization = PROMISE_HOOK_WEAK - } - # Promise strong hook. - send_option = { - is_valid = { - # Can't offer a strong hook if they've already got a strong hook on you. - NOT = { - scope:secondary_recipient ?= { has_strong_hook = scope:actor } - } - } - flag = promise_hook_strong - localization = PROMISE_HOOK_STRONG - } - # Promise gold. - send_option = { - flag = promise_gold_medium - localization = PROMISE_GOLD_MEDIUM - } - # Promise piles of gold. - send_option = { - flag = promise_gold_large - localization = PROMISE_GOLD_LARGE - } - - on_accept = { - if = { - limit = { exists = scope:secondary_recipient } - scope:actor = { - # Scope:secondary_recipient joins your conspiracy. - custom_tooltip = diarch_coup_liege_interaction.tt.secondary_recipient.joins_conspiracy - ## Send a notification just for a bit of extra feedback. - send_interface_toast = { - type = event_toast_effect_good - title = diarch_coup_liege_interaction.tt.secondary_recipient.joins_conspiracy - left_icon = scope:secondary_recipient - } - # HerHis reward is collected if you succeed. - if = { - limit = { scope:promise_nothing = no } - custom_tooltip = diarch_coup_liege_interaction.tt.secondary_recipient.reward - } - # Certain scope:secondary_recipients may betray their liege in the throne room itself. - ## Chancellors in diplo coups. - if = { - limit = { scope:secondary_recipient ?= scope:recipient.cp:councillor_chancellor } - custom_tooltip = diarch_coup_liege_interaction.tt.secondary_recipient.chancellor_sabotage - } - ## Spymasters in intrigue coups. - if = { - limit = { scope:secondary_recipient ?= scope:recipient.cp:councillor_spymaster } - custom_tooltip = diarch_coup_liege_interaction.tt.secondary_recipient.spymaster_sabotage - } - ## Personal Champions in prowess coups. - if = { - limit = { - scope:secondary_recipient = { has_court_position = champion_court_position } - } - custom_tooltip = diarch_coup_liege_interaction.tt.secondary_recipient.champion_sabotage - # Yes, there are other candidates, but we're not tooltipping every conceivable case. Rulers are gonna have supporters. - custom_tooltip = diarch_coup_liege_interaction.tt.secondary_recipient.champion_sabotage.others - } - # Right, actually record them. - ## Including in the variable. - add_to_variable_list = { - name = coup_pv_supporters_list - target = scope:secondary_recipient - } - ## And their promised payment, if anything. - ### Weak hooks. - if = { - limit = { scope:promise_hook_weak = yes } - add_to_variable_list = { - name = coup_promise_list_weak_hook - target = scope:secondary_recipient - } - } - ### Strong hooks. - else_if = { - limit = { scope:promise_hook_strong = yes } - add_to_variable_list = { - name = coup_promise_list_strong_hook - target = scope:secondary_recipient - } - } - ### Cash. - else_if = { - limit = { scope:promise_gold_medium = yes } - add_to_variable_list = { - name = coup_promise_list_gold - target = scope:secondary_recipient - } - } - ### Big Cash. - else_if = { - limit = { scope:promise_gold_large = yes } - add_to_variable_list = { - name = coup_promise_list_big_gold - target = scope:secondary_recipient - } - } - tgp_activate_catalyst_against_hegemon_effect = { - HEGEMON = scope:actor.top_liege - CATALYST = catalyst_diarch_mandate - } - } - } - } - - # Disguise the interaction from players. - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - ai_accept = { - # Base reluctance to commit to a risky, treasonous plan. - base = -50 - - # Opinion. - ## Of scope:actor. - opinion_modifier = { - who = scope:secondary_recipient - opinion_target = scope:actor - multiplier = 1 - } - ## Of scope:recipient. - opinion_modifier = { - who = scope:secondary_recipient - opinion_target = scope:recipient - multiplier = -0.5 - } - # Personality. - ## Values. - ai_value_modifier = { - who = scope:secondary_recipient - ai_honor = -1 - ai_boldness = 0.25 - } - ## Traits. - ### +++ Disloyal. - modifier = { - add = diarch_ai_desire_plus_3_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.disloyal - scope:secondary_recipient = { has_trait = disloyal } - } - ### +++ Ambitious. - modifier = { - add = diarch_ai_desire_plus_3_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.ambitious - scope:secondary_recipient = { has_trait = ambitious } - } - ### ++ Arbitrary. - modifier = { - add = diarch_ai_desire_plus_2_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.arbitrary - scope:secondary_recipient = { has_trait = arbitrary } - } - ### + Fickle. - modifier = { - add = diarch_ai_desire_plus_1_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.fickle - scope:secondary_recipient = { has_trait = fickle } - } - ### - Stubborn. - modifier = { - add = diarch_ai_desire_minus_1_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.stubborn - scope:secondary_recipient = { has_trait = stubborn } - } - ### -- Just. - modifier = { - add = diarch_ai_desire_minus_2_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.just - scope:secondary_recipient = { has_trait = just } - } - ### --- Content. - modifier = { - add = diarch_ai_desire_minus_3_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.content - scope:secondary_recipient = { has_trait = content } - } - ### --- Loyal. - modifier = { - add = diarch_ai_desire_minus_3_value - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook.tt.has_trait.loyal - scope:secondary_recipient = { has_trait = loyal } - } - # Hooks. - ## Weak hooks are happy to have you in power. - modifier = { - add = 25 - scope:secondary_recipient = { has_weak_hook = scope:actor } - } - ## Strong hooks are *very* happy to have you in power. - modifier = { - add = 75 - scope:secondary_recipient = { has_strong_hook = scope:actor } - } - ## And conversely, don't want you to coup scope:recipient if they've already got a strong hook on them. - modifier = { - add = -100 - scope:secondary_recipient = { has_strong_hook = scope:recipient } - } - ## Loyalty hooks stop the AI signing up. - modifier = { - add = -1000 - desc = diarch_coup_liege_interaction.tt.liege_has_loyalty_hook - diarch_loyalty_due_to_hook_trigger = { - LIEGE = scope:recipient - DIARCH = scope:secondary_recipient - } - } - # Various. - ## Scope:secondary_recipient generally doesn't want to betray an ally. - modifier = { - add = { - value = -100 - # Reduce the malus a little if also allied to scope:actor. - if = { - limit = { - scope:secondary_recipient = { is_allied_to = scope:actor } - } - add = 50 - } - } - scope:secondary_recipient = { is_allied_to = scope:recipient } - } - ## Heirs don't generally want to betray scope:recipient, as they'll lose out. - modifier = { - add = -100 - desc = diarch_coup_liege_interaction.tt.heir_will_not_side_against_benefactor - scope:recipient = { - any_heir = { this = scope:secondary_recipient } - } - } - # Promises. - ## Weak hook. - modifier = { - add = { - value = 25 - # Multiply this... - ## ... down for folks who wouldn't care... - if = { - limit = { has_trait = honest } - multiply = 0.5 - } - ## ... & and up for those who would. - if = { - limit = { has_trait = deceitful } - multiply = 2 - } - } - desc = diarch_coup_liege_interaction.tt.wants_hook - scope:promise_hook_weak = yes - } - ## Strong hook. - modifier = { - add = { - value = 50 - # Multiply this... - ## ... down for folks who wouldn't care... - if = { - limit = { has_trait = honest } - multiply = 0.5 - } - ## ... & and up for those who would. - if = { - limit = { has_trait = deceitful } - multiply = 2 - } - } - desc = diarch_coup_liege_interaction.tt.wants_strong_hook - scope:promise_hook_strong = yes - } - ## Gold. - modifier = { - add = { - value = 25 - # Multiply this... - ## ... down for folks who wouldn't care... - if = { - limit = { has_trait = generous } - multiply = 0.5 - } - ## ... & and up for those who would. - if = { - limit = { has_trait = greedy } - multiply = 2 - } - } - desc = diarch_coup_liege_interaction.tt.wants_gold - scope:promise_gold_medium = yes - } - ## Lotsa gold. - modifier = { - add = { - value = 50 - # Multiply this... - ## ... down for folks who wouldn't care... - if = { - limit = { has_trait = generous } - multiply = 0.5 - } - ## ... & and up for those who would. - if = { - limit = { has_trait = greedy } - multiply = 2 - } - } - desc = diarch_coup_liege_interaction.tt.wants_strong_gold - scope:promise_gold_large = yes - } - } - - # AI - ## The AI doesn't use this interaction automatically - they try it manually upon hitting the required threshold. -} - - - - - - - - - -################################################## -# LIEGE ON DIARCH POWERS - -# Liege (actor) transfers vizier's (recipient's) extravagance modifiers into their own gold. -mulct_vizier_interaction = { - category = interaction_category_diarch - common_interaction = yes - icon = icon_gold - - desc = mulct_vizier_interaction_desc - - is_shown = { - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - diarch ?= scope:recipient - # Plus only on viziers. - has_diarchy_active_parameter = unlock_mulct_vizier_interaction - } - } - - is_valid_showing_failures_only = { - scope:actor = { - # Some basic checks. - is_available_adult = yes - # Shouldn't happen, but just in case. - NOT = { is_at_war_with = scope:recipient } - } - # Must select something. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = interactions_general.tt.must_select_one_option - OR = { - scope:mulct_vizier_interaction_minimal = yes - scope:mulct_vizier_interaction_minor = yes - scope:mulct_vizier_interaction_medium = yes - scope:mulct_vizier_interaction_major = yes - scope:mulct_vizier_interaction_massive = yes - } - } - } - } - - # Don't squeeze them too often. - cooldown = { years = 10 } - - # Attempt Methods - send_options_exclusive = yes - ## Minimal. - ### Always show this'un. - send_option = { flag = mulct_vizier_interaction_minimal } - ## Minor. - send_option = { flag = mulct_vizier_interaction_minor } - ## Medium. - send_option = { flag = mulct_vizier_interaction_medium } - ## Major. - send_option = { flag = mulct_vizier_interaction_major } - ## Massive. - send_option = { flag = mulct_vizier_interaction_massive } - - can_send = { - trigger_if = { - limit = { scope:mulct_vizier_interaction_minor = yes } - custom_tooltip = { - text = mulct_vizier_interaction.extravagances_required.t1 - scope:recipient = { - OR = { - has_character_modifier = vizier_extravagance_t1_treasure_modifier - has_character_modifier = vizier_extravagance_t1_activities_modifier - has_character_modifier = vizier_extravagance_t1_property_modifier - has_character_modifier = vizier_extravagance_t1_charity_modifier - } - } - } - custom_tooltip = { - text = mulct_vizier_interaction.scales_too_swung.tt - scope:actor.vizier_mulct_swing_check_value >= vizier_mulct_swing_gain_minor_value - } - } - trigger_if = { - limit = { scope:mulct_vizier_interaction_medium = yes } - custom_tooltip = { - text = mulct_vizier_interaction.extravagances_required.t2 - scope:recipient = { - OR = { - has_character_modifier = vizier_extravagance_t2_treasure_modifier - has_character_modifier = vizier_extravagance_t2_activities_modifier - has_character_modifier = vizier_extravagance_t2_property_modifier - has_character_modifier = vizier_extravagance_t2_charity_modifier - } - } - } - custom_tooltip = { - text = mulct_vizier_interaction.scales_too_swung.tt - scope:actor.vizier_mulct_swing_check_value >= vizier_mulct_swing_gain_medium_value - } - } - trigger_if = { - limit = { scope:mulct_vizier_interaction_major = yes } - custom_tooltip = { - text = mulct_vizier_interaction.extravagances_required.t3 - scope:recipient = { - OR = { - has_character_modifier = vizier_extravagance_t3_treasure_modifier - has_character_modifier = vizier_extravagance_t3_activities_modifier - has_character_modifier = vizier_extravagance_t3_property_modifier - has_character_modifier = vizier_extravagance_t3_charity_modifier - } - } - } - custom_tooltip = { - text = mulct_vizier_interaction.scales_too_swung.tt - scope:actor.vizier_mulct_swing_check_value >= vizier_mulct_swing_gain_major_value - } - } - trigger_if = { - limit = { scope:mulct_vizier_interaction_massive = yes } - custom_tooltip = { - text = mulct_vizier_interaction.extravagances_required.t4 - scope:recipient = { - OR = { - has_character_modifier = vizier_extravagance_t4_treasure_modifier - has_character_modifier = vizier_extravagance_t4_activities_modifier - has_character_modifier = vizier_extravagance_t4_property_modifier - has_character_modifier = vizier_extravagance_t4_charity_modifier - } - } - } - custom_tooltip = { - text = mulct_vizier_interaction.scales_too_swung.tt - scope:actor.vizier_mulct_swing_check_value >= vizier_mulct_swing_gain_massive_value - } - } - } - - on_accept = { - # Sort the gold transfer. - mulct_vizier_for_cash_effect = { VIZIER = scope:recipient } - scope:recipient = { - # How angry is scope:recipient? - if = { - limit = { scope:mulct_vizier_interaction_minimal = yes } - mulct_vizier_for_cash_opinion_reaction_effect = { MULT = 1 } - } - if = { - limit = { scope:mulct_vizier_interaction_minor = yes } - mulct_vizier_for_cash_opinion_reaction_effect = { MULT = 2 } - } - if = { - limit = { scope:mulct_vizier_interaction_medium = yes } - mulct_vizier_for_cash_opinion_reaction_effect = { MULT = 3 } - } - if = { - limit = { scope:mulct_vizier_interaction_major = yes } - mulct_vizier_for_cash_opinion_reaction_effect = { MULT = 4 } - } - if = { - limit = { scope:mulct_vizier_interaction_massive = yes } - mulct_vizier_for_cash_opinion_reaction_effect = { MULT = 5 } - } - # How much stress is this causing them? - stress_impact = { - ambitious = major_stress_impact_loss - arrogant = medium_stress_impact_loss - generous = minor_stress_impact_loss - greedy = major_stress_impact_gain - } - } - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_vizmulct_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_vizmulct_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_vizmulct_accept_recipient_list } - } - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = diarch } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 120 - kingdom = 120 - empire = 120 - hegemony = 120 - } - ai_potential = { - has_active_diarchy = yes - has_diarchy_parameter = unlock_mulct_vizier_interaction - } - - ai_will_do = { - # You generally want to do this if you can. - base = 100 - - # Circumstances. - ## Are we in debt? - modifier = { - add = 100 - gold <= -1 - } - ## Are we at war? - modifier = { - add = 100 - is_at_war = yes - } - - # Vizier Extravagances. - ## Are they in the upper tiers? - modifier = { - add = 50 - scope:recipient = { - OR = { - has_character_modifier = vizier_extravagance_t3_treasure_modifier - has_character_modifier = vizier_extravagance_t3_activities_modifier - has_character_modifier = vizier_extravagance_t3_property_modifier - has_character_modifier = vizier_extravagance_t3_charity_modifier - } - } - } - ## Are they in the uppermost tier? - modifier = { - add = 25 - scope:recipient = { - OR = { - has_character_modifier = vizier_extravagance_t4_treasure_modifier - has_character_modifier = vizier_extravagance_t4_activities_modifier - has_character_modifier = vizier_extravagance_t4_property_modifier - has_character_modifier = vizier_extravagance_t4_charity_modifier - } - } - } - - # Traits. - ## Greedy characters'll do it whenever they can. - modifier = { - add = 50 - has_trait = greedy - } - ## Generous characters'll only do it occasionally. - modifier = { - add = -50 - has_trait = generous - } - - # Send Option Usage. - ## These teach the AI how to use the send options. - ## These are linear; basically, prefer the largest number you're valid for (since the can_send'll block whatever you can't mulct). - modifier = { - add = 1 - scope:mulct_vizier_interaction_minimal = yes - } - modifier = { - add = 2 - scope:mulct_vizier_interaction_minor = yes - } - modifier = { - add = 3 - scope:mulct_vizier_interaction_medium = yes - } - modifier = { - add = 4 - scope:mulct_vizier_interaction_major = yes - } - modifier = { - add = 5 - scope:mulct_vizier_interaction_massive = yes - } - } -} - - - - - - - - - - -################################################## -# BOTH-WAYS POWERS - -# Diarch or liege target their opposite number and inflict negative realm opinion equivalent to the multiplied difference between intrigue or diplomacy in exchange for influence. -scapegoat_counterpart_interaction = { - category = interaction_category_diarch - icon = icon_scheme_slander - - desc = scapegoat_counterpart_interaction_desc - - interface_priority = 25 - - is_shown = { - # You must be one of the partners in a diarchy. - is_in_scapegoating_diarchy_visibility_trigger = { PARAMETER_TYPE = has_diarchy_parameter } - } - - is_valid_showing_failures_only = { - # Free adults only: you can't issue this type of decree from prison, and it wouldn't be fair to stop you from slandering a child but let a child slander you. - scope:actor = { - is_imprisoned = no - is_adult = yes - } - # And you can't blame a literal child. - scope:recipient = { is_adult = yes } - # Nor can you blame the opposing party if you're a deactivated diarch. - trigger_if = { - limit = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - } - custom_tooltip = { - text = scapegoat_counterpart_interaction.tt.skill_requirements - OR = { - scope:actor.diplomacy > scope:recipient.diplomacy - scope:actor.intrigue > scope:recipient.intrigue - } - } - is_in_scapegoating_diarchy_visibility_trigger = { PARAMETER_TYPE = has_diarchy_active_parameter } - # Cannot be at war with each other. - NOT = { - scope:actor = { is_at_war_with = scope:recipient } - } - } - - cooldown = { years = 3 } - - cost = { - # Non-ruler diarchs have all the time to do this the slow way. - prestige = { - if = { - limit = { - scope:actor = { is_ruler = yes } - } - value = medium_prestige_value - } - } - } - - # Diplomacy - ## Small amount - send_option = { - is_valid = { - custom_tooltip = { - text = scapegoat_counterpart_interaction.diplomacy_small.is_valid - scope:actor.diplomacy > scope:recipient.diplomacy - } - } - flag = diplomacy_small - localization = scapegoat_counterpart_interaction.diplomacy_small.t - } - ## Large amount - send_option = { - is_valid = { - custom_tooltip = { - text = scapegoat_counterpart_interaction.diplomacy_large.is_valid - scope:actor.diplomacy > scope:recipient.diplomacy - } - } - flag = diplomacy_large - localization = scapegoat_counterpart_interaction.diplomacy_large.t - } - # Intrigue - ## Small amount - send_option = { - is_valid = { - custom_tooltip = { - text = scapegoat_counterpart_interaction.intrigue_small.is_valid - scope:actor.intrigue > scope:recipient.intrigue - } - } - flag = intrigue_small - localization = scapegoat_counterpart_interaction.intrigue_small.t - } - ## Large amount - send_option = { - is_valid = { - custom_tooltip = { - text = scapegoat_counterpart_interaction.intrigue_large.is_valid - scope:actor.intrigue > scope:recipient.intrigue - } - } - flag = intrigue_large - localization = scapegoat_counterpart_interaction.intrigue_large.t - } - - on_accept = { - scope:recipient = { - # Send out our effects for the diarch. - if = { - limit = { is_diarch_of_target = scope:actor } - trigger_event = diarchy.8041 - every_player = { - limit = { - top_liege = scope:actor.top_liege - NOR = { - this = scope:actor - this = scope:recipient - } - } - trigger_event = diarchy.8041 - } - scapegoat_counterpart_interaction_process_results_effect = { - REALM_OPINION_ACTOR = add_tyranny - REALM_OPINION_RECIPIENT = change_strife_opinion - } - } - # And our effects for the liege. - else = { - tgp_activate_catalyst_against_hegemon_effect = { - HEGEMON = scope:actor.top_liege - CATALYST = catalyst_diarch_mandate - } - trigger_event = diarchy.8042 - every_player = { - limit = { - top_liege = scope:actor.top_liege - NOR = { - this = scope:actor - this = scope:recipient - } - } - trigger_event = diarchy.8042 - } - scapegoat_counterpart_interaction_process_results_effect = { - REALM_OPINION_ACTOR = change_strife_opinion - REALM_OPINION_RECIPIENT = add_tyranny - } - } - } - # Regardless of what happens, scope:recipient is a bit miffed. - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = slandered_me_opinion - opinion = { - value = scope:multiplied_diff - divide = -20 - max = -10 - } - } - } - custom_tooltip = scapegoat_counterpart_interaction.tt.infighting_sullies_the_realm - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = liege } - ai_targets = { ai_recipients = diarch } - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_potential = { - OR = { - # Either they're a liege. - AND = { - has_active_diarchy = yes - # With suitable skill diffs to give some kind of a gain. - OR = { - diplomacy_diff = { - target = diarch - value >= 5 - } - intrigue_diff = { - target = diarch - value >= 5 - } - } - } - # Or they're the diarch. - AND = { - is_diarch = yes - # With suitable skill diffs to give some kind of a gain. - OR = { - diplomacy_diff = { - target = liege - value >= 5 - } - intrigue_diff = { - target = liege - value >= 5 - } - } - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - } - # Filter out some traits that would never do this. - NOR = { - has_trait = just - has_trait = honest - has_trait = loyal - } - } - - ai_will_do = { - base = -50 - - # Opinion. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -2.5 - } - ## Plus weight up a bit further for bad relationships. - first_valid = { - # Nemeses. - modifier = { - add = 200 - has_relation_nemesis = scope:recipient - } - # Rivals. - modifier = { - add = 50 - has_relation_rival = scope:recipient - } - } - # Traits. - ## +++ Deceitful - modifier = { - add = 30 - has_trait = deceitful - } - ## +++ Ambitious - modifier = { - add = 30 - has_trait = ambitious - } - ## ++ Arrogant - modifier = { - add = 20 - has_trait = arrogant - } - ## ++ Arbitrary - modifier = { - add = 20 - has_trait = arbitrary - } - ## ++ Vengeful & doesn't like you - modifier = { - add = 20 - has_trait = vengeful - opinion = { - target = scope:recipient - value <= -1 - } - } - ## + Sadistic - modifier = { - add = 10 - has_trait = sadistic - } - ## + Fickle - modifier = { - add = 10 - has_trait = fickle - } - ## + Eccentric - modifier = { - add = 10 - has_trait = eccentric - } - ## + Greedy - modifier = { - add = 10 - has_trait = greedy - } - ## - Generous - modifier = { - add = -10 - has_trait = generous - } - ## -- Compassionate - modifier = { - add = -20 - has_trait = compassionate - } - ## -- Craven - modifier = { - add = -20 - has_trait = craven - } - ## --- Forgiving - modifier = { - add = -30 - has_trait = forgiving - } - ## --- Humble - modifier = { - add = -30 - has_trait = humble - } - ## ---- Content - modifier = { - add = -50 - has_trait = content - } - ## We've already pre-filtered out Honest & Just. - # Dread. - ## Intimidated. - modifier = { - add = -50 - scope:actor = { - has_dread_level_towards = { - target = scope:recipient - level = 1 - } - } - } - ## Cowed. - modifier = { - add = -100 - scope:actor = { - has_dread_level_towards = { - target = scope:recipient - level = 2 - } - } - } - # Flag Management. - ## Okay, we want to try and pick the larger of either our diplo diff or our intrigue diff. - ### If our diplo diff is higher than our intrigue diff, go for diplo. - modifier = { - add = 4 - scope:diplomacy_large = yes - scapegoat_counterpart_interaction_calc_diplo_diff_treshhold_value >= scapegoat_counterpart_interaction_calc_intrigue_diff_treshhold_value - } - ### Else, go for intrigue. - modifier = { - add = 3 - scope:intrigue_large = yes - } - ### These two should never trigger, but we've got them here as fallbacks. - modifier = { - add = 2 - scope:diplomacy_small = yes - } - modifier = { - add = 1 - scope:intrigue_small = yes - } - ### And then the AI otherwise doesn't worry about which smaller send option to pick. - # Influence status. - ## Swimming in influence? Not worth it. - modifier = { - factor = 0 - scope:actor.influence >= 500 - } - ## In debt? Weight it up. - modifier = { - factor = 2 - scope:actor.influence <= -1 - } - } -} - - - - - - - - - - -################################################## -# MANAGE DIARCHY INTERACTIONS - -# Diarch or liege target their opposite number and sink currency to reaffirm their influence in the realm. -swing_scales_currency_interaction = { - category = interaction_category_diarch - common_interaction = yes - highlighted_reason = HIGHLIGHTED_CAN_SWING_SCALES - icon = scroll_scales - - desc = swing_scales_currency_interaction_desc - - interface_priority = 20 - - is_shown = { - # You must be one of the partners in a diarchy. - OR = { - scope:actor = { is_diarch_of_target = scope:recipient } - scope:recipient = { is_diarch_of_target = scope:actor } - } - } - - is_valid_showing_failures_only = { - # Forbid when we're at max swing... - ## ... for the regent. - trigger_if = { - limit = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:recipient.diarchy_swing < 100 - } - } - ## ... and for the liege. - trigger_if = { - limit = { - NOT = { - scope:actor = { has_diarchy_active_parameter = liege_may_voluntarily_cede_authority } - } - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - # As long as you're able to give something even vaguely like an order to someone who might advocate on your behalf, you're gucci. - scope:actor = { - is_imprisoned = no - age >= 8 - } - # Must select something. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = interactions_general.tt.must_select_one_option - OR = { - scope:swing_influence = yes - scope:swing_cede_authority = yes - scope:swing_prestige = yes - scope:swing_piety = yes - scope:swing_gold = yes - scope:swing_hook = yes - scope:swing_hof = yes - } - } - } - # And in the _rare_ circumstance that a diarch is a child, they must be at least this tall. - ## Note that we _don't_ do this for the liege, since we want the player to be able to manage their regency — assume that _someone_ is looking out for the child's best interests. - scope:actor = { - trigger_if = { - limit = { - is_diarch_of_target = scope:recipient - is_adult = no - } - age >= 8 - } - } - # Cannot be at war with each other. - NOT = { - scope:actor = { is_at_war_with = scope:recipient } - } - } - - cooldown = { years = 2 } - - cost = { - influence = { - if = { - limit = { always = scope:swing_influence } - value = scope:actor.swing_scales_influence_cost_value - # LEGITIMACY OF RULER AFFECTS COSTS FOR REGENTS - if = { - limit = { scope:actor = { is_valid_for_legitimacy_change = yes } } - multiply = legitimacy_regent_swing_scale_multipler_value - } - } - } - prestige = { - if = { - limit = { always = scope:swing_prestige } - value = scope:actor.swing_scales_prestige_cost_value - # LEGITIMACY OF RULER AFFECTS COSTS FOR REGENTS - if = { - limit = { scope:actor = { is_valid_for_legitimacy_change = yes } } - multiply = legitimacy_regent_swing_scale_multipler_value - } - } - } - piety = { - if = { - limit = { - OR = { - always = scope:swing_piety - always = scope:swing_hof - } - } - value = scope:actor.swing_scales_piety_cost_value - # LEGITIMACY OF RULER AFFECTS COSTS FOR REGENTS - if = { - limit = { scope:actor = { is_valid_for_legitimacy_change = yes } } - multiply = legitimacy_regent_swing_scale_multipler_value - } - } - } - gold = { - if = { - limit = { - OR = { - always = scope:swing_gold - always = scope:swing_hof - } - } - value = scope:actor.swing_scales_cash_cost_value - # LEGITIMACY OF RULER AFFECTS COSTS FOR REGENTS - if = { - limit = { scope:actor = { is_valid_for_legitimacy_change = yes } } - multiply = legitimacy_regent_swing_scale_multipler_value - } - } - } - } - - # Influence - send_option = { - is_shown = { - # Make sure influence would be relevant. - OR = { - AND = { - scope:recipient.liege ?= scope:actor - scope:actor = { government_allows = administrative } - } - AND = { - scope:actor.liege ?= scope:recipient - scope:recipient = { government_allows = administrative } - } - } - } - is_valid = { - scope:actor = { government_allows = administrative } - # Can't be a liege with the scales swung completely towards them. - trigger_if = { - limit = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - } - starts_enabled = { scope:actor.influence >= scope:actor.swing_scales_influence_cost_value } - flag = swing_influence - localization = SWING_INFLUENCE - current_description = SWING_INFLUENCE_DESC - } - # Movement Power - send_option = { - starts_enabled = { - exists = scope:actor.var:movement_power_individual - scope:actor.var:movement_power_individual >= decent_movement_power_value - } - is_shown = { - scope:actor = { - government_has_flag = government_is_celestial - is_diarch_of_target = scope:recipient - } - scope:recipient = { government_has_flag = government_is_celestial } - } - is_valid = { - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_min_movement_power - scope:actor.var:movement_power_individual >= medium_movement_power_value - } - } - flag = swing_movement_power - localization = SWING_MOVEMENT_POWER - current_description = SWING_MOVEMENT_POWER_DESC - } - # Cede control voluntarily. - send_option = { - is_shown = { - scope:actor = { has_diarchy_active_parameter = liege_may_voluntarily_cede_authority } - scope:recipient = { is_diarch_of_target = scope:actor } - } - is_valid = { - # Can't be a liege with the scales swung too far in favour of their diarch. - custom_tooltip = { - text = mulct_vizier_interaction.scales_too_swung.tt - scope:actor.diarchy_swing <= 90 - } - } - starts_enabled = { scope:actor.influence >= scope:actor.swing_scales_influence_cost_value } - flag = swing_cede_authority - localization = SWING_CEDE_AUTHORITY - current_description = SWING_CEDE_AUTHORITY_DESC - } - # Prestige - send_option = { - starts_enabled = { scope:actor.prestige >= scope:actor.swing_scales_prestige_cost_value } - is_valid = { - # Can't be a liege with the scales swung completely towards them. - trigger_if = { - limit = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - } - flag = swing_prestige - localization = SWING_PRESTIGE - current_description = SWING_PRESTIGE_DESC - } - # Piety - send_option = { - is_valid = { - # You must share a HoF to be able to petition one. - custom_tooltip = { - text = swing_scales_currency_interaction.tt.no_shared_hof - # We're also secretly just testing if characters are the same faith. - OR = { - scope:actor.faith = scope:recipient.faith - AND = { - exists = scope:actor.faith.religious_head - exists = scope:recipient.faith.religious_head - scope:actor.faith.religious_head = scope:recipient.faith.religious_head - } - } - } - # Can't be a liege with the scales swung completely towards them. - trigger_if = { - limit = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - } - starts_enabled = { scope:actor.piety >= scope:actor.swing_scales_piety_cost_value } - flag = swing_piety - localization = SWING_PIETY - current_description = SWING_PIETY_DESC - } - # Gold - send_option = { - is_shown = { - # Filter out for the liege in vizierates - they can mulct the vizier, so we don't give them the chance to spend that gold back. - interaction_actor_is_liege_with_vizierate_trigger = no - } - starts_enabled = { scope:actor.gold >= scope:actor.swing_scales_cash_cost_value } - is_valid = { - # Can't be a liege with the scales swung completely towards them. - trigger_if = { - limit = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - } - flag = swing_gold - localization = SWING_GOLD - current_description = SWING_GOLD_DESC - } - # Hook - send_option = { - starts_enabled = { - scope:actor = { has_usable_hook = scope:recipient } - } - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - # Can't be a liege with the scales swung completely towards them. - trigger_if = { - limit = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - } - flag = swing_hook - localization = SWING_HOOK - current_description = SWING_HOOK_DESC - } - # HoF - send_option = { - is_shown = { - # Filter out for the liege in vizierates - they can mulct the vizier, so we don't give them the chance to spend that gold back. - interaction_actor_is_liege_with_vizierate_trigger = no - } - is_valid = { - diarch_swing_scales_valid_shared_hof_trigger = yes - # Can't be a liege with the scales swung completely towards them. - trigger_if = { - limit = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_max_swung - scope:actor.diarchy_swing > 0 - } - } - } - # Top of the prio order for enablement. - starts_enabled = { diarch_swing_scales_valid_shared_hof_trigger = yes } - flag = swing_hof - localization = SWING_HOF - current_description = SWING_HOF_DESC - } - - on_accept = { - # Swing the scales in the direction of scope:actor. - scope:recipient = { - # Swing the scales up if we're ceding power. - if = { - limit = { scope:swing_cede_authority = yes } - send_interface_message = { - type = msg_mandate_results_neutral_effect - title = swing_scales_interaction_by_liege.t - right_icon = scope:actor - scope:actor = { - # Viziers give you more bang for your buck when swinging against 'em. - # Perk check for Voyager perk - if = { - limit = { - has_diarchy_active_parameter = lieges_swing_more_against_diarchs - has_perk = power_at_home_perk - is_travelling = yes - } - update_diarchy_swing_with_perspective_effect = { - SWING = monumental_sop_swing_diarch_gain - LIEGE = scope:actor - } - } - # Perk or Vizier - else_if = { - limit = { - OR = { - has_diarchy_active_parameter = lieges_swing_more_against_diarchs - AND = { - has_perk = power_at_home_perk - is_travelling = yes - } - } - } - update_diarchy_swing_with_perspective_effect = { - SWING = massive_sop_swing_diarch_gain - LIEGE = scope:actor - } - } - # Neither - else = { - update_diarchy_swing_with_perspective_effect = { - SWING = major_sop_swing_diarch_gain - LIEGE = scope:actor - } - } - diarch_swing_scales_guts_effect = yes - # Plus, everyone benefits. - change_influence = { - value = 200 - # LEGITIMACY OF RULER AFFECTS COSTS FOR REGENTS - multiply = legitimacy_regent_swing_scale_multipler_value - round = yes - } - scope:recipient = { - change_influence = { - value = 200 - # LEGITIMACY OF RULER AFFECTS COSTS FOR REGENTS - multiply = legitimacy_regent_swing_scale_multipler_value - round = yes - } - } - } - } - } - # Swing the scales down if this is the liege. - else_if = { - limit = { is_diarch_of_target = scope:actor } - send_interface_message = { - type = msg_mandate_results_bad_effect - title = swing_scales_interaction_by_liege.t - right_icon = scope:actor - scope:actor = { - # Viziers give you more bang for your buck when swinging against 'em. - # Perk check for Voyager perk - if = { - limit = { - has_diarchy_active_parameter = lieges_swing_more_against_diarchs - has_perk = power_at_home_perk - is_travelling = yes - } - update_diarchy_swing_with_perspective_effect = { - SWING = massive_sop_swing_liege_gain - LIEGE = scope:actor - } - } - # Perk or Vizier - else_if = { - limit = { - OR = { - has_diarchy_active_parameter = lieges_swing_more_against_diarchs - AND = { - has_perk = power_at_home_perk - is_travelling = yes - } - } - } - update_diarchy_swing_with_perspective_effect = { - SWING = major_sop_swing_liege_gain - LIEGE = scope:actor - } - } - # Neither - else = { - update_diarchy_swing_with_perspective_effect = { - SWING = medium_sop_swing_liege_gain - LIEGE = scope:actor - } - } - diarch_swing_scales_guts_effect = yes - } - } - } - # And up if this is the diarch. - else = { - send_interface_message = { - type = msg_mandate_results_bad_effect - title = swing_scales_interaction_by_diarch.t - right_icon = scope:actor - if = { - limit = { - scope:actor = { - has_perk = power_at_home_perk - is_travelling = yes - } - } - update_diarchy_swing_with_perspective_effect = { - SWING = major_sop_swing_diarch_gain - LIEGE = scope:recipient - } - } - else = { - update_diarchy_swing_with_perspective_effect = { - SWING = medium_sop_swing_diarch_gain - LIEGE = scope:recipient - } - } - scope:actor = { diarch_swing_scales_guts_effect = yes } - } - } - } - # Unless you gave power to them, scope:recipient is a bit miffed. - scope:recipient = { - # We're actually giving them swing, so gain opinion. - ## We lessen the gains from this over time, as they become more and more entitled. - if = { - limit = { scope:swing_cede_authority = yes } - # Actual gains. - if = { - limit = { - OR = { - NOT = { has_variable = diarch_authority_ceded } - var:diarch_authority_ceded < diarch_authority_ceded_opinion_value - } - } - # First, check to see how much opinion we should give. - save_scope_value_as = { - name = opinion_gain - value = { - value = diarch_authority_ceded_opinion_value - if = { - limit = { has_variable = diarch_authority_ceded } - subtract = var:diarch_authority_ceded - } - } - } - # Then, adjust the opinion. - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = scope:opinion_gain - } - # And decrease our gain next time. - increment_variable_effect = { - VAR = diarch_authority_ceded - VAL = 5 - } - } - # Otherwise, a paltry amount. - ## We're deliberately giving you basically nothing here — the 1 is for comedic effect. - else = { - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 1 - } - } - } - # Co-monarchs are more annoyed. - else_if = { - limit = { - OR = { - AND = { - scope:actor = { is_diarch_of_target = scope:recipient } - scope:recipient = { has_diarchy_active_parameter = diarchy_is_co_rulership } - } - AND = { - scope:recipient = { is_diarch_of_target = scope:actor } - scope:actor = { has_diarchy_active_parameter = diarchy_is_co_rulership } - } - } - } - add_opinion = { - target = scope:actor - modifier = frustrated_opinion - opinion = -20 - } - } - # Take away a normal amount. - else = { - add_opinion = { - target = scope:actor - modifier = frustrated_opinion - opinion = -10 - } - } - } - # Some diarchs might be swinging as a prelude to a coup attempt. - ai_diarch_check_to_see_if_should_launch_coup_effect = yes - - # Debug & object explorer logging. - ## Diarch swung. - if = { - limit = { - exists = scope:recipient.diarch - scope:actor = scope:recipient.diarch - } - debug_log = debug_log.swing_scales.diarch_swung - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_swung_diarch } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_swung_diarch_list } - } - } - ## Else liege swung. - else = { - debug_log = debug_log.swing_scales.liege_swung - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_swung_liege } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_swung_liege_list } - } - } - } - - auto_accept = yes - - # AI - ai_targets = { - ai_recipients = liege - ai_recipients = diarch - } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 24 - } - - ai_potential = { - OR = { - # Either they're a liege. - AND = { - has_active_diarchy = yes - # With some kind of valid cause to worry. - OR = { - # Lieges don't care unless your regency is entrenched _and_ it's looking to stay that way... - has_diarchy_active_parameter = regency_cant_be_ended_above_this_point - # ... unless they could get out of it. - can_leave_diarchy_trigger = yes - } - } - # Or they're the diarch. - AND = { - is_diarch = yes - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - } - } - - ai_will_do = { - # We're generally ruthless here. - base = @ai_secondary_powers_base_value - - # Additions. - ## Flag management. - ### Influence. - modifier = { - add = 7 - scope:swing_influence = yes - } - modifier = { - add = 6 - scope:swing_movement_power = yes - } - ### Cede Authority. - #### Only do this if you're also humble. - modifier = { - add = 10 - scope:swing_cede_authority = yes - has_trait = humble - } - ### Prestige. - modifier = { - add = 2 - scope:swing_prestige = yes - } - ### Piety. - modifier = { - add = 3 - scope:swing_piety = yes - } - ### Gold. - modifier = { - add = 1 - scope:swing_gold = yes - } - ### Hook. - modifier = { - add = 5 - scope:swing_hook = yes - } - ### HoF - combined Gold/Piety. - modifier = { - add = 4 - scope:swing_hof = yes - } - # Factors. - ## x0 Don't go into prestige debt! - modifier = { - factor = 0 - scope:swing_prestige = yes - prestige < 0 - } - ## We otherwise take care of these in the ai_potential block, because otherwise the AI interacts very, very weirdly with them. - } -} - -# For titleless diarchs: anyone playable uses the regular interaction. -diarch_swing_scales_currency_interaction = { - category = interaction_category_diarch - common_interaction = yes - diarch_interaction = yes - highlighted_reason = HIGHLIGHTED_CAN_SWING_SCALES - icon = scroll_scales - - desc = swing_scales_currency_interaction_desc - - interface_priority = 20 - - is_shown = { - scope:recipient = scope:actor.liege - # This is for landless diarchs only, and we pre-filter them, so we don't really care about this block. - ## But filter out players anyway for that _seamless_ debug play experience. - scope:actor = { is_ai = yes } - } - - is_valid_showing_failures_only = { - # Forbid when we're at max swing. - scope:recipient = { - # Plus also weed out some weird errors where we got confused and looked at ourselves. - has_active_diarchy = yes - # Now the actual check. - trigger_if = { - limit = { has_active_diarchy = yes } - diarchy_swing < 100 - } - trigger_else = { always = no } - } - # As long as you're able to give something even vaguely like an order to someone who might advocate on your behalf, you're gucci. - scope:actor = { is_imprisoned = no } - # And in the _rare_ circumstance that a diarch is a child, they must be at least this tall. - ## Note that we _don't_ do this for the liege, since we want the player to be able to manage their regency — assume that _someone_ is looking out for the child's best interests. - scope:actor = { - trigger_if = { - limit = { - is_diarch_of_target = scope:recipient - is_adult = no - } - age >= 8 - } - } - } - - cooldown = { years = 2 } - - cost = { - influence = { - if = { - limit = { always = scope:swing_influence } - # Diarch version. - if = { - limit = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - # Costs should always be applied on the diarch. - add = scope:actor.swing_scales_influence_cost_value - } - # Liege version. - else = { - # Costs should always be applied on the diarch. - add = scope:recipient.swing_scales_influence_cost_value - } - # Cost scaling mults. - multiply = scope:actor.swing_scales_discounts_multiplier_value - } - } - prestige = { - if = { - limit = { always = scope:swing_prestige } - # Diarch version. - if = { - limit = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - # Costs should always be applied on the diarch. - add = scope:actor.swing_scales_prestige_cost_value - } - # Liege version. - else = { - # Costs should always be applied on the diarch. - add = scope:recipient.swing_scales_prestige_cost_value - } - # Cost scaling mults. - multiply = scope:actor.swing_scales_discounts_multiplier_value - } - } - piety = { - if = { - limit = { - OR = { - always = scope:swing_piety - always = scope:swing_hof - } - } - # Diarch version. - if = { - limit = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - # Costs should always be applied on the diarch. - add = scope:actor.swing_scales_piety_cost_value - } - # Liege version. - else = { - # Costs should always be applied on the diarch. - add = scope:recipient.swing_scales_piety_cost_value - } - # Cost scaling mults. - multiply = scope:actor.swing_scales_discounts_multiplier_value - } - } - gold = { - if = { - limit = { - OR = { - always = scope:swing_gold - always = scope:swing_hof - } - } - # Diarch version. - if = { - limit = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - # Costs should always be applied on the diarch. - add = scope:actor.swing_scales_cash_cost_value - } - # Liege version. - else = { - # Costs should always be applied on the diarch. - add = scope:recipient.swing_scales_cash_cost_value - } - # Cost scaling mults. - multiply = scope:actor.swing_scales_discounts_multiplier_value - } - } - } - - # Influence - send_option = { - is_shown = { - # Make sure influence would be relevant. - OR = { - AND = { - scope:recipient.liege ?= scope:actor - scope:actor = { government_allows = administrative } - } - AND = { - scope:actor.liege ?= scope:recipient - scope:recipient = { government_allows = administrative } - } - } - } - is_valid = { - scope:actor = { government_allows = administrative } - } - starts_enabled = { scope:actor.influence >= scope:actor.swing_scales_influence_cost_value } - flag = swing_influence - localization = SWING_INFLUENCE - current_description = SWING_INFLUENCE_DESC - } - # Movement Power - send_option = { - starts_enabled = { - exists = scope:actor.var:movement_power_individual - scope:actor.var:movement_power_individual >= decent_movement_power_value - } - is_shown = { - scope:actor = { - government_has_flag = government_is_celestial - is_diarch_of_target = scope:recipient - } - scope:recipient = { government_has_flag = government_is_celestial } - } - is_valid = { - custom_tooltip = { - text = swing_scales_currency_interaction.tt.scales_min_movement_power - scope:actor.var:movement_power_individual >= medium_movement_power_value - } - } - flag = swing_movement_power - localization = SWING_MOVEMENT_POWER - current_description = SWING_MOVEMENT_POWER_DESC - } - # Prestige - send_option = { - starts_enabled = { scope:actor.prestige >= scope:actor.swing_scales_prestige_cost_value } - flag = swing_prestige - localization = SWING_PRESTIGE - } - # Piety - send_option = { - is_valid = { - # You must share a HoF to be able to petition one. - custom_tooltip = { - text = swing_scales_currency_interaction.tt.no_shared_hof - # We're also secretly just testing if characters are the same faith. - OR = { - scope:actor.faith = scope:recipient.faith - AND = { - exists = scope:actor.faith.religious_head - exists = scope:recipient.faith.religious_head - scope:actor.faith.religious_head = scope:recipient.faith.religious_head - } - } - } - } - starts_enabled = { scope:actor.piety >= scope:actor.swing_scales_piety_cost_value } - flag = swing_piety - localization = SWING_PIETY - } - # Gold - send_option = { - starts_enabled = { scope:actor.gold >= scope:actor.swing_scales_cash_cost_value } - flag = swing_gold - localization = SWING_GOLD - } - # Hook - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - starts_enabled = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = swing_hook - localization = SWING_HOOK - } - # HoF - send_option = { - is_valid = { diarch_swing_scales_valid_shared_hof_trigger = yes } - # Top of the prio order for enablement. - starts_enabled = { diarch_swing_scales_valid_shared_hof_trigger = yes } - flag = swing_hof - localization = SWING_HOF - } - - on_accept = { - # Swing the scales down, since scope:actor is always a landless diarch. - scope:recipient = { - # Slight chance delays may lead to a diarchy ending before this is received. - if = { - limit = { has_active_diarchy = yes } - send_interface_message = { - type = msg_mandate_results_bad_effect - title = swing_scales_interaction_by_diarch.t - right_icon = scope:actor - update_diarchy_swing_with_perspective_effect = { - SWING = medium_sop_swing_diarch_gain - LIEGE = scope:recipient - } - scope:actor = { diarch_swing_scales_guts_effect = yes } - } - } - # Scope:recipient is a bit miffed. - add_opinion = { - target = scope:actor - modifier = frustrated_opinion - opinion = -10 - } - } - # Some diarchs might be swinging as a prelude to a coup attempt. - ai_diarch_check_to_see_if_should_launch_coup_effect = yes - - # Debug logging. - debug_log = debug_log.swing_scales.diarch_swung - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_swung_diarch } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_swung_diarch_list } - } - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = liege } - # We turn the frequency up higher than the cooldown so that diarchs don't take two years to get into the loop. - ai_frequency_by_tier = { - barony = 0 - county = 6 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_potential = { - # Double check due to some irritating errors. - is_diarch = yes - liege = { has_active_diarchy = yes } - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - # We're generally ruthless here. - base = @ai_core_loop_base_value - - # Additions. - ## Flag management. - ### Influence. - modifier = { - add = 6 - scope:swing_influence = yes - } - ### Prestige. - modifier = { - add = 2 - scope:swing_prestige = yes - } - ### Piety. - modifier = { - add = 3 - scope:swing_piety = yes - } - ### Gold. - modifier = { - add = 1 - scope:swing_gold = yes - } - ### Hook. - modifier = { - add = 5 - scope:swing_hook = yes - } - ### HoF - combined Gold/Piety. - modifier = { - add = 4 - scope:swing_hof = yes - } - # Factors. - ## x0 Don't go into prestige debt! - modifier = { - factor = 0 - scope:swing_prestige = yes - prestige < 0 - } - } -} - -# Diarch (actor) shifts from a Temporary Regency to an Entrenched Regency. -diarch_entrench_regency_interaction = { - category = interaction_category_diarch - common_interaction = yes - diarch_interaction = yes - highlighted_reason = HIGHLIGHTED_CAN_DIARCH_ENTRENCH_REGENCY - icon = icon_entrench_regency - - desc = diarch_entrench_regency_interaction_desc - - popup_on_receive = yes - pause_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - exists = liege - is_diarch_of_target = liege - # With the extra consideration that we only want this to appear for Temporary Regencies. - liege = { has_diarchy_parameter = unlock_entrench_regency_interaction } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = unlock_entrench_regency_interaction } - # You must be able to act as diarch. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - } - - on_accept = { - scope:recipient = { - # Tell scope:recipient what's up. - send_interface_toast = { - type = msg_start_diarchy - title = diarch_entrench_regency_interaction.tt.recipient_notification - left_icon = scope:actor - # Change the diarchy type to entrenched. - set_diarchy_type = regency - # Set our power level down a bit, but still higher than entrenched regencies that *start* that way would be. - set_diarchy_swing = 40 - } - # Plus scope:recipient probably isn't super happy about this. - add_opinion = { - target = scope:actor - modifier = suspicion_opinion - opinion = -20 - } - } - # Bit o'prestige for your hard work. - scope:actor = { add_prestige = medium_prestige_gain } - - # Debug logging. - debug_log = debug_log.entrench_regency.attempt_made - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entrench } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entrench_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entrench_recipient_list } - } - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - ai_potential = { - is_diarch = yes - # Don't entrench for no reason — we want to have a bit of a delay so that the AI can go off travelling or get locked in prison once in a while. - liege = { years_in_diarchy >= 2 } - } - - ai_will_do = { - # You never _don't_ want to do this. - base = 1000 - } -} - -# Diarch (actor) shifts from an Entrenched Regency to Co-Emperorship. -diarch_regent_appoints_self_co_emperor_interaction = { - category = interaction_category_diarch - common_interaction = yes - diarch_interaction = yes - icon = icon_entrench_regency - - desc = diarch_regent_appoints_self_co_emperor_interaction_desc - - popup_on_receive = yes - pause_on_receive = yes - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - exists = liege - is_diarch_of_target = liege - # With the extra consideration that we only want this to appear for those who can actually _have_ co-emperors. - liege = { - has_diarchy_parameter = diarch_can_appoint_self_co_emperor - may_appoint_co_emperors_trigger = yes - } - } - } - - is_valid_showing_failures_only = { - # Make sure scope:recipient is the liege. - custom_tooltip = { - text = custom_description.tt.must_target_liege - scope:recipient = scope:actor.liege - } - # Diarchs must have unlocked the appropriate power. - scope:actor.liege = { has_diarchy_active_parameter = diarch_can_appoint_self_co_emperor } - # You must be able to act as diarch. - diarch_cannot_be_disabled_trigger = { DIARCH = scope:actor } - } - - cost = { - influence = { - # Rulers pay influence, non-rulers get a freebie (since they otherwise likely won't accrue the requisite influence). - if = { - limit = { - scope:actor = { is_ruler = yes } - } - value = 500 - } - # If we're doing this vs. someone who could leave a regency, it's significantly costlier. - if = { - limit = { - scope:recipient = { regency_for_personal_reasons_trigger = no } - } - add = 1000 - } - } - } - - on_accept = { - scope:recipient = { - # Tell scope:recipient what's up. - send_interface_toast = { - type = msg_start_diarchy - title = diarch_regent_appoints_self_co_emperor_interaction.tt.recipient_notification - left_icon = scope:actor - # Change the diarchy type to a co-emperorship. - custom_tooltip = { - text = diarch_regent_appoints_self_co_emperor_interaction.tt.become_co_emperorship - set_diarchy_type = co_emperorship - } - # Set our power level down a bit, we've just got one helluva prize. - custom_tooltip = { - text = diarch_regent_appoints_self_co_emperor_interaction.tt.set_swing - set_diarchy_swing = diarch_regent_appoints_self_co_emperor_interaction_sop_swing_set_value - } - add_legitimacy = minor_legitimacy_loss - } - # Plus scope:recipient probably isn't super happy about this. - add_opinion = { - target = scope:actor - modifier = suspicion_opinion - opinion = -50 - } - } - # Notify the player about the price spike. - if = { - limit = { - scope:recipient = { regency_for_personal_reasons_trigger = yes } - } - custom_tooltip = diarch_regent_appoints_self_co_emperor_interaction.tt.adults_cost_more - } - else = { custom_tooltip = diarch_regent_appoints_self_co_emperor_interaction.children_cost_less } - # Bit o'prestige for your hard work. - scope:actor = { add_prestige = medium_prestige_gain } - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 12 - hegemony = 12 - } - ai_potential = { - is_diarch = yes - # Filter us down nice'n'tight. - liege = { may_appoint_co_emperors_trigger = yes } - # Loyal diarchs don't engage in skullduggery. - diarch_loyalty < diarch_loyalty_visibly_loyal_threshold - } - - ai_will_do = { - # You never _don't_ want to do this. - base = 1000 - } -} - -# Liege (actor) ends a Temporary Regency. -liege_dismiss_temporary_regency_interaction = { - category = interaction_category_diarch - common_interaction = yes - icon = icon_dismiss_temporary_regency - - desc = liege_dismiss_temporary_regency_interaction_desc - - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - diarch ?= scope:recipient - # With the extra consideration that we only want this to appear for Temporary Regencies. - has_diarchy_parameter = can_be_instantly_dismissed - } - } - - is_valid_showing_failures_only = { - # Basic requirements must be fulfilled. - scope:actor = { can_leave_diarchy_trigger = yes } - } - - on_accept = { - scope:actor = { - # Tell scope:recipient what's up. - send_interface_toast = { - type = event_toast_effect_neutral - title = liege_dismiss_temporary_regency_interaction.tt.recipient_notification - left_icon = scope:actor - right_icon = scope:recipient - # End the diarchy. - end_diarchy = yes - scope:recipient = { - # Bit o'prestige for your hard work. - if = { - limit = { - exists = dynasty - NOT = { - exists = scope:actor.dynasty.dynast - dynasty.dynast = scope:actor.dynasty.dynast - } - } - custom_tooltip = liege_dismiss_temporary_regency_interaction.tt.dynasty_receives_prestige - hidden_effect = { - dynasty = { add_dynasty_prestige = liege_dismiss_temporary_regency_interaction_dynasty_prestige_value } - } - } - else = { add_prestige = medium_prestige_gain } - } - } - } - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_dismtemp_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_dismtemp_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_dismtemp_accept_recipient_list } - } - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = diarch } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 24 - kingdom = 12 - empire = 12 - hegemony = 12 - } - ai_potential = { has_active_diarchy = yes } - - ai_will_do = { - # You never _don't_ want to do this. - base = 1000 - } -} - -# Liege (actor) moves to end an Entrenched Regency. -liege_dismiss_entrenched_regency_interaction = { - category = interaction_category_diarch - common_interaction = yes - notification_text = liege_dismiss_entrenched_regency_interaction_proposal - icon = icon_dismiss_entrenched_regency - - desc = liege_dismiss_entrenched_regency_interaction_desc - - ai_maybe = yes - can_send_despite_rejection = yes - popup_on_receive = yes - pause_on_receive = yes - - interface_priority = 60 - ai_min_reply_days = 4 - ai_max_reply_days = 9 - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - diarch ?= scope:recipient - # With the extra consideration that we only want this to appear for Entrenched Regencies. - OR = { - has_diarchy_parameter = dismissal_requires_gift - AND = { - has_diarchy_parameter = dismissal_requires_no_ministry - tgp_has_access_to_ministry_trigger = no - } - } - } - } - - cooldown = { years = 1 } - - is_valid_showing_failures_only = { - # Basic requirements must be fulfilled. - scope:actor = { can_leave_diarchy_trigger = yes } - # And you mustn't be locked in by your regent's power. - scope:actor = { - NOT = { has_diarchy_active_parameter = regency_cant_be_ended_above_this_point } - } - # Must select something. - trigger_if = { - # AI won't exploit and need this exception, as they don't actually open the windows, so they'll be blocked from taking the interaction otherwise. - limit = { - scope:actor = { is_ai = no } - } - custom_tooltip = { - text = interactions_general.tt.must_select_one_option - OR = { - scope:diarchy_ending_gift_unnecessary = yes - scope:diarchy_ending_gift_stiffed = yes - scope:diarchy_ending_gift_hook = yes - scope:diarchy_ending_gift_dynasty_prestige = yes - scope:diarchy_ending_gift_piety = yes - scope:diarchy_ending_gift_cash = yes - scope:diarchy_ending_gift_herd = yes - } - } - } - custom_tooltip = { - text = government_is_celestial_tt - scope:actor = { - tgp_has_access_to_ministry_trigger = no - } - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - # Ending gifts. - send_options_exclusive = yes - ## No gift required. - send_option = { - flag = diarchy_ending_gift_unnecessary - current_description = diarchy_ending_gift_unnecessary_desc - is_shown = { - scope:actor = { - NOT = { has_diarchy_active_parameter = regency_free_end_below_this_point } - } - } - } - ## Stiff scope:recipient for opinion loss. - send_option = { - flag = diarchy_ending_gift_stiffed - current_description = diarchy_ending_gift_stiffed_desc - is_shown = { - scope:actor = { has_diarchy_active_parameter = regency_free_end_below_this_point } - } - } - ## A hook for scope:recipient on scope:actor. - send_option = { - flag = diarchy_ending_gift_hook - current_description = diarchy_ending_gift_hook_desc - is_shown = { - scope:recipient = { - NOT = { has_hook = scope:actor } - } - } - } - ## Transfer some of your prestige into their dynasty prestige. - send_option = { - flag = diarchy_ending_gift_dynasty_prestige - current_description = diarchy_ending_gift_dynasty_prestige_desc - is_shown = { - # Filter out characters with no dynasty. - exists = scope:recipient.dynasty - # And make sure that they don't share a dynasty. - trigger_if = { - limit = { exists = scope:actor.dynasty } - scope:actor.dynasty != scope:recipient.dynasty - } - } - } - ## Pray for them to transfer piety. - ### Requires same-HoF. - send_option = { - flag = diarchy_ending_gift_piety - current_description = diarchy_ending_gift_piety_desc - is_shown = { - shared_faith_or_hof_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - } - ## Cash. - send_option = { - flag = diarchy_ending_gift_cash - current_description = diarchy_ending_gift_cash_desc - } - ## Horse. - send_option = { - flag = diarchy_ending_gift_herd - current_description = diarchy_ending_gift_herd_desc - is_shown = { - # Can only pay herd if actor has herd to pay and recipient accepts herd as a currency - scope:actor = { government_has_flag = government_is_nomadic } - scope:recipient = { government_has_flag = government_is_nomadic } - } - } - - on_send = { - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - # Remove the waiting flag. - add_character_flag = trying_to_dismiss_regent - } - } - - on_accept = { - # End the diarchy. - scope:actor = { end_diarchy = yes } - scope:recipient = { - # Transfer a gift. - ## ... or don't, 'cause one isn't necessary! - if = { - limit = { scope:diarchy_ending_gift_unnecessary = yes } - custom_tooltip = liege_dismiss_entrenched_regency_interaction.tt.no_gift_necessary - } - ## Give 'em *nothing*, even though they earnt it. - if = { - limit = { scope:diarchy_ending_gift_stiffed = yes } - custom_tooltip = liege_dismiss_entrenched_regency_interaction.tt.stiff_them - # Scope:recipient is unhappy about this. - if = { - limit = { is_ai = yes } - # More so if they're arrogant, as they take such a smack in the face even more on the proverbial nose. - if = { - limit = { has_trait = arrogant } - add_opinion = { - target = scope:actor - modifier = insult_opinion - opinion = -50 - } - } - else = { - add_opinion = { - target = scope:actor - modifier = disappointed_opinion - opinion = -30 - } - } - } - } - ## Give 'em a hook. - if = { - limit = { scope:diarchy_ending_gift_hook = yes } - # Transfer the hook. - add_hook = { - type = favor_hook - target = scope:actor - } - # Plus they're happy. - if = { - limit = { is_ai = yes } - # More so if they're deceitful, since they value favours. - if = { - limit = { has_trait = deceitful } - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 30 - } - } - else = { - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 15 - } - } - } - } - ## Give 'em some dynasty prestige. - if = { - limit = { scope:diarchy_ending_gift_dynasty_prestige = yes } - scope:actor = { add_prestige = minor_prestige_loss } - # Transfer the prestige. - custom_tooltip = liege_dismiss_entrenched_regency_interaction.tt.dynasty_receives_prestige - hidden_effect = { - dynasty = { add_dynasty_prestige = liege_dismiss_entrenched_regency_interaction_dynasty_prestige_value } - } - # Plus they're happy. - if = { - limit = { is_ai = yes } - # More so if they're the dynasty head, as then they can make use of it. - if = { - limit = { dynasty.dynast = scope:recipient } - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 30 - } - } - else = { - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 15 - } - } - } - } - ## Give 'em some piety. - if = { - limit = { scope:diarchy_ending_gift_piety = yes } - # Transfer the piety. - scope:actor = { add_piety = medium_piety_loss } - add_piety = major_piety_value - # Plus they're happy. - if = { - limit = { is_ai = yes } - # More so if they're zealous, as zealots like piety. - if = { - limit = { has_trait = zealous } - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 30 - } - } - else = { - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 15 - } - } - } - } - ## Five 'em cold, hard cash. - if = { - limit = { scope:diarchy_ending_gift_cash = yes } - # Transfer the cash. - scope:actor = { - pay_short_term_gold = { - target = scope:recipient - gold = major_gold_value - } - } - # Plus they're happy. - if = { - limit = { is_ai = yes } - # More so if they're greedy, 'cause greedy likes money. - if = { - limit = { has_trait = greedy } - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 30 - } - } - else = { - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 15 - } - } - } - } - # Herd - if = { - limit = { scope:diarchy_ending_gift_herd = yes } - # Transfer the cash. - scope:actor = { - #gold = major_gold_value - pay_herd = { - target = scope:recipient - value = domicile.ten_percent_herd_value - } - } - # Plus they're happy. - if = { - limit = { is_ai = yes } - # More so if they're greedy, 'cause greedy likes money i mean horses. - if = { - limit = { has_trait = greedy } - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 30 - } - } - else = { - add_opinion = { - target = scope:actor - modifier = pleased_opinion - opinion = 15 - } - } - } - } - } - - # Object explorer logging. - if = { - limit = { always = scope:diarchy_ending_gift_unnecessary } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_unnecessary_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_unnecessary_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_unnecessary_accept_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_stiffed } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_stiffed_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_stiffed_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_stiffed_accept_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_hook } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_hook_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_hook_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_hook_accept_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_dynasty_prestige } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_dynpres_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_dynpres_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_dynpres_accept_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_piety } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_piety_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_piety_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_piety_accept_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_cash } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_cash_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_cash_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_cash_accept_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_herd } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_herd_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_herd_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_herd_accept_recipient_list } - } - } - } - - on_decline = { - scope:actor = { - # Attempting to assert authority pushes scope:actor's scales in their favour. - update_diarchy_swing_with_perspective_effect = { - SWING = major_sop_swing_liege_gain - LIEGE = scope:actor - } - # Plus AI don't like being told *no*. - if = { - limit = { is_ai = no } - add_opinion = { - target = scope:recipient - modifier = trust_opinion - opinion = -30 - } - } - } - # Clean-up that pesky flag. - if = { - limit = { - scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } - } - scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } - } - # And add a _new_ pesky flag to stop 'em doubling up whilst also telling them to try to take this interaction again AQAP. - ## This is to stop the AI from failing to tackle this efficiently. - scope:actor = { - if = { - limit = { is_ai = yes } - add_character_flag = trying_to_dismiss_regent - trigger_event = { - id = diarchy.0111 - days = 366 - } - } - } - - # Object explorer logging. - if = { - limit = { always = scope:diarchy_ending_gift_stiffed } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_stiffed_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_stiffed_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_stiffed_decline_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_hook } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_hook_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_hook_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_hook_decline_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_dynasty_prestige } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_dynpres_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_dynpres_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_dynpres_decline_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_piety } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_piety_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_piety_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_piety_decline_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_cash } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_cash_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_cash_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_cash_decline_recipient_list } - } - } - else_if = { - limit = { always = scope:diarchy_ending_gift_herd } - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_entr_herd_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_herd_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_entr_herd_decline_recipient_list } - } - } - } - - auto_accept = { - custom_tooltip = { - text = liege_dismiss_entrenched_regency_interaction.tt.force_ending - scope:diarchy_ending_gift_unnecessary = yes - } - } - - ai_accept = { - # Diarchs don't *want* to agree, by default... - base = 0 - - # ... except loyal ones, who really, really do... - modifier = { - add = 100 - desc = liege_dismiss_entrenched_regency_interaction.modifier.desc.loyal_diarch - diarch_loyalty >= diarch_loyalty_visibly_loyal_threshold - } - # ... plus inactive ones, who can't really refuse. - modifier = { - add = 50 - desc = liege_dismiss_entrenched_regency_interaction.modifier.desc.is_disabled - scope:recipient = { is_diarch_able_trigger = no } - } - # If you could just end the diarchy without any fuss, then they're much more inclined to agree. - modifier = { - add = 1000 - desc = liege_dismiss_entrenched_regency_interaction.modifier.desc.could_freely_dismiss_me - scope:actor = { - NOT = { has_diarchy_active_parameter = regency_free_end_below_this_point } - } - } - # Factor for diplomacy. - ## Yours. - modifier = { - add = { - value = scope:actor.diplomacy - multiply = 2 - } - desc = INTERACTION_DIPLOMACY_ACTOR - } - ## Theirs. - modifier = { - add = { - value = scope:recipient.diplomacy - multiply = -2 - } - desc = INTERACTION_DIPLOMACY_RECIPIENT - } - # Factor for opinion. - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - # Factor for AI personalities. - ai_value_modifier = { - ai_honor = 1 - ai_boldness = -0.5 - } - # Factor for Scales of Power. - modifier = { - add = { - value = scope:actor.diarchy_swing - # Reduce by 40. - ## 20 is (currently) the node at which things become free, so we want to subtract above this point and invert below it. - ## The extra -20 is so that diarchs are more willing to go in exchange for a gift when their power is ebbing, rather than holding on until they can be discharged without one. - add = -40 - # Invert it, since scope:actor wants low scales. - multiply = -1 - } - desc = INTERACTION_SCALES_OF_POWER - } - # Intimidation. - ## Intimidated. - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - ## Cowed. - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - # Factor for low grandeur. - ## 1 level below. - modifier = { - add = -20 - desc = GRANDEUR_REASON - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level <= 1_levels_below_expected_level - court_grandeur_current_level > 3_levels_below_expected_level - } - ## 3 levels below. - modifier = { - add = -40 - desc = GRANDEUR_REASON - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level <= 3_levels_below_expected_level - court_grandeur_current_level > 5_levels_below_expected_level - } - ## 5 levels below. - modifier = { - add = -60 - desc = GRANDEUR_REASON - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level <= 5_levels_below_expected_level - court_grandeur_current_level > 7_levels_below_expected_level - } - ## 7 levels below. - modifier = { - add = -80 - desc = GRANDEUR_REASON - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level <= 7_levels_below_expected_level - court_grandeur_current_level > 9_levels_below_expected_level - } - ## 9 levels below. - modifier = { - add = -100 - desc = GRANDEUR_REASON - has_royal_court = yes - has_dlc_feature = royal_court - court_grandeur_current_level <= 9_levels_below_expected_level - } - # Negative relationships. - ## Rival. - modifier = { - add = -50 - desc = offer_vassalization_interaction_aibehavior_rival_tt - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - ## Nemesis. - modifier = { - add = -100 - desc = offer_vassalization_interaction_aibehavior_nemesis_tt - scope:recipient = { has_relation_nemesis = scope:actor } - } - # Plus for whether you're offering a gift and if it's one they need or not. - ## No gift offered. - ### No base-vs.-trait modifier here, as we want arrogant characters to be dramatic little bastards. - modifier = { - add = -30 - desc = AI_OPINION_OFFENDED - scope:diarchy_ending_gift_stiffed = yes - } - ## Favour. - ### Deceitful variant. - modifier = { - add = 60 - desc = liege_dismiss_entrenched_regency_interaction.tt.deceitful_likes_hook - scope:diarchy_ending_gift_hook = yes - has_trait = deceitful - } - ### Base variant. - modifier = { - add = 30 - desc = liege_dismiss_entrenched_regency_interaction.tt.offered_gift - scope:diarchy_ending_gift_hook = yes - NOT = { has_trait = deceitful } - } - ## Dynasty Prestige. - ### Dynasty Head variant. - modifier = { - add = 60 - desc = liege_dismiss_entrenched_regency_interaction.tt.dynasty_head_likes_dynasty_prestige - scope:diarchy_ending_gift_dynasty_prestige = yes - this = dynasty.dynast - } - ### Base variant. - modifier = { - add = 30 - desc = liege_dismiss_entrenched_regency_interaction.tt.offered_gift - scope:diarchy_ending_gift_dynasty_prestige = yes - this != dynasty.dynast - } - ## Piety. - ### Zealous variant. - modifier = { - add = 60 - desc = liege_dismiss_entrenched_regency_interaction.tt.zealous_likes_piety - scope:diarchy_ending_gift_piety = yes - has_trait = zealous - } - ### Base variant. - modifier = { - add = 30 - desc = liege_dismiss_entrenched_regency_interaction.tt.offered_gift - scope:diarchy_ending_gift_piety = yes - NOT = { has_trait = zealous } - } - ## Cash. - ### Greedy variant. - modifier = { - add = 60 - desc = liege_dismiss_entrenched_regency_interaction.tt.greedy_likes_cash - scope:diarchy_ending_gift_cash = yes - has_trait = greedy - } - ### Base variant. - modifier = { - add = 30 - desc = liege_dismiss_entrenched_regency_interaction.tt.offered_gift - scope:diarchy_ending_gift_cash = yes - NOT = { has_trait = greedy } - } - ### Also debters like this. - modifier = { - add = 60 - desc = PT_AI_IS_IN_DEBT - scope:diarchy_ending_gift_cash = yes - debt_level >= 1 - } - } - - # AI - ai_targets = { ai_recipients = diarch } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 24 - kingdom = 12 - empire = 12 - hegemony = 12 - } - ai_potential = { - # Are we in a diarchy at all? - has_active_diarchy = yes - # Can we leave it? - can_leave_diarchy_trigger = yes - # Are we locked into a speed-leave cycle? - NOT = { has_character_flag = trying_to_dismiss_regent } - } - - ai_will_do = { - # You never _don't_ want to do this. - base = 1000 - - # Flag management. - ## Auto-dismiss. - modifier = { - add = 10 - scope:diarchy_ending_gift_unnecessary = yes - } - ## Stiff 'em. - ### If we hate the diarch, try to stiff them till we can dismiss 'em. - modifier = { - scope:diarchy_ending_gift_stiffed = yes - add = 9 - diarch_liege_wants_to_stiff_regent_trigger = yes - } - ### Otherwise, try to down prio this. It'll just make things harder. - modifier = { - scope:diarchy_ending_gift_stiffed = yes - add = 1 - diarch_liege_wants_to_stiff_regent_trigger = no - } - ## Hook. - modifier = { - add = 4 - scope:diarchy_ending_gift_hook = yes - } - ## Dynasty Prestige. - modifier = { - add = 5 - scope:diarchy_ending_gift_dynasty_prestige = yes - } - ## Piety. - modifier = { - add = 2 - scope:diarchy_ending_gift_piety = yes - } - ## Cash. - modifier = { - add = 3 - scope:diarchy_ending_gift_cash = yes - } - ## Herd. - modifier = { - add = 5 - scope:diarchy_ending_gift_herd = yes - } - } -} - -# Liege (actor) dismisses a Vizierate. -liege_dismiss_vizier_interaction = { - category = interaction_category_diarch - common_interaction = yes - icon = icon_dismiss_temporary_regency - - desc = liege_dismiss_vizier_interaction_desc - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Diarchy checks for scope:actor. - scope:actor = { - # If you're not in a diarchy, we don't care. - diarch ?= scope:recipient - # With the extra consideration that we only want this to appear for Vizierates. - has_diarchy_parameter = primeminister_dismissal_will_upset_administration - } - } - - is_valid_showing_failures_only = { - # Basic requirements must be fulfilled. - scope:actor = { can_leave_diarchy_trigger = yes } - } - - cooldown = { years = 5 } - - on_accept = { - scope:actor = { - # We've dismissed your vizier! - ## Do we need to give a warning tooltip first? - if = { - limit = { has_diarchy_active_parameter = primeminister_dismissal_will_upset_administration } - custom_tooltip = liege_dismiss_vizier_interaction.tt.problematic_dismissal.vizier_too_entrenched - } - ## Now apply the real effects. - send_interface_toast = { - type = event_toast_effect_neutral - title = liege_dismiss_vizier_interaction.toast.t - left_icon = scope:actor - # Will this have ripple effects (actual)? - if = { - limit = { has_diarchy_active_parameter = primeminister_dismissal_will_upset_administration } - # Apply the modifier, scaling to how much we dun goofed. - add_character_modifier = { - modifier = civil_service_in_chaos_modifier - years = 10 - } - } - # End the diarchy. - end_diarchy = yes - } - } - # How badly do they take it? - scope:recipient = { - # Vengeful takes it badly. - if = { - limit = { - has_trait = vengeful - can_set_relation_rival_trigger = { CHARACTER = scope:actor } - } - set_relation_rival = { - target = scope:actor - reason = rival_dismissed_me_from_vizierate - } - add_opinion = { - target = scope:actor - modifier = insult_opinion - opinion = -50 - } - } - # Even if they have something stopping them from becoming a rival (e.g., they're already your vizier). - else_if = { - limit = { has_trait = vengeful } - add_opinion = { - target = scope:actor - modifier = insult_opinion - opinion = -50 - } - } - # Forgiving isn't mad, they're just disappointed. - else_if = { - limit = { has_trait = forgiving } - add_opinion = { - target = scope:actor - modifier = insult_opinion - opinion = -10 - } - } - # Otherwise, a bit of pain is to be expected. - else = { - progress_towards_rival_effect = { - REASON = rival_dismissed_me_from_vizierate - CHARACTER = scope:actor - OPINION = 0 - } - # Throw the opinion manually so we can keep the type unified. - add_opinion = { - target = scope:actor - modifier = insult_opinion - opinion = -25 - } - } - # Plus some stress. - stress_impact = { - lazy = major_stress_impact_loss - humble = medium_stress_impact_loss - content = medium_stress_impact_loss - diligent = medium_stress_impact_gain - ambitious = major_stress_impact_gain - arrogant = major_stress_impact_gain - } - # Extravagance modifiers taken care of in the on_action. - } - # Plus, remember to advertise to the player that there are alternatives. - ## We're deliberately doing this outside of scope:actor so we can make it a lil subtitle rather than something lumped in with the effect block. - ## Just give 'em a duchy. - if = { - limit = { - scope:actor = { has_diarchy_active_parameter = primeminister_requires_duchy } - } - custom_tooltip = liege_dismiss_vizier_interaction.tt.problematic_dismissal.bribe.duchy - } - ## Just give 'em a county. - else_if = { - limit = { - scope:actor = { has_diarchy_active_parameter = primeminister_requires_county } - } - custom_tooltip = liege_dismiss_vizier_interaction.tt.problematic_dismissal.bribe.county - } - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_dismviz_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_dismviz_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_dismviz_accept_recipient_list } - } - } - - auto_accept = yes - - # AI - ai_targets = { ai_recipients = diarch } - ai_frequency_by_tier = { - barony = 0 - county = 120 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 24 - } - ai_potential = { has_active_diarchy = yes } - - ai_will_do = { - # You should actively want to get rid of them. - base = -25 - - # If you appointed this vizier, don't remove them unless you get booted down to county or something. - modifier = { - add = -500 - var:my_vizier ?= scope:recipient - } - - # Realm. - ## Weight up heavily for counts; they shouldn't generally get them, but they don't want to keep them if they do. - modifier = { - add = 1000 - highest_held_title_tier = tier_county - } - ## Weight up for dukes. - modifier = { - add = 25 - highest_held_title_tier = tier_duchy - } - ## Weight down for kings. - modifier = { - add = -25 - highest_held_title_tier = tier_kingdom - } - ## Weight down for emperors. - modifier = { - add = -50 - highest_held_title_tier >= tier_empire - } - ## Realm Size. - ### Smaller you are, the more likely you are to do this. - ### Tiny or less. - modifier = { - add = 50 - realm_size <= tiny_realm_size - } - ### Minor. - modifier = { - add = 25 - realm_size > tiny_realm_size - realm_size <= minor_realm_size - } - ### Major. - modifier = { - add = -25 - realm_size >= major_realm_size - realm_size < massive_realm_size - } - ### Massive or more. - modifier = { - add = -50 - realm_size >= massive_realm_size - } - - # Traits. - ## +++ Ambitious. - modifier = { - add = 25 - has_trait = ambitious - } - ## +++ Arrogant. - modifier = { - add = 25 - has_trait = arrogant - } - ## ++ Diligent. - modifier = { - add = 15 - has_trait = diligent - } - ## ++ Patient. - modifier = { - add = 15 - has_trait = patient - } - ## + Gregarious. - modifier = { - add = 5 - has_trait = gregarious - } - ## - Shy. - modifier = { - add = -5 - has_trait = shy - } - ## - Content. - modifier = { - add = -5 - has_trait = content - } - ## -- Impatient. - modifier = { - add = -15 - has_trait = impatient - } - ## -- Content. - modifier = { - add = -15 - has_trait = content - } - ## -- Humble. - modifier = { - add = -15 - has_trait = humble - } - ## --- Greedy. - modifier = { - add = -25 - has_trait = greedy - } - ## --- Lazy. - modifier = { - add = -25 - has_trait = lazy - } - } -} - -# A vassal requests their liege designate them as regent, should the need arise. -declare_me_regent_interaction = { - category = interaction_category_diarch - icon = icon_declare_me_regent - filter_tags = { admin_liege rep_liege } - - desc = declare_me_regent_interaction_desc - notification_text = DECLARE_ME_REGENT_PROPOSAL - - interface_priority = 20 - ai_min_reply_days = 4 - ai_max_reply_days = 9 - - is_shown = { - # The obvious. - scope:actor != scope:recipient - # Only useable on your liege. - scope:recipient = scope:actor.liege - # And said-liege can't be in a regency already... - scope:recipient = { - trigger_if = { - limit = { - NOT = { has_diarchy_type = grand_secretariat } - } - has_active_diarchy = no - } - trigger_else = { - scope:actor = { - OR = { - has_title = title:e_minister_grand_marshal - has_title = title:e_minister_chancellor - has_title = title:e_minister_censor - } - } - } - } - # ... or have declared you their regent already! - scope:actor = { - is_designated_diarch = no - NOR = { - is_diarch_of_target = scope:recipient - # Can't be used during the Cid story cycle - has_variable = ongoing_cid_story_cycle - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - # Can't do if you're already expected to be regent. - is_designated_diarch = no - # Can't be too young. - is_adult = yes - # Or imprisoned. - is_imprisoned = no - # Or, for that matter, incapable. - NOT = { has_trait = incapable } - is_diarch_valid_trigger = yes - } - # Put a general cooldown on this stuff. - scope:recipient = { - trigger_if = { - limit = { - exists = designated_diarch - } - time_after_diarch_designated = { years >= 10 } - } - } - } - - # No general cooldown: if your liege changes, ask away. - # Long specific cooldown, though. We don't want these going through constantly. - cooldown_against_recipient = { years = 10 } - - # High cost to reduce spam. - cost = { prestige = 500 } - - #Use hook - send_options_exclusive = no - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = GENERIC_SPEND_A_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = declare_me_regent_interaction.tt.success - left_icon = scope:recipient - # Jump the queue to become diarch. - scope:recipient = { - if = { - limit = { - has_diarchy_type = grand_secretariat - } - if = { - limit = { - scope:actor = { - has_title = title:e_minister_grand_marshal - } - } - add_realm_law = grand_marshal_law - } - else_if = { - limit = { - scope:actor = { - has_title = title:e_minister_chancellor - } - } - add_realm_law = grand_chancellor_law - } - else_if = { - limit = { - scope:actor = { - has_title = title:e_minister_censor - } - } - add_realm_law = grand_censor_law - } - scope:actor = { - set_variable = { - name = asked_to_be_secretary_director - value = yes - } - } - } - else = { - designate_diarch = scope:actor - } - } - # This prompts some strife. - change_strife_opinion = major_strife_gain - } - # If you used a hook, calc some extra stuff. - ## We move this outside of the toast because we've not got enough room for all this info in there. - if = { - limit = { - scope:hook = yes - has_usable_hook = scope:recipient - } - # Use the hook up. - use_hook = scope:recipient - # Plus scope:recipient is _very_ upset. - reverse_add_opinion = { - target = scope:recipient - modifier = suspicion_opinion - opinion = -20 - } - } - } - scope:recipient = { - # Some folks may not be happy. - custom_tooltip = declare_me_regent_interaction.tt.warning.opinions.succession - custom_tooltip = declare_me_regent_interaction.tt.warning.opinions.courtlies - } - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_desigme_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_desigme_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_desigme_accept_recipient_list } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = declare_me_regent_interaction.tt.failure - left_icon = scope:recipient - # AI lose opinion of their opposite number. - if = { - limit = { is_ai = yes } - add_opinion = { - target = scope:recipient - modifier = insult_opinion - opinion = -40 - } - } - # Even trying produces some strife. - change_strife_opinion = medium_strife_gain - } - } - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_desigme_decline } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_desigme_decline_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_desigme_decline_recipient_list } - } - } - - auto_accept = { - scope:recipient = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - } - - ai_accept = { - # Try to make it 0 for most interactions - base = -40 - - # Weight for dislike of current regent. - # Designated regent. - modifier = { - add = { - # Designated diarchs. - if = { - limit = { - designated_diarch ?= { - save_temporary_scope_as = diarch_successor_temp - save_temporary_opinion_value_as = { - name = recipient_opinion_temp - target = scope:diarch_successor_temp - } - } - } - add = scope:recipient_opinion_temp - # Invert to get the true total. - multiply = -1 - } - # Expected diarchs. - else_if = { - limit = { - diarchy_successor ?= { - save_temporary_scope_as = diarch_successor_temp - scope:actor = { - save_temporary_opinion_value_as = { - name = recipient_opinion_temp - target = scope:diarch_successor_temp - } - } - } - } - add = scope:recipient_opinion_temp - # Invert to get the true total. - multiply = -1 - } - } - desc = declare_me_regent_interaction.tt.opinion_of_current_regent - } - # Opinion of scope:actor. - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - } - # Personality. - ai_value_modifier = { - # Meek characters are more likely to accept this. - ai_boldness = -0.5 - # Characters with low energy just want to avoid all this planning. - ai_energy = -0.25 - } - # Familial closeness. - ## Close family get a decent boost. - modifier = { - add = 30 - desc = declare_me_regent_interaction.tt.actor_is.close_family - is_close_family_of = scope:actor - # Make sure this isn't cancelled out by the incumbent sharing the relation. - diarchy_successor = { - NOT = { - is_close_family_of = scope:recipient - } - } - } - ## Extended family get a minor boost. - modifier = { - add = 20 - desc = declare_me_regent_interaction.tt.actor_is.extended_family - is_extended_family_of = scope:actor - # Make sure this isn't cancelled out by the incumbent sharing the relation. - diarchy_successor = { - NOT = { - is_extended_family_of = scope:recipient - } - } - } - ## House members get a slight boost. - modifier = { - add = 10 - desc = declare_me_regent_interaction.tt.actor_is.house_member - house = scope:actor.house - NOT = { - is_close_or_extended_family_of = scope:actor - } - # Make sure this isn't cancelled out by the incumbent sharing the relation. - diarchy_successor = { - house != scope:recipient.house - } - } - # Relationships. - ## Positive. - modifier = { - add = 25 - desc = declare_me_regent_interaction.tt.actor_is.positive_relationship - has_any_good_relationship_with_character_trigger = { CHARACTER = scope:actor } - # We don't factor for this in the designated/expected diarch 'cause the matrix of overlap'd be hellish. - } - ## Negative. - modifier = { - add = -25 - desc = declare_me_regent_interaction.tt.actor_is.negative_relationship - has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } - # We don't factor for this in the designated/expected diarch 'cause the matrix of overlap'd be hellish. - } - # Succession score is a direct factor. - modifier = { - add = scope:actor.diarchy_regent_succession_score_value - desc = declare_me_regent_interaction.tt.actor_is.succession_score - scope:recipient = { - NOT = { has_diarchy_type = grand_secretariat } - } - } - - # Grand Secretariat - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - scope:actor.top_participant_group:dynastic_cycle ?= { - exists = var:movement_favored - } - desc = diarch_candidate_score.grand_secretariat.favored_value - add = 20 - } - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - scope:actor = { - is_any_movement_leader = yes - } - desc = you_are_a_movement_leader_desc_value - add = 20 - } - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - scope:actor = { - is_in_pro_hegemon_or_hegemon_movement = yes - } - desc = diarch_candidate_score.grand_secretariat.pro_hegemon_value - add = 20 - } - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - scope:actor = { - has_court_position = favored_minister_court_position - } - desc = grand_secretariat_aptitude.favored_minister_value - add = 20 - } - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - desc = actors_merit_level_desc - add = { - if = { - limit = { - scope:actor.merit_level >= scope:actor.top_liege.diarch.merit_level - scope:actor.merit >= scope:actor.top_liege.merit - } - add = 10 - } - else = { - add = -10 - } - } - } - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - desc = ACTOR_HIGH_MOVEMENT_POWER - add = { - if = { - limit = { - exists = scope:actor.top_liege.diarch.var:movement_power - exists = scope:actor.var:movement_power - scope:actor.var:movement_power >= scope:actor.top_liege.diarch.var:movement_power - } - add = 10 - } - else = { - add = -40 - } - } - } - # Events - modifier = { - add = 25 - desc = tgp_power_undermined_modifier_tt - has_character_modifier = tgp_power_undermined_modifier - # We don't factor for this in the designated/expected diarch 'cause the matrix of overlap'd be hellish. - } - } - - # AI - #ai_targets = { ai_recipients = liege } - #ai_frequency = 0 - # - #ai_potential = { - # # Turning off for the AI for the moment due to not being able to display who you'll offend if you do it. - # ## Should otherwise work and can be turned back on again if wished. - # always = no - # # Some traits lock the AI out. - # ## Calc these first 'cause they're cheaper. - # NOR = { - # has_trait = lazy - # has_trait = humble - # has_trait = content - # } - # OR = { - # # Driven by traits or personality. - # has_trait = arrogant - # has_trait = ambitious - # # Family think themselves worthy. - # any_close_or_extended_family_member = { this = liege } - # } - #} - - ai_will_do = { - # Most AI think this is audacious. - base = 0 - - # Weight for personality. - ## Both modifier. - ai_value_modifier = { - # Bold, energetic characters fancy the gig. - ai_boldness = 0.5 - ai_energy = 0.5 - } - ## And traits! - ### These are balanced differently to the other interactions, so it's deliberate that they're not using the @values here. - ### +++ Ambitious. - modifier = { - add = 15 - has_trait = ambitious - } - ### ++ Arrogant. - modifier = { - add = 10 - has_trait = arrogant - } - ### + Diligent. - modifier = { - add = 5 - has_trait = diligent - } - ### + Loyal. - modifier = { - add = 5 - has_trait = loyal - } - ### - Humble. - modifier = { - add = -5 - has_trait = humble - } - ### --- Content. - modifier = { - add = -15 - has_trait = content - } - ### --- Lazy. - modifier = { - add = -15 - has_trait = lazy - } - # Weight by proximity to the ruler: close family, spouses, etc. - modifier = { - add = 25 - OR = { - any_close_or_extended_family_member = { this = scope:recipient } - any_spouse = { this = scope:recipient } - } - } - # Councillors have ambitions. - modifier = { - add = 25 - is_councillor = yes - } - # Weight for opinion of current regent. - modifier = { - add = { - scope:recipient = { - # Designated diarchs. - if = { - limit = { - designated_diarch ?= { - save_temporary_scope_as = diarch_successor_temp - scope:actor = { - save_temporary_opinion_value_as = { - name = actor_opinion_temp - target = scope:diarch_successor_temp - } - } - } - } - add = scope:actor_opinion_temp - # Invert to get the true total. - multiply = -1 - } - # Expected diarchs. - else_if = { - limit = { - diarchy_successor ?= { - save_temporary_scope_as = diarch_successor_temp - scope:actor = { - save_temporary_opinion_value_as = { - name = actor_opinion_temp - target = scope:diarch_successor_temp - } - } - } - } - add = scope:actor_opinion_temp - # Invert to get the true total. - multiply = -1 - } - } - } - always = yes - } - # The AI will only use a Hook if they couldn't otherwise do this - modifier = { - scope:hook = yes - add = -1 - } - # Grand Secretariat - modifier = { - scope:recipient = { - has_diarchy_type = grand_secretariat - } - add = { - if = { - limit = { - scope:actor.top_participant_group:dynastic_cycle ?= { - exists = var:movement_favored - } - } - add = 10 - } - if = { - limit = { - scope:actor = { - has_court_position = favored_minister_court_position - } - } - add = 20 - } - if = { - limit = { - scope:actor.merit_level >= scope:actor.top_liege.diarch.merit_level - scope:actor.merit >= scope:actor.top_liege.merit - } - add = 10 - } - if = { - limit = { - exists = scope:actor.top_liege.diarch.var:movement_power - exists = scope:actor.var:movement_power - } - if = { - limit = { - scope:actor.var:movement_power >= scope:actor.top_liege.diarch.var:movement_power - } - add = 10 - } - else = { - add = -100 - } - } - } - } - } -} - -# Liege (actor) selects a vizier to help them run the realm. -appoint_vizier_interaction = { - category = interaction_category_diarch - icon = icon_declare_me_regent - - desc = appoint_vizier_interaction_desc - interface_priority = 20 - - is_shown = { - scope:actor = { - # Must be able to retain a vizier. - government_has_flag = may_appoint_viziers - # Plus obscure the interaction if we've already got one, else it's annoyingly redundant. - NOT = { has_diarchy_active_parameter = diarchy_is_vizierate } - } - # We perform this upon ourselves or our (probable) candidates. - scope:recipient = { - OR = { - this = scope:actor - is_courtier_of = scope:actor - AND = { - highest_held_title_tier = tier_barony - liege = scope:actor - } - } - } - } - - is_valid_showing_failures_only = { - # You can't already be in a diarchy of any kind. - scope:actor = { - has_active_diarchy = no - } - # Must be of a decent tier. - custom_tooltip = { - text = appoint_vizier_interaction.tt.duchy_or_more - scope:actor.highest_held_title_tier >= tier_duchy - } - # Plus the usuals. - scope:actor = { is_available_at_peace = yes } - # And can't have put the realm into turmoil over this recently. - scope:actor = { - NOT = { has_character_modifier = civil_service_in_chaos_modifier } - } - } - - cooldown = { years = 5 } - - populate_recipient_list = { sort_vizier_candidates_to_list_effect = yes } - - cost = { - prestige = major_prestige_value - renown = { - if = { - limit = { - exists = scope:secondary_recipient - exists = scope:actor.house - scope:secondary_recipient.house ?= scope:actor.house - } - add = scope:actor.dynasty.massive_dynasty_prestige_value - } - } - } - - auto_accept = yes - - pre_auto_accept = { - # If we're an AI, set the secondary_recipient up for us. - scope:actor = { - if = { - limit = { is_ai = yes } - # First, we need to calc who _is_ most qualified; we don't have access to the character list any more, so reassemble it. - sort_vizier_candidates_to_list_effect = yes - # Now, parse through the list to find the best character. - ordered_in_list = { - list = characters - order_by = diarchy_vizier_succession_score_value - save_scope_as = ai_recipient - } - } - } - } - - on_accept = { - scope:actor = { - # We enter into a vizierate with scope:secondary_recipient. - custom_tooltip = { - text = appoint_vizier_interaction.tt.enter_vizierate_with_secondary_recipient - try_start_diarchy = vizierate - # The player uses scope:secondary_recipient. - if = { - limit = { - # We use a NOT here rather than is_ai = no because the AI was occasionally managing to bork its selection process, and the title does _not_ like setting an empty diarch, so we fallback AI who can't behave to a sub-optimal choice. - NOT = { exists = scope:ai_recipient } - } - set_diarch = scope:secondary_recipient - } - # Whereas the AI grabs their pre-selected candidate. - else = { - set_diarch = scope:ai_recipient - } - } - # Apply opinion. - ## AI. - if = { - limit = { exists = scope:ai_recipient } - scope:ai_recipient = { - add_opinion = { - target = scope:actor - modifier = compliment_opinion - opinion = 30 - } - stress_impact = { - ambitious = minor_stress_impact_loss - arrogant = minor_stress_impact_loss - lazy = major_stress_impact_gain - } - } - } - ## Player. - else = { - scope:secondary_recipient = { - add_opinion = { - target = scope:actor - modifier = compliment_opinion - opinion = 30 - } - stress_impact = { - ambitious = minor_stress_impact_loss - arrogant = minor_stress_impact_loss - lazy = major_stress_impact_gain - } - } - } - # And get X tax jurisdictions. - custom_tooltip = appoint_vizier_interaction.tt.secondary_recipient_grants_tax_jurisdictions - # If scope:secondary_recipient isn't the most qualified candidate, we'll take a scaling negative stewardship modifier. - ## The AI will always pick the highest scoring character, so we only do this for players - lock it off so we're not doing lots of unnecessary calculating. - if = { - limit = { is_ai = no } - # First, we need to calc who _is_ most qualified; we don't have access to the character list any more, so reassemble it. - sort_vizier_candidates_to_list_effect = yes - # Now, parse through the list to find the best character. - ordered_in_list = { - list = characters - order_by = diarchy_vizier_succession_score_value - save_scope_as = best_candidate - } - # Is our chap _the_ chap? - if = { - limit = { - scope:secondary_recipient != scope:best_candidate - } - # Ok, now display some warnings. - custom_tooltip = appoint_vizier_interaction.tt.secondary_recipient_is_not_best_candidate - add_character_modifier = { - modifier = civil_service_upset_modifier - years = 10 - } - } - } - # Are they of our house? - if = { - limit = { - exists = scope:secondary_recipient.house - house ?= scope:secondary_recipient.house - } - custom_tooltip = appoint_vizier_interaction.tt.same_house_penalty - } - # If we have a designated diarch (and it's not this guy), then they're annoyed. - designated_diarch ?= { - if = { - limit = { - this != scope:secondary_recipient - } - add_opinion = { - target = scope:actor - modifier = appointed_vizier_over_designated_regent_opinion - opinion = -40 - } - } - } - # Set a reminder that we appointed this vizier — the AI'll use this to help with determining whether they should remove them or not. - set_variable = { - name = my_vizier - value = scope:recipient - } - # Finally, let's do some stress. - stress_impact = { - trusting = massive_stress_impact_loss - lazy = major_stress_impact_loss - paranoid = minor_stress_impact_gain - diligent = minor_stress_impact_gain - } - } - # Notify about council problemos. - scope:secondary_recipient = { - if = { - limit = { is_councillor = yes } - custom_tooltip = appoint_vizier_interaction.tt.warning.vizier_replace_councillor - } - } - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_appviz_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appviz_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appviz_accept_recipient_list } - } - } - - # AI - ai_targets = { ai_recipients = self } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 240 - kingdom = 120 - empire = 120 - hegemony = 120 - } - - ai_potential = { - government_has_flag = may_appoint_viziers - } - - ai_will_do = { - base = 0 - - # Realm. - ## Weight up for kings. - modifier = { - add = 50 - highest_held_title_tier = tier_kingdom - } - ## Weight up for emperors. - modifier = { - add = 75 - highest_held_title_tier >= tier_empire - } - ## Add realm size directly. - modifier = { - add = sub_realm_size - is_landed = yes - } - - # Traits. - ## +++ Lazy. - modifier = { - add = 25 - has_trait = lazy - } - ## +++ Greedy. - modifier = { - add = 25 - has_trait = greedy - } - ## ++ Humble. - modifier = { - add = 15 - has_trait = humble - } - ## ++ Content. - modifier = { - add = 15 - has_trait = content - } - ## ++ Impatient. - modifier = { - add = 15 - has_trait = impatient - } - ## + Content. - modifier = { - add = 5 - has_trait = content - } - ## + Shy. - modifier = { - add = 5 - has_trait = shy - } - ## - Gregarious. - modifier = { - add = -5 - has_trait = gregarious - } - ## -- Patient. - modifier = { - add = -15 - has_trait = patient - } - ## -- Diligent. - modifier = { - add = -15 - has_trait = diligent - } - ## --- Arrogant. - modifier = { - add = -25 - has_trait = arrogant - } - ## --- Ambitious. - modifier = { - add = -25 - has_trait = ambitious - } - } -} - -# Liege (actor) selects a junior emperor to be their heir. -appoint_junior_emperor_interaction = { - category = interaction_category_diarch - icon = icon_declare_me_regent - redirect = { - scope:recipient = { save_scope_as = secondary_recipient } - if = { - limit = { scope:secondary_recipient = scope:actor } - clear_saved_scope = secondary_recipient - } - if = { - limit = { - NOT = { - scope:secondary_recipient ?= { valid_junior_emperor_candidate_trigger = { LIEGE = scope:actor } } - } - } - clear_saved_scope = secondary_recipient - } - } - - desc = appoint_junior_emperor_interaction_desc - interface_priority = 20 - - is_shown = { - # Must be able to retain a co-emperor. - scope:actor = { may_appoint_co_emperors_trigger = yes } - # We perform this upon ourselves or our (probable) candidates. - OR = { - scope:recipient ?= scope:actor - scope:secondary_recipient ?= { valid_junior_emperor_candidate_trigger = { LIEGE = scope:actor } } - } - } - - is_valid_showing_failures_only = { - # You can't already be in a diarchy of any kind. - scope:actor = { - has_active_diarchy = no - } - # Make sure we're targeting the right people, since redirects make this a lil slippery. - trigger_if = { - limit = { exists = scope:secondary_recipient } - scope:secondary_recipient = { valid_junior_emperor_candidate_trigger = { LIEGE = scope:actor } } - } - # Plus the usuals. - scope:actor = { is_available_at_peace = yes } - } - - populate_recipient_list = { sort_junior_emperor_candidates_to_list_effect = yes } - - cost = { - prestige = designate_heir_admin_prestige_cost - influence = designate_heir_admin_influence_cost - } - - auto_accept = yes - - pre_auto_accept = { - # If we're an AI, set the secondary_recipient up for us. - scope:actor = { - if = { - limit = { is_ai = yes } - # First, we need to calc who _is_ most qualified; we don't have access to the character list any more, so reassemble it. - sort_junior_emperor_candidates_to_list_effect = yes - # Now, parse through the list to find the best character. - ## And by that I mean play literal favourites. - ordered_in_list = { - list = characters - order_by = "reverse_opinion(scope:actor)" - save_scope_as = ai_recipient - } - } - } - } - - on_accept = { - scope:actor = { - # We enter into a junior emperorship with scope:secondary_recipient. - ## The player uses scope:secondary_recipient. - if = { - limit = { - # We use a NOT here rather than is_ai = no because the AI was occasionally managing to bork its selection process, and the title does _not_ like setting an empty diarch, so we fallback AI who can't behave to a sub-optimal choice. - NOT = { exists = scope:ai_recipient } - } - custom_tooltip = { - text = appoint_junior_emperor_interaction.tt.enter_junior_emperorship_with_secondary_recipient - try_start_diarchy = junior_emperorship - set_diarch = scope:secondary_recipient - } - # We set them to be our designated heir. - ## & if we already have an heir, warn that this overwrites it. - designated_heir ?= { - if = { - limit = { this != scope:secondary_recipient } - custom_tooltip = appoint_junior_emperor_interaction.tt.overwrite_designated_heir - # Nab them for use further on. - save_scope_as = old_heir - } - } - ## Designate and inform. - set_designated_heir = scope:secondary_recipient - } - ## Whereas the AI grabs their pre-selected candidate. - else = { - try_start_diarchy = junior_emperorship - set_diarch = scope:ai_recipient - # We set them to be our designated heir. - ## First grabbing the old one for opinions. - designated_heir ?= { - if = { - limit = { this != scope:ai_recipient } - # Nab them for use further on. - save_scope_as = old_heir - } - } - ## Then overwriting. - set_designated_heir = scope:ai_recipient - } - } - # And remember who appointed them on scope:recipient. - grateful_for_appointment_as_co_emperor_effect = yes - # Your designated heir is _very_ pissed. - diarch_overwrites_old_designated_heir_apply_opinions_effect = { - LIEGE = scope:actor - CO_RULER = scope:secondary_recipient - } - # Your designated regent is also unhappy (probably). - designated_diarch_overwridden_by_co_ruler_effect = { - LIEGE = scope:actor - CO_RULER = scope:secondary_recipient - } - # Make sure we have our co-ruler directly with us. - ## Courtiers are given to us immediately. - if = { - limit = { - scope:secondary_recipient = { is_ruler = no } - scope:secondary_recipient = { NOT = { is_in_the_same_court_as = scope:actor } } - } - scope:actor = { add_courtier = scope:secondary_recipient } - } - ## Vassals are retracted. - if = { - limit = { scope:secondary_recipient.liege != scope:actor } - scope:secondary_recipient.liege = { - add_opinion = { - target = scope:actor - modifier = retracted_vassal - } - } - scope:secondary_recipient.liege = { - add_opinion = { - target = scope:actor - modifier = retracted_vassal - } - } - create_title_and_vassal_change = { - type = revoked - save_scope_as = change - } - scope:secondary_recipient = { - change_liege = { - liege = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - - - - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_appjunemp_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appjunemp_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appjunemp_accept_recipient_list } - } - } - - # AI - ai_targets = { ai_recipients = children } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 60 - hegemony = 60 - } - - ai_potential = { - # Filter us down nice'n'tight. - may_appoint_co_emperors_trigger = yes - # Plus rule out any diarchies already on the go. - has_active_diarchy = no - # Aaaand finally, the AI won't do this unless they're considering their age and they've got no adult kids. - age >= 50 - any_child = { - count = all - is_adult = no - } - } - - ai_will_do = { - # The AI doesn't like doing this without good reason. - base = -100 - - ai_wants_junior_or_co_emperor_modifier = yes - } -} - -# Liege (actor) selects a co-emperor to be their heir/influence farming stooge. -appoint_co_emperor_interaction = { - category = interaction_category_diarch - icon = icon_declare_me_regent - redirect = { - scope:recipient = { save_scope_as = secondary_recipient } - if = { - limit = { scope:secondary_recipient ?= scope:actor } - clear_saved_scope = secondary_recipient - } - if = { - limit = { - NOT = { - scope:secondary_recipient ?= { - valid_co_emperor_candidate_trigger = { LIEGE = scope:actor } - } - } - } - clear_saved_scope = secondary_recipient - } - } - - desc = appoint_co_emperor_interaction_desc - interface_priority = 280 - - is_shown = { - # Must be able to retain a co-emperor. - scope:actor = { may_appoint_co_emperors_trigger = yes } - # We perform this upon ourselves or our (probable) candidates. - OR = { - scope:recipient ?= scope:actor - scope:secondary_recipient ?= { - valid_co_emperor_candidate_trigger = { LIEGE = scope:actor } - } - } - } - - is_valid_showing_failures_only = { - # You can't already be in a diarchy of any kind. - scope:actor = { - has_active_diarchy = no - } - # Make sure we're targeting the right people, since redirects make this a lil slippery. - trigger_if = { - limit = { exists = scope:secondary_recipient } - scope:secondary_recipient = { - valid_co_emperor_candidate_trigger = { LIEGE = scope:actor } - } - } - # Plus the usuals. - scope:actor = { is_available_at_peace = yes } - } - - populate_recipient_list = { sort_co_emperor_candidates_to_list_effect = yes } - - cost = { - prestige = designate_heir_admin_prestige_cost - influence = designate_heir_admin_influence_cost - } - - auto_accept = yes - - pre_auto_accept = { - # If we're an AI, set the secondary_recipient up for us. - scope:actor = { - if = { - limit = { is_ai = yes } - # First, we need to calc who _is_ most qualified; we don't have access to the character list any more, so reassemble it. - sort_co_emperor_candidates_to_list_effect = yes - # Now, parse through the list to find the best character. - ## And by that I mean play literal favourites. - ordered_in_list = { - list = characters - order_by = { - value = "reverse_opinion(scope:actor)" - # Boost up anyone we're related to by blood or marriage. - if = { - limit = { - OR = { - is_close_or_extended_family_of = scope:actor - house ?= scope:actor.house - any_spouse = { is_close_or_extended_family_of = scope:actor } - } - } - # This means we should _generally_ prefer people who are in with the imperial family, but if we hate them then we boot them down the list even further. - multiply = 10 - } - } - save_scope_as = ai_recipient - } - } - } - } - - on_accept = { - scope:actor = { - # We enter into a co-emperorship with scope:secondary_recipient. - ## The player uses scope:secondary_recipient. - if = { - limit = { - # We use a NOT here rather than is_ai = no because the AI was occasionally managing to bork its selection process, and the title does _not_ like setting an empty diarch, so we fallback AI who can't behave to a sub-optimal choice. - NOT = { exists = scope:ai_recipient } - } - custom_tooltip = { - text = appoint_co_emperor_interaction.tt.enter_co_emperorship_with_secondary_recipient - try_start_diarchy = co_emperorship - set_diarch = scope:secondary_recipient - } - # If appropriate, we set them to be our designated heir. - if = { - limit = { - scope:secondary_recipient = { - is_close_or_extended_family_of = scope:actor - house ?= scope:actor.house - } - } - # & if we already have an heir, warn that this overwrites it. - designated_heir ?= { - if = { - limit = { this != scope:secondary_recipient } - custom_tooltip = appoint_co_emperor_interaction.tt.overwrite_designated_heir - # Nab them for use further on. - save_scope_as = old_heir - } - } - # Designate and inform. - set_designated_heir = scope:secondary_recipient - } - } - ## Whereas the AI grabs their pre-selected candidate. - else = { - try_start_diarchy = co_emperorship - set_diarch = scope:ai_recipient - # If appropriate, we set them to be our designated heir. - if = { - limit = { - scope:secondary_recipient = { - is_close_or_extended_family_of = scope:actor - house ?= scope:actor.house - } - } - # First grabbing the old one for opinions. - designated_heir ?= { - if = { - limit = { this != scope:secondary_recipient } - # Nab them for use further on. - save_scope_as = old_heir - } - } - # Then overwriting. - set_designated_heir = scope:ai_recipient - } - } - } - # And remember who appointed them on scope:recipient. - grateful_for_appointment_as_co_emperor_effect = yes - # Your designated heir is _very_ pissed. - diarch_overwrites_old_designated_heir_apply_opinions_effect = { - LIEGE = scope:actor - CO_RULER = scope:secondary_recipient - } - # Your designated regent is also unhappy (probably). - designated_diarch_overwridden_by_co_ruler_effect = { - LIEGE = scope:actor - CO_RULER = scope:secondary_recipient - } - # Make sure we have our co-ruler directly with us. - ## Courtiers are given to us immediately. - if = { - limit = { - scope:secondary_recipient = { is_ruler = no } - } - scope:actor = { add_courtier = scope:secondary_recipient } - } - ## Vassals are retracted. - if = { - limit = { - scope:secondary_recipient.liege != scope:actor - scope:secondary_recipient = { NOT = { is_in_the_same_court_as = scope:actor } } - } - scope:secondary_recipient.liege = { - add_opinion = { - target = scope:actor - modifier = retracted_vassal - } - } - create_title_and_vassal_change = { - type = revoked - save_scope_as = change - } - scope:secondary_recipient = { - change_liege = { - liege = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - - - - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_appcoemp_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appcoemp_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appcoemp_accept_recipient_list } - } - } - - # AI - ai_targets = { ai_recipients = children } - ai_targets = { ai_recipients = vassals } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 60 - hegemony = 60 - } - - ai_potential = { - # Filter us down nice'n'tight. - may_appoint_co_emperors_trigger = yes - # Plus rule out any diarchies already on the go. - has_active_diarchy = no - # Aaaand finally, the AI won't do this unless they're considering their age and they've got adult kids. - age >= 50 - any_child = { is_adult = yes } - } - - ai_will_do = { - # The AI doesn't like doing this without good reason. - base = -100 - - ai_wants_junior_or_co_emperor_modifier = yes - } -} - -# Liege (actor) selects one of their children to be their heir & diarch. -appoint_co_monarch_interaction = { - category = interaction_category_diarch - icon = icon_declare_me_regent - redirect = { - scope:recipient = { save_scope_as = secondary_recipient } - if = { - limit = { scope:secondary_recipient ?= scope:actor } - clear_saved_scope = secondary_recipient - } - if = { - limit = { - NOT = { - scope:secondary_recipient ?= { is_child_of = scope:actor } - } - } - clear_saved_scope = secondary_recipient - } - } - - desc = appoint_co_monarch_interaction_desc - interface_priority = 20 - - is_shown = { - # Must be able to retain a co-emperor. - scope:actor = { may_appoint_co_monarchs_trigger = yes } - # We perform this upon ourselves or our (probable) candidates. - OR = { - scope:recipient ?= scope:actor - scope:secondary_recipient ?= { is_child_of = scope:actor } - } - } - - is_valid_showing_failures_only = { - # You can't already be in a diarchy of any kind. - scope:actor = { - has_active_diarchy = no - } - # Make sure we're targeting the right people, since redirects make this a lil slippery. - trigger_if = { - limit = { exists = scope:secondary_recipient } - scope:secondary_recipient = { valid_co_monarch_candidate_trigger = { LIEGE = scope:actor } } - } - # Plus the usuals. - scope:actor = { is_available_at_peace = yes } - } - - populate_recipient_list = { sort_co_monarch_candidates_to_list_effect = yes } - - cost = { - prestige = { - value = designate_heir_cost - # Discount it because this _is_ worse than the standard path. - multiply = 0.5 - } - } - - auto_accept = yes - - pre_auto_accept = { - # If we're an AI, set the secondary_recipient up for us. - scope:actor = { - if = { - limit = { is_ai = yes } - # First, we need to calc who _is_ most qualified; we don't have access to the character list any more, so reassemble it. - sort_co_monarch_candidates_to_list_effect = yes - # Now, parse through the list to find the best character. - ## And by that I mean play literal favourites. - ordered_in_list = { - list = characters - limit = { valid_co_monarch_candidate_trigger = { LIEGE = scope:actor } } - order_by = "reverse_opinion(scope:actor)" - save_scope_as = ai_recipient - } - } - } - } - - on_accept = { - scope:actor = { - # We enter into a co-emperorship with scope:secondary_recipient. - ## The player uses scope:secondary_recipient. - if = { - limit = { - # We use a NOT here rather than is_ai = no because the AI was occasionally managing to bork its selection process, and the title does _not_ like setting an empty diarch, so we fallback AI who can't behave to a sub-optimal choice. - NOT = { exists = scope:ai_recipient } - } - custom_tooltip = { - text = appoint_co_monarch_interaction.tt.enter_co_monarchy_with_secondary_recipient - try_start_diarchy = co_monarchy - set_diarch = scope:secondary_recipient - } - # We set them to be our designated heir. - ## & if we already have an heir, warn that this overwrites it. - designated_heir ?= { - if = { - limit = { this != scope:secondary_recipient } - custom_tooltip = appoint_co_monarch_interaction.tt.overwrite_designated_heir - # Nab them for use further on. - save_scope_as = old_heir - } - } - ## Designate and inform. - set_designated_heir = scope:secondary_recipient - } - ## Whereas the AI grabs their pre-selected candidate. - else = { - try_start_diarchy = co_emperorship - set_diarch = scope:ai_recipient - # We set them to be our designated heir. - ## First grabbing the old one for opinions. - designated_heir ?= { - if = { - limit = { this != scope:secondary_recipient } - # Nab them for use further on. - save_scope_as = old_heir - } - } - ## Then overwriting. - set_designated_heir = scope:ai_recipient - } - } - # And remember who appointed them on scope:recipient. - grateful_for_appointment_as_co_emperor_effect = yes - # Your designated heir is _very_ pissed. - diarch_overwrites_old_designated_heir_apply_opinions_effect = { - LIEGE = scope:actor - CO_RULER = scope:secondary_recipient - } - # Your designated regent is also unhappy (probably). - designated_diarch_overwridden_by_co_ruler_effect = { - LIEGE = scope:actor - CO_RULER = scope:secondary_recipient - } - # Make sure we have our co-ruler directly with us. - ## Courtiers are given to us immediately. - if = { - limit = { - scope:secondary_recipient = { is_ruler = no } - scope:secondary_recipient = { NOT = { is_in_the_same_court_as = scope:actor } } - } - scope:actor = { add_courtier = scope:secondary_recipient } - } - ## Vassals are retracted. - if = { - limit = { scope:secondary_recipient.liege != scope:actor } - scope:secondary_recipient.liege = { - add_opinion = { - target = scope:actor - modifier = retracted_vassal - } - } - create_title_and_vassal_change = { - type = revoked - save_scope_as = change - } - scope:secondary_recipient = { - change_liege = { - liege = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - - - - - # Object explorer logging. - scope:actor = { - diarch_interaction_set_or_update_global_variable_effect = { VARIABLE = di_track_appcomon_accept } - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appcomon_accept_actor_list } - } - scope:recipient = { - diarch_interaction_add_to_global_list_effect = { VARIABLE_LIST = di_track_appcomon_accept_recipient_list } - } - } - - # AI - ai_targets = { ai_recipients = children } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 120 - empire = 120 - hegemony = 120 - } - - ai_potential = { - # Filter us down nice'n'tight. - may_appoint_co_monarchs_trigger = yes - # Plus rule out any diarchies already on the go. - has_active_diarchy = no - # Aaaand finally, the AI won't do this unless they're considering their age and they've got adult kids. - age >= 50 - any_child = { is_adult = yes } - } - - ai_will_do = { - # The AI doesn't like doing this without good reason. - base = -100 - - ai_wants_junior_or_co_emperor_modifier = yes - } -} - -# Start a scheme to replace an incumbent regent. -overthrow_regent_scheme_interaction = { - category = interaction_category_diarch - icon = icon_declare_me_regent - ignores_pending_interaction_block = yes - - scheme = overthrow_regent - desc = overthrow_regent_scheme_interaction_desc - - interface_priority = 20 - - is_shown = { - # Standard setup. - scope:actor.liege ?= { - has_active_diarchy = yes - # You can't overthrow non-regencies. At least not this way. - has_diarchy_parameter = diarchy_is_regency - } - scope:recipient = { - this != scope:actor - liege ?= { - this = scope:actor.liege - diarch ?= scope:recipient - this != scope:actor - } - } - } - - is_valid_showing_failures_only = { - # Make sure you wouldn't just cop out immediately. - ## Disabling is fine, FWIW. You'll de-disable with time. - scope:actor = { is_diarch_valid_trigger = yes } - # Have we been vetoed from succession due to politicking? - custom_tooltip = { - text = overthrow_regent_scheme_interaction.tt.filtered_due_to_incumbent_politicking - NOT = { scope:actor.var:diarch_succession_filtered_due_to_incumbents_politicking ?= scope:recipient } - } - } - - # Long specific cooldown. If you give up, you should give it a rest 'less things change. - cooldown_against_recipient = { years = 10 } - - # Scheme Starter Packages - options_heading = schemes.t.agent_packages - send_options_exclusive = yes - ## Balanced agents. - send_option = { - flag = agent_focus_balance - current_description = overthrow_regent_scheme_interaction.tt.agent_focus_balance - } - ## Focused on Success Chance. - send_option = { - flag = agent_focus_success - current_description = overthrow_regent_scheme_interaction.tt.agent_focus_success - } - ## Focused on Speed. - send_option = { - flag = agent_focus_speed - current_description = overthrow_regent_scheme_interaction.tt.agent_focus_speed - } - ## Focused on Secrecy. - send_option = { - flag = agent_focus_secrecy - current_description = overthrow_regent_scheme_interaction.tt.agent_focus_secrecy - } - - on_accept = { - scope:actor = { - # Sort some stress stuff. - overthrow_regent_scheme_interaction_actor_stress_effect = yes - # And some feedback for starting. - send_interface_toast = { - type = event_toast_effect_neutral - title = overthrow_regent_scheme_interaction.tt.started_scheme - left_icon = scope:actor - right_icon = scope:recipient - # Success. - if = { - limit = { scope:agent_focus_success ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = overthrow_regent - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Success. - AGENT_1 = agent_thug - AGENT_2 = agent_ambusher - AGENT_3 = agent_muscle - # Speed. - AGENT_4 = agent_footpad - # Secrecy. - AGENT_5 = agent_lookout - } - } - # Speed. - else_if = { - limit = { scope:agent_focus_speed ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = overthrow_regent - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Speed. - AGENT_1 = agent_footpad - AGENT_2 = agent_tracker - AGENT_3 = agent_planner - # Success. - AGENT_4 = agent_thug - # Secrecy. - AGENT_5 = agent_lookout - } - } - # Secrecy. - else_if = { - limit = { scope:agent_focus_secrecy ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = overthrow_regent - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Secrecy. - AGENT_1 = agent_lookout - AGENT_2 = agent_lookout - AGENT_3 = agent_decoy - # Success. - AGENT_4 = agent_thug - # Speed. - AGENT_5 = agent_footpad - } - } - # Balanced. - else = { - begin_scheme_with_agents_effect = { - SCHEME_TYPE = overthrow_regent - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Success. - AGENT_1 = agent_thug - AGENT_2 = agent_ambusher - # Speed. - AGENT_3 = agent_footpad - AGENT_4 = agent_planner - # Secrecy. - AGENT_5 = agent_lookout - } - } - } - } - } - - auto_accept = yes - - # AI - ai_targets = { - ai_recipients = peer_vassals - ai_recipients = scripted_relations - } - ai_frequency_by_tier = { - barony = 0 - county = 120 - duchy = 60 - kingdom = 60 - empire = 60 - hegemony = 60 - } - - ai_potential = { - # Some traits lock the AI out. - ## Calc these first 'cause they're cheaper. - NOR = { - has_trait = lazy - has_trait = humble - has_trait = content - } - OR = { - # Driven by traits or personality. - has_trait = arrogant - has_trait = ambitious - # Family think themselves worthy. - any_close_or_extended_family_member = { this = liege } - # If you're rivals with the current regent, that's a good cause. - any_relation = { - type = rival - is_diarch_of_target = root.liege - } - } - } - - ai_will_do = { - # Most AI think this is audacious. - base = -50 - - # Opinion Factor - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -1 - } - # Weight for personality. - ## Both modifier. - ai_value_modifier = { - # Bold, energetic characters fancy the gig. - ai_boldness = 0.5 - ai_energy = 0.5 - } - ## And traits! - ### These are balanced differently to the other interactions, so it's deliberate that they're not using the @values here. - ### +++ Loyal (if current regent is disloyal). - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = loyal - exists = liege - scope:recipient = { diarch_loyalty <= diarch_loyalty_visibly_disloyal_threshold } - diarch_loyalty_score_type_regency_value >= diarch_loyalty_visibly_loyal_threshold - } - ### +++ Disloyal (if current regent is loyal). - modifier = { - add = diarch_ai_desire_plus_3_value - has_trait = disloyal - exists = liege - scope:recipient = { diarch_loyalty >= diarch_loyalty_visibly_loyal_threshold } - diarch_loyalty_score_type_regency_value >= diarch_loyalty_visibly_disloyal_threshold - } - ### ++ Ambitious. - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = ambitious - } - ### ++ Arrogant. - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = arrogant - } - ### ++ Deceitful. - modifier = { - add = diarch_ai_desire_plus_2_value - has_trait = deceitful - } - ### + Diligent. - modifier = { - add = diarch_ai_desire_plus_1_value - has_trait = diligent - } - ### - Lazy. - modifier = { - add = diarch_ai_desire_minus_1_value - has_trait = lazy - } - ### -- Honest. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = honest - } - ### -- Humble. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = humble - } - ### -- Content. - modifier = { - add = diarch_ai_desire_minus_2_value - has_trait = content - } - ### --- Disloyal (if current regent is disloyal). - modifier = { - add = diarch_ai_desire_minus_3_value - has_trait = disloyal - exists = liege - scope:recipient = { diarch_loyalty <= diarch_loyalty_visibly_disloyal_threshold } - diarch_loyalty_score_type_regency_value <= diarch_loyalty_visibly_disloyal_threshold - } - ### --- Loyal (if current regent is loyal). - #### Also some loyal-adjacent traits that would otherwise cause stress. - modifier = { - add = diarch_ai_desire_minus_3_value - OR = { - has_trait = loyal - has_trait = honest - has_trait = compassionate - has_trait = just - } - exists = liege - scope:recipient = { diarch_loyalty >= diarch_loyalty_visibly_loyal_threshold } - diarch_loyalty_score_type_regency_value >= diarch_loyalty_visibly_loyal_threshold - } - # Weight by proximity to the ruler: close family, spouses, etc. - modifier = { - add = diarch_ai_desire_plus_2_value - exists = scope:recipient.liege - OR = { - any_close_or_extended_family_member = { this = scope:recipient.liege } - any_spouse = { this = scope:recipient.liege } - } - } - # Councillors have ambitions. - modifier = { - add = diarch_ai_desire_plus_2_value - is_councillor = yes - } - # Factors. - ## If relations are near-perfect, we don't want to go plotting, as it'll look weird. - modifier = { - factor = 0 - OR = { - has_any_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } - opinion = { - target = scope:recipient - value >= very_high_positive_opinion - } - } - } - } -} diff --git a/common/character_interactions/00_gift.txt b/common/character_interactions/00_gift.txt deleted file mode 100644 index b06b8dc1..00000000 --- a/common/character_interactions/00_gift.txt +++ /dev/null @@ -1,789 +0,0 @@ -#Give characters money to improve their opinion of you -gift_interaction = { - icon = icon_gold - category = interaction_category_friendly - common_interaction = yes - interface_priority = 65 - desc = gift_interaction_desc - - greeting = positive - notification_text = SEND_GIFT_PROPOSAL - - answer_accept_key = SEND_GIFT_ACCEPT - answer_reject_key = SEND_GIFT_REJECT - - ai_targets = { - ai_recipients = scripted_relations - ai_recipients = liege - ai_recipients = head_of_faith - } - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = peer_vassals - max = 10 - } - ai_targets = { - ai_recipients = vassals - max = 10 - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 120 - county = 60 - duchy = 60 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - is_shown = { - scope:recipient != scope:actor - - # Prioritize paying back loans first - scope:actor = { - trigger_if = { - limit = { - exists = var:loan_amount_owed - exists = var:loan_holder - } - NOT = { var:loan_holder = scope:recipient } - } - } - } - - is_highlighted = { - scope:recipient = { - OR = { - house ?= { - OR = { - is_dominant_family = yes - is_powerful_family = yes - } - } - } - } - } - - highlighted_reason = HIGHLIGHTED_FAMILY_RATING - - is_valid_showing_failures_only = { - scope:actor.gold >= gift_value - scope:recipient = { - NOT = { is_imprisoned_by = scope:actor } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0100 - } - } - - on_accept = { - scope:recipient = { - # Verify that they could become friend - if = { - limit = { - NAND = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - has_relation_soulmate = scope:actor - has_relation_best_friend = scope:actor - } - } - gifting_leads_towards_friendship_effect = yes - } - } - # HOUSE RELATIONS - if = { - limit = { - scope:actor = { - is_house_head = yes - } - scope:recipient = { - is_house_head = yes - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - } - scope:recipient.house = { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_improve_medium_value - REASON = sent_a_gift - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - } - scope:actor = { - # Warning for multiple gifts - if = { - limit = { - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - custom_tooltip = ALREADY_SENT_GIFT_WARNING - } - - send_interface_message = { - type = event_gold_neutral - title = gift_interaction_notification - right_icon = scope:recipient - pay_short_term_gold = { - gold = gift_value - target = scope:recipient - } - stress_impact = { - greedy = medium_stress_impact_gain - } - if = { - limit = { - scope:recipient = { - NOT = { - is_heir_of = scope:actor - } - } - } - stress_impact = { - generous = medium_stress_impact_loss - } - } - - #FP3 Tenet Communal Possessions Perk - piety gain for gift giving. - if = { - limit = { - scope:actor = { - faith = { - has_doctrine_parameter = piety_from_gifts_active - } - } - } - scope:actor = { - add_piety = minor_piety_gain - } - } - - # Check if the target already has been sent a gift or not. If not, apply the following effects - if = { - limit = { - NOT = { - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - } - - # Struggle Catalyst - if = { - limit = { - scope:actor = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_gift_independent_ruler - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_gift_independent_ruler - CHAR = scope:recipient - } - } - } - } - hidden_effect = { - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { phase_has_catalyst = catalyst_gift_independent_ruler } - activate_struggle_catalyst = { - catalyst = catalyst_gift_independent_ruler - character = scope:actor - } - } - } - } - } - if = { - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:actor - SECOND = scope:recipient - } - scope:actor = { - any_character_struggle = { - #involvement = involved - activate_struggle_catalyst_secondary_character_involvement_either_trigger = { - CATALYST = catalyst_gift_supporter_detractor_ruler - CHAR = scope:recipient - } - } - } - } - hidden_effect = { - scope:actor = { - every_character_struggle = { - #involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_either_trigger = { - CATALYST = catalyst_gift_supporter_detractor_ruler - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_gift_supporter_detractor_ruler - character = scope:actor - } - log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_gift_supporter_detractor_ruler } - } - } - } - } - - # FP2 Urbanism Legacy Perk 2: increase cultural acceptance when gifting a republican vassal - if = { - limit = { - scope:actor = { - dynasty ?= { has_dynasty_perk = fp2_urbanism_legacy_4 } - } - scope:recipient = { - AND = { - is_vassal_of = scope:actor - government_has_flag = government_is_republic - } - } - scope:actor.culture != scope:recipient.capital_province.county.culture - } - scope:recipient.capital_province.county.culture = { - change_cultural_acceptance = { - target = scope:actor.culture - value = { - value = 20 - multiply = scope:recipient.capital_province.county.development_level - divide = 100 - } - desc = cultural_acceptance_gain_gift_dynasty_perk - } - } - } - } - - # Let's apply the opinion modifier last, as to apply everything else correctly first - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = gift_opinion - opinion = send_gift_opinion - } - } - } - - if = { # for tutorial purposes - limit = { - is_ai = no - scope:recipient = { is_child_of = scope:actor } - } - add_character_flag = { - flag = tutorial_sent_gift - days = 200 - } - } - #Influence gain between admin rulers - if = { - limit = { - is_ruler = yes - government_allows = administrative - scope:recipient = { - is_ruler = yes - government_allows = administrative - any_held_title = { - is_noble_family_title = yes - } - } - } - if = { - limit = { - scope:recipient = { - OR = { - house = { - is_dominant_family = yes - } - this = scope:actor.top_liege - } - influence_level >= 5 - } - } - change_influence = { - value = miniscule_influence_gain - multiply = 8 - } - } - else_if = { - limit = { - scope:recipient = { - OR = { - house = { - is_dominant_family = yes - } - this = scope:actor.top_liege - } - influence_level >= 3 - } - } - change_influence = { - value = miniscule_influence_gain - multiply = 7 - } - } - else_if = { - limit = { - scope:recipient = { - OR = { - house = { - is_dominant_family = yes - } - this = scope:actor.top_liege - } - } - } - change_influence = { - value = miniscule_influence_gain - multiply = 6 - } - } - else_if = { - limit = { - scope:recipient = { - OR = { - house = { - is_powerful_family = yes - } - this = scope:actor.top_liege - } - influence_level >= 5 - } - } - change_influence = { - value = miniscule_influence_gain - multiply = 6 - } - } - else_if = { - limit = { - scope:recipient = { - OR = { - house = { - is_powerful_family = yes - } - this = scope:actor.top_liege - } - influence_level >= 3 - } - } - change_influence = { - value = miniscule_influence_gain - multiply = 5 - } - } - else_if = { - limit = { - scope:recipient = { - OR = { - house = { - is_powerful_family = yes - } - this = scope:actor.top_liege - } - } - } - change_influence = { - value = miniscule_influence_gain - multiply = 4 - } - } - else_if = { - limit = { - scope:recipient = { influence_level >= 5 } - } - change_influence = { - value = miniscule_influence_gain - multiply = 3 - } - } - else_if = { - limit = { - scope:recipient = { influence_level >= 3 } - } - change_influence = { - value = miniscule_influence_gain - multiply = 2 - } - } - else = { - change_influence = miniscule_influence_gain - } - } - } - } - - ai_accept = { - base = 0 - modifier = { - add = 100 - desc = GOLD_REASON - } - - # Struggle motive - modifier = { - desc = AI_STRUGGLE_INTENT - scope:recipient = { - top_liege = this - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:recipient = { - any_character_struggle = { - phase_has_catalyst = catalyst_gift_independent_ruler - } - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:recipient = { - any_character_struggle = { - phase_has_catalyst = catalyst_gift_independent_ruler - } - } - } - add = 200 - } - } - } - } - - ai_potential = { - is_available_at_peace_ai_adult = yes - ai_greed < medium_positive_ai_value - short_term_gold >= gift_interaction_cutoff - NOT = { - has_trait = greedy - } - NOT = { has_variable = conqueror } - ai_should_focus_on_building_in_their_capital = no - } - - auto_accept = { - custom_description = { - text = auto_accept_interaction_ai - object = scope:recipient - scope:recipient = { - is_ai = yes - } - } - } - - ai_min_reply_days = 1 - ai_max_reply_days = 1 - - ai_will_do = { - base = 100 - - modifier = { # Do not send double-gifts - factor = 0 - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - - modifier = { # Basic Filtering - factor = 0 - scope:recipient = { - NOR = { - AND = { # Bankrupt lovers, friends and a bankrupt liege should be considered - OR = { - scope:actor = { - any_liege_or_above = { - this = scope:recipient - } - } - has_secret_relation_lover = scope:actor - has_relation_lover = scope:actor - has_relation_soulmate = scope:actor - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - } - gold < 0 - } - AND = { # Generous characters will give gifts to their friends/lovers - is_ruler = yes - OR = { - has_secret_relation_lover = scope:actor - has_relation_lover = scope:actor - has_relation_soulmate = scope:actor - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - } - scope:actor = { - OR = { - ai_greed <= high_negative_ai_value - AND = { - ai_greed < 0 - culture = { - has_cultural_parameter = gives_more_gifts - } - } - } - } - } - AND = { # Characters with the Generous Cultural Tradition will give gifts to more people - is_ruler = yes - OR = { - is_allied_to = scope:actor - is_close_or_extended_family_of = scope:actor - } - scope:actor = { - ai_greed < 0 - culture = { - has_cultural_parameter = gives_more_gifts - } - } - } - AND = { # Characters with the loyal trait more likely to give gifts to friends/lieges - OR = { - scope:actor.liege ?= this - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - is_allied_to = scope:actor - is_close_or_extended_family_of = scope:actor - } - scope:actor = { - ai_greed <= 0 - has_trait = loyal - } - } - AND = { # Zealous characters want to support the defending side in GHW's - gold < 200 - any_character_war = { - OR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - primary_defender = scope:recipient - } - scope:actor = { - ai_zeal >= 50 - } - } - AND = { # Powerful vassals should be considered - is_powerful_vassal_of = scope:actor - opinion = { - target = scope:actor - value < 0 - } - NOT ={ - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - AND = { # Factioneering vassals should be considered - is_vassal_of = scope:actor - is_a_faction_member = yes - NOT ={ - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - AND = { # Realm Priests should be considered - scope:actor = { - faith = { has_doctrine = doctrine_theocracy_temporal } - exists = cp:councillor_court_chaplain - cp:councillor_court_chaplain = scope:recipient - } - opinion = { - target = scope:actor - value <= 25 - } - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = gift_opinion - } - } - } - AND = { # Rulers at war with your rivals deserve gold if they're bankrupt - gold < 0 - is_at_war = yes - any_war_enemy = { - has_relation_rival = scope:actor - } - } - AND = { # Independent ruler within the struggle should be considered - any_character_struggle = { - phase_has_catalyst = catalyst_gift_independent_ruler - } - } - } - } - } - - # Struggle - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_gift_independent_ruler - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_gift_independent_ruler - } - NOT = { - has_relation_rival = scope:recipient - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - } - scope:recipient = { - has_character_flag = agenda_towards_deescalation - } - } - add = { - value = 150 - if = { - limit = { scope:recipient = { is_ai = no} } - add = 150 # higher for human player to Prioritize them - } - # Then lower the intent depending on the gold reserve - # Base value applied if the AI has 3x the gold cutoff - multiply = { - value = short_term_gold - divide = { - value = gift_interaction_cutoff - multiply = 3 - } - } - } - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - } - } - add = { - value = 25 - if = { - limit = { scope:recipient = { is_ai = no} } - add = 150 # higher for human player to Prioritize them - } - # Then lower the intent depending on the gold reserve - # Base value applied if the AI has 3x the gold cutoff - multiply = { - value = short_term_gold - divide = { - value = gift_interaction_cutoff - multiply = 3 - } - } - } - } - } - } - - modifier = { - factor = 0.1 - scope:recipient = { - opinion = { - target = scope:actor - value < 0 - } - NAND = { - is_vassal_of = scope:actor - scope:actor = { - ai_rationality > 50 - } - } - } - } - - modifier = { - add = 100 - scope:actor = { - is_at_war = no - has_trait = fp3_struggle_supporter - any_character_struggle = { is_struggle_type = persian_struggle } - } - scope:recipient = { - title:d_sunni.holder ?= this - gold < 0 - } - } - - # Nomads are slightly less likely to do this since they'd prefer to send Herd instead - modifier = { - add = -10 - scope:actor = { - government_has_flag = government_is_nomadic - } - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - - modifier = { - factor = 0.1 - scope:recipient = { - has_relation_rival = scope:actor - } - } - - modifier = { - factor = 2 - scope:actor.house.house_confederation ?= { - has_cohesion_level_parameter = bloc_members_send_leader_gifts - leading_house.house_head ?= scope:recipient - } - } - } -} diff --git a/common/character_interactions/00_grant_titles_interaction.txt b/common/character_interactions/00_grant_titles_interaction.txt index e9d99379..464e711c 100644 --- a/common/character_interactions/00_grant_titles_interaction.txt +++ b/common/character_interactions/00_grant_titles_interaction.txt @@ -42,7 +42,7 @@ grant_titles_interaction = { limit = { scope:actor = { government_has_flag = government_is_nomadic NOT = { government_has_flag = government_allows_nomad_domicile_titles }} } - scope:recipient = { NOT = { government_has_flag = government_is_true_herder } } + scope:recipient = { NOT = { government_has_flag = government_is_herder } } } } diff --git a/common/character_interactions/00_invite_agent_to_scheme.txt b/common/character_interactions/00_invite_agent_to_scheme.txt deleted file mode 100644 index 2723d6ab..00000000 --- a/common/character_interactions/00_invite_agent_to_scheme.txt +++ /dev/null @@ -1,844 +0,0 @@ - -invite_agent_to_scheme_interaction = { - special_interaction = invite_to_scheme_interaction - hidden = yes - - # Delaying the response makes it possible to invite multiple agents to the same slot. - ai_instant_response = yes - - on_accept = { - scope:recipient = { - if = { - limit = { - OR = { - always = scope:mandala_trickster - always = scope:gift - always = scope:gift_significant - always = scope:offer_hook - always = scope:offer_hook_strong - always = scope:hook - always = scope:opportunities_t1 - always = scope:opportunities_t2 - always = scope:prestige - always = scope:influence - always = scope:council_rights - always = scope:de_jure_title - always = scope:claimed_title - always = scope:piety - always = scope:herd - var:devotee_agent_var ?= scope:actor - } - } - force_add_to_agent_slot = { - agent_slot = scope:agent_slot - years = 5 - } - } - else = { add_to_agent_slot = scope:agent_slot } - } - scope:actor = { - # No bribe. - ## We hack this in to stop the window jumping around as you add or remove bribes. - if = { - limit = { - NOR = { - always = scope:mandala_trickster - always = scope:gift - always = scope:gift_significant - always = scope:offer_hook - always = scope:offer_hook_strong - always = scope:hook - always = scope:opportunities_t1 - always = scope:opportunities_t2 - always = scope:prestige - always = scope:influence - always = scope:council_rights - always = scope:de_jure_title - always = scope:claimed_title - always = scope:piety - always = scope:herd - } - } - custom_tooltip = offer_bribes.tt.window_jump_fix - } - # Mandala Trickster - if = { - limit = { always = scope:mandala_trickster } - add_piety = { - value = trickster_mandala_force_agent_bribe_value - multiply = -1 - } - } - # Bribe - if = { - limit = { always = scope:gift } - pay_short_term_gold = { - gold = bribe_value - target = scope:recipient - } - stress_impact = { greedy = minor_stress_impact_gain } - } - # Big Bribe - if = { - limit = { always = scope:gift_significant } - pay_short_term_gold = { - gold = greater_bribe_value - target = scope:recipient - } - stress_impact = { greedy = medium_stress_impact_gain } - } - # Offer Hook - if = { - limit = { always = scope:offer_hook } - stress_impact = { - base = minor_stress_impact_gain - paranoid = major_stress_impact_gain - } - scope:recipient = { - add_hook = { - type = favor_hook - target = scope:actor - } - } - } - # Offer Strong Hook - if = { - limit = { always = scope:offer_hook_strong } - stress_impact = { base = major_stress_impact_gain } - scope:recipient = { - add_hook = { - type = strong_favor_hook - target = scope:actor - } - } - } - # Use Hook - if = { - limit = { always = scope:hook } - use_hook = scope:recipient - } - # Burn Opportunities - if = { - limit = { always = scope:opportunities_t1 } - custom_tooltip = { - text = spend_agent_charges.tt.t1 - scope:scheme = { - change_opportunities = { - value = invite_agent_opportunities_t1_value - multiply = -1 - } - } - } - } - # Burn More Opportunities - if = { - limit = { always = scope:opportunities_t2 } - custom_tooltip = { - text = spend_agent_charges.tt.t2 - scope:scheme = { - change_opportunities = { - value = invite_agent_opportunities_t2_value - multiply = -1 - } - } - } - } - # Prestige - if = { - limit = { always = scope:prestige } - add_prestige = { - value = prestige_bribe_value - multiply = -1 - } - scope:recipient = { add_prestige = prestige_bribe_value } - } - # Influence - if = { - limit = { always = scope:influence } - change_influence = { - value = influence_bribe_value - multiply = -1 - } - scope:recipient = { change_influence = influence_bribe_value } - } - # Council Rights - if = { - limit = { always = scope:council_rights } - scope:recipient = { - vassal_contract_set_obligation_level = { - type = council_rights - level = 1 - } - set_subject_contract_modification_blocked = yes - } - } - create_title_and_vassal_change = { - type = granted - save_scope_as = change - } - # De Jure County - if = { - limit = { always = scope:de_jure_title } - random_held_title = { - limit = { - actor_has_valid_de_jure_enticement_county_trigger = yes - any_this_title_or_de_jure_above = { - holder ?= { this = scope:recipient } - } - } - change_title_holder = { - holder = scope:recipient - change = scope:change - } - } - } - # Claimed County - if = { - limit = { always = scope:claimed_title } - random_held_title = { - limit = { - actor_has_valid_claimed_enticement_county_trigger = yes - scope:recipient = { has_claim_on = prev } - } - change_title_holder = { - holder = scope:recipient - change = scope:change - } - } - } - resolve_title_and_vassal_change = scope:change - # Piety - if = { - limit = { always = scope:piety } - scope:actor = { - add_piety = { - value = piety_bribe_value - multiply = -1 - } - } - scope:recipient = { add_piety = piety_bribe_value } - } - # Herd - if = { - limit = { always = scope:herd } - if = { - limit = { - scope:recipient.domicile ?= { - herd > 0 - } - } - scope:actor = { - pay_herd = { - target = scope:recipient - value = domicile.herd_bribe_value - } - } - } - else = { - scope:actor = { custom_tooltip = scheme_change_herd_value } - hidden_effect = { - scope:actor.domicile = { - change_herd = { - value = herd_bribe_value - multiply = -1 - } - } - scope:recipient = { - add_gold = { - value = domicile.herd_bribe_value - multiply = 0.1 - } - } - } - } - } - } - # Stress. - ## For scope: recipient. - scope:recipient = { - if = { - limit = { - scope:scheme = { is_scheme_category = contract } - } - # Honourable characters don't like being forced into criminal schemes. - if = { - limit = { - OR = { - has_trait = just - has_trait = compassionate - } - scope:scheme.task_contract ?= { is_criminal = yes } - } - add_opinion = { - target = scope:actor - modifier = forced_me_to_help_crimes_opinion - opinion = -20 - } - stress_impact = { - just = minor_stress_impact_gain - compassionate = miniscule_stress_impact_gain - } - } - # Lazy characters don't like being made to work at all. - else_if = { - limit = { has_trait = lazy } - add_opinion = { - target = scope:actor - modifier = forced_me_to_work_opinion - opinion = -10 - } - stress_impact = { lazy = miniscule_stress_impact_gain } - } - } - } - } - - ai_accept = { - base = 0 - scheme_modifier = { - object = scope:scheme - target = scope:recipient - } - # You should not add modifiers here! If you want to add modifiers, they should be added to either: - ## - ai_agent_join_chance_hostile_general_suite_modifier - ## - ai_agent_join_chance_personal_general_suite_modifier - } - - auto_accept = { - trigger_if = { - limit = { - scope:recipient.var:devotee_agent_var ?= scope:actor # They are a devotee of yours - } - custom_tooltip = devotee_agent_desc - } - trigger_else_if = { - limit = { scope:mandala_trickster = yes } - custom_tooltip = { - text = SCHEME_AGENT_MANDALA_TRICKSTER - always = yes - } - } - trigger_else_if = { - limit = { - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - always = yes - } - } - trigger_else_if = { - limit = { - scope:scheme = { is_scheme_category = contract } - } - # Should be synced with the modifiers in ai_agent_join_chance_laamp_contract_modifier, else agents'll leave the scheme immediately after joining. - scope:recipient = { - is_courtier_of = scope:actor - NOR = { - has_relation_rival = scope:actor - custom_tooltip = { - text = invite_agent_to_scheme_interaction.tt.no_stooges - AND = { - scope:actor = { has_court_position = stooge_camp_officer } - is_court_position_employer = { - court_position = stooge_camp_officer - who = scope:actor - } - } - } - } - } - } - trigger_else = { always = no } - } - - options_heading = invite_agent_to_scheme_interaction.t.options_header - # Everyone - ## Spend opportunities. - ### x1. - send_option = { - flag = opportunities_t1 - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - custom_tooltip = { - text = offer_opportunities.tt.need_an_opportunity.t1 - scope:scheme = { scheme_agent_charges >= invite_agent_opportunities_t1_value } - } - custom_tooltip = { - text = offer_opportunities.tt.cannot_offer_multiple_sets - scope:opportunities_t2 = no - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_OPPORTUNITIES_T1 - } - ### x3. - send_option = { - flag = opportunities_t2 - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - custom_tooltip = { - text = offer_opportunities.tt.need_an_opportunity.t2 - scope:scheme = { scheme_agent_charges >= invite_agent_opportunities_t2_value } - } - custom_tooltip = { - text = offer_opportunities.tt.cannot_offer_multiple_sets - scope:opportunities_t1 = no - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_OPPORTUNITIES_T2 - } - ## Mandala Trickery Aspect - send_option = { - flag = mandala_trickster - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - scope:actor = { - government_has_flag = government_is_mandala - house = { has_house_head_parameter = unlock_force_agent_using_piety } - is_house_head = yes - } - } - is_valid = { - scope:actor.piety >= trickster_mandala_force_agent_bribe_value - custom_tooltip = { - text = offer_gold.tt.cannot_offer_both_bribes - scope:piety = no - } - custom_tooltip = { - text = not_two_overrides - trigger_if = { - limit = { scope:hook = yes } - NOT = { - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_MANDALA_TRICKSTER - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.piety >= trickster_mandala_force_agent_bribe_value } - desc = SCHEME_AGENT_MANDALA_TRICKSTER_VALID - } - } - } - ## Gold - send_option = { - flag = gift - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:actor.gold >= bribe_value - custom_tooltip = { - text = offer_gold.tt.cannot_offer_both_bribes - scope:gift_significant = no - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_GOLD - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.gold >= bribe_value } - desc = SCHEME_AGENT_GOLD_VALID - } - } - } - ## Even more gold - send_option = { - flag = gift_significant - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:actor.gold >= greater_bribe_value - custom_tooltip = { - text = offer_gold.tt.cannot_offer_both_bribes - scope:gift = no - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_GOLD_SIGNIFICANT - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.gold >= greater_bribe_value } - desc = SCHEME_AGENT_GOLD_SIGNIFICANT_VALID - } - } - } - ## Offer a hook - send_option = { - flag = offer_hook - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - custom_tooltip = { - text = offer_hook.tt.cannot_offer_both_hooks - scope:offer_hook_strong = no - } - NOT = { - scope:recipient = { has_hook = scope:actor } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_HOOK - } - ## Offer a strong hook - send_option = { - flag = offer_hook_strong - is_shown = { - scope:actor = { has_trait_with_flag = can_offer_strong_hook_to_agents } - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - custom_tooltip = { - text = offer_hook.tt.cannot_offer_both_hooks - scope:offer_hook = no - } - NOT = { - scope:recipient = { has_strong_hook = scope:actor } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_HOOK_STRONG - } - ## Use hook. - ### Weak hook bonus is added through the scheme's agent join chance. - ### Strong hook is in the auto_accept block. - send_option = { - flag = hook - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - custom_tooltip = { - text = not_two_overrides - trigger_if = { - limit = { - scope:actor = { has_strong_hook = scope:recipient } - } - scope:mandala_trickster = no - } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_HOOK_EXPLICIT - } - # Rulers - ## Prestige - send_option = { - flag = prestige - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:actor.prestige >= prestige_bribe_value - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_PRESTIGE - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.prestige >= prestige_bribe_value } - desc = SCHEME_AGENT_PRESTIGE_VALID - } - } - } - ## Influence - send_option = { - flag = influence - is_shown = { - scope:actor.top_liege ?= scope:recipient.top_liege - scope:actor = { government_allows = administrative } - scope:recipient = { - OR = { - government_allows = administrative - host = { government_allows = administrative } - AND = { - highest_held_title_tier = tier_barony - liege = { government_allows = administrative } - } - } - } - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:actor.influence >= influence_bribe_value - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_INFLUENCE - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.influence >= influence_bribe_value } - desc = SCHEME_AGENT_INFLUENCE_VALID - } - } - } - ## Council Rights - send_option = { - flag = council_rights - is_shown = { - would_actor_consider_dramatic_enticement_trigger = yes - scope:recipient.liege ?= scope:actor - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:recipient = { vassal_contract_has_modifiable_obligations = yes } - NOT = { - scope:recipient = { has_trait = lazy } - } - custom_tooltip = { - text = council_rights.tt.already_has_council_rights - scope:recipient = { - NOR = { - vassal_contract_has_flag = can_demand_council_seat - vassal_contract_has_flag = can_demand_kurultai_seat - } - } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_COUNCIL_RIGHTS - } - ## De jure county of theirs you hold. - send_option = { - flag = de_jure_title - is_shown = { - would_actor_consider_dramatic_enticement_trigger = yes - scope:recipient = { - is_landed = yes - any_liege_or_above = { this = scope:actor } - } - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - custom_tooltip = { - text = de_jure_title.tt.no_suitable_county - scope:actor = { - any_held_title = { - actor_has_valid_de_jure_enticement_county_trigger = yes - any_this_title_or_de_jure_above = { - holder ?= { this = scope:recipient } - } - } - } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_DE_JURE_TITLE - } - # Landless Chars - ## County they hold a claim to that you hold. - send_option = { - flag = claimed_title - is_shown = { - would_actor_consider_dramatic_enticement_trigger = yes - trigger_if = { - limit = { - exists = scope:scheme.scheme_target_character - } - scope:recipient = { - is_ruler = no - # And you don't want them _because_ they're in your target's court. - host != scope:scheme.scheme_target_character - } - } - trigger_if = { - limit = { - exists = scope:scheme.scheme_target_title - } - scope:recipient = { - is_ruler = no - # And you don't want them _because_ they're in your target's court. - host != scope:scheme.scheme_target_title.holder - } - } - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:recipient = { - trigger_if = { - limit = { - any_claim = { } - } - custom_tooltip = { - text = claimed_title.tt.no_valid_county - any_claim = { actor_has_valid_claimed_enticement_county_trigger = yes } - } - } - trigger_else = { - custom_tooltip = { - text = claimed_title.tt.no_claims - always = no - } - } - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_CLAIMED_TITLE - } - # Nomad Chars - ## Use Herd - send_option = { - flag = herd - is_shown = { - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - scope:actor = { - government_has_flag = government_is_nomadic - is_ai = no - } - scope:recipient = { - government_has_flag = government_is_nomadic - exists = domicile - } - } - is_valid = { - scope:actor.domicile.herd >= herd_bribe_value - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_HERD - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.domicile.herd >= herd_bribe_value } - desc = SCHEME_AGENT_HERD_VALID - } - } - } - # Cofaithists - ## Piety - send_option = { - flag = piety - is_shown = { - trigger_if = { #Mandala override - limit = { - scope:actor = { government_has_flag = government_is_mandala } - } - scope:actor = { - house = { has_house_head_parameter = unlock_agent_piety_bribe } - is_house_head = yes - } - } - trigger_else = { #Everyone else - ## Target amenable to this argument. - scope:recipient = { - OR = { - has_trait = devoted - has_trait = zealous - has_council_position = councillor_court_chaplain - government_has_flag = government_is_theocracy - } - } - ## In-group out-group requirements. - OR = { - ## Either we share a faith. - scope:actor.faith = scope:recipient.faith - ## Or our faiths *really* get along. - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value <= faith_fully_accepted_level - } - } - } - } - # We don't show bribes for schemes where agents will always auto-accept or else deny. - NAND = { - scope:scheme = { is_scheme_category = contract } - scope:recipient = { is_courtier_of = scope:actor } - } - } - is_valid = { - scope:actor.piety >= piety_bribe_value - trigger_if = { #Mandala override - limit = { - scope:actor = { - NOT = { government_has_flag = government_is_mandala } - } - } - NOT = { - scope:recipient = { has_trait = cynical } - } - } - custom_tooltip = { - text = offer_gold.tt.cannot_offer_both_bribes - scope:mandala_trickster = no - } - would_agent_accept_petty_bribes_against_target_trigger = yes - } - localization = SCHEME_AGENT_PIETY - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.piety >= piety_bribe_value } - desc = SCHEME_AGENT_PIETY_VALID - } - } - } - send_options_exclusive = no -} diff --git a/common/character_interactions/00_marriage_interactions.txt b/common/character_interactions/00_marriage_interactions.txt index d32e7b30..62a5dfb5 100644 --- a/common/character_interactions/00_marriage_interactions.txt +++ b/common/character_interactions/00_marriage_interactions.txt @@ -3224,7 +3224,7 @@ offer_concubine = { } } scope:recipient = { - #NOT = { government_has_flag = government_is_true_herder } + #NOT = { government_has_flag = government_is_herder } allowed_concubines = yes is_adult = yes } diff --git a/common/character_interactions/00_modifiy_vassal_contract.txt b/common/character_interactions/00_modifiy_vassal_contract.txt deleted file mode 100644 index b22ce9bc..00000000 --- a/common/character_interactions/00_modifiy_vassal_contract.txt +++ /dev/null @@ -1,2464 +0,0 @@ -liege_modify_vassal_contract_interaction = { - special_interaction = liege_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - common_interaction = yes - icon = icon_contract_modification_single - interface_priority = 5 - - send_name = "modify_vassal_contract_interaction_SEND" - desc = liege_modify_vassal_contract_interaction_desc - - force_notification = yes - notification_text = MODIFY_VASSAL_CONTRACT_NOTIFICATION_TO_VASSAL - - is_shown = { - scope:recipient = { - this != scope:actor - liege ?= scope:actor # this excludes tributary contracts by default - is_ruler = yes - vassal_contract_has_modifiable_obligations = yes - NOT = { government_allows = administrative } - NOT = { government_has_flag = government_is_nomadic } - } - } - - is_valid_showing_failures_only = { - NOT = { scope:actor = { is_at_war_with = scope:recipient } } - } - - can_send = { - #Mandala gets special treatment - trigger_if = { - limit = { - scope:actor = { government_has_flag = government_is_mandala } - } - custom_tooltip = { - text = liege_modify_vassal_contract_mandala_cooldown - NOT = { - scope:recipient = { var:liege_recently_adjusted_mandala_vassal_contract ?= scope:actor } - } - } - scope:actor = { - has_changed_contract_obligation_trigger = yes - - custom_description = { - text = "liege_modify_vassal_contract_cannot_exceed_tyranny_cap" - object = scope:actor - NOT = { - vassal_obligation_increase_tyranny_gain_multiplier > 1 - } - } - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - - # If the trade without the hook usage is already in the vassal's favour or fair then don't waste your hook - save_temporary_scope_value_as = { - name = obligations_favoring_vassal - value = scope:recipient.count_obligation_improvements_for_vassal - } - trigger_if = { - limit = { scope:obligations_favoring_vassal > 0 } - custom_description = { - text = "vassal_modify_vassal_contract_unnecessary_hook_usage_vassal_favor" - object = scope:recipient - value = scope:obligations_favoring_vassal - NOT = { always = scope:hook } - } - } - trigger_else_if = { - limit = { scope:obligations_favoring_vassal = 0 } - custom_description = { - text = "vassal_modify_vassal_contract_unnecessary_hook_usage_equal" - object = scope:recipient - NOT = { always = scope:hook } - } - } - trigger_else = {} # Otherwise we're fine! - } - } - #The rest - trigger_else_if = { #If they're blocked we don't want to show anything else - limit = { - scope:recipient = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:recipient = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - scope:actor = { - has_changed_contract_obligation_trigger = yes - - custom_description = { - text = "liege_modify_vassal_contract_cannot_exceed_tyranny_cap" - object = scope:actor - NOT = { - vassal_obligation_increase_tyranny_gain_multiplier > 1 - } - } - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - - # If the trade without the hook usage is already in the vassal's favour or fair then don't waste your hook - save_temporary_scope_value_as = { - name = obligations_favoring_vassal - value = scope:recipient.count_obligation_improvements_for_vassal - } - trigger_if = { - limit = { scope:obligations_favoring_vassal > 0 } - custom_description = { - text = "vassal_modify_vassal_contract_unnecessary_hook_usage_vassal_favor" - object = scope:recipient - value = scope:obligations_favoring_vassal - NOT = { always = scope:hook } - } - } - trigger_else_if = { - limit = { scope:obligations_favoring_vassal = 0 } - custom_description = { - text = "vassal_modify_vassal_contract_unnecessary_hook_usage_equal" - object = scope:recipient - NOT = { always = scope:hook } - } - } - trigger_else = {} # Otherwise we're fine! - } - } - } - - auto_accept = yes - on_accept = { - hidden_effect = { - # Struggle Catalysts - ## We work these out first so they're not invalidated by the actual effect block. - if = { - limit = { - catalyst_granted_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_granted_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - if = { - limit = { - catalyst_revoked_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - - # Improving contract catalyst - if = { - limit = { - scope:recipient.count_obligation_improvements_for_vassal > 0 - scope:actor = { - is_diff_faith_or_culture_trigger = { - CHAR = scope:recipient - STATUS = involved - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_grant_privilege_to_diff_faith_culture_vassal - character = scope:actor - } - } - } - } - } - - # Enact changes. - scope:actor = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:recipient - # Add tyranny for each level increased. Can spend one hook to avoid one level of tyranny hit. - add_tyranny = vassal_obligation_increase_tyranny_gain - if = { - limit = { vassal_obligation_increase_tyranny_gain != 0 } - stress_impact = { - just = medium_stress_impact_gain - generous = medium_stress_impact_gain - } - } - if = { - limit = { - always = scope:hook - } - use_hook = scope:recipient - add_achievement_flag_effect = { FLAG = achievement_fine_print_flag } - } - - scope:recipient = { - hidden_effect = { - set_subject_contract_modification_blocked = yes - } - set_variable = { - name = liege_recently_adjusted_mandala_vassal_contract - value = scope:actor - years = mandala_vassal_obligation_cooldown_years - } - } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:recipient = { - vassal_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - } - - } - } - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no -} - -vassal_modify_vassal_contract_interaction = { - special_interaction = liege_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - common_interaction = yes - icon = icon_contract_modification_single - - send_name = "modify_vassal_contract_interaction_SEND" - desc = vassal_modify_vassal_contract_interaction_desc - - force_notification = yes - notification_text = MODIFY_VASSAL_CONTRACT_NOTIFICATION_TO_LIEGE - - redirect = { - # need to reverse the role for the UI to work properly - scope:recipient = { - save_scope_as = secondary_recipient - } - scope:actor = { - save_scope_as = recipient - } - - scope:secondary_recipient = { - save_scope_as = actor - } - } - - is_shown = { - scope:recipient = { - top_liege != this - this != scope:actor - liege ?= scope:actor # this excludes tributary contracts by default - vassal_contract_has_modifiable_obligations = yes - NOT = { government_allows = administrative } - NOT = { government_has_flag = government_is_nomadic } - } - } - - is_valid_showing_failures_only = { - NOT = { scope:recipient = { is_at_war_with = scope:actor } } - } - - can_send = { - #Mandala gets special treatment - trigger_if = { - limit = { - scope:recipient = { government_has_flag = government_is_mandala } - } - custom_tooltip = { - text = vassal_modify_vassal_contract_mandala_cooldown - NOT = { - scope:actor = { var:vassal_recently_adjusted_mandala_vassal_contract ?= scope:recipient } - } - } - scope:actor = { - has_changed_contract_obligation_trigger = yes - } - - scope:recipient = { - # Must be an even trade overall - trigger_if = { - limit = { - count_obligation_improvements_for_vassal_include_hook >= 0 - } - custom_description = { - text = "vassal_modify_vassal_contract_cannot_increase_obligation_level" - object = scope:actor - value = count_obligation_improvements_for_vassal_include_hook - count_obligation_improvements_for_vassal_include_hook = 0 - } - } - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - } - } - #The rest - trigger_else_if = { #If you're blocked we don't want to show anything else - limit = { - scope:recipient = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:recipient = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - scope:actor = { - has_changed_contract_obligation_trigger = yes - } - - scope:recipient = { - # Must be an even trade overall - trigger_if = { - limit = { - count_obligation_improvements_for_vassal_include_hook >= 0 - } - custom_description = { - text = "vassal_modify_vassal_contract_cannot_increase_obligation_level" - object = scope:actor - value = count_obligation_improvements_for_vassal_include_hook - count_obligation_improvements_for_vassal_include_hook = 0 - } - } - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - } - } - } - - auto_accept = yes - - on_accept = { - # Enact changes. - scope:recipient = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:actor - if = { - limit = { always = scope:hook } - use_hook = scope:actor - add_achievement_flag_effect = { FLAG = achievement_fine_print_flag } - } - - hidden_effect = { set_subject_contract_modification_blocked = yes } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:recipient = { - vassal_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - } - } - } - } - scope:actor = { - set_variable = { - name = vassal_recently_adjusted_mandala_vassal_contract - value = scope:recipient - years = mandala_vassal_obligation_cooldown_years - } - } - # If there's a diarch involved, and they called in their change, that gets flagged. - diarch_changed_own_contract_effect = yes - - hidden_effect = { - # Struggle Catalysts - ## We work these out first so they're not invalidated by the actual effect block. - if = { - limit = { - catalyst_granted_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_granted_powerful_diff_faith_vassal_religious_protection - character = scope:recipient - } - } - } - } - # Improving contract catalyst - if = { - limit = { - scope:recipient.count_obligation_improvements_for_vassal > 0 - scope:actor = { - is_diff_faith_or_culture_trigger = { - CHAR = scope:recipient - STATUS = involved - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_grant_privilege_to_diff_faith_culture_vassal - character = scope:actor - } - } - } - } - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - send_option = { - is_valid = { - scope:recipient = { - has_usable_hook = scope:actor - } - } - flag = hook - localization = SCHEME_HOOK - } - send_option = { - is_shown = { - scope:recipient = { is_diarch_of_target = scope:actor } - scope:actor = { has_diarchy_parameter = diarch_gets_a_free_change_on_vassal_contract } - } - is_valid = { - scope:recipient = { - trigger_if = { - limit = { has_variable_list = diarch_contract_rights_used_list } - NOT = { - is_target_in_variable_list = { - name = diarch_contract_rights_used_list - target = scope:actor - } - } - } - } - scope:actor = { has_diarchy_active_parameter = diarch_gets_a_free_change_on_vassal_contract } - } - flag = diarch - localization = CALL_IN_DIARCH_RIGHTS - } - should_use_extra_icon = { - scope:recipient = { has_usable_hook = scope:actor } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no -} - -ai_only_liege_modify_vassal_contract_interaction = { - category = interaction_category_vassal - send_name = "modify_vassal_contract_interaction_SEND" - desc = liege_modify_vassal_contract_interaction_desc - - auto_accept = yes - - is_shown = { - scope:actor = { - is_ai = yes - has_usable_hook = scope:recipient - } - scope:recipient = { - this != scope:actor - NOT = { - has_strong_hook = scope:actor - } - liege ?= scope:actor # this excludes tributary contracts by default - is_ruler = yes - vassal_contract_can_be_modified_trigger = yes - does_ai_liege_in_vassal_contract_desire_obligation_change = yes - } - NOT = { scope:actor = { is_at_war_with = scope:recipient } } - } - - on_accept = { - scope:actor = { - stress_impact = { - generous = minor_stress_impact_gain - } - } - - scope:recipient = { - set_subject_contract_modification_blocked = yes - trigger_event = char_interaction.0250 - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - ai_potential = { - trigger_if = { - limit = { - NOT = { government_allows = administrative } - } - is_at_war = no - } - } - - ai_targets = { - ai_recipients = vassals - } - - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 12 - kingdom = 24 - empire = 24 - hegemony = 36 - } - - ai_will_do = { - base = 100 - - modifier = { - factor = 0 - scope:recipient = { - OR = { - AND = { - scope:actor = { - ai_greed <= high_positive_ai_value - } - has_relation_friend = scope:actor - } - has_relation_best_friend = scope:actor - has_relation_soulmate = scope:actor - } - } - } - } -} - -# AI only interaction for specifically Admin Province obligations -ai_only_liege_modify_vassal_contract_admin_province_interaction = { - category = interaction_category_vassal - send_name = "modify_vassal_contract_interaction_SEND" - desc = liege_modify_vassal_contract_interaction_desc - - auto_accept = yes - - is_shown = { - scope:actor = { - is_ai = yes - AND = { - government_has_flag = government_uses_admin_province_obligations - scope:recipient = { government_has_flag = government_uses_admin_province_obligations } - } - } - scope:recipient = { - this != scope:actor - NOT = { - has_strong_hook = scope:actor - } - liege ?= scope:actor # this excludes tributary contracts by default - is_ruler = yes - government_has_flag = government_uses_admin_province_obligations - - does_ai_liege_in_vassal_contract_desire_admin_province_obligation_change = yes - } - NOT = { scope:actor = { is_at_war_with = scope:recipient } } - } - - on_accept = { - scope:actor = { - stress_impact = { - generous = minor_stress_impact_gain - } - } - - scope:recipient = { - trigger_event = char_interaction.0253 - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - ai_targets = { - ai_recipients = vassals - max = 10 - } - - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 12 - kingdom = 6 - empire = 6 - hegemony = 3 - } - - is_available = { - # This also blocks non-admin govs with admin vassals from changing province obligations... but we're OK with that. - government_has_flag = government_uses_admin_province_obligations - } - - ai_will_do = { - base = 100 - } -} - -ai_only_vassal_modify_vassal_contract_interaction = { - category = interaction_category_vassal - send_name = "modify_vassal_contract_interaction_SEND" - desc = vassal_modify_vassal_contract_interaction_desc - - auto_accept = yes - - is_shown = { - scope:actor = { - is_ai = yes - top_liege != this - has_usable_hook = scope:recipient - vassal_contract_can_be_modified_trigger = yes - does_ai_vassal_in_vassal_contract_desire_obligation_change = yes - } - scope:recipient = { - this != scope:actor - liege ?= scope:actor # this excludes tributary contracts by default - is_ruler = yes - NOT = { - has_strong_hook = scope:actor - } - } - NOT = { scope:actor = { is_at_war_with = scope:recipient } } - } - - on_accept = { - scope:recipient = { - trigger_event = char_interaction.0251 - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - ai_potential = { - always = yes - } - - ai_targets = { - ai_recipients = liege - } - ai_frequency_by_tier = { - barony = 0 - county = 24 - duchy = 24 - kingdom = 24 - empire = 36 - hegemony = 0 - } - - ai_will_do = { - base = 100 - - modifier = { - factor = 0 - scope:recipient = { - OR = { - AND = { - scope:actor = { - ai_greed <= high_positive_ai_value - } - has_relation_friend = scope:actor - } - has_relation_best_friend = scope:actor - has_relation_soulmate = scope:actor - } - } - } - } -} - -# Separate interactions are set up for Administrative - This is to help with localisation and some of the effects -admin_liege rep_liege_modify_vassal_contract_interaction = { - special_interaction = liege_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - common_interaction = yes - interface_priority = 1000 - icon = icon_contract_modification_single - - send_name = admin_liege rep_liege_modify_vassal_contract_interaction - desc = admin_liege rep_liege_modify_vassal_contract_interaction_desc - - force_notification = yes - notification_text = MODIFY_VASSAL_CONTRACT_NOTIFICATION_TO_VASSAL - - is_shown = { - scope:recipient = { - this != scope:actor - OR = { - is_landed = yes - is_councillor_of = scope:actor.top_liege - } - liege ?= scope:actor # this excludes tributary contracts by default - is_ruler = yes - vassal_contract_has_modifiable_obligations = yes - government_allows = administrative - any_held_title = { - OR = { - tier >= holder.main_administrative_tier - tier >= holder.min_title_maa_tier - } - is_noble_family_title = no - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - NOT = { is_at_war_with = scope:recipient } - tgp_is_ceremonial_liege_trigger = no - } - } - - can_send = { - trigger_if = { #If they're blocked we don't want to show anything else - limit = { - scope:recipient = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:recipient = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - # There is no cooldown present - To make sure we somehow don't show both cooldowns at the same time, we split them into separate triggers - trigger_if = { - limit = { - scope:recipient = { - has_variable = admin_contract_cooldown - } - } - custom_tooltip = { - text = admin_contract_cooldown_desc - scope:recipient = { - NOT = { has_variable = admin_contract_cooldown } - } - } - } - trigger_else = { - scope:actor = { - has_changed_contract_obligation_trigger = yes - } - } - } - } - - auto_accept = yes - on_accept = { - hidden_effect = { - # Struggle Catalysts - ## We work these out first so they're not invalidated by the actual effect block. - if = { - limit = { - catalyst_granted_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_granted_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - if = { - limit = { - catalyst_revoked_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - - # Improving contract catalyst - if = { - limit = { - scope:recipient.count_obligation_improvements_for_vassal > 0 - scope:actor = { - is_diff_faith_or_culture_trigger = { - CHAR = scope:recipient - STATUS = involved - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_grant_privilege_to_diff_faith_culture_vassal - character = scope:actor - } - } - } - } - } - - # Enact changes. - scope:actor = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:recipient - - scope:recipient = { - hidden_effect = { - set_variable = { - name = admin_contract_cooldown - value = yes - years = admin_contract_cooldown_value - } - } - } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:recipient = { - vassal_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - - # Update the succession law for celestial province types if applicable - That way, we don't have to wait until the current law invalidates. - if = { - limit = { - government_has_flag = government_is_celestial - scope:obligation.vassal_contract_type = vassal_contract:celestial_provinces - } - - if = { - limit = { - OR = { - vassal_contract_has_flag = celestial_province_military - vassal_contract_has_flag = celestial_province_protectorate - } - NOT = { has_realm_law = celestial_military_appointment_succession_law } - } - add_realm_law_skip_effects = celestial_military_appointment_succession_law - } - else_if = { - limit = { - OR = { - vassal_contract_has_flag = celestial_province_standard - vassal_contract_has_flag = celestial_province_industrial - vassal_contract_has_flag = celestial_province_metropolitan - } - NOT = { has_realm_law = celestial_appointment_succession_law } - } - add_realm_law_skip_effects = celestial_appointment_succession_law - } - } - } - } - } - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - send_options_exclusive = no -} - -admin_vassal_modify_vassal_contract_interaction = { - special_interaction = vassal_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - interface_priority = 65 - common_interaction = yes - icon = icon_contract_modification_single - - filter_tags = { admin_liege rep_liege } - - send_name = "admin_vassal_modify_vassal_contract_interaction_send" - desc = admin_vassal_modify_vassal_contract_interaction_desc - - is_shown = { - scope:actor = { - top_liege != this - this != scope:recipient - liege ?= scope:recipient # this excludes tributary contracts by default - vassal_contract_has_modifiable_obligations = yes - government_allows = administrative - tgp_is_ceremonial_liege_trigger = no - } - } - - is_valid_showing_failures_only = { - scope:actor = { - custom_tooltip = { - text = admin_vassal_not_holding_a_theme_desc - any_held_title = { - OR = { - tier >= holder.main_administrative_tier - tier >= holder.min_title_maa_tier - } - is_noble_family_title = no - } - } - NOT = { is_at_war_with = scope:recipient } - } - } - - can_send = { - trigger_if = { #If you're blocked we don't want to show anything else (we don't really use this for admin, but we'll keep the logic, just in case) - limit = { - scope:actor = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:actor = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - # There is no cooldown present - To make sure we somehow don't show both cooldowns at the same time, we split them into separate triggers - trigger_if = { - limit = { - scope:actor = { - has_variable = admin_contract_cooldown - } - } - custom_tooltip = { - text = admin_contract_cooldown_desc_vassal - scope:actor = { - NOT = { has_variable = admin_contract_cooldown } - } - } - } - trigger_else = { - custom_tooltip = { - text = admin_contract_request_cooldown_desc - scope:actor = { - NOT = { has_variable = admin_contract_request_cooldown } - } - } - scope:actor = { - has_changed_contract_obligation_trigger = yes - } - } - - # You can afford the influence cost - trigger_if = { - limit = { - NOR = { - scope:hook = yes - scope:dominant_family = yes - } - } - scope:actor = { - influence >= major_influence_value - } - } - } - } - - auto_accept = { - custom_tooltip = { - text = admin_vassal_force_obligation_change_desc - OR = { - scope:hook = yes - scope:dominant_family = yes - scope:diarch = yes - } - } - } - - on_accept = { - # Enact changes - scope:actor = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:recipient - - # If you use a hook - Spend it - if = { - limit = { always = scope:hook } - use_hook = scope:recipient - add_achievement_flag_effect = { FLAG = achievement_fine_print_flag } - } - - # If you didn't use a hook or leveraged your position as a Dominant Family, pay Influence - if = { - limit = { - has_changed_contract_obligation_trigger = yes # Don't show the cost unless we actually change the contract - NOR = { - scope:hook = yes - scope:dominant_family = yes - scope:diarch = yes - } - } - scope:actor = { - change_influence = major_influence_loss - } - } - - # Activate cooldown - To prevent liege from changing it too soon - hidden_effect = { - set_variable = { - name = admin_contract_cooldown - value = yes - years = admin_contract_cooldown_value - } - } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:actor = { - vassal_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - - # Update the succession law for celestial province types if applicable - That way, we don't have to wait until the current law invalidates. - if = { - limit = { - government_has_flag = government_is_celestial - scope:obligation.vassal_contract_type = vassal_contract:celestial_provinces - } - - if = { - limit = { - OR = { - vassal_contract_has_flag = celestial_province_military - vassal_contract_has_flag = celestial_province_protectorate - } - NOT = { has_realm_law = celestial_military_appointment_succession_law } - } - add_realm_law_skip_effects = celestial_military_appointment_succession_law - } - else_if = { - limit = { - OR = { - vassal_contract_has_flag = celestial_province_standard - vassal_contract_has_flag = celestial_province_industrial - vassal_contract_has_flag = celestial_province_metropolitan - } - NOT = { has_realm_law = celestial_appointment_succession_law } - } - add_realm_law_skip_effects = celestial_appointment_succession_law - } - } - } - } - } - } - - # If there's a diarch involved, and they called in their change, that gets flagged. - diarch_changed_own_contract_effect = yes - - hidden_effect = { - # Struggle Catalysts - ## We work these out first so they're not invalidated by the actual effect block. - if = { - limit = { - catalyst_granted_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:recipient = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:actor - } - } - } - } - scope:recipient = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:actor - } - } - activate_struggle_catalyst = { - catalyst = catalyst_granted_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - # Improving contract catalyst - if = { - limit = { - scope:actor.count_obligation_improvements_for_vassal > 0 - scope:recipient = { - is_diff_faith_or_culture_trigger = { - CHAR = scope:actor - STATUS = involved - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:actor - } - } - } - } - scope:recipient = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:actor - } - } - activate_struggle_catalyst = { - catalyst = catalyst_grant_privilege_to_diff_faith_culture_vassal - character = scope:recipient - } - } - } - } - } - } - - on_decline = { - # Activate cooldown - You may only ask for it to be changed every so often (this mostly exists for MP, since you cannot send it to the AI unless they accept) - hidden_effect = { - scope:actor = { - set_variable = { - name = admin_contract_request_cooldown - value = yes - years = admin_contract_cooldown_value - } - } - } - } - - # Send Options - # Hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - # Dominant Family - send_option = { - is_shown = { - scope:actor = { - house ?= { is_dominant_family = yes } - } - } - flag = dominant_family - localization = OPTION_DOMINANT_FAMILY - } - # Diarch - send_option = { - is_shown = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - is_valid = { - scope:actor = { - trigger_if = { - limit = { has_variable_list = diarch_contract_rights_used_list } - NOT = { - is_target_in_variable_list = { - name = diarch_contract_rights_used_list - target = scope:recipient - } - } - } - } - } - flag = diarch - localization = CALL_IN_DIARCH_RIGHTS - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no - - ai_accept = { - base = -25 - - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - desc = AI_OPINION_REASON - } - - # Governor efficiency - Skilled governors are more likely to get accepted - modifier = { - add = scope:actor.governor_efficiency_presented - desc = AI_GOVERNOR_EFFICIENCY - } - - # Members of a powerful family are more likely to get accepted - modifier = { - scope:actor = { - house ?= { is_powerful_family = yes } - NOT = { house ?= scope:recipient.house } - } - add = 50 - desc = AI_POWERFUL_FAMILY - } - - # Members of the emperors family are much more likely to get accepted - modifier = { - scope:actor = { - house ?= scope:recipient.house - } - add = 60 - desc = AI_SAME_HOUSE - } - } -} - -# Separate interactions are set up for Nomads - This is to help with localisation and some of the effects -nomad_liege_modify_vassal_contract_interaction = { - special_interaction = liege_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - common_interaction = yes - icon = icon_contract_modification_single - - send_name = nomad_liege_modify_vassal_contract_interaction - desc = nomad_liege_modify_vassal_contract_interaction_desc - - force_notification = yes - notification_text = MODIFY_VASSAL_CONTRACT_NOTIFICATION_TO_VASSAL - - is_shown = { - scope:recipient = { - NOT = { this = scope:actor } - liege ?= scope:actor # this excludes tributary contracts by default - is_ruler = yes - vassal_contract_has_modifiable_obligations = yes - government_has_flag = government_is_nomadic - } - } - - is_valid_showing_failures_only = { - NOT = { scope:actor = { is_at_war_with = scope:recipient } } - } - - can_send = { - trigger_if = { #If they're blocked we don't want to show anything else - limit = { - scope:recipient = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:recipient = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - scope:actor = { - has_changed_contract_obligation_trigger = yes - - custom_description = { - text = "liege_modify_vassal_contract_cannot_exceed_tyranny_cap" - object = scope:actor - NOT = { - vassal_obligation_increase_tyranny_gain_multiplier > 1 - } - } - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - - # If the trade without the hook usage is already in the vassal's favour or fair then don't waste your hook - save_temporary_scope_value_as = { - name = obligations_favoring_vassal - value = scope:recipient.count_obligation_improvements_for_vassal - } - trigger_if = { - limit = { scope:obligations_favoring_vassal > 0 } - custom_description = { - text = "vassal_modify_vassal_contract_unnecessary_hook_usage_vassal_favor" - object = scope:recipient - value = scope:obligations_favoring_vassal - NOT = { always = scope:hook } - } - } - trigger_else_if = { - limit = { scope:obligations_favoring_vassal = 0 } - custom_description = { - text = "vassal_modify_vassal_contract_unnecessary_hook_usage_equal" - object = scope:recipient - NOT = { always = scope:hook } - } - } - trigger_else = {} # Otherwise we're fine! - } - } - } - - auto_accept = yes - on_accept = { - hidden_effect = { - # Struggle Catalysts - ## We work these out first so they're not invalidated by the actual effect block. - if = { - limit = { - catalyst_granted_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_granted_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_granted_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - if = { - limit = { - catalyst_revoked_powerful_diff_faith_vassal_religious_protection_preliminary_trigger = { CHAR = scope:recipient } - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_revoked_powerful_diff_faith_vassal_religious_protection - character = scope:actor - } - } - } - } - - # Improving contract catalyst - if = { - limit = { - scope:recipient.count_obligation_improvements_for_vassal > 0 - scope:actor = { - is_diff_faith_or_culture_trigger = { - CHAR = scope:recipient - STATUS = involved - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_grant_privilege_to_diff_faith_culture_vassal - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_grant_privilege_to_diff_faith_culture_vassal - character = scope:actor - } - } - } - } - } - - # Enact changes. - scope:actor = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:recipient - if = { - limit = { vassal_obligation_increase_tyranny_gain != 0 } - stress_impact = { - just = medium_stress_impact_gain - generous = medium_stress_impact_gain - } - } - if = { - limit = { - always = scope:hook - } - use_hook = scope:recipient - add_achievement_flag_effect = { FLAG = achievement_fine_print_flag } - } - - scope:recipient = { - hidden_effect = { - set_subject_contract_modification_blocked = yes - set_variable = { - name = vassal_modify_contract_cooldown - value = yes - years = vassal_modify_contract_cooldown_value - } - } - } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:recipient = { - vassal_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - } - - } - } - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no -} - -nomad_vassal_modify_vassal_contract_interaction = { - special_interaction = vassal_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - interface_priority = 65 - common_interaction = yes - icon = icon_contract_modification_single - - send_name = "nomad_vassal_modify_vassal_contract_interaction_send" - desc = nomad_vassal_modify_vassal_contract_interaction_desc - - redirect = { - # need to reverse the role for the UI to work properly - scope:recipient = { - save_scope_as = secondary_recipient - } - scope:actor = { - save_scope_as = recipient - } - - scope:secondary_recipient = { - save_scope_as = actor - } - } - - is_shown = { - scope:recipient = { - is_independent_ruler = no - NOT = { this = scope:actor } - liege ?= scope:actor # this excludes tributary contracts by default - vassal_contract_has_modifiable_obligations = yes - government_has_flag = government_is_nomadic - } - } - - is_valid_showing_failures_only = { - NOT = { scope:recipient = { is_at_war_with = scope:actor } } - } - - can_send = { - trigger_if = { #If you're blocked we don't want to show anything else - limit = { - scope:recipient = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:recipient = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - # There is no cooldown present - To make sure we somehow don't show both cooldowns at the same time, we split them into separate triggers - trigger_if = { - limit = { - scope:actor = { - has_variable = vassal_modify_contract_cooldown - } - } - custom_tooltip = { - text = vassal_modify_contract_cooldown_desc - scope:actor = { - NOT = { has_variable = vassal_modify_contract_cooldown } - } - } - } - trigger_else = { - custom_tooltip = { - text = nomad_contract_request_cooldown_desc - scope:actor = { - NOT = { has_variable = nomad_contract_request_cooldown } - } - } - } - scope:actor = { - has_changed_contract_obligation_trigger = yes - } - - scope:recipient = { - # Must be an even trade overall - custom_description = { - text = "vassal_modify_vassal_contract_cannot_increase_obligation_level" - object = scope:actor - value = count_obligation_improvements_for_vassal_include_hook - count_obligation_improvements_for_vassal_include_hook = 0 - } - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - } - } - } - - auto_accept = yes - - on_accept = { - # Enact changes - scope:recipient = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:actor - if = { - limit = { always = scope:hook } - use_hook = scope:actor - add_achievement_flag_effect = { FLAG = achievement_fine_print_flag } - } - - # Activate cooldown - To prevent liege from changing it too soon - hidden_effect = { - set_variable = { - name = vassal_modify_contract_cooldown - value = yes - years = vassal_modify_contract_cooldown_value - } - } - - hidden_effect = { set_subject_contract_modification_blocked = yes } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:recipient = { - vassal_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - } - } - } - } - # If there's a diarch involved, and they called in their change, that gets flagged. - diarch_changed_own_contract_effect = yes - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - on_decline = { - # Activate cooldown - You may only ask for it to be changed every so often (this mostly exists for MP, since you cannot send it to the AI unless they accept) - hidden_effect = { - scope:recipient = { - set_variable = { - name = nomad_contract_request_cooldown - value = yes - years = vassal_modify_contract_cooldown_value - } - } - } - } - - # Send Options - # Hook - send_option = { - is_valid = { - scope:recipient = { - has_usable_hook = scope:actor - } - } - flag = hook - localization = SCHEME_HOOK - } - send_option = { - is_shown = { - scope:recipient = { is_diarch_of_target = scope:actor } - } - is_valid = { - scope:recipient = { - trigger_if = { - limit = { has_variable_list = diarch_contract_rights_used_list } - NOT = { - is_target_in_variable_list = { - name = diarch_contract_rights_used_list - target = scope:actor - } - } - } - } - } - flag = diarch - localization = CALL_IN_DIARCH_RIGHTS - } - should_use_extra_icon = { - scope:recipient = { has_usable_hook = scope:actor } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no -} - -suzerain_modify_tributary_contract_interaction = { - special_interaction = liege_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - common_interaction = yes - icon = icon_contract_modification_single - - send_name = "suzerain_modify_tributary_contract_interaction_send" - desc = suzerain_modify_tributary_contract_interaction_desc - - force_notification = yes - notification_text = MODIFY_VASSAL_CONTRACT_NOTIFICATION_TO_VASSAL - - is_shown = { - scope:recipient = { - is_tributary_of = scope:actor # excludes vassals by default - subject_contract_has_modifiable_obligations = yes - NOT = { government_has_flag = government_is_true_herder } - } - } - - is_valid_showing_failures_only = { - NOT = { scope:recipient = { is_at_war_with = scope:actor } } - } - - can_send = { - #Mandala gets special treatment - trigger_if = { - limit = { - scope:actor = { government_has_flag = government_is_mandala } - } - custom_tooltip = { - text = suzerain_modify_subject_contract_mandala_cooldown - NOT = { - scope:recipient = { var:suzerain_recently_adjusted_mandala_subject_contract ?= scope:actor } - } - } - scope:actor = { - has_changed_contract_obligation_trigger = yes - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - - # If the trade without the hook usage is already in the vassal's favour or fair then don't waste your hook - save_temporary_scope_value_as = { - name = obligations_favoring_tributary - value = scope:recipient.count_obligation_improvements_for_vassal - } - trigger_if = { - limit = { scope:obligations_favoring_tributary > 0 } - custom_description = { - text = "tributary_modify_vassal_contract_unnecessary_hook_usage_vassal_favor" - object = scope:recipient - value = scope:obligations_favoring_tributary - NOT = { always = scope:hook } - } - } - trigger_else_if = { - limit = { scope:obligations_favoring_tributary = 0 } - custom_description = { - text = "tributary_modify_vassal_contract_unnecessary_hook_usage_equal" - object = scope:recipient - NOT = { always = scope:hook } - } - } - - # You can afford the prestige cost of an unequal contract - trigger_else_if = { - limit = { - scope:obligations_favoring_tributary < 0 - NOT = { always = scope:hook } - } - scope:actor = { piety >= major_piety_value } - } - trigger_else = {} # Otherwise we're fine! - } - } - trigger_else_if = { #If they're blocked we don't want to show anything else - limit = { - scope:recipient = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:recipient = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - scope:actor = { - has_changed_contract_obligation_trigger = yes - - # Cannot change more than three things at once - custom_description = { - text = "vassal_modify_vassal_contract_obligation_change_limit" - value = list_size:changed_obligations - list_size:changed_obligations <= max_contract_changes - } - - # If the trade without the hook usage is already in the vassal's favour or fair then don't waste your hook - save_temporary_scope_value_as = { - name = obligations_favoring_tributary - value = scope:recipient.count_obligation_improvements_for_vassal - } - trigger_if = { - limit = { scope:obligations_favoring_tributary > 0 } - custom_description = { - text = "tributary_modify_vassal_contract_unnecessary_hook_usage_vassal_favor" - object = scope:recipient - value = scope:obligations_favoring_tributary - NOT = { always = scope:hook } - } - } - trigger_else_if = { - limit = { scope:obligations_favoring_tributary = 0 } - custom_description = { - text = "tributary_modify_vassal_contract_unnecessary_hook_usage_equal" - object = scope:recipient - NOT = { always = scope:hook } - } - } - - # You can afford the prestige cost of an unequal contract - trigger_else_if = { - limit = { - scope:obligations_favoring_tributary < 0 - NOT = { always = scope:hook } - } - scope:actor = { - prestige >= medium_prestige_value - } - } - trigger_else = {} # Otherwise we're fine! - } - } - } - - auto_accept = yes - - on_accept = { - scope:actor = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:recipient - if = { - limit = { - always = scope:hook - } - use_hook = scope:recipient - add_achievement_flag_effect = { FLAG = achievement_fine_print_flag } - } - - # Prestige and opinion cost of making an unequal contract without a hook - if = { - limit = { - scope:recipient.count_obligation_improvements_for_vassal < 0 - NOT = { always = scope:hook } - } - - if = { - limit = { government_has_flag = government_is_mandala } - add_piety = major_piety_loss - } - else = { add_prestige = medium_prestige_loss } - - scope:recipient = { - add_opinion = { - modifier = outraged_opinion - opinion = -30 - target = scope:actor - } - } - - every_tributary = { - limit = { - NOT = { this = scope:recipient } - } - add_opinion = { - modifier = outraged_opinion - opinion = -10 - target = scope:actor - } - } - } - - scope:recipient = { - hidden_effect = { - set_subject_contract_modification_blocked = yes - } - set_variable = { - name = suzerain_recently_adjusted_mandala_subject_contract - value = scope:actor - years = mandala_vassal_obligation_cooldown_years - } - } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:recipient = { - tributary_contract_set_obligation_level = { - type = scope:obligation.vassal_contract_type - level = scope:obligation - } - } - } - } - } - - # Additional Flavor Titles - scope:recipient = { additional_flavor_check_effect = yes } - } - - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no -} - -subject_modify_tributary_contract_interaction = { - special_interaction = vassal_modify_vassal_contract - interface = modify_vassal_contract - category = interaction_category_vassal - interface_priority = 65 - common_interaction = yes - icon = icon_contract_modification_single - - send_name = "subject_modify_tributary_contract_interaction_send" - desc = subject_modify_tributary_contract_interaction_desc - - is_shown = { - scope:actor = { - is_tributary_of = scope:recipient # excludes vassals by default - subject_contract_has_modifiable_obligations = yes - } - } - - is_valid_showing_failures_only = { - scope:actor = { - is_travelling = no - } - NOT = { scope:recipient = { is_at_war_with = scope:actor } } - } - - can_send = { - #Mandala gets special treatment - trigger_if = { - limit = { - scope:recipient = { government_has_flag = government_is_mandala } - } - custom_tooltip = { - text = subject_modify_subject_contract_mandala_cooldown - NOT = { - scope:actor = { var:subject_recently_adjusted_mandala_subject_contract ?= scope:recipient } - } - } - # You can afford the cost if there is one - scope:actor = { - has_changed_contract_obligation_trigger = yes - trigger_if = { - limit = { scope:hook = no } # no cost - trigger_if = { - limit = { subject_standing < 0 } # this means we don't use subject standing - trigger_if = { - limit = { - government_has_flag = government_is_nomadic - scope:recipient = { government_has_flag = government_is_nomadic } - } - domicile.herd >= domicile.major_herd_value - } - trigger_else = { - gold >= major_gold_value - } - } - trigger_else = { - subject_standing > 20 - } - } - } - } - trigger_else_if = { #If you're blocked we don't want to show anything else (we don't really use this for admin, but we'll keep the logic, just in case) - limit = { - scope:actor = { - subject_contract_is_blocked_from_modification = yes - } - } - scope:actor = { - subject_contract_is_blocked_from_modification = no - } - } - trigger_else = { - # There is no cooldown present - To make sure we somehow don't show both cooldowns at the same time, we split them into separate triggers - trigger_if = { - limit = { - scope:actor = { - has_variable = tributary_modify_contract_cooldown - } - } - custom_tooltip = { - text = tributary_modify_contract_cooldown_desc - scope:actor = { - NOT = { has_variable = tributary_modify_contract_cooldown } - } - } - } - trigger_else = { - custom_tooltip = { - text = tributary_modify_contract_cooldown_desc - scope:actor = { - NOT = { has_variable = tributary_modify_contract_cooldown } - } - } - } - - # You can afford the cost if there is one - scope:actor = { - trigger_if = { - limit = { scope:hook = no } # no cost - trigger_if = { - limit = { subject_standing < 0 } # this means we don't use subject standing - trigger_if = { - limit = { - government_has_flag = government_is_nomadic - scope:recipient = { government_has_flag = government_is_nomadic } - } - domicile.herd >= domicile.major_herd_value - } - trigger_else = { - gold >= major_gold_value - } - } - trigger_else = { - subject_standing > 20 - } - } - } - } - } - - auto_accept = { - custom_tooltip = { - text = nomad_vassal_force_obligation_change_desc - scope:hook = yes - } - } - - on_accept = { - # Enact changes - scope:actor = { - send_interface_message = { - type = msg_vassal_contract_change - title = modify_vassal_contract_interaction_notification - right_icon = scope:recipient - - # If you use a hook - Spend it - if = { - limit = { always = scope:hook } - use_hook = scope:recipient - } - else = { - if = { - limit = { subject_standing < 0 } # this means we don't use subject standing - if = { - limit = { - government_has_flag = government_is_nomadic - scope:recipient = { government_has_flag = government_is_nomadic } - } - pay_herd = { - target = scope:recipient - value = domicile.major_herd_value - } - } - else = { - pay_short_term_gold = { - target = scope:recipient - gold = major_gold_value - } - } - } - else = { - if = { # the subject tilting the contract in their favor costs Subject Standing - limit = { scope:new_value < 0 } - add_subject_standing = { - value = 10 - multiply = scope:new_value - } - } - } - } - - # Activate cooldown - To prevent liege from changing it too soon - hidden_effect = { - set_variable = { - name = tributary_modify_contract_cooldown - value = yes - years = tributary_modify_contract_cooldown_value - } - } - set_variable = { - name = subject_recently_adjusted_mandala_subject_contract - value = scope:recipient - years = mandala_vassal_obligation_cooldown_years - } - - every_in_list = { - list = changed_obligations - - save_scope_as = obligation - - scope:actor = { - tributary_contract_set_obligation_level = { - type = scope:obligation.subject_contract_type - level = scope:obligation - } - } - } - } - } - - # If there's a diarch involved, and they called in their change, that gets flagged. - diarch_changed_own_contract_effect = yes - } - - on_decline = { - # Activate cooldown - You may only ask for it to be changed every so often (this mostly exists for MP, since you cannot send it to the AI unless they accept) - hidden_effect = { - scope:actor = { - set_variable = { - name = tributary_modify_contract_cooldown - value = yes - years = tributary_modify_contract_cooldown_value - } - } - } - } - - # Send Options - # Hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - send_option = { - is_shown = { - scope:actor = { is_diarch_of_target = scope:recipient } - } - is_valid = { - scope:actor = { - trigger_if = { - limit = { has_variable_list = diarch_contract_rights_used_list } - NOT = { - is_target_in_variable_list = { - name = diarch_contract_rights_used_list - target = scope:recipient - } - } - } - } - } - flag = diarch - localization = CALL_IN_DIARCH_RIGHTS - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no - - ai_accept = { - base = -25 - - # Opinion Factor - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - desc = AI_OPINION_REASON - } - - modifier = { - add = { - add = scope:new_value - multiply = -20 #Overlord favoring options have a negative score - if = { # the Chinese Emperor cares less since they get tribute through missions as well - limit = { - scope:new_value < 0 - scope:actor = { - OR = { - has_subject_contract_group = tributary_celestial - has_subject_contract_group = tributary_hegemonic - } - } - } - multiply = 0.5 - } - } - desc = AI_CONTRACT_BALANCE - } - } -} - -ai_only_hegemonic_tributary_modify_tributary_contract_interaction = { - category = interaction_category_vassal - desc = subject_modify_tributary_contract_interaction_desc - - auto_accept = yes - - is_shown = { - scope:actor = { - is_ai = yes - is_available = yes # Let's not have the AI do this when they're away from home etc (like paying tribute) - is_tributary_of = scope:recipient # excludes vassals by default - OR = { - has_subject_contract_group = tributary_celestial - has_subject_contract_group = tributary_hegemonic - } - subject_standing > 40 - subject_contract_has_modifiable_obligations = yes - does_ai_subject_in_subject_contract_desire_obligation_change = yes - NOT = { is_at_war_with = scope:recipient } - } - } - - on_accept = { - scope:actor = { - if = { - # if the subject has a Seal of Investiture, they will always ask for an Investiture Privilege if they can - limit = { - any_character_artifact = { - OR = { - artifact_type = seal_of_investiture - artifact_type = seal_of_investiture_court - } - } - } - random_list = { - 33 = { - trigger = { - tributary_contract_obligation_level_can_be_increased = celestial_tributary_investiture_privilege_trade - } - save_scope_value_as = { name = ask value = flag:trade } - } - 33 = { - trigger = { - tributary_contract_obligation_level_can_be_increased = celestial_tributary_investiture_privilege_marriage - } - save_scope_value_as = { name = ask value = flag:marriage } - } - 33 = { - trigger = { - tributary_contract_obligation_level_can_be_increased = celestial_tributary_investiture_privilege_politics - } - save_scope_value_as = { name = ask value = flag:politics } - } - } - } - suzerain = { - trigger_event = char_interaction.0252 - } - } - } - - ai_potential = { - always = yes - } - - ai_targets = { - ai_recipients = suzerain - } - - ai_frequency_by_tier = { - barony = 0 - county = 24 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 0 - } - - ai_will_do = { - base = 100 - } -} diff --git a/common/character_interactions/00_prison_interactions.txt b/common/character_interactions/00_prison_interactions.txt deleted file mode 100644 index 499e303b..00000000 --- a/common/character_interactions/00_prison_interactions.txt +++ /dev/null @@ -1,8286 +0,0 @@ -imprison_interaction = { - interface_priority = 120 - common_interaction = yes - icon = prison - - category = interaction_category_hostile - highlighted_reason = { - triggered_desc = { - trigger = { - scope:actor = { - has_title = title:e_minister_of_justice - NOT = { has_imprisonment_reason = scope:recipient } - } - } - desc = HIGHLIGHTED_MINISTER_IMPRISONMENT_REASON - } - triggered_desc = { - trigger = { - scope:actor = { - has_imprisonment_reason = scope:recipient - } - } - desc = HIGHLIGHTED_HAS_IMPRISONMENT_REASON - } - } - ai_maybe = yes - ai_min_reply_days = 4 - ai_max_reply_days = 9 - can_send_despite_rejection = yes - popup_on_receive = yes - pause_on_receive = yes - - desc = imprison_interaction_desc - - greeting = negative - notification_text = REQUEST_ARREST_NOTIFICATION_TEXT - pre_answer_maybe_key = ANSWER_MIGHT_SUCCEED - pre_answer_no_key = ANSWER_CANT_SUCCEED - pre_answer_yes_key = ANSWER_WILL_SUCCEED - pre_answer_maybe_breakdown_key = ANSWER_SUM_CHANCE - - on_decline_summary = { - triggered_desc = { - trigger = { - scope:recipient = { - NOR = { - AND = { - has_government = landless_adventurer_government - reverse_has_opinion_modifier = { - target = scope:actor - modifier = eviction_ignored_opinion - } - } - scope:actor = { - has_title = title:e_minister_of_justice - } - scope:recipient = { - is_landed = no - any_held_title = { - is_noble_family_title = yes - } - } - } - } - } - desc = imprison_decline_summary - } - } - - ai_potential = { - trigger_if = { - limit = { has_realm_law_flag = imprisonment_toggle_enable } - has_realm_law_flag = imprisonment_toggle_on - } - is_imprisoned = no - } - - is_shown = { - scope:actor != scope:recipient - scope:actor = { - OR = { - AND = { - has_title = title:e_minister_of_justice - scope:recipient = { - tgp_is_any_minister = no - liege = { - basic_allowed_to_imprison_character_trigger = { - CHARACTER = scope:recipient - } - } - } - } - basic_allowed_to_imprison_character_trigger = { - CHARACTER = scope:recipient - } - } - } - # Scope:recipient can't be visiting elsewhere. - trigger_if = { - limit = { - scope:recipient = { is_courtier_of = scope:actor } - } - NOT = { - scope:recipient.host = { - any_foreign_court_guest = { this = scope:recipient } - } - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - trigger_if = { - limit = { - has_title = title:e_minister_of_justice - scope:recipient = { - tgp_is_any_minister = no - } - NOT = { - allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } - } - } - top_liege = { - allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } - } - } - trigger_else = { - allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } - } - trigger_if = { - limit = { - government_has_flag = government_is_nomadic - } - NOT = { has_realm_law = nomadic_authority_1 } - } - trigger_if = { - limit = { - has_title = title:e_minister_of_justice - } - scope:recipient = { - NOT = { - is_close_or_extended_family_of = scope:actor.top_liege - } - } - } - } - imprison_neutral_is_valid_showing_failures_only_triggers_trigger = yes - custom_tooltip = { - text = cannot_take_overt_hostile_actions_against_diarch.tt - NOT = { scope:recipient ?= scope:actor.diarch } - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - trigger_if = { - limit = { - is_ai = no - } - scope:recipient = { - trigger_if = { - limit = { - has_government = landless_adventurer_government - reverse_has_opinion_modifier = { - target = scope:actor - modifier = eviction_ignored_opinion - } - } - is_travelling = no - } - } - } - trigger_else = { - OR = { - has_imprisonment_reason = scope:recipient - any_character_struggle = { - involvement = involved - } - } - } - } - } - - is_highlighted = { - scope:recipient = { - is_imprisoned = no - } - scope:actor = { - OR = { - has_imprisonment_reason = scope:recipient - has_title = title:e_minister_of_justice - } - } - } - - #Use hook - send_option = { - is_valid = { - exists = scope:recipient - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - cost = { - # Usually, this action is free, but during certain diarchies, we want it to cost. - prestige = liege_diarchy_surcharge_interaction_imprison_interaction_value - treasury = { - if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_justice - } - scope:recipient = { - NOT = { is_courtier_of = scope:actor } - } - } - value = { - value = 0 - desc = BASE - } - add = { - value = scope:actor.major_treasury_value - desc = IMPRISON_MINISTER_OF_JUSTICE_TREASURY_COST - } - } - } - } - - on_send = { - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - } - } - - on_auto_accept = { - # the rest of the necessary logic is covered by auto_accept also triggering on_accept below - scope:recipient = { - trigger_event = char_interaction.0233 - } - } - - on_accept = { - scope:actor = { - if = { - limit = { - has_title = title:e_minister_of_justice - } - if = { - limit = { - NOR = { - has_imprisonment_reason = scope:recipient - scope:recipient.liege = { - has_imprisonment_reason = scope:recipient - } - scope:hook = yes - } - any_character_situation = { - situation_type = dynastic_cycle - situation_top_has_catalyst = catalyst_minister_imprison - } - } - save_scope_value_as = { - name = use_strife_not_tyranny - value = yes - } - situation:dynastic_cycle = { - trigger_situation_catalyst = { - catalyst = catalyst_minister_imprison - character = scope:recipient - } - } - } - if = { - limit = { - government_allows = merit - } - change_merit = { - value = minor_merit_gain - multiply = scope:recipient.highest_held_title_tier - } - } - if = { - limit = { - government_has_flag = government_has_influence - } - change_influence = { - value = minor_influence_gain - multiply = scope:recipient.highest_held_title_tier - } - } - scope:recipient.liege = { - if = { - limit = { has_imprisonment_reason = scope:recipient } - consume_imprisonment_reasons = scope:recipient - } - } - } - } - if = { - limit = { scope:hook = yes } - scope:actor = { use_hook = scope:recipient } - } - illegal_imprisonment_dread_effect = yes - imprison_court_chaplain_consequences_effect = yes - imprison_HoF_consequences_effect = yes - scope:recipient = { - if = { - limit = { - is_a_faction_member = yes - liege = scope:actor - } - joined_faction = { save_scope_as = retaliating_faction } - } - } - imprison_character_effect = { - TARGET = scope:recipient - IMPRISONER = scope:actor - } - # If they recently revoked your title, or asked for your excommunication, they become your rival - imprison_attempt_escalates_rivalry_effect = yes - scope:actor = { - trigger_event = char_interaction.0231 - if = { - limit = { - has_imprisonment_reason = scope:recipient - } - stress_impact = { - compassionate = minor_stress_impact_gain - forgiving = minor_stress_impact_gain - } - } - else = { - stress_impact = { - just = medium_stress_impact_gain - compassionate = medium_stress_impact_gain - } - if = { - limit = { exists = scope:retaliating_faction} - scope:retaliating_faction = { - imprisonment_retribution_start_faction_war_if_valid = yes - } - } - } - } - if = { - limit = { - scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } - } - scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } - } - - # If we're a clan this interaction affects unity - if = { # If you don't have an imprisonment reason, and the target is landed, you lose more unity - limit = { - NOT = { scope:actor = { has_imprisonment_reason = scope:recipient } } - scope:recipient = { is_landed_or_landless_administrative = yes } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_imprison.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else_if = { # If you don't have an imprisonment reason, and the target is unlanded, you lose slightly less unity - limit = { - NOT = { scope:actor = { has_imprisonment_reason = scope:recipient } } - scope:recipient = { is_landed_or_landless_administrative = no } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_imprison.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else = { # If you have a valid reason, you lose only a tiny bit of unity (criminal or not, they are still family) - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_imprison.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # Harrying logic. - scope:actor = { - if = { - limit = { - character_is_valid_for_harrying_of_the_north_trigger = yes - scope:recipient = { - character_is_valid_for_harrying_of_the_north_trigger = yes - is_important_or_vip_struggle_character = yes - } - culture != scope:recipient.culture - } - global_var:harrying_of_the_north = { save_scope_as = story } - if = { - limit = { - character_is_valid_norman_for_harrying_of_the_north_trigger = yes - scope:recipient = { character_is_valid_anglo_saxon_for_harrying_of_the_north_trigger = yes } - } - ep3_increase_pacification_effect = { AMOUNT = harrying_minor_increase_value } - } - else_if = { - limit = { - character_is_valid_anglo_saxon_for_harrying_of_the_north_trigger = yes - scope:recipient = { character_is_valid_norman_for_harrying_of_the_north_trigger = yes } - } - ep3_increase_resistance_effect = { AMOUNT = harrying_minor_increase_value } - } - } - } - } - - on_decline = { - if = { - limit = { - scope:recipient = { - has_government = landless_adventurer_government - reverse_has_opinion_modifier = { - target = scope:actor - modifier = eviction_ignored_opinion - } - } - } - scope:recipient = { - if = { - limit = { current_military_strength >= ep3_interactions_events_0500_troops_count_value } - start_war = { - cb = ep3_laamp_apprehend_adventurer_cb - target = scope:actor - } - } - else = { - # Remove them immediately. - remove_laamp_from_exiled_county_automatically_effect = { - PROVINCE = scope:recipient.location - LAAMP = scope:recipient - } - } - } - } - else = { - scope:actor = { - imprison_HoF_consequences_effect = yes - imprison_tyranny_effect = yes - } - scope:recipient = { - #If target is count or higher, start war. - if = { - limit = { - is_playable_character = yes - primary_title.tier > tier_barony - } - if = { - limit = { - is_a_faction_member = yes - liege = scope:actor - joined_faction = { - faction_target = scope:actor - NOT = { faction_is_type = populist_faction } - } - } - joined_faction = { - save_scope_as = retaliating_faction # For loc - imprisonment_retribution_start_faction_war_if_valid = yes - } - hidden_effect = { - if = { - limit = { NOT = { exists = joined_faction.faction_war } } - war_for_imprison_effect = yes - } - } - } - else = { - war_for_imprison_effect = yes - } - } - #If target is a baron or unlanded, have them escape. - else = { - if = { #To block them from being instantly rehired - limit = { - is_councillor_of = scope:actor - can_be_fired_from_council_trigger = { COURT_OWNER = scope:actor } - } - set_variable = { - name = escaped_imprisonment_from - value = scope:actor - years = 20 - } - } - imprison_court_chaplain_consequences_effect = yes - if = { - limit = { - is_landed_or_landless_administrative = yes - } - depose_effect = { DEPOSER = scope:actor } - } - else_if = { - limit = { - is_hostage = yes - warden = scope:actor - } - save_scope_as = imprison_failure - save_scope_as = hostage - warden = { save_scope_as = warden } - home_court = { save_scope_as = home_court } - scope:warden = { trigger_event = bp2_hostage_system.0400 } - scope:home_court = { trigger_event = bp2_hostage_system.0401 } - return_hostage = yes - } - else_if = { - limit = { - is_landed_or_landless_administrative = no - trigger_if = { - limit = { - is_councillor = yes - } - can_be_fired_from_council_trigger = { COURT_OWNER = scope:recipient.liege } - } - trigger_if = { - limit = { - exists = scope:actor.faith.religious_head - } - scope:actor.faith.religious_head != scope:recipient - } - } - select_and_move_to_pool_effect = yes - } - add_opinion = { - target = scope:actor - modifier = attempted_imprisonment_opinion - } - } - } - - if = { - limit = { - scope:actor = { has_realm_law_flag = vassal_refusal_is_treason } - } - scope:actor = { - add_opinion = { - target = scope:recipient - modifier = treasonous_imprison_refusal - } - } - } - } - - #Remove them as guardian/ward for any courtier (feedback given in char_interaction.0230) - scope:actor = { - if = { - limit = { - any_courtier = { - has_relation_guardian = scope:recipient - } - } - every_courtier = { - limit = { - has_relation_guardian = scope:recipient - } - save_scope_as = ward - scope:recipient = { remove_relation_ward = scope:ward } - - scope:ward = { - if = { - limit = { - host != liege - } - return_to_court = yes - } - guardian_remove_opinion_effect = { - GUARDIAN = scope:recipient - WARD = this - WARD_LIEGE = scope:actor - } - } - - add_to_list = ward_children - } - } - if = { - limit = { - any_courtier = { - has_relation_ward = scope:recipient - } - } - random_courtier = { - limit = { - has_relation_ward = scope:recipient - } - save_scope_as = guardian - scope:guardian = { remove_relation_ward = scope:recipient } - - scope:guardian = { - if = { - limit = { - host != liege - } - return_to_court = yes - } - guardian_remove_opinion_effect = { - GUARDIAN = this - WARD = scope:recipient - WARD_LIEGE = scope:actor - } - } - - add_to_list = guardian_list - } - - hidden_effect = { - scope:guardian = { - send_interface_message = { - type = event_childhood_neutral - title = remove_guardian_interaction_notification - left_icon = scope:recipient - right_icon = scope:guardian - remove_guardian_effect = { - GUARDIAN = scope:guardian - WARD = scope:recipient - RETURN_WARD = yes - HIDE_OPINION = no - } - } - } - } - } - } - - scope:actor = { - if = { - limit = { - scope:recipient = { - OR = { - is_playable_character = no - AND = { - is_playable_character = yes - primary_title.tier = tier_barony - } - } - } - } - trigger_event = char_interaction.0230 - } - } - - if = { - limit = { - scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } - } - scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } - } - - # If we're a clan this interaction affects unity - if = { # If you don't have an imprisonment reason, and the target is landed, you lose more unity - limit = { - NOT = { - scope:actor = { has_imprisonment_reason = scope:recipient } - } - scope:recipient = { is_landed_or_landless_administrative = yes } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_imprison.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else_if = { # If you don't have an imprisonment reason, and the target is unlanded, you lose slightly less unity - limit = { - NOT = { - scope:actor = { has_imprisonment_reason = scope:recipient } - } - scope:recipient = { is_landed_or_landless_administrative = no } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_imprison.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else = { # If you have a valid reason, you lose only a tiny bit of unity (criminal or not, they are still family) - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = miniscule_unity_loss - DESC = clan_unity_imprison.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - auto_accept = { - # OR does not display properly here - trigger_if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_justice - } - } - custom_description = { - text = you_are_the_minister_of_justice - scope:actor = { - has_title = title:e_minister_of_justice - } - } - } - trigger_else_if = { - limit = { - scope:recipient = { - is_landed = no - any_held_title = { - is_noble_family_title = yes - } - } - } - custom_description = { - text = noble_family_head_cannot_refuse_your_power - scope:recipient = { - is_landed = no - any_held_title = { - is_noble_family_title = yes - } - } - } - } - trigger_else = { - always = no - } - } - - ai_accept = { - base = 0 # Try to make it 0 for most interactions - - modifier = { - add = { - value = scope:actor.intrigue - multiply = 1 - } - desc = IMPRISON_INTRIGUE_ACTOR - } - modifier = { - add = { - value = scope:recipient.intrigue - multiply = -2 - } - desc = IMPRISON_INTRIGUE_RECIPIENT - } - - modifier = { - add = 30 - scope:hook = yes - desc = SCHEME_HOOK_USED - } - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - ai_value_modifier = { - who = scope:recipient - ai_boldness = { - if = { - limit = { - scope:recipient = { NOT = { ai_boldness = 0 } } - } - value = -0.5 - } - } - ai_honor = { - if = { - limit = { - scope:recipient = { #If AI is honorable and the law compels to obey the liege, AI will be more likely to obey. - ai_honor > 0 - } - scope:actor = { - has_imprisonment_reason = scope:recipient - has_realm_law_flag = vassal_refusal_is_treason - } - } - value = 0.75 - } - } - } - modifier = { - add = 20 - scope:actor = { - any_vassal_or_below = { this = scope:recipient } - has_realm_law_flag = vassal_refusal_is_treason - } - desc = AI_REFUSAL_IS_TREASON - } - modifier = { - add = 50 - scope:actor = { - has_perk = prison_feudal_complex_perk - } - desc = AI_PRISON_FEUDAL_COMPLEX_PERK - } - modifier = { #I am a King! - desc = offer_vassalization_interaction_aibehavior_hightier_tt - scope:recipient = { highest_held_title_tier = tier_kingdom } - add = -40 - } - modifier = { #Courtiers. - desc = AI_REFUSAL_COURTIER - scope:recipient = { is_ruler = no } - add = 50 - } - modifier = { # Your young children can't really stop you - desc = AI_REFUSAL_YOUNG_CHILD - scope:recipient = { - is_child_of = scope:actor - is_courtier_of = scope:actor - is_adult = no - } - add = 200 - } - modifier = { #They're a claimant against you - desc = AI_CLAIMANT_PENALTY - scope:actor = { - OR = { - any_targeting_faction = { - faction_type = claimant_faction - faction_is_at_war = yes - special_character ?= scope:recipient - } - AND = { - exists = var:claimant_faction_sent_demand - var:claimant_faction_sent_demand = scope:recipient - } - } - } - add = -70 - } - modifier = { #Rank difference. - desc = AI_REFUSAL_RANK_DIFFERENCE - scope:recipient = { - is_ruler = yes - is_landed = yes - highest_held_title_tier < tier_kingdom - } - add = { - value = -15 - if = { - limit = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 2 - } - } - } - add = 5 - } - if = { - limit = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 3 - } - } - } - add = 5 - } - if = { #King asking Baron, modifier becomes positive. - limit = { - scope:actor = { - tier_difference = { - target = scope:recipient - value >= 4 - } - } - } - add = 10 - } - } - } - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - modifier = { - add = intimidated_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_external_reason_value - scope:recipient = { - NOT = { target_is_liege_or_above = scope:actor } - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - modifier = { #Comparative military strength. - desc = offer_vassalization_interaction_aibehavior_power_tt - trigger = { - scope:actor = { is_ruler = yes } - scope:recipient = { is_ruler = yes } - } - add = { - value = 1 - subtract = { - value = scope:recipient.current_military_strength - divide = { value = scope:actor.current_military_strength min = 1 } - } - multiply = 100 - min = -1000 - # This max needs to match the loc in offer_vassalization_interaction_aibehavior_power_tt - max = 20 - } - } - modifier = { #Rivalry modifier. - desc = offer_vassalization_interaction_aibehavior_rival_tt - trigger = { - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - add = -50 - } - modifier = { #Nemesis modifier. - desc = offer_vassalization_interaction_aibehavior_nemesis_tt - trigger = { - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - add = -100 - } - modifier = { - add = 10 - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - is_liege_or_above_of = scope:recipient - court_grandeur_current_level >= 7 - court_grandeur_current_level < 9 - } - desc = GRANDEUR_REASON - } - modifier = { - add = 20 - scope:actor = { - has_royal_court = yes - has_dlc_feature = royal_court - is_liege_or_above_of = scope:recipient - court_grandeur_current_level >= 9 - } - desc = GRANDEUR_REASON - } - modifier = { # Legalistic tradition - desc = tradition_legalistic_name - scope:actor = { - has_imprisonment_reason = scope:recipient - culture = { has_cultural_parameter = vassals_more_likely_accept_punishments } - } - add = legalistic_vassal_punishment_acceptance - } - modifier = { # AI Mongols, tyranny wars just delay the inevitable fun! - scope:actor = { - is_ai = yes - OR = { - has_trait = greatest_of_khans - has_character_modifier = the_great_khan_modifier - } - } - scope:recipient = { - is_ai = yes - } - add = 500 - } - # Thug accolade increases imprison chance because they scary - modifier = { - scope:actor = { - any_active_accolade = { - accolade_parameter = accolade_imprisonment_chance - } - } - desc = THUG_REASON - add = accolade_imprisonment_chance_value - } - modifier = { - scope:actor = { - any_active_accolade = { - accolade_parameter = accolade_imprisonment_chance_high - } - } - desc = THUG_REASON_HIGH - add = accolade_imprisonment_chance_value_high - } - evaluate_action_decreasing_house_unity = { - VALUE = 100 - } - modifier = { - add = -25 - scope:recipient = { - culture = { has_cultural_parameter = vassals_more_likely_to_refuse_demands } - } - desc = VASSALS_REFUSAL_indomitable_azatani - } - modifier = { - add = 10 - scope:recipient = { has_character_modifier = ach_intent_imprisonment_modifier } - desc = ach_host_intent_imprison_reason - } - } - - # AI - ai_targets = { - ai_recipients = vassals - chance = 0.5 - } - ai_targets = { - ai_recipients = courtiers - chance = 0.25 - } - - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 10 - kingdom = 10 - empire = 10 - hegemony = 10 - } - - ai_will_do = { - base = -100 - - modifier = { # Make sure the AI uses hooks for this as it's % based - scope:hook = yes - add = 1 - } - - modifier = { # Default imprisonment reason weight - add = 200 - scope:actor = { - has_imprisonment_reason = scope:recipient - } - } - - modifier = { # More likely to imprison criminal Soryo's if Ritsuryo - add = 200 - scope:actor = { - has_imprisonment_reason = scope:recipient - government_has_flag = government_is_japan_administrative - } - scope:recipient = { - government_has_flag = government_is_japan_feudal - } - } - - modifier = { # Even more imprisonment reason if you are a danger to the Kampaku - add = 400 - scope:actor = { - primary_title = title:e_japan - has_imprisonment_reason = scope:recipient - } - scope:recipient = { - exists = house.house_confederation - house.house_confederation.combined_military_strength > scope:actor.current_military_strength - } - } - - modifier = { # Avoid Tyranny wars at inopportune times - add = -190 - scope:actor = { - ai_rationality > -100 # Lunatics can do whatever, let the world burn... - is_at_war = yes - } - scope:recipient = { - is_playable_character = yes - } - } - - modifier = { # Avoid imprisonments in certain circumstances - add = -190 - scope:actor = { - ai_rationality > -100 # Lunatics can do whatever, let the world burn... - NOR = { - AND = { - intrigue > scope:recipient.intrigue - intrigue >= 12 - } - has_perk = prison_feudal_complex_perk - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level >= 1 - } - } - culture = { has_cultural_parameter = vassals_more_likely_accept_punishments } - current_military_strength >= scope:recipient.twice_current_military_strength - scope:recipient.ai_boldness <= -100 - } - } - scope:recipient = { - is_playable_character = yes - } - } - - modifier = { # If the AI is not very bold, avoid imprisoning people unless you're more powerful - add = -190 - scope:actor.ai_rationality > -100 # Lunatics can do whatever, let the world burn... - scope:actor.ai_boldness <= 25 - scope:actor.current_military_strength < scope:recipient.one_and_a_half_times_current_military_strength - } - - modifier = { # Avoid imprisoning people that would destroy you - add = -190 - scope:actor.ai_rationality > -100 # Lunatics can do whatever, let the world burn... - scope:actor.current_military_strength < scope:recipient.current_military_strength - } - - modifier = { # Do not imprison when the chance of success if exceedingly low - add = -190 - scope:actor.ai_rationality > -100 # Lunatics can do whatever, let the world burn... - scope:recipient = { - is_playable_character = yes - } - NOT = { - scope:recipient = { - highest_held_title_tier = tier_barony - } - } - scope:actor = { - gold < minimum_ai_gold_value_for_tyranny_wars - } - } - - modifier = { # Don't imprison people you like - scope:actor = { - NOT = { - has_trait = sadistic - } - OR = { - has_secret_relation_lover = scope:recipient - has_relation_lover = scope:recipient - has_relation_soulmate = scope:recipient - has_relation_friend = scope:recipient - has_relation_best_friend = scope:recipient - opinion = { - target = scope:recipient - value > very_high_positive_opinion - } - } - } - add = -1000 - } - - modifier = { # Don't imprison your own children... unless they're your rival/nemesis - scope:recipient = { - is_child_of = scope:actor - NOR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - } - } - add = -1000 - } - - modifier = { # Don't imprison your spouse, unless they're your rival/have cheated on you - scope:recipient = { - is_spouse_of = scope:actor - NOR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - } - } - add = -1000 - } - - modifier = { # Try to avoid pointless imprisonments - scope:recipient = { - NOR = { - scope:actor = { # Sadists want people to torture - has_trait = sadistic - } - AND = { # Imprisoning vassals you have revoke reasons on is relevant - is_playable_character = yes - scope:actor = { has_revoke_title_reason = scope:recipient } - } - is_a_faction_member = yes - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - scope:actor = { # Scheme Agents should be imprisoned indiscriminately - any_targeting_scheme = { - hostile_scheme_trigger = yes - is_scheme_agent_exposed = scope:recipient - } - } - AND = { # Zealots will imprison characters of other faiths - scope:actor.ai_zeal >= medium_positive_ai_value - scope:actor.faith != scope:recipient.faith - } - scope:actor = { - has_opinion_modifier = { - modifier = murdered_close_family_crime - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = attempted_murder_close_family_crime - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = executed_close_family - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = slept_with_spouse_discovered_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = slept_with_spouse_exposed_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = unfaithful_spouse_discovered_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = unfaithful_spouse_exposed_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = refused_to_renounce_lover_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = betrayed_our_promise - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = botched_my_treatment_crime_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = botched_treatment_of_kin_crime_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = smeared_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = insulted_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = mocked_me_in_time_of_need - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = loved_one_dungeon_death - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = abandoned_me_opinion - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = reason_child_died - target = scope:recipient - } - } - scope:actor = { - has_opinion_modifier = { - modifier = falsely_accused - target = scope:recipient - } - } - } - } - add = -1000 - } - - modifier = { - exists = scope:recipient.primary_title - add = scope:recipient.primary_title.tier - } - - # Agenda impact - modifier = { - scope:recipient = { - is_important_or_vip_struggle_character = yes - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_imprison_important - } - has_character_flag = agenda_towards_escalation - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_imprison_important - } - } - } - add = -100 - } - } - } - modifier = { - scope:recipient = { - has_trait = fp3_struggle_supporter - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_imprison_supporter - } - has_trait = fp3_struggle_detractor - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_imprison_supporter - } - } - } - add = -100 - } - } - } - modifier = { - scope:recipient = { - has_trait = fp3_struggle_detractor - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_imprison_detractor - } - has_trait = fp3_struggle_supporter - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_imprison_detractor - } - } - } - add = -100 - } - } - } - - # TGP Be more careful with blocs generally - house_bloc_tyranny_war_modifiers = yes - - modifier = { # Avoid triggering Tyranny wars mid-grand activity - factor = 0 - scope:actor = { - has_ongoing_grand_activity_trigger = yes - } - scope:recipient = { - highest_held_title_tier >= tier_county - } - } - - evaluate_action_decreasing_house_unity = { - VALUE = 100 - } - } -} - -move_to_dungeon_interaction = { - interface_priority = 30 - category = interaction_category_prison - desc = move_to_dungeon_interaction_desc - icon = prison - - is_shown = { - scope:actor = { - is_landless_ruler = no - } - scope:recipient = { - is_imprisoned_by = scope:actor - is_in_prison_type = house_arrest - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - tgp_blocked_action_against_tenno_trigger = { - ACTOR = scope:actor - TARGET = scope:recipient - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - on_accept = { - if = { - limit = { scope:recipient = { has_character_modifier = allowed_to_go_outside } } - scope:recipient = { remove_character_modifier = allowed_to_go_outside } - } - scope:recipient = { - hidden_effect = { - change_prison_type = dungeon - } - trigger_event = prison_notification.1001 - custom_tooltip = MOVE_PRISONER_TO_DUNGEON - scope:recipient = { - every_close_or_extended_family_member = { - custom = all_family_members - limit = { - scope:actor != this - } - add_opinion = { - modifier = family_moved_to_dungeon_opinion - target = scope:actor - } - } - } - } - scope:actor = { - stress_impact = { - compassionate = medium_stress_impact_gain - forgiving = medium_stress_impact_gain - } - hidden_effect = { - send_interface_message = { - type = event_prison_neutral - title = msg_move_prisoner_to_dungeon - right_icon = scope:recipient - custom_tooltip = MOVE_PRISONER_TO_DUNGEON - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_move_to_dungeon.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = yes - - # AI - ai_targets = { - ai_recipients = prisoners - } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:actor.ai_compassion < medium_positive_ai_value - scope:actor = { - opinion = { - target = scope:recipient - value <= high_negative_opinion - } - } - } - modifier = { # Family Feud - add = 25 - trigger = { - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - - } - } - desc = INTERACTION_FAMILY_FEUD_REASON - } - } -} - -move_to_house_arrest_interaction = { - interface_priority = 30 - category = interaction_category_prison - desc = move_to_house_arrest_interaction_desc - icon = prison - - is_shown = { - scope:actor = { - is_landless_ruler = no - } - scope:recipient = { - is_imprisoned_by = scope:actor - is_in_prison_type = dungeon - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - on_accept = { - if = { - limit = { scope:recipient = { has_character_modifier = allowed_to_go_outside } } - scope:recipient = { remove_character_modifier = allowed_to_go_outside } - } - if = { - limit = { scope:recipient = { has_character_modifier = moldy_gruel_diet } } - scope:recipient = { remove_character_modifier = moldy_gruel_diet } - } - scope:recipient = { - hidden_effect = { - change_prison_type = house_arrest - trigger_event = prison_notification.1002 - } - custom_tooltip = MOVE_PRISONER_TO_HOUSE_ARREST - scope:recipient = { - every_close_or_extended_family_member = { - custom = all_family_members - limit = { - scope:actor != this - } - add_opinion = { - modifier = moved_to_house_arrest_opinion - target = scope:actor - } - } - } - } - scope:actor = { - stress_impact = { - sadistic = medium_stress_impact_gain - vengeful = medium_stress_impact_gain - } - hidden_effect = { - send_interface_message = { - type = event_prison_neutral - title = msg_move_prisoner_to_house_arrest - right_icon = scope:recipient - custom_tooltip = MOVE_PRISONER_TO_HOUSE_ARREST - } - } - } - } - - auto_accept = yes -} - -ransom_interaction = { - interface_priority = 50 - common_interaction = no - use_diplomatic_range = no - category = interaction_category_prison - special_interaction = ransom_interaction - icon = icon_gold - redirect = { - scope:recipient = { - save_scope_as = secondary_recipient - if = { - limit = { - is_ruler = no - exists = liege - } - liege = { - save_scope_as = recipient - } - } - } - } - - desc = ransom_interaction_desc - - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:secondary_recipient = scope:recipient - } - desc = OFFER_RANSOM_PROPOSAL_PERSONAL - } - desc = OFFER_RANSOM_PROPOSAL - } - } - - is_shown = { - scope:secondary_recipient = { - #exists = liege - is_imprisoned_by = scope:actor - } - scope:actor != scope:recipient - } - - is_valid_showing_failures_only = { - trigger_if = { - limit = { - scope:invalid = yes - } - always = no - } - - scope:secondary_recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:secondary_recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - cost = { - influence = { - value = 0 - if = { - limit = { scope:influence_send_option = yes } - add = scope:actor.medium_influence_value - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - } - - on_accept = { - if = { - limit = { scope:recipient = { has_character_modifier = allowed_to_go_outside } } - scope:recipient = { remove_character_modifier = allowed_to_go_outside } - } - if = { - limit = { scope:recipient = { has_character_modifier = moldy_gruel_diet } } - scope:recipient = { remove_character_modifier = moldy_gruel_diet } - } - # Set up event scopes and trigger the exchange. - if = { - limit = { scope:secondary_recipient = { is_imprisoned_by = scope:actor } } # To prevent simultaneous release-shenanigans - scope:secondary_recipient = { - save_scope_as = prisoner - } - scope:recipient = { - save_scope_as = payer - if = { - limit = { - employs_court_position = person_haggler_camp_officer - is_asking_for_gold_in_ransom_trigger = yes - } - random_court_position_holder = { - type = person_haggler_camp_officer - save_scope_as = haggler - } - scope:prisoner = { - save_scope_value_as = { - name = new_ransom_value - value = haggler_ransom_cost_modifier - } - } - custom_tooltip = has_person_haggler_decrease_ransom_cost - } - # If the recipient doesn't have enough funds to pay the full amount and we're only requesting their current funds, save how much they've agreed to pay. - if = { - limit = { - OR = { - exists = scope:current_gold - exists = scope:extortionate_current_gold - } - } - save_scope_value_as = { - name = ransom_saved_gold_value - value = scope:payer.current_gold_value - } - } - } - scope:actor = { - save_scope_as = imprisoner - if = { - limit = { - employs_court_position = person_haggler_camp_officer - is_asking_for_gold_in_ransom_trigger = yes - } - random_court_position_holder = { - type = person_haggler_camp_officer - save_scope_as = haggler - } - scope:recipient = { - scope:prisoner = { - save_scope_value_as = { - name = new_ransom_value - value = haggler_ransom_cost_modifier - } - } - custom_tooltip = has_person_haggler_increase_ransom_cost - } - } - - #Save scopes for portraits - scope:recipient = { save_scope_as = portrait_first } - if = { - limit = { - scope:portrait_first != scope:prisoner - } - scope:prisoner = { save_scope_as = portrait_second } - # Must come after we save the payment value, or the payer won't know how much they need to pay. - send_interface_message = { - type = event_prison_good - title = msg_ransom_prisoner - right_icon = scope:portrait_first - left_icon = scope:portrait_second - ransom_interaction_effect = yes - } - } - else = { - # Must come after we save the payment value, or the payer won't know how much they need to pay. - send_interface_message = { - type = event_prison_good - title = msg_ransom_prisoner - right_icon = scope:portrait_first - ransom_interaction_effect = yes - } - } - - # Struggle Catalyst - if = { - limit = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_important - CHAR = scope:secondary_recipient - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_important - CHAR = scope:secondary_recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_ransom_important - character = scope:actor - } - } - } - } - } - } - - on_decline = { - # If a player declines this ransom offer, wait 10 years before sending another one (they presumably will ransom that character themselves when they want them back). - if = { - limit = { scope:recipient = { is_ai = no } } - scope:secondary_recipient = { - add_character_flag = { - flag = character_ransom_refused_by_player - years = 10 - } - } - } - - # Trigger notification event - scope:actor = { - trigger_event = char_interaction.0131 - } - } - - # Pay me an extortionate amount! - send_option = { - is_shown = { - scope:actor = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - scope:recipient ?= { - gold >= scope:secondary_recipient.increased_ransom_cost_value - } - } - flag = extortionate_gold - localization = "RANSOM_EXTORTIONATE_GOLD_OPTION" - } - - # If you don't have what they're worth, pay me what you have (extort version)! - send_option = { - is_shown = { - scope:actor = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - scope:recipient ?= { - gold < scope:secondary_recipient.increased_ransom_cost_value - gold >= 1 - } - } - flag = extortionate_current_gold - localization = "RANSOM_EXTORTIONATE_CURRENT_GOLD_OPTION" - } - - # Pay me what they're worth! - send_option = { - is_shown = { - scope:actor = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - scope:recipient ?= { - gold >= scope:secondary_recipient.ransom_cost_value - } - } - flag = gold - localization = "RANSOM_GOLD_OPTION" - } - - # If you don't have what they're worth, pay me what you have! - send_option = { - is_shown = { - scope:actor = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - scope:recipient ?= { - gold < scope:secondary_recipient.ransom_cost_value - gold >= 1 - } - } - flag = current_gold - localization = "RANSOM_CURRENT_GOLD_OPTION" - } - - send_option = { - is_shown = { - trigger_if = { # in the mass action ransom we only want to do it for gold - limit = { exists = scope:mass_action } - scope:mass_action = no - } - } - is_valid = { - scope:actor = { - can_add_hook = { #To match the hook added through ransom_interaction_effect - target = scope:recipient - type = favor_hook - } - } - } - flag = favor - localization = "RANSOM_FAVOR_OPTION" - } - - send_option = { # EP3 Influence - is_shown = { # Actor must have a government that uses influence - trigger_if = { # in the mass action ransom we only want to do it for gold - limit = { exists = scope:mass_action } - scope:mass_action = no - } - scope:actor = { - government_has_flag = government_has_influence - } - } - is_valid = { - # Actor has enough influence - scope:actor = { influence >= medium_influence_value } - # Both characters are within the same top realm - custom_tooltip = { - text = not_same_realm_tt - scope:recipient.top_liege = scope:actor.top_liege - } - } - flag = influence_send_option - localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE - } - - # MPO Herd - send_option = { - is_shown = { # Actor must have a government that uses Herd - scope:actor = { - government_has_flag = government_is_nomadic - exists = domicile - is_ai = no - } - # Recipient must care about Herd - scope:recipient ?= { - government_has_flag = government_is_nomadic - exists = domicile - } - } - is_valid = { - # Recipient has enough Herd - scope:recipient = { domicile.herd >= domicile.medium_herd_value } - } - flag = herd_send_option - localization = RANSOM_HERD_OPTION - } - - localization_values = { - EXTORTIONATE_RANSOM_COST = scope:secondary_recipient.increased_ransom_cost_value - RANSOM_COST = scope:secondary_recipient.ransom_cost_value - CURRENT_GOLD = scope:recipient.gold - RANSOM_HERD_COST = ransom_herd_value_recipient - } - - ai_accept = { - base = 0 - modifier = { # Greedy characters can have their greed get the better of them... - add = { - value = scope:recipient.ai_greed - multiply = -0.5 - } - scope:recipient.ai_greed >= medium_positive_ai_value - OR = { - scope:gold = yes - scope:extortionate_gold = yes - } - scope:recipient != scope:secondary_recipient - desc = AI_VALUE_MODIFIER_GREED - } - modifier = { # Generous characters are more willing to pay - add = { - value = scope:recipient.ai_greed - multiply = -0.10 - } - OR = { - scope:gold = yes - scope:extortionate_gold = yes - } - scope:recipient != scope:secondary_recipient - scope:recipient.ai_greed <= medium_negative_ai_value - desc = AI_VALUE_MODIFIER_GENEROUS - } - modifier = { - add = -10 - scope:recipient != scope:secondary_recipient - scope:recipient = { - NOR = { - is_spouse_of = scope:secondary_recipient - is_close_or_extended_family_of = scope:secondary_recipient - has_relation_lover = scope:secondary_recipient - has_relation_friend = scope:secondary_recipient - has_secret_relation_lover = scope:secondary_recipient - has_relation_soulmate = scope:secondary_recipient - has_relation_best_friend = scope:secondary_recipient - is_parent_of = scope:secondary_recipient - } - } - desc = "UNIMPORTANT_CHAR_REASON" - } - modifier = { - add = 100 - scope:recipient = scope:secondary_recipient - desc = "WANTS_FREEDOM_REASON" - } - modifier = { # Acceptance boon for lovers, friends, etc - add = 25 - scope:recipient != scope:secondary_recipient - scope:recipient = { - OR = { - is_spouse_of = scope:secondary_recipient - is_close_or_extended_family_of = scope:secondary_recipient - has_relation_lover = scope:secondary_recipient - has_relation_friend = scope:secondary_recipient - has_secret_relation_lover = scope:secondary_recipient - } - NOR = { - has_relation_soulmate = scope:secondary_recipient - has_relation_best_friend = scope:secondary_recipient - is_parent_of = scope:secondary_recipient - } - } - desc = "DEAR_TO_ME_REASON" - } - modifier = { # Massive acceptance boon for Soulmates and Best Friends - add = 200 - scope:recipient = { - OR = { - has_relation_soulmate = scope:secondary_recipient - has_relation_best_friend = scope:secondary_recipient - is_parent_of = scope:secondary_recipient - } - NOR = { - is_spouse_of = scope:secondary_recipient - AND = { - NOT = { - is_parent_of = scope:secondary_recipient - } - is_close_or_extended_family_of = scope:secondary_recipient - } - has_relation_lover = scope:secondary_recipient - has_relation_friend = scope:secondary_recipient - has_secret_relation_lover = scope:secondary_recipient - } - } - desc = "DEAR_TO_ME_REASON" - } - modifier = { # Say no to rivals - add = -200 - scope:recipient = { - has_relation_rival = scope:secondary_recipient - } - desc = "RIVAL_TO_ME_REASON" - } - modifier = { # Say no to rivals - add = -500 - scope:recipient = { - has_relation_nemesis = scope:secondary_recipient - } - desc = "NEMESIS_TO_ME_REASON" - } - modifier = { - add = 10 - scope:recipient = { - NOR = { - this = scope:secondary_recipient - is_spouse_of = scope:secondary_recipient - is_close_or_extended_family_of = scope:secondary_recipient - has_relation_lover = scope:secondary_recipient - has_relation_soulmate = scope:secondary_recipient - has_secret_relation_lover = scope:secondary_recipient - } - NOR = { - has_relation_rival = scope:secondary_recipient - has_relation_nemesis = scope:secondary_recipient - } - } - scope:recipient.dynasty = scope:secondary_recipient.dynasty - desc = "MY_DYNASTY_REASON" - } - modifier = { # An Intimidated recipient is significantly more likely to accept an offer from the liege - add = intimidated_reason_value - trigger = { - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - } - desc = INTIMIDATED_REASON - } - - modifier = { # An Cowed recipient is significantly more likely to accept an offer from the liege - add = cowed_reason_value - trigger = { - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - } - desc = COWED_REASON - } - } - - # AI - ai_targets = { - ai_recipients = prisoners - } - ai_frequency_by_tier = { - barony = 36 - county = 6 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - OR = { - OR = { - scope:gold = yes - scope:extortionate_gold = yes - } - AND = { - scope:recipient = { - gold >= 25 - } - scope:secondary_recipient = { - time_in_prison = { years > 1 } - } - scope:current_gold = yes - } - } - } - - modifier = { - add = ai_greed - ai_greed > 0 - OR = { - scope:gold = yes - scope:extortionate_gold = yes - } - } - - modifier = { - add = -100 - has_relation_rival = scope:secondary_recipient - } - - modifier = { - add = -300 - has_relation_nemesis = scope:secondary_recipient - } - - modifier = { - add = 100 - scope:favor = yes - scope:recipient = { - OR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - - # Struggle Agenda - modifier = { - scope:secondary_recipient = { - any_character_struggle = { - involvement = involved - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_ransom_important - } - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_ransom_important - } - } - } - add = 200 - } - } - } - - modifier = { # Do not ransom at war - factor = 0 - scope:actor = { is_at_war = yes } - } - - modifier = { # Don't annoy players - factor = 0 - scope:recipient = { is_ai = no } - OR = { - scope:recipient = { is_at_war = yes } - scope:secondary_recipient = { has_character_flag = character_ransom_refused_by_player } - } - } - - #don't ransom if they are tied with a prison break contract, we don't want it invalidating all the time - modifier = { - factor = 0 - scope:secondary_recipient = { - has_character_flag = being_prisonbroken_by_laamp - } - } - } - - # Needs to be after all other send options so we only default to it if everything else is blocked - send_option = { - is_shown = { # When doing the mass ransom, its possible for no option to be valid for the gold costs, so instead of defaulting wrong we explitly fail it - exists = scope:mass_action - scope:mass_action = yes - } - flag = invalid - localization = "INVALID" - } -} - -#For lieges to ransom their courtiers -pay_ransom_interaction = { - interface_priority = 50 - common_interaction = no - use_diplomatic_range = no - category = interaction_category_prison - icon = icon_gold - - redirect = { - scope:recipient = { - save_scope_as = secondary_recipient - if = { - limit = { - exists = imprisoner - } - imprisoner = { save_scope_as = recipient } - } - } - } - - desc = pay_ransom_interaction_desc - - cost = { - influence = { - value = 0 - if = { - limit = { scope:influence_send_option = yes } - add = scope:actor.medium_influence_value - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - } - - greeting = positive - notification_text = PAY_RANSOM_PROPOSAL - - is_shown = { - exists = scope:recipient - scope:secondary_recipient = { - this != scope:actor - is_imprisoned_by = scope:recipient - OR = { - liege ?= scope:actor # You can ransom anyone you have in your court - is_close_family_of = scope:actor # And anyone who is your close family - dynasty ?= { # And anyone from your Dynasty - this ?= scope:actor.dynasty - } - any_spouse = { # And anyone married to one of your close kin or dynasty members - OR = { - is_close_family_of = scope:actor - dynasty ?= { - this ?= scope:actor.dynasty - } - } - } - has_relation_lover = scope:actor # And Lovers - has_relation_friend = scope:actor # And Friends - } - } - scope:actor != scope:recipient - } - - is_valid_showing_failures_only = { - scope:secondary_recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - } - - on_accept = { - # Set up event scopes and trigger the exchange. - if = { - limit = { scope:secondary_recipient = { is_imprisoned_by = scope:recipient } } - scope:secondary_recipient = { - save_scope_as = prisoner - } - scope:recipient = { - save_scope_as = imprisoner - if = { - limit = { - employs_court_position = person_haggler_camp_officer - is_asking_for_gold_in_ransom_trigger = yes - } - random_court_position_holder = { - type = person_haggler_camp_officer - save_scope_as = haggler - } - custom_tooltip = has_person_haggler_increase_ransom_cost - } - } - scope:actor = { - save_scope_as = payer - if = { - limit = { - employs_court_position = person_haggler_camp_officer - is_asking_for_gold_in_ransom_trigger = yes - } - random_court_position_holder = { - type = person_haggler_camp_officer - save_scope_as = haggler - - } - scope:prisoner = { - save_scope_value_as = { - name = new_ransom_value - value = haggler_ransom_cost_modifier - } - } - custom_tooltip = has_person_haggler_decrease_ransom_cost - } - # Stress impacts - if = { - limit = { - scope:prisoner = { # Stress impact for random courtiers - NOR = { - is_vassal_of = scope:actor - is_consort_of = scope:actor - is_close_family_of = scope:actor - dynasty ?= { - this ?= scope:actor.dynasty - } - any_spouse = { - OR = { - is_close_family_of = scope:actor - dynasty ?= { - this ?= scope:actor.dynasty - } - } - } - has_relation_lover = scope:actor - has_relation_friend = scope:actor - } - } - } - stress_impact = { - compassionate = minor_stress_impact_loss - generous = medium_stress_impact_loss - } - } - else_if = { # Stress impact for 'relevant' ransoms; in other words, everyone but random courtiers - limit = { - scope:prisoner = { - OR = { - is_vassal_of = scope:actor - is_consort_of = scope:actor - is_close_family_of = scope:actor - dynasty ?= { - this ?= scope:actor.dynasty - } - any_spouse = { - OR = { - is_close_family_of = scope:actor - dynasty ?= { - this ?= scope:actor.dynasty - } - } - } - has_relation_lover = scope:actor - has_relation_friend = scope:actor - } - } - } - stress_impact = { - compassionate = medium_stress_impact_loss - generous = minor_stress_impact_loss - just = minor_stress_impact_loss - } - } - - if = { # Lustful characters want their lovers back - limit = { - scope:prisoner = { - has_relation_lover = scope:actor - } - } - stress_impact = { - lustful = major_stress_impact_loss - } - } - - if = { # Loyal characters want to free their friends and lovers - limit = { - scope:prisoner = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - } - } - } - stress_impact = { - loyal = major_stress_impact_loss - } - } - - if = { # Family should be free! - limit = { - scope:prisoner = { - is_close_family_of = scope:payer - } - } - stress_impact = { - family_first = miniscule_stress_impact_loss - } - } - - # If the payer doesn't have enough funds to pay the full amount and we're only requesting their current funds, save how much they've agreed to pay. - if = { - limit = { - OR = { - exists = scope:current_gold - exists = scope:extortionate_current_gold - } - } - save_scope_value_as = { - name = ransom_saved_gold_value - value = scope:payer.current_gold_value - } - } - - # Must come after we save the payment value, or the payer won't know how much they need to pay. - trigger_event = char_interaction.0140 - } - hidden_effect = { - scope:prisoner = { - send_interface_toast = { - type = event_toast_effect_good - title = ransomed_by_someone - left_icon = scope:payer - show_as_tooltip = { - scope:imprisoner = { - ransom_interaction_effect = yes - } - } - } - } - scope:prisoner = { - if = { - limit = { - liege ?= { - is_ai = no - NOR = { - this = scope:payer - this = scope:imprisoner - } - OR = { - is_close_or_extended_family_of = scope:prisoner - is_consort_of = scope:prisoner - has_relation_lover = scope:prisoner - has_relation_friend = scope:prisoner - } - } - } - liege = { - save_scope_as = prisoner_liege_scope - send_interface_toast = { - type = event_toast_effect_good - title = ransomed_by_someone_third_party - left_icon = scope:payer - right_icon = scope:prisoner - custom_tooltip = ransomed_by_someone_third_party_desc - } - } - } - } - } - scope:imprisoner = { - send_interface_message = { - type = event_prison_neutral - title = recipient_released_from_prison - right_icon = scope:prisoner - left_icon = scope:imprisoner - ransom_interaction_effect = yes - } - - # Struggle Catalyst - if = { - limit = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_important - CHAR = scope:prisoner - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_important - CHAR = scope:prisoner - } - } - activate_struggle_catalyst = { - catalyst = catalyst_ransom_important - character = scope:imprisoner - } - } - } - if = { - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:imprisoner - SECOND = scope:prisoner - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_supporter_detractor - CHAR = scope:prisoner - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_supporter_detractor - CHAR = scope:prisoner - } - } - activate_struggle_catalyst = { - catalyst = catalyst_ransom_supporter_detractor - character = scope:imprisoner - } - log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_ransom_supporter_detractor } - } - } - } - if = { - limit = { scope:hook = yes } - scope:actor = { - use_hook = scope:recipient - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:prisoner - VALUE = medium_unity_gain - DESC = clan_unity_ransom.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - on_decline = { - # If a player declines this ransom offer, wait 10 years before sending another one (they presumably have reasons for keeping that character in prison). - if = { - limit = { scope:recipient = { is_ai = no } } - scope:secondary_recipient = { - add_character_flag = { - flag = character_ransom_refused_by_player - years = 10 - } - } - } - - # Trigger notification event - scope:actor = { - trigger_event = char_interaction.0141 - } - } - - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - is_valid = { - exists = scope:recipient - scope:actor = { - gold >= scope:secondary_recipient.increased_ransom_cost_value - } - } - starts_enabled = { - exists = scope:recipient - scope:recipient = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - scope:actor = { - gold >= scope:secondary_recipient.increased_ransom_cost_value - } - } - flag = extortionate_gold - localization = "RANSOM_EXTORTIONATE_GOLD_IMPRISONED_PERSPECTIVE_OPTION" - } - - # If you don't have what they're worth, pay me what you have (extort version)! - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - scope:actor = { - gold < scope:secondary_recipient.increased_ransom_cost_value - gold > 0 - } - } - starts_enabled = { - exists = scope:recipient - scope:recipient = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - scope:actor = { - gold < scope:secondary_recipient.increased_ransom_cost_value - gold > 0 - } - } - flag = extortionate_current_gold - localization = "RANSOM_EXTORTIONATE_CURRENT_GOLD_IMPRISONED_PERSPECTIVE_OPTION" - } - - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - } - is_valid = { - exists = scope:recipient - scope:actor = { - gold >= scope:secondary_recipient.ransom_cost_value - } - } - starts_enabled = { - exists = scope:recipient - scope:recipient = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - scope:actor = { - gold >= scope:secondary_recipient.ransom_cost_value - } - } - flag = gold - localization = "RANSOM_GOLD_PAY_OPTION" - } - - # If you don't have what they're worth, pay me what you have! - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - scope:actor = { - gold < scope:secondary_recipient.ransom_cost_value - gold > 0 - } - } - starts_enabled = { - exists = scope:recipient - scope:recipient = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - scope:actor = { - gold < scope:secondary_recipient.ransom_cost_value - gold > 0 - } - } - flag = current_gold - localization = "RANSOM_CURRENT_PAY_GOLD_OPTION" - } - - send_option = { - is_valid = { - exists = scope:recipient - scope:recipient = { - can_add_hook = { #To match the hook added through ransom_interaction_effect - target = scope:actor - type = favor_hook - } - } - } - flag = favor - localization = "RANSOM_OWE_FAVOR_OPTION" - } - - send_option = { # EP3 Influence - is_shown = { # Actor must have a government that uses influence - scope:actor = { - government_has_flag = government_has_influence - } - } - is_valid = { - # Actor has enough influence - scope:actor = { influence >= medium_influence_value } - # Both characters are within the same top realm - custom_tooltip = { - text = not_same_realm_tt - scope:recipient.top_liege = scope:actor.top_liege - } - } - flag = influence_send_option - localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE - } - - send_option = { # MPO Herd - is_shown = { # Actor must have a government that uses Herd - scope:actor = { - government_has_flag = government_is_nomadic - exists = domicile - is_ai = no - } - # Recipient must care about Herd - scope:recipient = { - government_has_flag = government_is_nomadic - exists = domicile - } - } - is_valid = { - # Actor has enough Herd - scope:actor = { domicile.herd >= domicile.medium_herd_value } - } - flag = herd_send_option - localization = PAY_FOR_BETTER_AI_ACCEPTANCE - } - - #Use hook - send_option = { - is_valid = { - exists = scope:recipient - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - localization_values = { - EXTORTIONATE_RANSOM_COST = scope:secondary_recipient.increased_ransom_cost_value - RANSOM_COST = scope:secondary_recipient.ransom_cost_value - CURRENT_GOLD = scope:actor.gold - RANSOM_HERD_COST = ransom_herd_value_actor - } - - ai_accept = { - base = 0 - modifier = { - add = 50 - OR = { - scope:gold = yes - scope:extortionate_gold = yes - } - desc = "GOLD_POSITIVE_REASON" - } - modifier = { # Accept more than half the ransom (unless greedy) - add = 25 - scope:current_gold = yes - AND = { - scope:actor = { gold >= scope:secondary_recipient.half_ransom_cost_value } - NOT = { scope:recipient.ai_greed >= medium_positive_ai_value } - } - desc = "GOLD_POSITIVE_REASON" - } - modifier = { # Accept more than half the ransom (unless greedy) - add = 25 - scope:extortionate_current_gold = yes - AND = { - scope:actor = { gold >= scope:secondary_recipient.half_increased_ransom_cost_value } - NOT = { scope:recipient.ai_greed >= medium_positive_ai_value } - } - desc = "GOLD_POSITIVE_REASON" - } - modifier = { - add = 50 - scope:favor = yes - scope:recipient.top_liege = scope:actor.top_liege - desc = "FAVOR_POSITIVE_REASON" - } - modifier = { - add = 0 - scope:favor = yes - scope:recipient.top_liege != scope:actor.top_liege - desc = "NO_USE_FOR_A_FAVOR_REASON" - } - modifier = { # For clarification - add = 0 - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - OR = { - scope:actor = { gold < scope:secondary_recipient.half_ransom_cost_value } - scope:recipient.ai_greed >= medium_positive_ai_value - } - desc = "WANTS_MORE_GOLD" - } - modifier = { # Say no to rivals - add = -55 - scope:recipient = { - has_relation_rival = scope:secondary_recipient - } - desc = "RIVAL_TO_ME_REASON" - } - modifier = { # Say no to rivals - add = -300 - scope:recipient = { - has_relation_nemesis = scope:secondary_recipient - } - desc = "NEMESIS_TO_ME_REASON" - } - modifier = { # At war - add = -300 - scope:recipient = { - is_at_war_with = scope:actor - } - desc = "IS_AT_WAR_REASON" - } - modifier = { # At war - add = -300 - scope:recipient = { - is_at_war = yes - any_primary_war_enemy = { - scope:secondary_recipient = { - liege ?= prev - } - } - } - desc = "IS_POW_REASON" - } - modifier = { # At war - add = -300 - scope:recipient = { - is_at_war_with = scope:secondary_recipient - } - desc = "IS_AT_WAR_WITH_TARGET_REASON" - } - #opinion_modifier = { # A lot more likely if Recipient likes Actor - # who = scope:recipient - # opinion_target = scope:actor - # multiplier = 1.0 - # desc = AI_OPINION_REASON - #} - #opinion_modifier = { # A lot more likely if Recipient likes secondary_recipient/prisoner - # who = scope:recipient - # opinion_target = scope:secondary_recipient - # multiplier = 1.0 - # desc = AI_OPINION_REASON - #} - modifier = { - scope:hook = yes - add = 100 - desc = SCHEME_WEAK_HOOK_USED - } - modifier = { # An Intimidated recipient is significantly more likely to accept an offer from the liege - add = 40 - trigger = { - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - } - desc = INTIMIDATED_REASON - } - - modifier = { # An Cowed recipient is significantly more likely to accept an offer from the liege - add = 100 - trigger = { - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - } - desc = COWED_REASON - } - - modifier = { - add = 25 - scope:influence_send_option = yes - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - - modifier = { - add = 25 - scope:herd_send_option = yes - desc = HERD_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - - - # AI - ai_targets = { - ai_recipients = family - ai_recipients = spouses - ai_recipients = scripted_relations - ai_recipients = liege - } - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = peer_vassals - ai_recipients = top_realm_domicile_owners - max = 5 - } - ai_frequency_by_tier = { - barony = 0 - county = 6 - duchy = 6 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - ai_potential = { - gold >= 25 - } - - ai_target_quick_trigger = { - prison = yes - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - OR = { - scope:gold = yes - scope:extortionate_gold = yes - AND = { - scope:actor = { - gold >= 25 - } - scope:secondary_recipient = { - time_in_prison = { years > 1 } - } - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - } - } - } - - modifier = { - add = -100 - has_relation_rival = scope:secondary_recipient - } - - modifier = { - add = -300 - has_relation_nemesis = scope:secondary_recipient - } - - modifier = { - add = 100 - scope:favor = yes - scope:recipient = { - OR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - - modifier = { # Ransom your primary heir first - add = 10 - OR = { - scope:gold = yes - scope:extortionate_gold = yes - AND = { - scope:actor = { - gold >= 25 - } - scope:secondary_recipient = { - time_in_prison = { years > 1 } - } - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - } - AND = { - scope:favor = yes - scope:recipient = { - OR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - } - scope:secondary_recipient = { - is_primary_heir_of = scope:actor - } - } - - modifier = { # Only ransom people you care about... unless you're very compassionate - factor = 0 - ai_compassion < high_positive_ai_value - scope:secondary_recipient = { - NOR = { - is_heir_of = scope:actor - is_child_of = scope:actor - is_grandchild_of = scope:actor - is_great_grandchild_of = scope:actor - is_consort_of = scope:actor - is_parent_of = scope:actor - is_grandparent_of = scope:actor - is_great_grandparent_of = scope:actor - has_relation_friend = scope:actor - has_relation_lover = scope:actor - has_secret_relation_lover = scope:actor - any_spouse = { - OR = { - is_heir_of = scope:actor - is_child_of = scope:actor - is_grandchild_of = scope:actor - is_great_grandchild_of = scope:actor - is_parent_of = scope:actor - is_grandparent_of = scope:actor - is_great_grandparent_of = scope:actor - has_relation_friend = scope:actor - } - } - } - } - } - - modifier = { # If you're very compassionate, well, then you ransom most people you can! - factor = 0 - ai_compassion >= high_positive_ai_value - scope:secondary_recipient = { - NOR = { - is_heir_of = scope:actor - is_close_or_extended_family_of = scope:actor - is_consort_of = scope:actor - has_relation_friend = scope:actor - has_relation_lover = scope:actor - has_secret_relation_lover = scope:actor - any_spouse = { - OR = { - is_heir_of = scope:actor - is_close_or_extended_family_of = scope:actor - has_relation_friend = scope:actor - } - } - } - } - } - - modifier = { # If you're very greedy... then they're a little bit more restrictive! - factor = 0 - ai_greed >= high_positive_ai_value - scope:secondary_recipient = { - NOR = { # Very Greedy rulers only ransom people in their own realm, or their heir - is_courtier_of = scope:actor - is_vassal_or_below_of = scope:actor - is_heir_of = scope:actor - } - NOR = { - is_heir_of = scope:actor - is_close_or_extended_family_of = scope:actor - is_consort_of = scope:actor - has_relation_friend = scope:actor - has_relation_lover = scope:actor - has_secret_relation_lover = scope:actor - any_spouse = { - OR = { - is_heir_of = scope:actor - is_close_or_extended_family_of = scope:actor - has_relation_friend = scope:actor - } - } - } - } - } - - # Some exceptions! - modifier = { # Lustful characters want to ransom lovers - add = 100 - has_trait = lustful - ai_greed <= 50 - scope:secondary_recipient = { - has_relation_lover = scope:actor - } - OR = { - scope:gold = yes - scope:extortionate_gold = yes - AND = { - scope:actor = { - gold >= 25 - } - scope:secondary_recipient = { - time_in_prison = { years > 1 } - } - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - } - } - } - - modifier = { # Loyal characters want to ransom their relations - add = 100 - has_trait = loyal - scope:secondary_recipient = { - OR = { - has_relation_lover = scope:actor - has_relation_friend = scope:actor - } - } - OR = { - scope:gold = yes - scope:extortionate_gold = yes - AND = { - scope:actor = { - gold >= 25 - } - scope:secondary_recipient = { - time_in_prison = { years > 1 } - } - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - } - } - } - - modifier = { # Certain characters will try to ransom their liege! - add = 100 - ai_greed <= very_high_negative_ai_value - ai_compassion >= very_high_negative_ai_value - NOT = { exists = joined_faction } - is_at_war = no - OR = { - has_trait = loyal - ai_honor >= high_positive_ai_value - } - scope:secondary_recipient = { - is_liege_or_above_of = scope:actor - } - OR = { - scope:gold = yes - scope:extortionate_gold = yes - # They won't offer current gold, only full ransoms - } - } - - modifier = { # Favors only relevant within the realm - add = -100 - scope:favor = yes - scope:recipient = { - NOR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - - modifier = { # Don't spam the player with cheapskate offers - add = -100 - scope:current_gold = yes - scope:recipient = { - is_ai = no - } - scope:secondary_recipient = { - highest_held_title_tier >= tier_duchy - } - } - - # Struggle Agenda - modifier = { - scope:secondary_recipient = { - any_character_struggle = { - involvement = involved - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_ransom_important - } - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_ransom_important - } - } - } - add = 200 - } - } - } - - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - - modifier = { # Don't give away prisoners for free - factor = 0 - NOR = { - scope:favor = yes - scope:extortionate_gold = yes - scope:extortionate_current_gold = yes - scope:gold = yes - AND = { - scope:actor = { - gold >= 25 - } - scope:current_gold = yes - } - } - } - - modifier = { # Don't annoy players - factor = 0 - scope:recipient = { is_ai = no } - OR = { - scope:recipient = { is_at_war = yes } - scope:secondary_recipient = { has_character_flag = character_ransom_refused_by_player } - } - } - - #don't ransom prisoners that are tied with a prison break contract, we don't want it invalidating all the time - modifier = { - factor = 0 - scope:secondary_recipient = { - has_character_flag = being_prisonbroken_by_laamp - } - } - } -} - -#To ransom yourself -ransom_me_interaction = { - interface_priority = 50 - common_interaction = yes - use_diplomatic_range = no - category = interaction_category_prison - icon = icon_gold - - greeting = positive - notification_text = PAY_RANSOM_PROPOSAL_PERSONAL - - desc = ransom_me_interaction_desc - - redirect = { # So that users can ransom themselves by clicking on their portrait - if = { - limit = { - scope:actor = scope:recipient - exists = scope:actor.imprisoner - } - scope:actor.imprisoner = { save_scope_as = recipient } - } - } - - is_shown = { - scope:actor = { - is_imprisoned_by = scope:recipient - } - } - - is_valid_showing_failures_only = { - scope:actor = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - on_accept = { - if = { - limit = { scope:actor = { is_imprisoned_by = scope:recipient } } - scope:actor = { - save_scope_as = prisoner - } - scope:recipient = { - save_scope_as = imprisoner - } - scope:actor = { - save_scope_as = payer - if = { - limit = { - employs_court_position = person_haggler_camp_officer - is_asking_for_gold_in_ransom_trigger = yes - } - random_court_position_holder = { - type = person_haggler_camp_officer - save_scope_as = haggler - } - save_scope_value_as = { - name = new_ransom_value - value = haggler_ransom_cost_modifier - } - custom_tooltip = has_person_haggler_decrease_ransom_cost - } - - # If the payer doesn't have enough funds to pay the full amount and we're only requesting their current funds, save how much they've agreed to pay. - if = { - limit = { - OR = { - exists = scope:current_gold - exists = scope:extortionate_current_gold - } - } - save_scope_value_as = { - name = ransom_saved_gold_value - value = scope:payer.current_gold_value - } - } - - # Must come after we save the payment value, or the payer won't know how much they need to pay. - trigger_event = char_interaction.0150 - } - scope:imprisoner = { - if = { - limit = { - employs_court_position = person_haggler_camp_officer - is_asking_for_gold_in_ransom_trigger = yes - } - random_court_position_holder = { - type = person_haggler_camp_officer - save_scope_as = haggler - } - scope:actor = { - custom_tooltip = has_person_haggler_increase_ransom_cost - } - } - send_interface_message = { - type = event_prison_neutral - title = recipient_released_from_prison - right_icon = scope:prisoner - left_icon = scope:imprisoner - ransom_interaction_effect = yes - } - - # Struggle Catalyst - if = { - limit = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_important - CHAR = scope:prisoner - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_ransom_important - CHAR = scope:prisoner - } - } - activate_struggle_catalyst = { - catalyst = catalyst_ransom_important - character = scope:imprisoner - } - } - } - } - if = { - limit = { always = scope:hook } - scope:actor = { - use_hook = scope:recipient - } - } - } - } - - on_decline = { - # If a player declines this ransom offer, wait 10 years before sending another one (they presumably have reasons for keeping you in prison). - if = { - limit = { scope:recipient = { is_ai = no } } - scope:actor = { - add_character_flag = { - flag = character_ransom_refused_by_player - years = 10 - } - } - } - - # Trigger notification event - scope:actor = { - trigger_event = char_interaction.0151 - } - } - - cost = { - influence = { - value = 0 - if = { - limit = { scope:influence_send_option = yes } - add = scope:actor.medium_influence_value - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - } - - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - is_valid = { - scope:actor = { - gold >= increased_ransom_cost - } - } - flag = extortionate_gold - localization = "RANSOM_EXTORTIONATE_GOLD_IMPRISONED_PERSPECTIVE_OPTION" - } - - # If you don't have what they're worth, pay me what you have (extort version)! - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - dynasty ?= { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - scope:actor = { - gold < increased_ransom_cost - gold > 0 - } - } - flag = extortionate_current_gold - localization = "RANSOM_EXTORTIONATE_CURRENT_GOLD_IMPRISONED_PERSPECTIVE_OPTION" - } - - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - } - is_valid = { - scope:actor = { - gold >= ransom_cost - } - } - flag = gold - localization = "RANSOM_GOLD_OPTION" - } - - # If you don't have what they're worth, pay me what you have! - send_option = { - is_shown = { - exists = scope:recipient - scope:recipient = { - OR = { - is_lowborn = yes - NOT = { - dynasty = { - has_dynasty_perk = fp1_pillage_legacy_3 - } - } - } - } - scope:actor = { - gold < ransom_cost - gold > 0 - } - } - flag = current_gold - localization = "RANSOM_CURRENT_GOLD_OPTION" - } - - send_option = { - is_valid = { - scope:recipient = { - can_add_hook = { #To match the hook added through ransom_interaction_effect - target = scope:actor - type = favor_hook - } - } - } - flag = favor - localization = "RANSOM_FAVOR_OPTION" - } - - send_option = { # EP3 Influence - is_shown = { # Actor must have a government that uses influence - scope:actor = { - government_has_flag = government_has_influence - } - } - is_valid = { - # Actor has enough influence - scope:actor = { influence >= medium_influence_value } - # Both characters are within the same top realm - custom_tooltip = { - text = not_same_realm_tt - scope:recipient.top_liege = scope:actor.top_liege - } - } - flag = influence_send_option - localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE - } - - send_option = { # MPO Herd - is_shown = { # Actor must have a government that uses Herd - scope:actor = { - government_has_flag = government_is_nomadic - exists = domicile - } - # Recipient must care about Herd - scope:recipient = { - government_has_flag = government_is_nomadic - exists = domicile - } - } - is_valid = { - # Actor has enough Herd - scope:actor = { domicile.herd >= domicile.medium_herd_value } - } - flag = herd_send_option - localization = PAY_FOR_BETTER_AI_ACCEPTANCE - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - localization_values = { - EXTORTIONATE_RANSOM_COST = scope:actor.increased_ransom_cost_value - RANSOM_COST = scope:actor.ransom_cost_value - CURRENT_GOLD = scope:actor.gold - RANSOM_HERD_COST = ransom_herd_value_actor - } - - ai_accept = { - base = 0 - modifier = { - add = 50 - OR = { - scope:gold = yes - scope:extortionate_gold = yes - } - desc = "GOLD_POSITIVE_REASON" - } - - modifier = { # Accept more than half the ransom (unless greedy) - add = 25 - scope:current_gold = yes - AND = { - scope:actor = { gold >= half_ransom_cost_value } - NOT = { scope:recipient.ai_greed >= medium_positive_ai_value } - } - desc = "GOLD_POSITIVE_REASON" - } - - modifier = { # Accept more than half the ransom (unless greedy) - add = 25 - scope:extortionate_current_gold = yes - AND = { - scope:actor = { gold >= half_increased_ransom_cost_value } - NOT = { scope:recipient.ai_greed >= medium_positive_ai_value } - } - desc = "GOLD_POSITIVE_REASON" - } - - modifier = { - add = 50 - scope:favor = yes - scope:recipient.top_liege = scope:actor.top_liege - desc = "FAVOR_POSITIVE_REASON" - } - - modifier = { - add = -50 - scope:favor = yes - NOR = { - scope:gold = yes - scope:extortionate_gold = yes - } - OR = { - scope:recipient.top_liege != scope:actor.top_liege - scope:recipient.ai_greed >= medium_positive_ai_value - } - desc = "NO_USE_FOR_A_FAVOR_REASON" - } - - modifier = { # For clarification - add = 0 - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - OR = { - scope:actor = { gold < half_ransom_cost_value } - scope:recipient.ai_greed >= medium_positive_ai_value - } - desc = "WANTS_MORE_GOLD" - } - - #opinion_modifier = { # A lot more likely if Recipient likes Actor - # who = scope:recipient - # opinion_target = scope:actor - # multiplier = 1.0 - # desc = AI_OPINION_REASON - #} - - modifier = { # Say no to rivals - add = -55 - scope:recipient = { - has_relation_rival = scope:actor - } - desc = "ACTOR_RIVAL_TO_ME_REASON" - } - modifier = { # Say no to nemesis - add = -300 - scope:recipient = { - has_relation_nemesis = scope:actor - } - desc = "ACTOR_NEMESIS_TO_ME_REASON" - } - - - modifier = { # At war - add = -300 - scope:recipient = { - is_at_war_with = scope:actor - } - desc = "IS_AT_WAR_REASON" - } - - modifier = { - scope:hook = yes - add = 100 - desc = SCHEME_WEAK_HOOK_USED - } - - modifier = { # An Intimidated recipient is significantly more likely to accept an offer from the liege - add = intimidated_reason_value - trigger = { - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - } - desc = INTIMIDATED_REASON - } - - modifier = { # A Cowed recipient is significantly more likely to accept an offer from the liege - add = cowed_reason_value - trigger = { - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - } - desc = COWED_REASON - } - modifier = { # Family Feud - add = -50 - trigger = { - scope:recipient = { - house_has_feud_relation_with_trigger = { TARGET = scope:actor } - - } - } - desc = INTERACTION_FAMILY_FEUD_REVERSE_REASON - } - - modifier = { - add = 25 - scope:influence_send_option = yes - desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION - } - - modifier = { - add = 25 - scope:herd_send_option = yes - desc = HERD_INTERACTION_ACCEPTANCE_SEND_OPTION - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - - # AI - ai_frequency_by_tier = { - barony = 72 - county = 24 - duchy = 24 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_targets = { - ai_recipients = self - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - OR = { - scope:gold = yes - scope:extortionate_gold = yes - AND = { - scope:actor = { - gold >= 25 - } - OR = { - time_in_prison = { years > 1 } - has_trait = impatient #LET ME OUT! I want out! NOW! - } - OR = { - scope:current_gold = yes - scope:extortionate_current_gold = yes - } - } - scope:herd_send_option = yes - } - } - - modifier = { - add = 100 - scope:favor = yes - scope:recipient = { - OR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - - modifier = { - add = -100 - scope:favor = yes - scope:recipient = { - NOR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - - # Struggle Agenda - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_ransom_important - } - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_ransom_important - } - } - } - add = 200 - } - } - } - - modifier = { # Don't give away prisoners for free - factor = 0 - NOR = { - scope:favor = yes - scope:gold = yes - scope:extortionate_gold = yes - scope:current_gold = yes - scope:herd_send_option = yes - AND = { - scope:actor = { - gold >= 25 - } - scope:current_gold = yes - } - } - } - - modifier = { # Don't annoy players - factor = 0 - scope:recipient = { is_ai = no } - OR = { - scope:recipient = { is_at_war = yes } - scope:actor = { has_character_flag = character_ransom_refused_by_player } - } - } - - #don't do it if you are tied with a prison break contract, we don't want it invalidating all the time - modifier = { - factor = 0 - scope:actor = { - has_character_flag = being_prisonbroken_by_laamp - } - } - } -} - -release_from_prison_interaction = { - interface_priority = 30 - common_interaction = yes - category = interaction_category_prison - special_interaction = release_from_prison_interaction - icon = prison - - desc = release_from_prison_interaction_desc - - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:demand_conversion = no - scope:renounce_claims = no - scope:banish = no - scope:take_vows = no - scope:recruit = no - scope:disfigure = no - scope:blind = no - scope:castrate = no - } - desc = RELEASE_PRISONER_OFFER - } - desc = RELEASE_PRISONER_OFFER_CONDITIONAL - } - } - - is_shown = { - scope:recipient = { - is_imprisoned_by = scope:actor - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - on_accept = { - if = { - limit = { scope:recipient = { has_character_modifier = allowed_to_go_outside } } - scope:recipient = { remove_character_modifier = allowed_to_go_outside } - } - if = { - limit = { scope:recipient = { has_character_modifier = moldy_gruel_diet } } - scope:recipient = { remove_character_modifier = moldy_gruel_diet } - } - if = { - limit = { scope:recipient = { is_imprisoned_by = scope:actor } } - - scope:recipient = { - # Demand Conversion - if = { - limit = { scope:demand_conversion = yes } - demand_conversion_interaction_effect = yes - add_opinion = { - modifier = demanded_my_conversion_opinion - target = scope:actor - } - - # Struggle Catalyst - if = { - limit = { - scope:actor = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_demanding_important_conversion - CHAR = scope:recipient - } - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_demanding_important_conversion - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_demanding_important_conversion - character = scope:actor - } - } - } - } - } - - # Banish Landed Character - if = { - limit = { - scope:banish = yes - scope:recipient = { is_landed_or_landless_administrative = yes } - } - banish_effect = { BANISHER = scope:actor } - if = { - limit = { - NOT = { - scope:actor = { - has_banish_reason = scope:recipient - } - } - } - scope:actor = { add_tyranny = banishment_tyranny_gain } - } - add_opinion = { - modifier = banished_me - target = scope:actor - } - } - # Banish Unlanded Character - else_if = { - limit = { - AND = { - scope:banish = yes - scope:recipient = { - is_landless_adventurer = no - is_pool_character = no # It is possible for them to end up in the pool between the interaction being sent, and it being accepted - } - } - } - if = { - limit = { - this.gold > 0 - NOR = { - has_character_flag = realm_priest - has_character_flag = was_bookmaker - } - } - pay_short_term_gold = { target = scope:actor gold = this.gold } - } - if = { - limit = { - has_any_artifact = yes - } - every_character_artifact = { - set_owner = { - target = scope:actor - history = { - location = scope:recipient.location - actor = scope:recipient - recipient = scope:actor - type = stolen - } - } - scope:actor = { - if = { - limit = { - NOT = { has_variable = stolen_artifact } - } - set_variable = { - name = stolen_artifact - value = 1 - } - } - else = { - change_variable = { - name = stolen_artifact - add = 1 - } - } - } - } - } - banish = yes - add_opinion = { - modifier = banished_me - target = scope:actor - } - } - # 'Banish' Pool Character - else_if = { - limit = { - AND = { - scope:banish = yes - scope:recipient = { - is_playable_character = no - is_pool_character = yes # They'll just leave for the pool - } - } - } - if = { - limit = { - this.gold > 0 - } - pay_short_term_gold = { target = scope:actor gold = this.gold } - } - add_opinion = { - modifier = banished_me - target = scope:actor - } - } - - # Recruit Character - if = { - limit = { scope:recruit = yes } - if = { - limit = { - scope:actor = { - culture = { - has_cultural_parameter = can_recruit_prisoners_easily - } - } - } - add_opinion = { - modifier = loyal_servant - target = scope:actor - } - scope:actor = { - if = { - limit = { - can_add_hook = { - target = scope:recipient - type = loyalty_hook - } - } - add_hook = { - type = loyalty_hook - target = scope:recipient - } - } - } - } - else = { - add_opinion = { - modifier = demanded_recruitment - target = scope:actor - } - } - scope:actor = { - if = { - limit = { - AND = { - scope:actor.faith = { - has_doctrine = tenet_communal_possessions - } - scope:recipient = { - has_trait = peasant_leader - } - } - } - scope:actor = { - add_piety = medium_piety_gain - } - } - } - scope:actor = { - add_courtier = scope:recipient - } - } - - # Renounce Claims - if = { - limit = { scope:renounce_claims = yes } - add_opinion = { - modifier = demanded_claim_renouncement - target = scope:actor - } - scope:recipient = { - every_claim = { - explicit = yes - limit = { - save_temporary_scope_as = temp_claim - OR = { - holder = scope:actor - AND = { - exists = holder - NOT = { prev = { target_is_liege_or_above = scope:actor } } - holder = { target_is_liege_or_above = scope:actor } - } - scope:actor = { - any_held_title = { - is_de_jure_liege_or_above_target = scope:temp_claim - } - } - } - } - scope:recipient = { remove_claim = prev } - } - } - } - - # Gain Hook - if = { - limit = { scope:gain_hook = yes } - add_opinion = { - modifier = demanded_hook - target = scope:actor - } - scope:actor = { - add_hook = { #Hook effect must match gain_hook option condition - target = scope:recipient - type = favor_hook - } - } - } - - # Take Vows - if = { - limit = { scope:take_vows = yes } - send_child_to_clergy_effect = yes - #Does Byzan go hay-wire with deposing vassals? - if = { - limit = { - scope:actor = { - is_ai = yes - culture = { has_cultural_pillar = heritage_byzantine } - } - } - debug_log = debug_ai_byzan_forced_vows_on_prison_release - debug_log_scopes = yes - } - #Does the AI in general go haywire with deposing prisoners? - else_if = { - limit = { - scope:actor = { is_ai = yes } - } - debug_log = debug_ai_forced_vows_on_prison_release - debug_log_scopes = yes - } - } - - # Become Executioner - if = { - limit = { scope:become_executioner = yes } - release_as_executioner_effect = yes - } - - # Disfigure - if = { - limit = { scope:disfigure = yes } - - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - - blind_castrate_and_disfigure_effect = yes #Stress & dread - - show_as_tooltip = { - scope:recipient = { - add_trait = disfigured - } - } - - torture_blind_castrate_disfigure_opinion_effect = { VERB = disfigured } - - scope:actor = { - trigger_event = { - id = prison.1030 - days = 1 - } - } - } - - # Blind - if = { - limit = { scope:blind = yes } - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - - blind_castrate_and_disfigure_effect = yes #Stress & dread - - show_as_tooltip = { - scope:recipient = { - add_trait = blind - } - } - - # Merciful Blindings - scope:actor = { - if = { - limit = { - culture = { has_cultural_parameter = merciful_blinding } - OR = { - has_execute_reason = scope:recipient - has_banish_reason = scope:recipient - } - } - add_piety = medium_piety_gain - } - } - - torture_blind_castrate_disfigure_opinion_effect = { VERB = blinded } - - scope:actor = { - trigger_event = { - id = prison.1020 - days = 1 - } - } - - # If we're a clan this interaction affects unity - if = { - limit = { scope:actor.culture = { has_cultural_parameter = merciful_blinding } } # If actor's culture has Merciful Blindings, they lose less unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_blinding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else = { - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_blinding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - # Castrate - if = { - limit = { scope:castrate = yes } - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - - blind_castrate_and_disfigure_effect = yes #Stress & dread - - show_as_tooltip = { - scope:recipient = { - if = { - limit = { - age < 12 - } - ep3_child_castration_effect = yes - } - else = { - ep3_youth_castration_effect = yes - } - } - } - - torture_blind_castrate_disfigure_opinion_effect = { VERB = castrated } - - scope:actor = { - trigger_event = { - id = prison.1025 - days = 1 - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_abelarding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # Demand Admin - if = { - limit = { scope:demand_admin = yes } - scope:recipient = { - change_to_administrative_effect = yes - } - } - - # Shared Torture effects - if = { - limit = { - OR = { - scope:disfigure = yes - scope:blind = yes - scope:castrate = yes - } - } - scope:recipient.house ?= { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = torture - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - } - - # No Demands Added - if = { - limit = { - scope:demand_conversion = no - scope:renounce_claims = no - scope:banish = no - scope:gain_hook = no - scope:take_vows = no - scope:become_executioner = no - scope:recruit = no - scope:disfigure = no - scope:blind = no - scope:castrate = no - scope:demand_admin = no - } - # Notification to the imprisoner - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = recipient_released_from_prison - left_icon = scope:recipient - scope:recipient = { - add_opinion = { - modifier = released_from_prison - target = scope:actor - } - } - } - house ?= { - change_house_relation_effect = { - HOUSE = scope:recipient.house - VALUE = house_relation_improve_medium_value - REASON = prison_released - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - add_dread = minor_dread_loss - stress_impact = { - sadistic = medium_stress_impact_gain - callous = minor_stress_impact_gain - } - # Struggle impact - if = { - limit = { - any_character_struggle = { - involvement = involved - OR = { - has_struggle_phase_parameter = release_prisoner_diff_culture_gives_prestige - has_struggle_phase_parameter = release_prisoner_diff_faith_gives_prestige - } - } - is_diff_faith_or_culture_trigger = { - CHAR = scope:recipient - STATUS = involved - } - } - add_prestige = medium_prestige_gain - } - - # Struggle Catalyst - if = { - limit = { - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_release_important - CHAR = scope:recipient - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_release_important - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_release_important - character = scope:actor - } - } - } - if = { - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:actor - SECOND = scope:recipient - } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_release_supporter_detractor - CHAR = scope:recipient - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_release_supporter_detractor - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_release_supporter_detractor - character = scope:actor - } - log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_release_supporter_detractor } - } - } - } - - # If we're a clan (and not making any demands) this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_released_from_own_prison.desc - REVERSE_NON_HOUSE_TARGET = no - } - - # LEGITIMACY GAIN FROM RELEASING DUKES AND ABOVE - if = { - limit = { - exists = scope:recipient.primary_title - scope:recipient.primary_title.tier >= tier_duchy - } - # Minus 2, since we want Duchy to be 1, and it's normally 3 - save_scope_value_as = { - name = title_tier_minus_2 - value = { - value = scope:recipient.primary_title.tier - subtract = 2 - } - } - scope:actor = { - send_interface_toast = { - type = msg_legitimacy_gain - title = legitimacy_gain_toast - left_icon = scope:actor - right_icon = scope:recipient - add_legitimacy = { - value = { - value = miniscule_legitimacy_gain - multiply = scope:title_tier_minus_2 - } - } - } - } - } - } - else = { - scope:actor = { - trigger_event = char_interaction.0160 - } - } - - # If a child was imprisoned due to yearly_4021 they'll come back to say hi - if = { - limit = { - exists = var:marked_for_revenge_in_event_yearly_4021 - } - add_opinion = { - modifier = abandoned_me_opinion - target = var:marked_for_revenge_in_event_yearly_4021 - } - if = { - limit = { - var:marked_for_revenge_in_event_yearly_4021 = { - is_alive = yes - is_ai = no - } - } - save_scope_as = child - if = { - limit = { #Make sure they're sadistic! - NOT = { has_trait = sadistic } - number_of_personality_traits < personality_trait_limit - } - add_trait = sadistic - } - var:marked_for_revenge_in_event_yearly_4021 = { - add_character_flag = { #TO make sure that they don't get spammed about the release - flag = block_for_prison_release_notification - days = 10 - } - trigger_event = yearly.4022 - } - remove_variable = marked_for_revenge_in_event_yearly_4021 - } - } - - if = { - limit = { - is_imprisoned = yes - # Release is handled in follow-up events - scope:disfigure = no - scope:blind = no - scope:castrate = no - } - release_from_prison = yes - } - } - - # FP3 - If prisoner is important for war - scope:actor = { # FP3 - if = { - limit = { - exists = scope:recipient.house - any_character_war = { - using_cb = fp3_free_house_member_cb - is_defender = scope:actor - primary_attacker.house = scope:recipient.house - } - } - random_character_war = { - limit = { - using_cb = fp3_free_house_member_cb - is_defender = scope:actor - primary_attacker.house = scope:recipient.house - } - primary_attacker = { - hidden_effect = { - send_interface_message = { - type = event_war_good - title = lesson_war_final_notes_victory_step_1 - left_icon = scope:recipient - right_icon = scope:actor - - show_as_tooltip = { - scope:recipient = { release_from_prison = yes } - add_prestige = major_prestige_gain - prev.primary_defender = { add_prestige = major_prestige_loss } - } - } - } - add_prestige = major_prestige_gain - prev.primary_defender = { add_prestige = major_prestige_loss } - } - } - } - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0161 - } - } - - send_option = { - flag = demand_conversion - localization = "RELEASE_DEMAND_CONVERSION" - is_shown = { - scope:recipient.faith != scope:actor.faith - } - is_valid = { - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - } - scope:recipient = { - OR = { - is_close_or_extended_family_of = scope:actor - is_vassal_of = scope:actor - } - } - } - - # Cannot ask Landed Rulers to convert if they're not your vassal - custom_description = { - text = cannot_demand_unsubordinate_landed_ruler_conversion - scope:recipient = { - trigger_if = { - limit = { - is_playable_character = yes - } - is_vassal_or_below_of = scope:actor - } - } - } - - # Cannot ask Religious Heads to convert - custom_description = { - text = cannot_demand_religious_head_conversion - NAND = { - exists = scope:recipient.faith.religious_head - scope:recipient.faith.religious_head = scope:recipient - } - } - # Cannot ask Holy Order Master to convert - custom_description = { - text = cannot_demand_holy_order_master_conversion - NAND = { - exists = scope:recipient.faith - scope:recipient.faith = { - any_faith_holy_order = { leader = scope:recipient } - } - } - } - } - } - - send_option = { - flag = renounce_claims - localization = RELEASE_RENOUNCE_CLAIMS - is_shown = { - custom_description = { - text = "release_renounce_claims" - subject = scope:recipient - scope:recipient = { - any_claim = { - explicit = yes - save_temporary_scope_as = temp_claim - OR = { - holder = scope:actor - AND = { - NOT = { prev = { target_is_liege_or_above = scope:actor } } - trigger_if = { - limit = { - exists = holder - } - holder = { target_is_liege_or_above = scope:actor } - } - } - scope:actor = { - any_held_title = { - is_de_jure_liege_or_above_target = scope:temp_claim - } - } - } - } - } - } - } - current_description = { - desc = RELEASE_RENOUNCE_CLAIMS_DESC - } - } - - send_option = { - flag = banish - localization = "RELEASE_BANISH" - is_shown = { - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - } - scope:recipient = { - OR = { - AND = { - is_playable_character = no - is_ruler = no - gold > scope:actor.gold - gold > scope:actor.medium_gold_value - scope:actor.ai_greed > low_negative_ai_value - } - AND = { - is_playable_character = no - is_ruler = no - gold > 0 - scope:actor = { - has_banish_reason = scope:recipient - } - } - AND = { - is_playable_character = no - is_ruler = no - gold > 100 - scope:actor.ai_greed >= high_positive_ai_value - } - AND = { - scope:actor = { - has_banish_reason = scope:recipient - } - scope:actor = { - opinion = { - target = scope:recipient - value <= medium_negative_opinion - } - } - } - } - } - } - trigger_if = { - limit = { - scope:recipient = { - is_playable_character = yes - } - } - scope:recipient = { - is_vassal_of = scope:actor - } - } - trigger_else = { - scope:recipient = { - is_courtier_of = scope:actor - } - } - custom_description = { - text = "release_banish_invalid_take_vows" - object = scope:recipient - scope:take_vows = no - } - scope:recruit = no #Should be impossible to have both but just in case - NOT = { - scope:recipient = { - is_spouse_of = scope:actor - } - } - } - } - - send_option = { - flag = gain_hook - localization = "RELEASE_GAIN_HOOK" - is_shown = { - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - } - scope:recipient = { - OR = { - is_vassal_of = scope:actor - liege ?= scope:actor - } - } - } - } - is_valid = { - scope:actor = { - can_add_hook = { - type = favor_hook #Matches the hook added in the on_accept - target = scope:recipient - } - } - } - } - - send_option = { - flag = take_vows - localization = "RELEASE_TAKE_VOWS" - is_shown = { - scope:actor = { take_vows_available_trigger = yes } - } - is_valid = { - #Handle AI - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - } - #We're AI and Byzantium - trigger_if = { - limit = { - scope:actor = { - culture = { has_cultural_pillar = heritage_byzantine } - } - } - scope:recipient = { - is_ai = yes #Not gonna depose player characters, for now - OR = { - is_close_or_extended_family_of = scope:actor - is_vassal_or_below_of = scope:actor #Weigh this for Byz AI in the modifiers below - has_relation_rival = scope:actor - is_courtier_of = scope:actor - } - NOT = { - is_heir_of = scope:actor - } - } - #Get rid of rivals despite potentially liking them - trigger_if = { - limit = { - scope:recipient = { has_relation_rival = scope:actor } - } - always = yes - } - #Only get rid of family members if we dislike them - trigger_else = { - scope:actor = { - opinion = { - target = scope:recipient - value <= medium_negative_opinion - } - } - } - } - #We're not Byzantium but plain AI - trigger_else = { - scope:recipient = { - is_ai = yes #Not gonna depose player characters, for now - is_close_or_extended_family_of = scope:actor - NOT = { - is_heir_of = scope:actor - } - } - scope:actor = { - opinion = { - target = scope:recipient - value <= medium_negative_opinion - } - } - custom_description = { - text = "release_vows_invalid_not_your_court" - object = scope:recipient - subject = scope:actor - OR = { - scope:recipient = { is_courtier_of = scope:actor } - scope:recruit = yes - } - } - } - } - #Enhanced Take the Vows for Byzantium players -- who do we want to boot to a monastery far, far away? - trigger_else_if = { - limit = { - scope:actor = { - culture = { has_cultural_pillar = heritage_byzantine } - } - } - scope:recipient = { - is_ai = yes #Not gonna depose player characters, for now - custom_description = { - text = "release_byz_vows_invalid" - object = scope:recipient - subject = scope:actor - OR = { - is_close_or_extended_family_of = scope:actor - is_vassal_or_below_of = scope:actor - has_relation_rival = scope:actor - is_courtier_of = scope:actor - } - } - } - } - #Otherwise standard procedure Take the Vows requirements - trigger_else = { - scope:recipient = { - is_ai = yes #Not gonna depose player characters, for now - } - scope:actor = { is_close_or_extended_family_of = scope:recipient } #Triggering I_AM_NOT instead of CHARACTER_IS_NOT makes the tooltip look less cursed - custom_description = { - text = "release_vows_invalid_not_your_court" - object = scope:recipient - subject = scope:actor - OR = { - scope:recipient = { is_courtier_of = scope:actor } - scope:recruit = yes - } - } - - } - custom_description = { - text = "release_vows_invalid_not_your_faith" - object = scope:recipient - subject = scope:actor - trigger_if = { - limit = { - scope:recipient.faith != scope:actor.faith - } - scope:demand_conversion = yes - } - } - custom_description = { - text = "release_executioner_invalid_take_vows_condition" - object = scope:recipient - scope:become_executioner = no - } - custom_description = { - text = "release_banish_invalid_take_vows" - object = scope:recipient - scope:banish = no - } - scope:recipient = { - age >= 10 - NOR = { - has_trait = excommunicated - has_trait = devoted - has_trait = incapable - } - #Do they have the "wrong" marriage type? - NOR = { - custom_description = { - text = is_married_matrilineally - subject = scope:recipient - any_spouse = { - is_female = yes - matrilinear_marriage = yes - } - } - custom_description = { - text = is_married_patrilineally - subject = scope:recipient - any_spouse = { - is_male = yes - patrilinear_marriage = yes - } - } - custom_description = { - text = matrilinear_betrothal - subject = scope:recipient - betrothed ?= { - is_female = yes - matrilinear_betrothal = yes - } - } - custom_description = { - text = patrilinear_betrothal - subject = scope:recipient - betrothed ?= { - is_male = yes - patrilinear_betrothal = yes - } - } - } - } - } - } - send_option = { - flag = become_executioner - localization = "RELEASE_AS_EXECUTIONER" - is_shown = { - has_ep1_court_positions_dlc_trigger = yes - scope:actor = { - has_royal_court = yes - } - scope:recipient = { - is_adult = yes - } - } - is_valid = { - scope:actor = { - can_employ_court_position_type = executioner_court_position - NOT = { employs_court_position = executioner_court_position } - } - scope:recipient = { - trigger_if = { - limit = { scope:recruit = yes } - custom_description = { - text = "release_executioner_invalid_recruit" - object = scope:recipient - scope:recruit = yes - } - } - trigger_else = { - is_courtier_of = scope:actor - } - - custom_description = { - text = "release_executioner_invalid_take_vows_condition" - object = scope:recipient - scope:take_vows = no - } - NOT = { is_spouse_of = scope:actor } - } - } - } - - send_option = { - flag = recruit - localization = "RELEASE_RECRUIT" - is_shown = { - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - } - scope:recipient = { - OR = { - has_relation_best_friend = scope:actor - has_relation_friend = scope:actor - has_relation_lover = scope:actor - has_relation_soulmate = scope:actor - has_secret_relation_lover = scope:actor - is_heir_of = scope:actor - } - } - } - scope:recipient = { - is_ruler = no - NOT = { is_courtier_of = scope:actor } - OR = { - is_adult = yes - AND = { - is_adult = no - OR = { - trigger_if = { - limit = { exists = liege } - NOT = { is_heir_of = liege } - } - NOT = { exists = liege } - } - } - } - } - } - } - - send_option = { - flag = disfigure - localization = "RELEASE_DISFIGURE" - is_shown = { - scope:actor = { - government_allows = administrative - culture = { has_cultural_tradition = tradition_ep3_palace_politics } - # If they're our partner emperor, we should use the maiming interaction instead. - liege_should_systematically_maim_co_ruler_trigger = no - } - scope:recipient = { - is_adult = yes - } - } - is_valid = { - scope:recipient = { - NOT = { has_trait = disfigured } - } - # Byzantines can't disfigure those not in their realm - trigger_if = { - limit = { - scope:actor = { - culture = { has_cultural_pillar = heritage_byzantine } - } - } - scope:recipient = { - custom_description = { - text = "release_byz_disfigure_invalid" - object = scope:recipient - subject = scope:actor - OR = { - is_close_or_extended_family_of = scope:actor - is_vassal_or_below_of = scope:actor - has_relation_rival = scope:actor - is_courtier_of = scope:actor - } - } - } - } - custom_description = { - text = "release_prisoner_disfigure_blind_castrate_condition" - object = scope:recipient - scope:blind = no - scope:castrate = no - } - } - } - - send_option = { - flag = blind - localization = "RELEASE_BLIND" - is_shown = { - scope:actor = { - is_adult = yes - culture = { has_cultural_parameter = can_blind_prisoners } - # If they're our partner emperor, we should use the maiming interaction instead. - liege_should_systematically_maim_co_ruler_trigger = no - } - scope:recipient = { - is_adult = yes - } - } - is_valid = { - scope:recipient = { - NOT = { has_trait = blind } - } - custom_description = { - text = "release_prisoner_disfigure_blind_castrate_condition" - object = scope:recipient - scope:disfigure = no - scope:castrate = no - } - } - } - - send_option = { - flag = castrate - localization = "RELEASE_CASTRATE" - is_shown = { - scope:recipient = { - is_imprisoned_by = scope:actor - is_eunuch_trigger = no - is_male = yes - } - scope:actor = { - is_adult = yes - culture = { - has_cultural_parameter = can_castrate_prisoners - } - # If they're our partner emperor, we should use the maiming interaction instead. - liege_should_systematically_maim_co_ruler_trigger = no - } - } - is_valid = { - scope:recipient = { - is_eunuch_trigger = no - } - custom_description = { - text = "release_prisoner_disfigure_blind_castrate_condition" - object = scope:recipient - scope:disfigure = no - scope:blind = no - } - } - } - - send_option = { - flag = demand_admin - localization = "RELEASE_DEMAND_ADMIN" - is_shown = { - scope:actor = { government_allows = administrative } - scope:actor = scope:recipient.liege - scope:recipient = { #Requirements match demand admin interaction - highest_held_title_tier >= tier_county - is_landed = yes - is_ruler = yes - NOT = { government_allows = administrative } - NOT = { - scope:recipient = { government_has_flag = government_is_tribal } - } - NOT = { scope:recipient ?= scope:recipient.faith.religious_head } - NOT = { scope:recipient ?= scope:actor.diarch } - } - } - is_valid = { - scope:recipient = { - NOT = { government_allows = administrative } - } - } - } - - send_options_exclusive = no - - auto_accept = { - scope:demand_conversion = no - scope:renounce_claims = no - scope:banish = no - scope:gain_hook = no - scope:take_vows = no - scope:recruit = no - scope:disfigure = no - scope:blind = no - scope:castrate = no - scope:demand_admin = no - } - - ai_accept = { - base = 0 - modifier = { - add = 100 - desc = "WANTS_FREEDOM_REASON" - } - # Basic modifiers - modifier = { - trigger = { - has_trait = ambitious - } - add = -20 - desc = "RECIPIENT_IS_AMBITIOUS" - } - - # Demand conversion - modifier = { - trigger = { - scope:recipient = { ai_zeal <= 20 } - scope:demand_conversion = yes - } - add = -20 - desc = "CONVERSION_NEGATIVE_REASON" - } - modifier = { - trigger = { - scope:recipient = { ai_zeal > 20 } - scope:demand_conversion = yes - } - add = { - value = ai_zeal - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value = faith_astray_level - } - } - } - multiply = -1 - } - else = { - multiply = -2 - } - } - desc = "CONVERSION_NEGATIVE_REASON" - } - # Renounce claims - modifier = { - add = -25 - trigger = { - scope:renounce_claims = yes - ai_greed < 0 - } - desc = "RENOUNCE_CLAIMS_REASON" - } - modifier = { - add = -50 - trigger = { - scope:renounce_claims = yes - ai_greed >= 0 - ai_greed < 26 - } - desc = "RENOUNCE_CLAIMS_REASON" - } - modifier = { - add = -75 - trigger = { - scope:renounce_claims = yes - ai_greed >= 26 - ai_greed < 51 - } - desc = "RENOUNCE_CLAIMS_REASON" - } - modifier = { - add = -95 - trigger = { - scope:renounce_claims = yes - ai_greed >= 51 - } - desc = "RENOUNCE_CLAIMS_REASON" - } - # Employ executioner - modifier = { - add = -50 - trigger = { - scope:become_executioner = yes - # Sadists don't care about becoming an executioner - NOR = { - has_trait = sadistic - has_trait = callous - } - } - desc = "BECOME_EXECUTIONER_REASON" - } - # Banish - modifier = { - add = -50 - trigger = { - scope:banish = yes - } - NOT = { - scope:actor = { - has_imprisonment_reason = scope:recipient - culture = { has_cultural_parameter = vassals_more_likely_accept_punishments } - } - } - desc = "BANISH_NEGATIVE_REASON" - } - modifier = { # Legalistic tradition - add = legalistic_vassal_punishment_acceptance - trigger = { - scope:banish = yes - } - scope:actor = { - has_imprisonment_reason = scope:recipient - culture = { has_cultural_parameter = vassals_more_likely_accept_punishments } - } - desc = tradition_legalistic_name - } - # Gain hook - modifier = { - add = { - value = -50 - if = { - limit = { - scope:recipient = { - ai_vengefulness > 0 - } - } - subtract = ai_vengefulness - } - } - trigger = { - scope:gain_hook = yes - } - desc = "GAIN_HOOK_NEGATIVE_REASON" - } - # Take vows - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - } - desc = "TAKE_VOWS_NEGATIVE_REASON" - } - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - has_trait = lustful - } - desc = "TAKE_VOWS_LUSTFUL_REASON" - } - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - has_trait = rakish - } - desc = "TAKE_VOWS_RAKISH_REASON" - } - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - has_trait = fornicator - } - desc = "TAKE_VOWS_FORNICATOR_REASON" - } - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - has_trait = seducer - } - desc = "TAKE_VOWS_SEDUCER_REASON" - } - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - has_trait = deviant - } - desc = "TAKE_VOWS_DEVIANT_REASON" - } - modifier = { - add = { - value = -15 - multiply = num_sinful_traits - } - trigger = { - scope:take_vows = yes - num_sinful_traits > 1 - } - desc = "TAKE_VOWS_SINS_REASON" - } - modifier = { - add = -30 - trigger = { - scope:take_vows = yes - has_trait = cynical - } - desc = "TAKE_VOWS_CYNICAL_REASON" - } - # Recruitment - modifier = { - add = -10 - trigger = { - scope:recruit = yes - NOT = { - scope:actor = { - culture = { - has_cultural_parameter = can_recruit_prisoners_easily - } - } - } - } - desc = "RECRUITMET_NEGATIVE_REASON" - } - # Disfigure - modifier = { - add = { - value = -100 - if = { - limit = { - has_trait = beauty_good - } - multiply = 2 - } - } - trigger = { - scope:disfigure = yes - OR = { - NOR = { - has_trait = maimed - has_trait = beauty_bad - ai_sociability < -75 - } - has_trait = beauty_good - } - } - desc = "DISFIGURE_NEGATIVE_REASON" - } - modifier = { - add = -75 - trigger = { - scope:disfigure = yes - OR = { - has_trait = maimed - has_trait = beauty_bad - ai_sociability < -75 - } - NOT = { has_trait = beauty_good } - } - desc = "DISFIGURE_NEGATIVE_REASON" - } - # Blind - modifier = { - add = -100 - trigger = { - scope:blind = yes - NOR = { - has_trait = one_eyed - has_trait = infirm - age > 60 # I.e. they have poor eyesight already - } - } - desc = "BLIND_NEGATIVE_REASON" - } - modifier = { - add = -75 - trigger = { - scope:blind = yes - OR = { - has_trait = one_eyed - has_trait = infirm - age > 60 # I.e. they have poor eyesight already - } - } - desc = "BLIND_NEGATIVE_REASON" - } - # Castrate - modifier = { - add = -75 - trigger = { - scope:castrate = yes - any_child = { count > 0 } - ai_boldness < -50 - } - desc = "CASTRATE_NEGATIVE_REASON" - } - modifier = { - add = -100 - trigger = { - scope:castrate = yes - any_child = { count > 0 } - ai_boldness >= -50 - } - desc = "CASTRATE_NEGATIVE_REASON" - } - modifier = { - add = -100 - trigger = { - scope:castrate = yes - any_child = { count <= 0 } - } - desc = "CASTRATE_NO_CHILDREN_NEGATIVE_REASON" - } - modifier = { - add = -100 - trigger = { - scope:castrate = yes - has_trait = lustful - } - desc = "TAKE_VOWS_LUSTFUL_REASON" - } - # Demand admin - modifier = { - add = -20 - trigger = { - scope:demand_admin = yes - OR = { - culture = { - OR = { - # Historical cultures - this = culture:greek - any_parent_culture_or_above = { - this = culture:greek - } - this = culture:han - any_parent_culture_or_above = { - this = culture:han - } - # Bureaucratic culture - has_cultural_pillar = ethos_bureaucratic - } - } - # Another admin government - government_allows = administrative - } - } - desc = "DEMAND_ADMIN_NEGATIVE_REASON" - } - modifier = { - add = -50 - trigger = { - scope:demand_admin = yes - NOR = { - culture = { - OR = { - # Historical cultures - this = culture:greek - any_parent_culture_or_above = { - this = culture:greek - } - this = culture:han - any_parent_culture_or_above = { - this = culture:han - } - # Bureaucratic culture - has_cultural_pillar = ethos_bureaucratic - } - } - # Another admin government - government_allows = administrative - } - culture = { - NOR = { - has_cultural_tradition = tradition_hereditary_hierarchy - has_cultural_tradition = tradition_staunch_traditionalists - } - } - } - desc = "DEMAND_ADMIN_NEGATIVE_REASON" - } - modifier = { - add = -100 - trigger = { - scope:demand_admin = yes - NOR = { - culture = { - OR = { - # Historical cultures - this = culture:greek - any_parent_culture_or_above = { - this = culture:greek - } - this = culture:han - any_parent_culture_or_above = { - this = culture:han - } - # Bureaucratic culture - has_cultural_pillar = ethos_bureaucratic - } - } - # Another admin government - government_allows = administrative - } - culture = { - OR = { - has_cultural_tradition = tradition_hereditary_hierarchy - has_cultural_tradition = tradition_staunch_traditionalists - } - } - } - desc = "DEMAND_ADMIN_NEGATIVE_REASON" - } - # Struggle - modifier = { - trigger = { - scope:demand_conversion = no - scope:renounce_claims = no - scope:banish = no - scope:gain_hook = no - scope:take_vows = no - scope:recruit = no - } - scope:recipient = { - any_character_struggle = { - involvement = involved - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:recipient = { - any_character_struggle = { - phase_has_catalyst = catalyst_release_important - } - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:recipient = { - any_character_struggle = { - phase_has_catalyst = catalyst_release_important - } - } - } - add = 200 - } - } - } - } - - # AI - ai_targets = { - ai_recipients = prisoners - } - ai_frequency = 1 - - ai_potential = { - has_prisoners = yes - } - - ai_will_do = { - base = 0 - - modifier = { - add = 20 - scope:demand_conversion = yes - } - modifier = { - add = 100 - scope:demand_conversion = yes - scope:recipient = { - is_vassal_of = scope:actor - } - } - modifier = { - add = 30 - scope:renounce_claims = yes - } - modifier = { - add = 50 - scope:banish = yes - } - modifier = { - add = 30 - scope:take_vows = yes - } - modifier = { - add = 10 - scope:recruit = yes - } - modifier = { - add = 30 - scope:disfigure = yes - } - modifier = { - add = 20 - scope:blind = yes - } - modifier = { - add = 50 - scope:castrate = yes - } - modifier = { # Rivals can rot - add = -40 - scope:actor = { - NOT = { - has_trait = forgiving - } - } - scope:recipient = { - OR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - scope:recipient = { - is_spouse_of = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - } - } - } - } - modifier = { # Rivals can rot FOREVER if vengeful - add = -100 - scope:actor = { - NOT = { - has_trait = forgiving - } - } - scope:actor.ai_vengefulness >= very_high_positive_ai_value - scope:recipient = { - OR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - scope:recipient = { - is_spouse_of = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - } - } - } - } - modifier = { # Compassionate characters don't want to keep children in their dungeon for too long - add = 10 - scope:actor = { - is_at_war = no - ai_compassion >= low_positive_ai_value - } - scope:recipient = { - is_adult = no - time_in_prison = { years > 1 } - } - } - modifier = { # Very compassionate characters tend to release prisoners - add = 10 - scope:actor = { - is_at_war = no - ai_compassion >= very_high_positive_ai_value - } - scope:recipient = { - time_in_prison = { years > 1 } - } - } - modifier = { # Somewhat compassionate characters tend to keep people in their dungeon for a while - add = 10 - scope:actor = { - is_at_war = no - ai_compassion >= medium_positive_ai_value - } - scope:recipient = { - is_playable_character = no - time_in_prison = { years > 3 } - } - } - modifier = { # Only truly discompassionate characters will have their dungeon full of hapless victims after 5 years - add = 10 - scope:actor = { - is_at_war = no - ai_compassion >= low_negative_ai_value - } - scope:recipient = { - is_playable_character = no - time_in_prison = { years > 5 } - } - } - modifier = { # Most AI characters will let family out... - add = 10 - scope:actor = { - is_at_war = no - OR = { - ai_compassion >= very_high_positive_ai_value - AND = { - ai_compassion >= high_negative_ai_value - opinion = { - target = scope:recipient - value >= low_negative_opinion - } - } - } - } - scope:recipient = { - time_in_prison = { years > 1 } - is_playable_character = no - is_close_family_of = scope:actor - } - } - modifier = { # Almost all will let their own children out - add = 40 - scope:actor = { - is_at_war = no - ai_compassion >= very_high_negative_ai_value - } - scope:recipient = { - is_playable_character = no - is_child_of = scope:actor - } - } - # Struggle - modifier = { - trigger = { - scope:demand_conversion = no - scope:renounce_claims = no - scope:banish = no - scope:gain_hook = no - scope:take_vows = no - scope:recruit = no - } - scope:recipient = { - any_character_struggle = { - involvement = involved - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_release_important - } - has_character_flag = agenda_towards_escalation - } - } - add = -100 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_release_important - } - NOT = { - ai_greed >= 25 - } - OR = { - ai_compassion > 50 - AND = { - ai_compassion > 0 - scope:recipient = { - time_in_prison = { years > 1 } - } - } - } - } - } - add = 200 - } - } - } - modifier = { # Family Feud - add = -50 - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - - } - } - #Byz AI can shove vassals off to remote monasteries - weigh that here - modifier = { - add = -10 - scope:take_vows = yes - scope:actor = { - culture = { has_cultural_pillar = heritage_byzantine } - } - scope:recipient = { is_vassal_or_below_of = scope:actor } - } - - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - #don't release prisoners that are tied with a prison break contract, we don't want it invalidating all the time - modifier = { - factor = 0 - scope:recipient = { - has_character_flag = being_prisonbroken_by_laamp - } - } - } -} - -execute_prisoner_interaction = { - interface_priority = 120 - common_interaction = yes - category = interaction_category_prison - special_interaction = execute_prisoner_interaction - icon = icon_dead - - desc = execute_prisoner_interaction_desc - - ai_targets = { - ai_recipients = prisoners - } - - ai_frequency_by_tier = { - barony = 72 - county = 12 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_potential = { - is_at_war = no - } - - ai_will_do = { - base = 0 - - opinion_modifier = { - trigger = { - scope:actor != scope:recipient - } - opinion_target = scope:recipient - multiplier = -1 - } - - ai_value_modifier = { - ai_compassion = -1 - } - modifier = { - add = -20 - ai_compassion >= low_positive_ai_value - scope:recipient = { is_adult = no } - } - # Try to avoid Kinslaying - modifier = { - add = -20 - scope:actor.dynasty = scope:recipient.dynasty - NOT = { faith = { has_doctrine = doctrine_kinslaying_any_dynasty_member_crime } } - } - modifier = { - add = -20 - is_close_or_extended_family_of = scope:recipient - NOT = { faith = { has_doctrine = doctrine_kinslaying_extended_family_crime } } - } - modifier = { - add = -20 - is_close_family_of = scope:recipient - NOT = { faith = { has_doctrine = doctrine_kinslaying_close_kin_crime } } - } - modifier = { - add = 50 - has_execute_reason = scope:recipient - OR = { - has_trait = sadistic - has_trait = lunatic - } - } - modifier = { # Executing your way to new titles is a worthy cause... - add = 20 - scope:actor = { - has_execute_reason = scope:recipient - ai_greed > 0 - any_heir_title = { # Execute rulers you can inherit land from - holder ?= scope:recipient - } - } - } - modifier = { # Vengeful characters enjoy executing their rivals - add = 20 - scope:actor = { - has_execute_reason = scope:recipient - ai_vengefulness >= medium_positive_ai_value - OR = { - has_relation_rival = scope:recipient # Execute rivals - has_relation_nemesis = scope:recipient # Execute rivals - scope:recipient = { - is_spouse_of = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - } - } - } - } - modifier = { # Executing your way to new titles is a worthy cause... and very greedy characters need no execution reason - add = 35 - scope:actor = { - ai_greed >= very_high_positive_ai_value - any_heir_title = { # Execute rulers you can inherit land from - holder ?= scope:recipient - } - } - } - modifier = { # Vengeful characters enjoy executing their rivals, and very vengeful characters need no execution reason - add = 35 - scope:actor = { - ai_vengefulness >= very_high_positive_ai_value - OR = { - has_relation_rival = scope:recipient # Execute rivals - has_relation_nemesis = scope:recipient # Execute rivals - scope:recipient = { - is_spouse_of = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - } - } - } - } - #Scope:target has caused internal strife in the realm - character_hates_scope_due_to_strife_modifier = { TARGET = scope:recipient } - modifier = { - factor = 0 - scope:actor = { - NOR = { # Do not execute unless you have some sort of reason to do it - has_execute_reason = scope:recipient - has_relation_rival = scope:recipient # Execute rivals - has_relation_nemesis = scope:recipient # Execute rivals - scope:recipient = { - is_spouse_of = scope:actor - exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor } - } - any_heir_title = { # Execute rulers you can inherit land from - holder ?= scope:recipient - } - has_trait = lunatic # Self explanatory - } - } - } - - # Agenda impact - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - } - is_important_or_vip_struggle_character = yes - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_execute_important - } - has_character_flag = agenda_towards_escalation - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_execute_important - } - } - } - add = -100 - } - } - } - - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - } - has_trait = fp3_struggle_supporter - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_execute_supporter - } - has_trait = fp3_struggle_detractor - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_execute_supporter - } - } - } - add = -100 - } - } - } - - #Nomads get the special beheading stuff - modifier = { - scope:actor = { - mpo_keep_prisoners_heads_trigger = yes - scope:recipient = { - is_ruler = yes - highest_held_title_tier >= tier_county - is_adult = yes - } - NOT = { - scope:recipient.top_liege ?= { - current_military_strength > scope:actor.current_military_strength - tier_difference = { - target = scope:actor - value >= -1 - } - } - } - } - NOT = { - scope:actor.faith = { has_doctrine_parameter = human_sacrifice_active } - } - add = 10 - } - #Boost further if actor if want to keep head - modifier = { - #want to keep head - scope:actor = { - mpo_keep_prisoners_heads_trigger = yes - } - scope:recipient = { - highest_held_title_tier >= tier_kingdom - is_adult = yes - } - NOT = { - scope:actor.faith = { has_doctrine_parameter = human_sacrifice_active } - } - add = 20 - } - #Boost further if actor wants to be scary - modifier = { - #want to keep head - scope:actor = { - mpo_keep_prisoners_heads_trigger = yes - scope:recipient = { - is_ruler = yes - highest_held_title_tier >= tier_county - is_adult = yes - } - OR = { - has_trait = conqueror - has_trait = greatest_of_khans - is_gurkhan = yes - } - } - NOT = { - scope:actor.faith = { has_doctrine_parameter = human_sacrifice_active } - } - add = 30 - } - - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - } - has_trait = fp3_struggle_detractor - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_execute_detractor - } - has_trait = fp3_struggle_supporter - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_execute_detractor - } - } - } - add = -100 - } - } - } - modifier = { - add = 200 - scope:actor.faith = { - has_doctrine = tenet_extinction_of_dharma - } - scope:recipient.faith = { - religion = root.faith.religion - NOT = { - has_doctrine = tenet_extinction_of_dharma - } - } - } - #don't kill prisoners that are tied with a prison break contract, we don't want it invalidating all the time - modifier = { - factor = 0 - scope:recipient = { - has_character_flag = being_prisonbroken_by_laamp - } - } - } - - is_shown = { - scope:recipient = { - is_imprisoned_by = scope:actor - } - } - - is_valid_showing_failures_only = { - scope:recipient = { NOT = { has_strong_hook = scope:actor } } - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - - # Blocked by current struggle phase - custom_tooltip = { - text = struggle_parameter_struggle_cannot_execute_involved_prisoners - NOT = { - scope:actor = { - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = struggle_cannot_execute_involved_prisoners - is_secondary_character_involvement_involved_trigger = { - CHAR = scope:recipient - } - } - } - } - } - - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - - # For use with co-ruler diarchs. - scope:recipient = { is_imprisoned_by = scope:actor } - } - - cost = { - # Usually, this action is free, but during certain diarchies, we want it to cost. - prestige = liege_diarchy_surcharge_interaction_execute_prisoner_interaction_value - } - - on_accept = { - # If this is a co-ruler we're executing, tell us if we have alternatives. - scope:actor = { - if = { - limit = { - OR = { - AND = { - has_diarchy_active_parameter = diarchy_is_co_rulership - diarch ?= scope:recipient - } - AND = { - scope:recipient = { has_diarchy_active_parameter = diarchy_is_co_rulership } - is_diarch_of_target = scope:recipient - } - } - } - # If the player doesn't have to execute their partner, point that out. - if = { - limit = { liege_can_maim_co_ruler_without_killing_them_trigger = yes } - custom_tooltip = execute_prisoner_interaction.tt.can_maim_diarch - } - # Otherwise, if they're out diarch, we end it. - if = { - limit = { scope:actor.diarch = scope:recipient } - end_diarchy = yes - every_player = { - limit = { - NOR = { - this = scope:actor - this = scope:recipient - } - top_liege = scope:actor.top_liege - } - trigger_event = diarchy.8022 - } - } - # Else, usurp. - else = { - custom_description_no_bullet = { - text = execute_prisoner_interaction_tt_co_emperor_usurpation - object = scope:recipient - } - create_title_and_vassal_change = { - type = usurped - save_scope_as = change - } - scope:recipient = { - every_held_title = { - limit = { - OR = { - this = scope:recipient.capital_county - this = scope:recipient.capital_county.duchy - AND = { - tier = tier_county - this.duchy = scope:recipient.capital_county.duchy - } - tier >= scope:recipient.highest_held_title_tier - } - } - change_title_holder = { - holder = scope:actor - change = scope:change - } - } - every_vassal = { - custom = custom.recipient_every_vassal - change_liege = { - LIEGE = scope:actor - CHANGE = scope:change - } - } - hidden_effect = { - change_liege = { - LIEGE = scope:actor - CHANGE = scope:change - } - } - } - resolve_title_and_vassal_change = scope:change - every_player = { - limit = { - NOR = { - this = scope:actor - this = scope:recipient - } - top_liege = scope:actor.top_liege - } - trigger_event = diarchy.8023 - } - } - } - # Regardless, this is legit politics, so we don't deduct legitimacy for it. - save_scope_value_as = { - name = suppress_legitimacy_from_crime - value = yes - } - } - # Now, the rest of it. - if = { - limit = { scope:recipient = { is_imprisoned_by = scope:actor } } - # Are you HumSac'ing the HoF of a faith that doesn't practice HumSac? - hidden_effect = { - scope:actor = { - humsacd_a_hof_effect = { - SACRIFICER = scope:actor - SACRIFICED_HOF = scope:recipient - } - } - } - if = { - limit = { always = scope:execution_public } - if = { - limit = { - scope:actor.capital_county = { - NOT = { has_county_modifier = held_public_execution_modifier } - } - } - custom_description_no_bullet = { - text = public_execution_tooltip - } - - scope:actor = { - capital_county = { - add_county_modifier = { - modifier = held_public_execution_modifier - days = 1850 - } - } - custom_tooltip = public_execution_control_effect - hidden_effect = { - every_held_title = { - title_tier = county - change_county_control = executioner_control_value - } - } - } - } - else = { - custom_description_no_bullet = { - text = public_execution_too_soon_tooltip - } - } - } - # Other Effects - if = { # Boil their skull? - limit = { - NOT = { always = scope:execution_devour } - scope:actor = { - has_relation_rival = scope:recipient - has_personality_malicious_trigger = yes - has_royal_court = yes - has_dlc_feature = court_artifacts - } - scope:recipient = { - is_adult = yes - } - } - scope:actor = { - random = { - chance = { - value = 25 - if = { - limit = { - has_relation_nemesis = scope:recipient - } - add = 75 - } - } - hidden_effect = { - scope:recipient = { - save_scope_as = skull_to_boil - } - trigger_event = { - id = artifact.7000 - days = { 3 10 } - } - } - } - } - } - if = { - limit = { - NOT = { always = scope:execution_devour } - scope:actor = { - is_adult = no - age >= 4 - is_ai = no - NOT = { has_character_flag = witnessed_execution_flag } - } - scope:recipient = { - is_adult = yes - } - } - scope:actor = { trigger_event = bp1_yearly.9045 } - } - else_if = { - limit = { - NOT = { always = scope:execution_devour } - scope:actor = { - OR = { - has_relation_friend = scope:recipient - has_relation_lover = scope:recipient - } - is_ai = no - } - scope:recipient = { - is_adult = yes - } - } - scope:actor = { trigger_event = bp1_yearly.9044 } - } - # Gallowsbait. - scope:actor = { - if = { - limit = { - has_government = landless_adventurer_government - scope:recipient = { - is_landless_adventurer = no - is_ruler = yes - } - } - if = { - limit = { scope:recipient.highest_held_title_tier >= tier_empire } - laamp_rewards_apply_criminal_xp_effect = { - TRACK = marauder - XP_MAX = gallowsbait_xp_massive_gain - XP_MIN = gallowsbait_xp_massive_gain - } - } - else_if = { - limit = { scope:recipient.highest_held_title_tier >= tier_kingdom } - laamp_rewards_apply_criminal_xp_effect = { - TRACK = marauder - XP_MAX = gallowsbait_xp_major_gain - XP_MIN = gallowsbait_xp_major_gain - } - } - else_if = { - limit = { scope:recipient.highest_held_title_tier >= tier_duchy } - laamp_rewards_apply_criminal_xp_effect = { - TRACK = marauder - XP_MAX = gallowsbait_xp_medium_gain - XP_MIN = gallowsbait_xp_medium_gain - } - } - else_if = { - limit = { scope:recipient.highest_held_title_tier >= tier_barony } - laamp_rewards_apply_criminal_xp_effect = { - TRACK = marauder - XP_MAX = gallowsbait_xp_minor_gain - XP_MIN = gallowsbait_xp_minor_gain - } - } - else = { - laamp_rewards_apply_criminal_xp_effect = { - TRACK = marauder - XP_MAX = 2 - XP_MIN = 2 - } - } - } - } - - # FP3 - # Struggle Catalysts - scope:actor = { - if = { # Execute important - limit = { - scope:recipient = { is_important_or_vip_struggle_character = yes } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_execute_important - CHAR = scope:recipient - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_execute_important - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_execute_important - character = scope:actor - } - } - } - if = { # Execute Supporter/Detractor - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:actor - SECOND = scope:recipient - } - } - if = { - limit = { - scope:recipient = { has_trait = fp3_struggle_detractor } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_execute_detractor - CHAR = scope:recipient - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_execute_detractor - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_execute_detractor - character = scope:actor - } - log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_execute_detractor } - } - } - else_if = { - limit = { - scope:recipient = { has_trait = fp3_struggle_supporter } - any_character_struggle = { - involvement = involved - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_execute_supporter - CHAR = scope:recipient - } - } - } - every_character_struggle = { - involvement = involved - limit = { - activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { - CATALYST = catalyst_execute_supporter - CHAR = scope:recipient - } - } - activate_struggle_catalyst = { - catalyst = catalyst_execute_supporter - character = scope:actor - } - log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_execute_supporter } - } - } - } - # Free House Member CB target executed during war - if = { - limit = { - exists = scope:recipient.house - any_character_war = { - using_cb = fp3_free_house_member_cb - is_defender = scope:actor - primary_attacker.house = scope:recipient.house - } - } - random_character_war = { - limit = { - using_cb = fp3_free_house_member_cb - is_defender = scope:actor - primary_attacker.house = scope:recipient.house - } - primary_attacker = { - add_opinion = { - target = scope:actor - modifier = executed_close_relation_opinion - } - } - } - add_prestige = { - value = medium_piety_loss - multiply = { - value = ai_honor - add = 1 - } - } - every_vassal = { - limit = { - OR = { - has_vassal_stance = courtly - has_vassal_stance = glory_hound - ai_honor > 0.48 - } - } - add_opinion = { - target = scope:actor - modifier = executed_valuable_prisoner_modifier - } - } - } - } - - if = { - limit = { - scope:actor.faith = { - has_doctrine = tenet_extinction_of_dharma - } - scope:recipient.faith = { - religion = scope:actor.faith.religion - NOT = { - has_doctrine = tenet_extinction_of_dharma - } - } - } - if = { - limit = { - scope:recipient = { - is_ruler = yes - highest_held_title_tier = tier_county - } - } - scope:actor = { - add_piety = minor_piety_value - } - } - else_if = { - limit = { - scope:recipient = { - highest_held_title_tier = tier_duchy - } - } - scope:actor = { - add_piety = medium_piety_value - } - } - else_if = { - limit = { - scope:recipient = { - highest_held_title_tier = tier_kingdom - } - } - scope:actor = { - add_piety = major_piety_value - } - } - else_if = { - limit = { - scope:recipient = { - highest_held_title_tier = tier_empire - } - } - scope:actor = { - add_piety = massive_piety_value - } - } - else_if = { - limit = { - scope:recipient = { - highest_held_title_tier = tier_hegemony - } - } - scope:actor = { - add_piety = monumental_piety_value - } - } - else = { - scope:actor = { - add_piety = miniscule_piety_value - } - } - } - if = { - limit = { - scope:actor = { - faith = { - has_doctrine = tenet_cranial_trophies - } - } - scope:recipient = { - is_adult = yes - is_faith_dominant_gender = yes - } - } - tgp_cranial_trophies_beheading_effect = { - KILLER = scope:actor - DEAD = scope:recipient - } - } - # Kill the target - if = { - limit = { - scope:recipient = { is_ai = no } - scope:actor = { is_ai = yes } - } - scope:recipient = { trigger_event = char_interaction.0170 } # Give players a chance to see what's about to happen - show_as_tooltip = { - execute_prisoner_effect = { - VICTIM = scope:recipient - EXECUTIONER = scope:actor - } - } - } - else = { - scope:recipient = { trigger_event = char_interaction.0171 } - execute_prisoner_effect = { - VICTIM = scope:recipient - EXECUTIONER = scope:actor - } - } - - if = { - limit = { always = scope:execution_devour } - scope:actor = { - custom_tooltip = devour_as_execution_tooltip - if = { - limit = { - faith = { has_doctrine_parameter = cannibalism_legal } - NOT = { has_trait = cannibal } - } - add_trait = cannibal - } - stress_impact = { - base = medium_stress_impact_loss - compassionate = miniscule_stress_impact_gain - forgiving = miniscule_stress_impact_gain - } - random = { - chance = 20 - show_as_tooltip = { add_trait = ill } - hidden_effect = { - trigger_event = { - id = health.1001 - days = { 3 10 } - } - } - } - } - } - - if = { - limit = { always = scope:execution_provisions } - scope:actor = { - domicile ?= { - change_provisions = human_provision_value - } - } - } - - if = { - limit = { - always = scope:execution_burned - scope:actor.faith = { - has_doctrine = doctrine_pluralism_fundamentalist - NOT = { - has_doctrine = tenet_extinction_of_dharma - } - } - } - scope:actor = { - add_piety = miniscule_piety_value - } - } - - scope:actor = { - hidden_effect = { - send_interface_message = { - type = event_prison_neutral - title = msg_execute_prisoner - right_icon = scope:recipient - custom_tooltip = msg_execute_prisoner_desc - } - } - } - } - } - - options_heading = execution_options_heading - - send_option = { - is_shown = { - scope:actor = { - OR = { - mpo_keep_prisoners_heads_trigger = yes - faith = scope:recipient.faith - faith = { - has_doctrine = tenet_cranial_trophies - } - culture_has_asian_heritage_pillar_trigger = yes - } - NOT = { - faith = { has_doctrine_parameter = human_sacrifice_active } - } - } - } - flag = execution_beheaded - localization = "EXECUTION_BEHEADED" - } - - #Cannibal option. Should be treated as a "normal" execution, but that you eat the body afterwards (in secret if faith does not allow it). - send_option = { - is_shown = { - scope:actor = { - OR = { - scope:actor.faith = { has_doctrine_parameter = cannibalism_legal } - has_trait = cannibal - any_secret = { type = secret_cannibal } - } - } - } - flag = execution_devour - localization = "EXECUTION_DEVOUR" - } - - send_option = { - is_shown = { - scope:actor = { - NOR = { - AND = { - faith = scope:recipient.faith - faith = { has_doctrine_parameter = human_sacrifice_active } - } - mpo_keep_prisoners_heads_trigger = yes - culture_has_asian_heritage_pillar_trigger = yes - } - } - } - flag = execution_burned - localization = "EXECUTION_BURNED" - } - - send_option = { - is_shown = { - scope:actor.faith = { has_doctrine_parameter = human_sacrifice_active } - } - flag = execution_sacrifice - localization = "EXECUTION_SACRIFICE" - } - - send_option = { - is_shown = { - scope:actor = { - employs_court_position = executioner_court_position - any_court_position_holder = { - type = executioner_court_position - is_physically_able = yes - } - exists = capital_county - } - } - is_valid = { - scope:actor = { - NOT = { - capital_county = { - has_county_modifier = held_public_execution_modifier - } - } - } - } - flag = execution_public - localization = "EXECUTION_PUBLIC" - } - - send_option = { - is_shown = { - scope:actor = { - employs_court_position = kennelperson_camp_officer - any_court_position_holder = { - type = kennelperson_camp_officer - is_physically_able = yes - } - } - } - flag = execution_kennel - localization = "EXECUTION_KENNEL" - } - - send_option = { - is_shown = { - scope:actor = { - has_government = landless_adventurer_government - has_perk = fear_tax_perk - } - } - flag = execution_provisions - localization = "EXECUTION_PROVISIONS" - } - - send_options_exclusive = yes - auto_accept = yes -} - -debug_imprison_simple_interaction = { - use_diplomatic_range = no - category = interaction_debug_main - ignores_pending_interaction_block = yes - icon = prison - interface_priority = 1000 - common_interaction = yes - - is_shown = { - debug_only = yes - scope:recipient = { - is_imprisoned = no - } - scope:recipient != scope:actor - } - - on_accept = { - scope:actor = { - imprison = { - target = scope:recipient - type = house_arrest - } - } - } - - auto_accept = yes -} - -torture_interaction = { - interface_priority = 30 - common_interaction = no - icon = torture_interaction - - category = interaction_category_prison - - desc = torture_interaction_desc - - #cooldown = { years = 1 } - cooldown_against_recipient = { years = 5 } - - is_shown = { - scope:recipient = { is_imprisoned_by = scope:actor } - scope:recipient = { is_adult = yes } - scope:actor = { is_adult = yes } - } - - is_valid_showing_failures_only = { - #scope:recipient = { - # NOT = { - # health <= 1.5 #Because torture would definitely kill them - # } - #} - scope:actor = { - trigger_if = { - limit = { - domicile ?= { is_domicile_type = camp } - } - custom_tooltip = { - text = laamp_torture_requires_tools_tt - domicile = { has_domicile_parameter = camp_unlocks_torture_interaction } - } - } - } - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - tgp_blocked_action_against_tenno_trigger = { - ACTOR = scope:actor - TARGET = scope:recipient - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - is_highlighted = { - OR = { - scope:actor = { has_trait = sadistic } - scope:actor = { has_relation_rival = scope:recipient } - scope:actor = { has_relation_nemesis = scope:recipient } - } - } - - on_accept = { - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - scope:actor = { save_scope_as = bg_override_char } - ###EFFECT TOOLTIP### - torture_interaction_actor_effect = yes - show_as_tooltip = { - scope:recipient = { - add_character_modifier = { - modifier = recently_tortured - years = 5 - } - } - } - if = { - limit = { - scope:actor = { - domicile ?= { has_domicile_parameter = estate_torture_grants_influence } - } - } - scope:actor = { custom_tooltip = estate_torture_grants_influence_desc } - } - - ###EVENTS### - hidden_effect = { - #Torture method for descs - random_list = { - 3 = { save_scope_value_as = { name = torture_method value = flag:rack } } - 3 = { save_scope_value_as = { name = torture_method value = flag:whip } } - 1 = { save_scope_value_as = { name = torture_method value = flag:rats } } - 8 = { - trigger = { - scope:actor = { has_trait = lifestyle_poet } - } - save_scope_value_as = { - name = torture_method - value = flag:poetry - } - } - } - - #They have a secret I want to know about - if = { - limit = { - scope:recipient = { - OR = { - any_secret = { - torture_secret_trigger = { PARTICIPANT = scope:recipient } - } - any_known_secret = { - secret_owner = { save_temporary_scope_as = torture_secret_owner } - torture_secret_trigger = { PARTICIPANT = scope:torture_secret_owner } - } - } - } - } - scope:recipient = { - trigger_event = { - id = prison.1001 - days = 1 - } - } - } - else = { - scope:actor = { - trigger_event = { - id = prison.1010 - days = 1 - } - } - } - } - - # Dark Insights Perk: - if = { - limit = { - scope:actor = { has_perk = dark_insights_perk } - } - scope:actor = { - dark_insights_skill_gain_roll_effect = yes - } - } - - # House Relation - scope:recipient.house ?= { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = torture - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - } - - auto_accept = yes - - # AI - ai_targets = { - ai_recipients = prisoners - } - - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 24 - kingdom = 24 - empire = 12 - hegemony = 12 - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = -25 - - modifier = { - has_trait = sadistic - add = 30 - } - ai_value_modifier = { - ai_compassion = tiny_chance_impact_negative_ai_value #Adds +50 for highly uncompassionate characters, -50 for highly compassionate characters - } - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -0.25 - } - #Scope:target has caused internal strife in the realm - character_hates_scope_due_to_strife_modifier = { TARGET = scope:recipient } - modifier = { # Family Feud - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - } - add = 30 - } - modifier = { - scope:actor = { - has_opinion_modifier = { - modifier = tried_to_escape_from_prison_opinion - target = scope:recipient - } - } - add = 25 - } - } -} - -castrate_interaction = { - interface_priority = 30 - icon = eunuch - - category = interaction_category_prison - desc = castrate_interaction_desc - - is_shown = { - scope:recipient = { - is_imprisoned_by = scope:actor - is_eunuch_trigger = no - is_male = yes - } - scope:actor = { - is_adult = yes - OR = { - culture = { has_cultural_parameter = can_castrate_prisoners } - top_liege.primary_title = { - has_variable = emulating_byz_punishment_var - } - } - - # If they're our partner emperor, we should use the maiming interaction instead. - liege_should_systematically_maim_co_ruler_trigger = no - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - is_highlighted = { - OR = { - scope:actor = { has_trait = sadistic } - scope:actor = { has_relation_rival = scope:recipient } - scope:recipient = { - any_claim = { - holder = scope:actor - } - } - } - } - - on_accept = { - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - - blind_castrate_and_disfigure_effect = yes #Stress & dread - - show_as_tooltip = { - scope:recipient = { - if = { - limit = { - age < 12 - } - ep3_child_castration_effect = yes - } - else = { - ep3_youth_castration_effect = yes - } - release_from_prison = yes - } - } - - torture_blind_castrate_disfigure_opinion_effect = { VERB = castrated } - - scope:actor = { - save_scope_as = bg_override_char - trigger_event = { - id = prison.1025 - days = 1 - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_abelarding.desc - REVERSE_NON_HOUSE_TARGET = no - } - - # House Relation - scope:recipient.house ?= { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = torture - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = prisoners - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = -20 - - modifier = { - has_trait = sadistic - add = 20 - } - ai_value_modifier = { - ai_compassion = tiny_chance_impact_negative_ai_value #Adds +50 for highly uncompassionate characters, -50 for highly compassionate characters - } - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -0.25 - } - #Scope:target has caused internal strife in the realm - character_hates_scope_due_to_strife_modifier = { TARGET = scope:recipient } - modifier = { # Family Feud - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - } - add = 30 - } - modifier = { - scope:actor = { - has_opinion_modifier = { - modifier = tried_to_escape_from_prison_opinion - target = scope:recipient - } - } - add = 25 - } - #Cruel Latins are really into this - modifier = { - top_liege.primary_title = { - has_variable = emulating_byz_punishment_var - } - add = 30 - } - } - - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 48 - kingdom = 36 - empire = 12 - hegemony = 12 - } -} - -blind_interaction = { - interface_priority = 30 - icon = blind - - category = interaction_category_prison - desc = blind_interaction_desc - - is_shown = { - scope:recipient = { - is_imprisoned_by = scope:actor - NOT = { has_trait = blind } - } - scope:actor = { - is_adult = yes - OR = { - culture = { has_cultural_parameter = can_blind_prisoners } - top_liege.primary_title = { - has_variable = emulating_byz_punishment_var - } - } - # If they're our partner emperor, we should use the maiming interaction instead. - liege_should_systematically_maim_co_ruler_trigger = no - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - cannot_release_former_regent_whilst_old_regent_holds_power_trigger = { - PRISONER = scope:recipient - REGENT = scope:recipient.var:imprisoned_by_diarch - } - custom_tooltip = { - text = is_currently_being_purged_tt - scope:recipient = { - NOT = { - has_character_flag = is_currently_being_purged - } - } - } - } - - is_highlighted = { - OR = { - scope:actor = { has_trait = sadistic } - scope:actor = { has_relation_rival = scope:recipient } - scope:recipient = { - any_claim = { - holder = scope:actor - } - } - scope:actor = { - culture = { has_cultural_parameter = merciful_blinding } - OR = { - has_execute_reason = scope:recipient - has_banish_reason = scope:recipient - } - } - } - } - - on_accept = { - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - - blind_castrate_and_disfigure_effect = yes #Stress & dread - - show_as_tooltip = { - scope:recipient = { - add_trait = blind - release_from_prison = yes - } - } - - # Merciful Blindings - scope:actor = { - if = { - limit = { - culture = { has_cultural_parameter = merciful_blinding } - OR = { - has_execute_reason = scope:recipient - has_banish_reason = scope:recipient - } - } - add_piety = medium_piety_gain - } - } - - torture_blind_castrate_disfigure_opinion_effect = { VERB = blinded } - - scope:actor = { - save_scope_as = bg_override_char - trigger_event = { - id = prison.1020 - days = 1 - } - } - - # If we're a clan this interaction affects unity - if = { - limit = { scope:actor.culture = { has_cultural_parameter = merciful_blinding } } # If actor's culture has Merciful Blindings, they lose less unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_blinding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else = { - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_blinding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # House Relation - scope:recipient.house ?= { - change_house_relation_effect = { - HOUSE = scope:actor.house - VALUE = house_relation_damage_medium_value - REASON = torture - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = prisoners - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = -20 - - modifier = { - has_trait = sadistic - add = 20 - } - ai_value_modifier = { - ai_compassion = tiny_chance_impact_negative_ai_value #Adds +50 for highly uncompassionate characters, -50 for highly compassionate characters - } - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -0.25 - } - #Scope:target has caused internal strife in the realm - character_hates_scope_due_to_strife_modifier = { TARGET = scope:recipient } - modifier = { # Family Feud - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - } - add = 30 - } - modifier = { - scope:actor = { - has_opinion_modifier = { - modifier = tried_to_escape_from_prison_opinion - target = scope:recipient - } - } - add = 25 - } - #Cruel Latins are really into this - modifier = { - top_liege.primary_title = { - has_variable = emulating_byz_punishment_var - } - add = 30 - } - } - - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 48 - kingdom = 36 - empire = 12 - hegemony = 12 - } -} - -prison_break_contract_interaction = { - interface_priority = 30 - common_interaction = yes - icon = prison - - category = interaction_category_prison - - desc = prison_break_contract_interaction_desc - - cooldown_against_recipient = { years = 1 } - - is_shown = { - scope:actor = { - any_character_active_contract = { - task_contract_type = laamp_prison_break_contract - OR = { - var:task_contract_target = scope:recipient - var:task_contract_object = scope:recipient - var:task_contract_employer = scope:recipient - } - } - } - } - - redirect = { - scope:actor = { - random_character_active_contract = { - task_contract_type = laamp_prison_break_contract - limit = { - OR = { - var:task_contract_target = scope:recipient - var:task_contract_object = scope:recipient - var:task_contract_employer = scope:recipient - } - } - var:task_contract_object = { - save_scope_as = secondary_recipient - } - var:task_contract_target = { - save_scope_as = recipient - } - var:task_contract_employer = { - save_scope_as = secondary_actor - } - } - } - } - - is_highlighted = { - always = yes - } - - on_accept = { - scope:actor = { - start_scheme = { - type = laamp_prison_break_scheme - target_character = scope:recipient - } - random_scheme = { - type = laamp_prison_break_scheme - limit = { - scheme_target_character = scope:recipient - } - save_scope_as = scheme - } - #save scopes for scheme start event - scope:secondary_recipient = { - save_scope_as = task_contract_object - } - scope:recipient = { - save_scope_as = task_contract_target - } - scope:secondary_actor = { - save_scope_as = task_contract_employer - } - trigger_event = laamp_extra_contract_schemes.0011 - } - } - - auto_accept = yes -} - -systematically_maim_character_interaction = { - interface_priority = 30 - icon = torture_interaction - category = interaction_category_diarch - common_interaction = no - desc = systematically_maim_character_interaction_desc - - is_shown = { - scope:actor = { liege_should_systematically_maim_co_ruler_trigger = yes } - } - - is_valid_showing_failures_only = { - scope:actor = { is_adult = yes } - scope:recipient = { - custom_description = { - text = "currently_being_tortured" - NOT = { has_character_flag = is_being_tortured } - } - } - scope:recipient = { is_imprisoned_by = scope:actor } - # There's literally nothing left to remove. - scope:recipient = { - NAND = { - OR = { - is_eunuch_trigger = yes - is_female = yes - } - has_trait = blind - has_trait = disfigured - has_trait = maimed - has_trait = one_legged - } - } - } - - send_option = { - flag = maim_castrate - is_valid = { - scope:recipient = { - NOR = { - is_eunuch_trigger = yes - is_female = yes - } - } - } - localization = maim_castrate_name - current_description = maim_castrate - } - send_option = { - flag = maim_blind - is_valid = { - scope:recipient = { - NOT = { has_trait = blind } - } - } - localization = maim_blind_name - current_description = maim_blind - - } - send_option = { - flag = maim_face - is_valid = { - scope:recipient = { - NOT = { has_trait = disfigured } - } - } - localization = maim_face_name - current_description = maim_face - } - send_option = { - flag = maim_leg - is_valid = { - scope:recipient = { - NOT = { has_trait = one_legged } - } - } - localization = maim_leg_name - current_description = maim_leg - } - send_option = { - flag = maim_arm - is_valid = { - scope:recipient = { - NOT = { has_trait = maimed } - } - } - localization = maim_arm_name - current_description = maim_arm - } - - on_accept = { - scope:recipient = { - add_character_flag = { - flag = is_being_tortured - months = 6 # Players in MP can keep the event window open... - } - } - - # Stress & dread - blind_castrate_and_disfigure_effect = yes - # Our diarchy will be destroyed. - save_scope_value_as = { - name = destroy_diarchy - value = yes - } - show_as_tooltip = { - scope:actor = { maiming_destroy_diarchy_effect = yes } - } - - # Let the enchoppening begin. - ## Castrate. - if = { - limit = { scope:maim_castrate = yes } - show_as_tooltip = { - scope:recipient = { - if = { - limit = { - age < 12 - } - ep3_child_castration_effect = yes - } - else = { - ep3_youth_castration_effect = yes - } - release_from_prison = yes - } - } - torture_blind_castrate_disfigure_opinion_effect = { VERB = castrated } - scope:actor = { - clear_designated_heir = yes - trigger_event = { - id = prison.1025 - days = 1 - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_abelarding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - ## Blind. - if = { - limit = { scope:maim_blind = yes } - show_as_tooltip = { - scope:recipient = { - add_trait = blind - release_from_prison = yes - } - } - torture_blind_castrate_disfigure_opinion_effect = { VERB = blinded } - scope:actor = { - clear_designated_heir = yes - # Merciful Blindings - if = { - limit = { - culture = { has_cultural_parameter = merciful_blinding } - OR = { - has_execute_reason = scope:recipient - has_banish_reason = scope:recipient - } - } - add_piety = medium_piety_gain - } - trigger_event = { - id = prison.1020 - days = 1 - } - } - # If actor's culture has Merciful Blindings, they lose less unity. - if = { - limit = { - scope:actor.culture = { has_cultural_parameter = merciful_blinding } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_blinding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else = { - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_blinding.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - ## Disfigure. - if = { - limit = { scope:maim_face = yes } - show_as_tooltip = { - scope:recipient = { - add_trait = disfigured - release_from_prison = yes - } - } - torture_blind_castrate_disfigure_opinion_effect = { VERB = disfigured } - scope:actor = { - clear_designated_heir = yes - trigger_event = { - id = prison.1030 - days = 1 - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_maimed.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - ## Take off an arm. - if = { - limit = { scope:maim_arm = yes } - show_as_tooltip = { - scope:recipient = { - apply_maimed_trait_and_modifier_effect = yes - release_from_prison = yes - } - } - torture_blind_castrate_disfigure_opinion_effect = { VERB = maimed } - scope:actor = { - clear_designated_heir = yes - save_scope_value_as = { - name = maim_type - value = flag:arm - } - trigger_event = { - id = prison.1041 - days = 1 - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_maimed.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - ## Take off a leg. - if = { - limit = { scope:maim_leg = yes } - show_as_tooltip = { - scope:recipient = { - add_trait = one_legged - release_from_prison = yes - } - } - torture_blind_castrate_disfigure_opinion_effect = { VERB = maimed } - scope:actor = { - clear_designated_heir = yes - save_scope_value_as = { - name = maim_type - value = flag:leg - } - trigger_event = { - id = prison.1041 - days = 1 - } - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_maimed.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - auto_accept = yes - - ai_targets = { ai_recipients = prisoners } - - ai_potential = { - has_diarchy_active_parameter = diarchy_is_co_rulership - liege_can_maim_co_ruler_without_killing_them_trigger = yes - } - - ai_will_do = { - base = -50 - - modifier = { - has_trait = sadistic - add = 50 - } - modifier = { - has_trait = callous - add = 40 - } - ai_value_modifier = { - ai_compassion = tiny_chance_impact_negative_ai_value #Adds +50 for highly uncompassionate characters, -50 for highly compassionate characters - } - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -1 - } - #Scope:target has caused internal strife in the realm - character_hates_scope_due_to_strife_modifier = { TARGET = scope:recipient } - modifier = { # Family Feud - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - } - add = 30 - } - modifier = { - scope:actor = { - has_opinion_modifier = { - modifier = tried_to_escape_from_prison_opinion - target = scope:recipient - } - } - add = 25 - } - } - - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 60 - empire = 60 - hegemony = 60 - } -} diff --git a/common/character_interactions/00_religious_interactions.txt b/common/character_interactions/00_religious_interactions.txt index 239dac97..cd98c0a4 100644 --- a/common/character_interactions/00_religious_interactions.txt +++ b/common/character_interactions/00_religious_interactions.txt @@ -826,7 +826,7 @@ demand_conversion_vassal_ruler_interaction = { is_ruler = yes OR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -836,7 +836,7 @@ demand_conversion_vassal_ruler_interaction = { scope:recipient = { OR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } diff --git a/common/character_interactions/00_revoke_title_interaction.txt b/common/character_interactions/00_revoke_title_interaction.txt index 6100af44..d05b7c71 100644 --- a/common/character_interactions/00_revoke_title_interaction.txt +++ b/common/character_interactions/00_revoke_title_interaction.txt @@ -72,7 +72,7 @@ is_shown = { scope:recipient = { - NOT = { government_has_flag = government_is_true_herder } # They have their own interaction without cooldowns/maluses + NOT = { government_has_flag = government_is_herder } # They have their own interaction without cooldowns/maluses is_landed_or_landless_administrative = yes # should be shown but be disabled for indirect vassals target_is_liege_or_above = scope:actor @@ -667,7 +667,7 @@ limit = { scope:landed_title.tier != tier_barony NOT = { - scope:recipient = { government_has_flag = government_is_true_herder } + scope:recipient = { government_has_flag = government_is_herder } } } scope:actor = { @@ -677,7 +677,7 @@ } if = { limit = { - scope:recipient = { government_has_flag = government_is_true_herder } + scope:recipient = { government_has_flag = government_is_herder } } scope:recipient = { add_opinion = { @@ -703,7 +703,7 @@ limit = { scope:actor = { has_realm_law_flag = vassal_refusal_is_treason } NOT = { - scope:recipient = { government_has_flag = government_is_true_herder } + scope:recipient = { government_has_flag = government_is_herder } } } scope:actor = { @@ -828,7 +828,7 @@ modifier = { scope:recipient = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } add = 40 desc = MIGRATION_INTERACTION_HERDER diff --git a/common/character_interactions/00_scheme_interactions.txt b/common/character_interactions/00_scheme_interactions.txt deleted file mode 100644 index 226b87ca..00000000 --- a/common/character_interactions/00_scheme_interactions.txt +++ /dev/null @@ -1,2838 +0,0 @@ -#Character interactions relating to schemes - -start_murder_interaction = { - icon = icon_scheme_murder - common_interaction = yes - interface_priority = 90 - category = interaction_category_hostile - - ignores_pending_interaction_block = yes - - scheme = murder - - send_name = START_SCHEME - - is_shown = { - scope:recipient != scope:actor - - NAND = { # Game Rules! - has_game_rule = no_players_multiplayer_murder_schemes - scope:actor = { - is_ai = no - } - scope:recipient = { - is_ai = no - } - } - - NAND = { - has_game_rule = no_player_families_multiplayer_murder_schemes - scope:actor = { - is_ai = no - } - scope:recipient = { - OR = { - is_ai = no - any_close_family_member = { - AND = { - is_ai = no - this != scope:actor - } - } - } - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - can_start_scheme = { - type = murder - target_character = scope:recipient - } - } - scope:recipient = { NOT = { has_strong_hook = scope:actor } } - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - trigger_if = { - limit = { scope:actor = { has_variable = no_scheming_allowed_var } } - custom_tooltip = { - text = no_scheming_allowed_var_tt - scope:actor.var:no_scheming_allowed_var != scope:recipient - } - } - } - - desc = { - triggered_desc = { - trigger = { - scope:actor = { - can_start_scheme = { - type = murder - target_character = scope:recipient - } - } - } - desc = scheme_interaction_tt_murder_approved - } - } - - # Scheme Starter Packages - options_heading = schemes.t.agent_packages - send_options_exclusive = yes - ## Balanced agents. - send_option = { - flag = agent_focus_balance - current_description = start_murder_interaction.tt.agent_focus_balance - } - ## Focused on Success Chance. - send_option = { - flag = agent_focus_success - current_description = start_murder_interaction.tt.agent_focus_success - } - ## Focused on Speed. - send_option = { - flag = agent_focus_speed - current_description = start_murder_interaction.tt.agent_focus_speed - } - ## Focused on Secrecy. - send_option = { - flag = agent_focus_secrecy - current_description = start_murder_interaction.tt.agent_focus_secrecy - } - - on_accept = { - scope:actor = { - stress_impact = { - compassionate = major_stress_impact_gain - honest = medium_stress_impact_gain - just = medium_stress_impact_gain - } - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = start_murder_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - # Success. - if = { - limit = { scope:agent_focus_success ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = murder - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Success. - AGENT_1 = agent_assassin - AGENT_2 = agent_assassin - AGENT_3 = agent_thug - # Speed. - AGENT_4 = agent_infiltrator - # Secrecy. - AGENT_5 = agent_alibi - } - } - # Speed. - else_if = { - limit = { scope:agent_focus_speed ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = murder - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Speed. - AGENT_1 = agent_infiltrator - AGENT_2 = agent_infiltrator - AGENT_3 = agent_footpad - # Success. - AGENT_4 = agent_assassin - # Secrecy. - AGENT_5 = agent_alibi - } - } - # Secrecy. - else_if = { - limit = { scope:agent_focus_secrecy ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = murder - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Secrecy. - AGENT_1 = agent_alibi - AGENT_2 = agent_alibi - AGENT_3 = agent_lookout - # Success. - AGENT_4 = agent_assassin - # Speed. - AGENT_5 = agent_infiltrator - } - } - # Balanced. - else = { - begin_scheme_with_agents_effect = { - SCHEME_TYPE = murder - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Success. - AGENT_1 = agent_assassin - AGENT_2 = agent_assassin - # Speed. - AGENT_3 = agent_infiltrator - AGENT_4 = agent_footpad - # Secrecy. - AGENT_5 = agent_alibi - } - } - } - # Plus any on_start modifiers we may need. - if = { - limit = { var:feast_events_ewan_0001_bonus_value ?= scope:recipient } - # Hand over the modifier. - random_scheme = { - type = murder - limit = { - scheme_target_character = scope:recipient - } - add_scheme_modifier = { type = feast_learnt_habits_modifier } - } - # Remove the variable now that we're done with it. - remove_variable = feast_events_ewan_0001_bonus_value - } - } - } - - auto_accept = yes - - # AI for murders is handled in event murder_scheme_maintenance.1, fired from the five_year_playable_pulse -} - -start_abduct = { - icon = icon_scheme_abduct - interface_priority = 70 - category = interaction_category_hostile - - send_name = START_SCHEME - - scheme = abduct - ignores_pending_interaction_block = yes - - is_shown = { - scope:actor = { - OR = { - has_perk = kidnapper_perk # Scheme unlocked by the Kidnapper Perk - domicile ?= { has_domicile_parameter = camp_unlocks_abduct_scheme } - AND = { - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = unlocks_abduct_for_all - is_secondary_character_involvement_involved_trigger = { - CHAR = scope:recipient - } - } - } - } - } - - NOR = { - scope:recipient = scope:actor - scope:recipient = { is_imprisoned_by = scope:actor } - } - #exists = scope:recipient.court_owner - - NAND = { # Game Rules! - has_game_rule = no_players_multiplayer_murder_schemes - scope:actor = { - is_ai = no - } - scope:recipient = { - is_ai = no - } - } - - NAND = { - has_game_rule = no_player_families_multiplayer_murder_schemes - scope:actor = { - is_ai = no - } - scope:recipient = { - OR = { - is_ai = no - any_close_family_member = { - AND = { - is_ai = no - this != scope:actor - } - } - } - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - can_start_scheme = { - type = abduct - target_character = scope:recipient - } - } - scope:recipient = { NOT = { has_strong_hook = scope:actor } } - #limit range for landless adventurers - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - trigger_if = { - limit = { scope:actor = { has_variable = no_scheming_allowed_var } } - custom_tooltip = { - text = no_scheming_allowed_var_tt - scope:actor.var:no_scheming_allowed_var != scope:recipient - } - } - } - - desc = { - triggered_desc = { - trigger = { - scope:actor = { - can_start_scheme = { - type = abduct - target_character = scope:recipient - } - } - } - desc = scheme_interaction_tt_abduct_approved - } - } - - # Scheme Starter Packages - options_heading = schemes.t.agent_packages - send_options_exclusive = yes - ## Balanced agents. - send_option = { - flag = agent_focus_balance - current_description = start_abduct.tt.agent_focus_balance - } - ## Focused on Success Chance. - send_option = { - flag = agent_focus_success - current_description = start_abduct.tt.agent_focus_success - } - ## Focused on Speed. - send_option = { - flag = agent_focus_speed - current_description = start_abduct.tt.agent_focus_speed - } - ## Focused on Secrecy. - send_option = { - flag = agent_focus_secrecy - current_description = start_abduct.tt.agent_focus_secrecy - } - - on_accept = { - scope:actor = { - stress_impact = { - compassionate = medium_stress_impact_gain - honest = minor_stress_impact_gain - just = minor_stress_impact_gain - } - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = start_abduct_notification - - left_icon = scope:actor - right_icon = scope:recipient - - # Success. - if = { - limit = { scope:agent_focus_success ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = abduct - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Success. - AGENT_1 = agent_thug - AGENT_2 = agent_thug - AGENT_3 = agent_muscle - # Speed. - AGENT_4 = agent_footpad - # Secrecy. - AGENT_5 = agent_lookout - } - } - # Speed. - else_if = { - limit = { scope:agent_focus_speed ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = abduct - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Speed. - AGENT_1 = agent_footpad - AGENT_2 = agent_footpad - AGENT_3 = agent_infiltrator - # Success. - AGENT_4 = agent_thug - # Secrecy. - AGENT_5 = agent_lookout - } - } - # Secrecy. - else_if = { - limit = { scope:agent_focus_secrecy ?= yes } - begin_scheme_with_agents_effect = { - SCHEME_TYPE = abduct - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Secrecy. - AGENT_1 = agent_lookout - AGENT_2 = agent_lookout - AGENT_3 = agent_decoy - # Success. - AGENT_4 = agent_thug - # Speed. - AGENT_5 = agent_footpad - } - } - # Balanced. - else = { - begin_scheme_with_agents_effect = { - SCHEME_TYPE = abduct - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - # Success. - AGENT_1 = agent_thug - AGENT_2 = agent_muscle - # Speed. - AGENT_3 = agent_footpad - AGENT_4 = agent_infiltrator - # Secrecy. - AGENT_5 = agent_lookout - } - } - } - } - } - - ai_targets = { ai_recipients = liege } - ai_frequency_by_tier = { - barony = 0 - county = 60 - duchy = 60 - kingdom = 60 - empire = 0 - hegemony = 0 - } - - ai_potential = { - liege ?= { has_diarchy_active_parameter = diarchy_is_co_rulership } - is_diarch = yes - is_ruler = yes - ai_diarch_would_maim_execute_superior_if_got_chance_trigger = { LIEGE = liege } - } - - ai_will_do = { - # They shouldn't always do this. - base = -100 - - # Obvious factor. - opinion_modifier = { - opinion_target = scope:recipient - multiplier = -1 - } - ai_value_modifier = { ai_honor = -1 } - # Traits. - ## Disloyal. - modifier = { - add = 100 - has_trait = disloyal - } - ## Ambitious. - modifier = { - add = 75 - has_trait = ambitious - } - ## Arrogant. - modifier = { - add = 25 - has_trait = arrogant - } - ## Fickle. - modifier = { - add = 25 - has_trait = fickle - } - ## Callous. - modifier = { - add = 25 - has_trait = callous - } - ## Compassionate. - modifier = { - add = -50 - has_trait = compassionate - } - ## Humble. - modifier = { - add = -50 - has_trait = humble - } - ## Content. - modifier = { - add = -100 - has_trait = content - } - ## Loyal. - modifier = { - add = -300 - has_trait = loyal - } - # Time as a diarch — the longer they've been waiting, the more eager they are. - modifier = { - add = { - value = years_as_diarch - multiply = 2 - } - always = yes - } - } - - auto_accept = yes -} - -end_scheme = { - is_shown = { - #debug_only = yes - } - special_interaction = remove_scheme_interaction - use_diplomatic_range = no - hidden = yes - on_accept = { - scope:scheme = { - end_scheme = yes - } - } - - auto_accept = yes - ignores_pending_interaction_block = yes -} - -befriend_interaction = { - icon = icon_scheme_befriend - category = interaction_category_friendly - - interface_priority = 90 - scheme = befriend - - send_name = START_SCHEME - ignores_pending_interaction_block = yes - - ai_targets = { - ai_recipients = liege - ai_recipients = neighboring_rulers - } - ai_targets = { - ai_recipients = vassals - ai_recipients = peer_vassals - chance = 0.25 - } - - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 24 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - is_shown = { - scope:actor = { - can_use_befriend_scheme_trigger = { TARGET = scope:recipient } - } - scope:actor != scope:recipient - } - - is_valid_showing_failures_only = { - scope:actor = { - can_start_scheme = { - type = befriend - target_character = scope:recipient - } - } - #limit range for landless adventurers - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - cost = { - prestige = { - value = 0 - if = { - limit = { - scope:actor = { - government_has_flag = government_is_nomadic - NOR = { - has_perk = befriend_perk - AND = { - exists = dynasty - dynasty = { - has_dynasty_perk = fp1_adventure_legacy_5 - } - target_is_vassal_or_below = scope:recipient - } - culture = { has_cultural_parameter = automatic_befriend_access } - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = struggle_unlocks_befriend_schemes_for_everyone - } - AND = { - government_has_flag = government_is_clan - is_in_same_clan_as_trigger = { CHARACTER = scope:recipient } - house = { has_house_unity_stage = harmonious } - } - } - } - } - add = scope:actor.minor_prestige_value - if = { - limit = { - scope:recipient = { - is_vassal_of = scope:actor - } - } - add = scope:actor.miniscule_prestige_value - } - if = { - limit = { - scope:actor = { - is_vassal_of = scope:recipient - } - } - add = scope:actor.minor_prestige_value - } - } - } - } - - desc = { - triggered_desc = { - trigger = { - scope:actor = { - NOT = { is_at_war_with = scope:recipient } - can_start_scheme = { - type = befriend - target_character = scope:recipient - } - } - } - desc = scheme_interaction_tt_befriend_approved - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = befriend_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - begin_scheme_basic_effect = { - SCHEME_TYPE = befriend - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - } - } - } - if = { #Stubborness effect - limit = { - scope:recipient = { - has_trait = stubborn - } - } - scope:actor = { - random_scheme = { - type = befriend - limit = { - scheme_target_character = scope:recipient - } - scheme_target_character = { - random_list = { - 20 = { - set_variable = { - name = recipient_stubborness_scheme - value = -5 - } - } - 20 = { - set_variable = { - name = recipient_stubborness_scheme - value = -10 - } - } - 20 = { - set_variable = { - name = recipient_stubborness_scheme - value = -15 - } - } - 20 = { - set_variable = { - name = recipient_stubborness_scheme - value = -20 - } - } - 20 = { - set_variable = { - name = recipient_stubborness_scheme - value = -25 - } - } - } - } - } - } - } - } - - ai_potential = { - OR = { - has_perk = befriend_perk # Unlocked by the Befriend Perk - dynasty ?= { - has_dynasty_perk = fp1_adventure_legacy_5 - } - culture = { has_cultural_parameter = automatic_befriend_access } - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = struggle_unlocks_befriend_schemes_for_everyone - } - house ?= { has_house_power_parameter = aspect_of_serenity } - } - NOR = { - has_trait = shy - has_trait = callous - any_scheme = { - OR = { - scheme_type = befriend - #scheme_type = sway # We allow the AI to override Sway with Befriend - scheme_type = seduce - scheme_type = courting - scheme_type = elope - scheme_type = learn_language - scheme_type = teach_governor - } - } - AND = { # No one cares about City barons - is_lowborn = yes - primary_title.tier <= tier_barony - } - } - } - - auto_accept = yes - - ai_will_do = { - base = 50 - - modifier = { # Try to befriend those who you might want to vassalize - add = 30 - scope:actor = { - top_liege = this - primary_title.tier >= tier_county - NOT = { - any_targeting_faction = { - exists = yes - OR = { - faction_is_type = liberty_faction - faction_is_type = claimant_faction - faction_is_type = independence_faction - } - } - } - } - scope:recipient = { - top_liege = this - is_playable_character = yes - primary_title.tier < scope:actor.primary_title.tier - OR = { - faith.religion = scope:actor.faith.religion - AND = { - faith = { - has_doctrine = doctrine_pluralism_pluralistic - } - scope:actor.faith = { - has_doctrine = doctrine_pluralism_pluralistic - } - } - } - } - } - - modifier = { - factor = 0.1 - scope:actor = { - opinion = { - target = scope:recipient - value < -50 - } - } - } - - modifier = { - factor = 0.1 - scope:recipient = { - opinion = { - target = scope:actor - value > 50 - } - } - } - - modifier = { - factor = 0.5 - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value < 2 - } - } - } - - modifier = { - factor = 0.1 - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value < 1 - } - } - } - - # Struggle - modifier = { - scope:actor = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_friend_lover_with_character - } - } - scope:recipient = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_friend_lover_with_character - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - trait_compatibility = { - target = scope:recipient - value >= low_positive_trait_compatibility - } - } - scope:recipient = { - has_character_flag = agenda_towards_deescalation - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - trait_compatibility = { - target = scope:recipient - value >= low_positive_trait_compatibility - } - } - } - add = 50 - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_escalation - } - } - add = -200 - } - else = { - add = 10 - } - } - } - - modifier = { - factor = 25 - OR = { - has_focus = diplomacy_family_focus - house ?= { has_house_power_parameter = aspect_of_serenity } - } - } - - modifier = { - factor = 2 - scope:recipient.liege = scope:actor - } - - modifier = { - factor = 0.5 - scope:recipient.faith != scope:actor.faith - } - - modifier = { - factor = 0.25 - scope:actor = { - is_ruler = yes - tier_difference = { - target = scope:recipient - value > 2 - } - } - } - modifier = { - factor = 0.35 - scope:actor = { - has_personality_malicious_trigger = yes - } - } - modifier = { - factor = 2 - scope:actor = { - OR = { - has_trait = gregarious - has_trait = diplomat - has_trait = family_first - has_trait = august - } - } - } - modifier = { - factor = 1.5 - scope:actor = { - num_of_relation_friend < 3 - } - } - modifier = { #Better to Court rather than befriend. - factor = 0.25 - scope:actor = { - is_spouse_of = scope:recipient - } - } - modifier = { - factor = 0.75 - scope:recipient = { - is_child_of = scope:actor - } - } - modifier = { - factor = 2 - scope:actor = { - is_child_of = scope:recipient - } - } - modifier = { - factor = 2 - scope:actor = { #Friends of friends - any_relation = { - type = friend - any_relation = { - type = friend - this = scope:recipient - } - } - } - } - modifier = { - factor = 0.25 - scope:recipient = { - any_claim = { - this = scope:actor.primary_title - } - } - } - } -} - -seduce_interaction = { - icon = icon_scheme_seduce - category = interaction_category_friendly - interface_priority = 45 - scheme = seduce - common_interaction = no - - send_name = START_SCHEME - ignores_pending_interaction_block = yes - - ai_targets = { - ai_recipients = family - max = 2 - } - ai_targets = { - ai_recipients = guests - ai_recipients = courtiers - max = 10 - } - ai_targets = { - ai_recipients = neighboring_rulers - max = 5 - } - ai_targets = { - ai_recipients = vassals - max = 5 - } - ai_targets = { - ai_recipients = peer_vassals - max = 5 - } - - # We don't want this to grow ludicrously large in big realms - ai_targets = { - ai_recipients = realm_characters - max = 10 - } - - ai_target_quick_trigger = { - adult = yes - attracted_to_owner = yes - owner_attracted = yes - } - - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 36 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - is_shown = { - scope:actor != scope:recipient - scope:recipient = { is_adult = yes } - scope:actor = { is_adult = yes } - - # Avoid seducing lowborn nobodies in foreign courts - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - } - NOT = { - scope:recipient = { - is_lowborn = yes - is_playable_character = no - NOR = { - is_courtier_of = scope:actor - is_foreign_court_or_pool_guest_of = scope:actor - } - } - } - } - scope:actor = { # Some early filtering for the AI to focus it towards fruitful seductions - trigger_if = { - limit = { - is_ai = yes - } - trigger_if = { # Deviants will seduce anyone - limit = { - is_deviant_trigger = yes - } - } - trigger_else_if = { # It's always fine to seduce your spouse - limit = { - scope:recipient = { is_consort_of = scope:actor } - } - } - trigger_else_if = { # If the target is a close family member, only certain AI's will seduce much older members - limit = { - ai_rationality <= -50 - is_close_family_of = scope:recipient - OR = { - has_trait = lustful - has_trait = rakish - is_incestuous_trigger = yes - has_opinion_modifier = { - modifier = childhood_crush - target = scope:recipient - } - } - } - scope:recipient.age <= scope:actor.age_plus_25 - } - trigger_else_if = { # Lustful/seduction-focused characters have a wider range - limit = { - OR = { - has_trait = lustful - has_trait = rakish - has_focus = intrigue_temptation_focus - } - } - OR = { - scope:recipient.age <= scope:actor.age_plus_10 - AND = { # Seducing your vassals/liege/realm priest is good realm management, AND drama! - has_focus = intrigue_temptation_focus - OR = { - scope:recipient = { - is_vassal_of = scope:actor - } - liege ?= scope:recipient - - scope:recipient = { - is_theocratic_lessee = yes - is_courtier_of = scope:actor - } - } - } - } - trigger_if = { # The AI should focus on bastard-producing seductions, it's more dramatic - limit = { - is_male = yes - scope:recipient = { - is_female = yes - } - } - scope:recipient.age <= scope:recipient.marriage_female_fertility_cutoff_age_value - } - } - trigger_else_if = { # Male characters with no children that are seducing women want to produce bastards - limit = { - is_male = yes - scope:recipient = { is_female = yes } - any_child = { - count <= 1 - } - } - scope:recipient.age <= scope:actor.age_plus_5 - scope:recipient.age <= scope:recipient.marriage_female_fertility_cutoff_age_value - } - trigger_else = { # Otherwise, try to not seduce with *too* large an age gap - scope:recipient.age <= scope:actor.age_plus_5 - scope:recipient.age >= scope:actor.age_minus_10 - } - } - trigger_else = { - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - NOT = { is_at_war_with = scope:recipient } - can_start_scheme = { - type = seduce - target_character = scope:recipient - } - } - trigger_if = { - limit = { - scope:recipient = { exists = primary_spouse } - } - scope:recipient = { primary_spouse = { NOT = { has_strong_hook = scope:actor } } } - } - #limit range for landless adventurers - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - desc = scheme_interaction_tt_seduce_approved - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = seduce_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - begin_scheme_basic_effect = { - SCHEME_TYPE = seduce - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - } - - seduce_interaction_stress_effect = yes - } - } - scope:actor = { - if = { - limit = { - NOT = { is_attracted_to_gender_of = scope:recipient } - } - custom_tooltip = scheme_interaction_tt_wrong_gender_no_lover - } - } - } - - ai_potential = { - is_adult = yes - NOR = { - has_trait = celibate - has_trait = chaste - scheme_generic_ai_blocker_trigger = yes - primary_title = { - is_mercenary_company = yes - } - AND = { # No one cares about City barons - is_lowborn = yes - primary_title.tier <= tier_barony - } - } - might_cheat_on_every_partner_trigger = yes - } - - auto_accept = yes - - ai_will_do = { - base = 5 - - modifier = { - add = -50 - scope:actor = { - primary_spouse ?= { has_strong_hook = scope:actor } - } - } - - modifier = { - add = 50 - scope:actor = { - has_focus = intrigue_temptation_focus - } - } - - modifier = { - add = 50 - scope:actor = { - has_opinion_modifier = { - modifier = childhood_crush - target = scope:recipient - } - } - } - - modifier = { - add = 25 - exists = scope:actor.dynasty - scope:actor.dynasty = { - has_dynasty_perk = fp1_adventure_legacy_2 - } - } - - modifier = { # Focus on befriending if that's the path you've chosen - add = -50 - scope:actor = { - has_perk = befriend_perk - } - } - - modifier = { # Non-lustful clergy tend to not seduce - add = -25 - scope:actor = { - is_clergy = yes - faith = { - NOT = { has_doctrine_parameter = clergy_can_marry } - } - NOR = { - has_trait = lustful - has_focus = intrigue_temptation_focus - } - } - } - - modifier = { # Seducing your unmarried courtiers is good for producing bastards, which the AI will want to do if they have few heirs - add = 10 - scope:actor = { - any_child = { - count <= 1 - } - } - scope:recipient = { - is_married = no - fertility > low_fertility - OR = { - is_courtier_of = scope:actor - is_pool_guest_of = scope:actor - } - } - } - - modifier = { - add = 30 - scope:actor = { - has_trait = lustful - } - } - - modifier = { # ( ͡° ͜ʖ ͡°) - add = 50 - scope:actor = { - is_close_or_extended_family_of = scope:recipient - is_deviant_trigger = yes - } - scope:recipient = { - OR = { - is_deviant_trigger = yes - has_trait = lustful - } - } - } - - modifier = { - add = 25 - scope:actor = { - is_close_or_extended_family_of = scope:recipient - is_deviant_trigger = yes - } - scope:recipient = { - NOR = { - is_deviant_trigger = yes - has_trait = lustful - } - } - } - - modifier = { - add = 50 - scope:actor = { - is_close_or_extended_family_of = scope:recipient - faith = { has_doctrine = tenet_divine_marriage } - } - } - - modifier = { # Seducing the spouse of your rival is good drama... - add = 25 - scope:recipient = { - primary_spouse ?= { - OR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - } - } - } - } - - modifier = { - add = -20 - scope:actor = { - NOR = { - has_trait = lustful - has_trait = arbitrary - is_deviant_trigger = yes - faith = { has_doctrine = tenet_divine_marriage } - has_perk = subtle_desire_perk - } - } - scope:recipient = { - is_close_family_of = scope:actor - } - } - - modifier = { # Seducing someone's spouse is not a clever prospect for most characters, so lowering the attractiveness a bit - add = -20 - scope:recipient = { - is_married = yes - primary_spouse != scope:actor - } - scope:actor = { - NOR = { - has_trait = lustful - has_focus = intrigue_temptation_focus - } - } - } - - modifier = { # Try to avoid agressive seduction unless you're geared for it - add = -10 - scope:actor = { - NOR = { - has_trait = lustful - has_focus = intrigue_temptation_focus - } - } - scope:recipient = { - is_lowborn = no - NOT = { is_pool_guest_of = scope:actor } - } - } - - # Struggle - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_friend_lover_with_character - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_friend_lover_with_character - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - trait_compatibility = { - target = scope:recipient - value >= low_positive_trait_compatibility - } - } - scope:recipient = { - has_character_flag = agenda_towards_deescalation - } - } - add = 50 - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_escalation - } - } - add = -200 - } - else = { - add = 5 - } - } - } - - modifier = { - factor = 1.25 - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value >= 1 - } - } - } - - modifier = { - factor = 1.5 - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value >= 2 - } - } - } - - modifier = { - factor = 2 - scope:recipient = { - number_of_personality_traits_in_common = { - target = scope:actor - value >= 3 - } - } - } - - modifier = { - factor = 1.5 - scope:recipient = { - is_playable_character = yes - } - } - - modifier = { # Target the player less aggressively - factor = 0.5 - scope:recipient = { - OR = { - is_ai = no - any_consort = { - is_ai = no - } - } - } - } - - modifier = { - factor = 1.25 - scope:recipient = { - OR = { - has_trait = lustful - has_trait = beauty_good - } - } - } - - modifier = { # Try to avoid 0% success chance - factor = { - value = 0.1 - if = { - limit = { - scope:recipient = { - opinion = { - target = scope:actor - value < -15 - } - } - } - value = 0 - } - } - scope:recipient = { - opinion = { - target = scope:actor - value < -5 - } - } - } - - modifier = { # Try to avoid 0% success chance - factor = 0.1 - scope:recipient = { - number_of_opposing_personality_traits = { - target = scope:actor - value >= 1 - } - } - } - - modifier = { - factor = 0.75 - scope:recipient = { - is_lowborn = yes - } - } - - modifier = { # Barons tend to not seduce anyone landed above them - factor = 0.1 - scope:actor = { - is_playable_character = yes - primary_title = { - tier = tier_barony - } - } - scope:recipient = { - OR = { - AND = { - is_playable_character = yes - primary_title = { - tier > tier_barony - } - } - any_spouse = { - is_playable_character = yes - primary_title = { - tier > tier_barony - } - } - } - } - } - - modifier = { - factor = 0.2 - scope:recipient = { - is_ai = yes - any_targeting_scheme = { - scheme_type = seduce - } - } - } - - modifier = { # - factor = 0.1 - scope:recipient = { - is_ai = yes - has_trait = chaste - } - } - - modifier = { - factor = 0 - scope:recipient = { - is_ai = yes - any_relation = { type = soulmate } - } - } - - modifier = { # Family Feud - add = 50 - scope:actor = { - house_has_feud_relation_with_trigger = { TARGET = scope:recipient } - } - } - } -} - -court_interaction = { - icon = icon_scheme_romance - category = interaction_category_friendly - - send_name = START_SCHEME - - interface_priority = 40 - scheme = courting - ignores_pending_interaction_block = yes - - ai_targets = { - ai_recipients = spouses - ai_recipients = neighboring_rulers - } - - ai_targets = { - ai_recipients = vassals - max = 5 - } - - ai_targets = { - ai_recipients = peer_vassals - max = 5 - } - - ai_targets = { - ai_recipients = family - max = 5 - } - - ai_targets = { - ai_recipients = realm_characters - max = 30 - } - - ai_target_quick_trigger = { - adult = yes - attracted_to_owner = yes - owner_attracted = yes - } - - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 36 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - is_shown = { - scope:recipient = { - is_adult = yes - is_attracted_to_gender_of = scope:actor - } - - scope:actor = { - this != scope:recipient - is_adult = yes - #Some asexuality handling - trigger_if = { - limit = { has_sexuality = asexual } - trigger_if = { - limit = { is_ai = yes } - always = no - } - trigger_else = { - scope:recipient = { is_consort_of = scope:actor } - } - } - # Some early filtering for the AI to focus it towards fruitful romance - trigger_if = { - limit = { is_ai = yes } - trigger_if = { # Deviants will romance anyone - limit = { is_deviant_trigger = yes } - } - trigger_else_if = { # It's always fine to romance your spouse - limit = { - scope:recipient = { is_consort_of = scope:actor } - } - } - trigger_else_if = { # If the target is a close family member, only certain AI's will romance much older members - limit = { - ai_rationality <= -50 - is_close_family_of = scope:recipient - OR = { - has_trait = lustful - has_trait = rakish - is_incestuous_trigger = yes - has_opinion_modifier = { - modifier = childhood_crush - target = scope:recipient - } - } - } - scope:recipient.age <= scope:actor.age_plus_25 - } - trigger_else_if = { # Lustful/seduction-focused characters have a wider range - limit = { - OR = { - has_trait = lustful - has_trait = rakish - has_focus = intrigue_temptation_focus - } - } - OR = { - scope:recipient.age <= scope:actor.age_plus_10 - AND = { # Romancing your vassals/liege/realm priest is good realm management, AND drama! - has_focus = intrigue_temptation_focus - OR = { - scope:recipient = { - is_vassal_of = scope:actor - } - liege ?= scope:recipient - - scope:recipient = { - is_theocratic_lessee = yes - is_courtier_of = scope:actor - } - } - } - } - trigger_if = { # The AI should focus on bastard-producing romances, it's more dramatic - limit = { - is_male = yes - scope:recipient = { - is_female = yes - } - } - scope:recipient.age <= scope:recipient.marriage_female_fertility_cutoff_age_value - } - } - trigger_else_if = { # Male characters with no children that are romancing women want to produce children - limit = { - is_male = yes - scope:recipient = { is_female = yes } - any_child = { - count <= 1 - } - } - scope:recipient.age <= scope:actor.age_plus_5 - scope:recipient.age <= scope:recipient.marriage_female_fertility_cutoff_age_value - } - trigger_else = { # Otherwise, try to not seduce with *too* large an age gap - scope:recipient.age <= scope:actor.age_plus_5 - scope:recipient.age >= scope:actor.age_minus_10 - } - } - trigger_else = { - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - NOT = { is_at_war_with = scope:recipient } - can_start_scheme = { - type = courting - target_character = scope:recipient - } - } - #limit range for landless adventurers - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - desc = scheme_interaction_tt_courtship_approved - - on_accept = { - scope:actor = { - # If you already have a soulmate, they get very mad - every_relation = { - type = soulmate - limit = { soulmate_relation_is_exclusive_trigger = yes } - - add_opinion = { - modifier = betrayed_our_promise - target = scope:actor - } - } - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = court_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - begin_scheme_basic_effect = { - SCHEME_TYPE = courting - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - } - - show_as_tooltip = { - # If you already have a soulmate, they get very mad - every_relation = { - type = soulmate - limit = { soulmate_relation_is_exclusive_trigger = yes } - - add_opinion = { - modifier = betrayed_our_promise - target = scope:actor - } - } - } - } - } - scope:recipient = { - if = { - limit = { - is_ai = no - } - add_character_flag = { - flag = courting_cooldown - years = 5 - } - } - } - } - - ai_potential = { - is_adult = yes - trigger_if = { - limit = { - NOR = { - culture = { - has_cultural_parameter = ai_romance_scheme_increase - } - AND = { - has_character_flag = agenda_towards_deescalation - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_best_friend_soulmate_with_very_important_character - } - } - } - } - ai_honor >= high_positive_ai_value - ai_compassion >= low_positive_ai_value - } - highest_held_title_tier > tier_barony - NOR = { - has_trait = celibate - has_trait = chaste - scheme_generic_ai_blocker_trigger = yes - AND = { # No one cared about City barons - is_lowborn = yes - primary_title.tier <= tier_barony - } - } - } - - auto_accept = yes - - ai_will_do = { - base = 0 - - - - # Struggle - modifier = { - scope:actor = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_best_friend_soulmate_with_very_important_character - } - } - scope:recipient = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_best_friend_soulmate_with_very_important_character - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - } - scope:recipient = { - has_character_flag = agenda_towards_deescalation - } - } - add = 25 - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_escalation - } - } - add = -200 - } - else = { - add = 5 - } - } - } - - modifier = { # Motivate AI's to use it on catalyst providers exclusively - add = -50 - scope:actor = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_best_friend_soulmate_with_very_important_character - } - } - scope:recipient = { - NOT = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - phase_has_catalyst = catalyst_became_best_friend_soulmate_with_very_important_character - } - } - } - } - - opinion_modifier = { - opinion_target = scope:recipient - multiplier = 0.4 - } - - compatibility_modifier = { - compatibility_target = scope:recipient - multiplier = 1 - max = court_scheme_max_compatability_value - } - - modifier = { - factor = 25 - culture = { - has_cultural_parameter = ai_romance_scheme_increase - } - } - - modifier = { - factor = 25 - has_focus = martial_chivalry_focus - } - - modifier = { - add = 50 - scope:actor = { - has_opinion_modifier = { - modifier = childhood_crush - target = scope:recipient - } - } - } - - modifier = { - add = -50 - scope:actor = { - is_close_family_of = scope:recipient - NOR = { - is_deviant_trigger = yes - has_trait = lustful - } - } - } - - modifier = { - factor = 3 - scope:recipient = { - OR = { - is_playable_character = yes - any_spouse = { - is_playable_character = yes - } - } - } - } - - modifier = { - factor = 1.25 - scope:recipient = { - has_trait = beauty_good - } - } - - modifier = { # Try to avoid 0% success chance - factor = { - value = 0.1 - if = { - limit = { - scope:recipient = { - opinion = { - target = scope:actor - value < -20 - } - } - } - value = 0 - } - } - scope:recipient = { - opinion = { - target = scope:actor - value < 0 - } - } - } - - modifier = { - factor = 0.2 - scope:recipient = { - is_ai = yes - any_targeting_scheme = { - scheme_type = courting - } - } - } - - modifier = { - factor = 0.1 - scope:recipient = { - any_relation = { type = soulmate } - } - } - - modifier = { - factor = 0.1 - scope:recipient = { - is_lowborn = yes - is_married = no - } - } - } -} - -sway_interaction = { - icon = icon_scheme_sway - category = interaction_category_friendly - common_interaction = yes - - send_name = START_SCHEME - - interface_priority = 75 - - scheme = sway - ignores_pending_interaction_block = yes - - ai_targets = { - ai_recipients = liege - ai_recipients = neighboring_rulers - max = 10 - } - ai_targets = { - ai_recipients = vassals - ai_recipients = peer_vassals - max = 10 - } - ai_targets = { - ai_recipients = councillors - } - ai_frequency_by_tier = { - barony = 0 - county = 120 - duchy = 24 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - is_shown = { - scope:actor != scope:recipient - } - - is_valid_showing_failures_only = { - scope:actor = { - can_start_scheme = { - type = sway - target_character = scope:recipient - } - } - #limit range for landless adventurers - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - desc = scheme_interaction_tt_sway_approved - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = sway_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - begin_scheme_basic_effect = { - SCHEME_TYPE = sway - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - } - } - } - } - - ai_potential = { - NOR = { - scheme_generic_ai_blocker_trigger = yes - primary_title = { - is_mercenary_company = yes - } - } - #Don't override Befriend with Sway? - trigger_if = { - limit = { - OR = { - AND = { - has_royal_court = yes - has_dlc_feature = royal_court - has_court_type = court_diplomatic - court_grandeur_current_level >= 10 - } - AND = { - dynasty ?= { has_dynasty_perk = glory_legacy_5 } - has_royal_court = yes - has_dlc_feature = royal_court - has_court_type = court_diplomatic - court_grandeur_current_level >= 10 - } - } - } - always = yes - } - trigger_else = { - NOT = { - any_scheme = { scheme_type = befriend } - } - } - } - - auto_accept = yes - - ai_will_do = { - base = 10 - - modifier = { # Prefer seducing if you've got the focus for it - add = -20 - scope:actor = { - has_focus = intrigue_temptation_focus - } - } - - modifier = { - add = 10 - scope:recipient = { - is_vassal_of = scope:actor - } - } - - modifier = { # Try to sway those who you might want to vassalize - add = 30 - scope:actor = { - top_liege = this - primary_title.tier >= tier_county - NOT = { - any_targeting_faction = { - exists = yes - OR = { - faction_is_type = liberty_faction - faction_is_type = claimant_faction - faction_is_type = independence_faction - } - } - } - } - scope:recipient = { - top_liege = this - is_playable_character = yes - primary_title.tier < scope:actor.primary_title.tier - OR = { - faith.religion = scope:actor.faith.religion - AND = { - faith = { - has_doctrine = doctrine_pluralism_pluralistic - } - scope:actor.faith = { - has_doctrine = doctrine_pluralism_pluralistic - } - } - } - } - } - - modifier = { - add = 10 - scope:recipient = { - joined_faction ?= { - faction_target = scope:actor - faction_is_type = liberty_faction - faction_is_at_war = no - } - } - } - - modifier = { - add = 20 - scope:recipient = { - joined_faction ?= { - faction_target = scope:actor - faction_is_type = claimant_faction - faction_is_at_war = no - } - } - } - - modifier = { - add = 30 - scope:recipient = { - joined_faction ?= { - faction_target = scope:actor - faction_is_type = independence_faction - faction_is_at_war = no - } - } - } - - modifier = { - factor = 2 - scope:recipient = { - is_a_faction_leader = yes - is_vassal_of = scope:actor - } - } - - modifier = { - factor = 3 - scope:recipient = { - is_vassal_of = scope:actor - opinion = { - target = scope:actor - value < 0 - } - } - } - - modifier = { - factor = 4 - scope:recipient = { - is_powerful_vassal_of = scope:actor - opinion = { - target = scope:actor - value < 0 - } - } - } - - modifier = { - factor = 0.5 - scope:recipient.faith != scope:actor.faith - } - - modifier = { - factor = 0.25 - scope:actor = { - is_ruler = yes - tier_difference = { - target = scope:recipient - value > 2 - } - } - scope:recipient = { - is_theocratic_lessee = no - } - } - modifier = { - factor = 0.5 - scope:actor = { - has_personality_malicious_trigger = yes - } - } - modifier = { - factor = 2 - scope:actor = { - OR = { - has_trait = gregarious - has_trait = diplomat - has_trait = family_first - has_trait = august - } - } - } - modifier = { - factor = 0.75 - scope:recipient = { - is_child_of = scope:actor - } - } - modifier = { - factor = 2 - scope:actor = { - is_child_of = scope:recipient - } - } - modifier = { - factor = 0.25 - scope:recipient = { - any_claim = { - this = scope:actor.primary_title - } - } - } - modifier = { # Butter up the realm priest - factor = 10 - scope:recipient = { - is_theocratic_lessee = yes - opinion = { - target = scope:actor - value <= 50 - } - } - } - modifier = { # Try to make your tax collectors like you - factor = 10 - scope:actor = { - government_has_flag = government_is_clan - } - scope:recipient = { - is_tax_collector = yes - opinion = { - target = scope:actor - value <= 50 - } - } - } - - modifier = { # No point in swaying if opinion is already at 100 - factor = 0 - scope:recipient = { - opinion = { - target = scope:actor - value >= 100 - } - } - } - - modifier = { # If they are unlanded, they have to be a realm priest or spymaster, or in the case for clan rulers, a tax collector - factor = 0 - scope:recipient = { - is_ruler = no - NOR = { - is_theocratic_lessee = yes - has_council_position = councillor_spymaster - AND = { - is_tax_collector = yes - scope:actor = { government_has_flag = government_is_clan } - } - } - } - } - - modifier = { # Ignore rivals unless forgiving - factor = 0 - scope:actor = { - has_relation_rival = scope:recipient - NOT = { has_trait = forgiving } - } - } - - modifier = { # Ignore non-councillor barons - factor = 0 - scope:recipient = { - primary_title.tier = tier_barony - is_councillor = no - } - } - - modifier = { # Ignore neighboring Kings+ - factor = 0 - scope:recipient = { - top_liege = this - is_playable_character = yes - primary_title.tier >= tier_kingdom - } - } - - modifier = { # Ignore neighboring Herders - factor = 0 - scope:recipient = { - government_has_flag = government_is_true_herder - } - } - } -} - -learn_language_interaction = { - icon = icon_scheme_learn_language - category = interaction_category_friendly - common_interaction = yes - - send_name = START_SCHEME - - interface_priority = 42 - scheme = learn_language - ignores_pending_interaction_block = yes - - ai_targets = { - ai_recipients = liege - ai_recipients = head_of_faith - ai_recipients = spouses - ai_recipients = scripted_relations - } - ai_targets = { - ai_recipients = vassals - ai_recipients = peer_vassals - max = 10 - } - ai_targets = { - ai_recipients = neighboring_rulers - max = 5 - } - ai_frequency_by_tier = { - barony = 0 - county = 72 - duchy = 48 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - is_shown = { - scope:actor = { - NOT = { - culture = { - has_same_culture_language = scope:recipient.culture - } - } - } - scope:actor != scope:recipient - } - - is_valid_showing_failures_only = { - scope:actor = { - can_start_scheme = { - type = learn_language - target_character = scope:recipient - } - } - #limit range for landless adventurers - trigger_if = { - limit = { - scope:actor = { - has_government = landless_adventurer_government - } - } - #Has to be used instead of diplo range checks in laamp to landed interactions - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - desc = scheme_interaction_tt_learn_language_approved - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = learn_language_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - begin_scheme_basic_effect = { - SCHEME_TYPE = learn_language - TARGET_TYPE = target_character - TARGET_SCOPE = scope:recipient - } - } - } - } - - ai_potential = { - primary_title.tier >= tier_county - NOR = { - has_trait = lazy - has_trait = paranoid - scheme_generic_ai_blocker_trigger = yes - primary_title = { - is_mercenary_company = yes - } - } - } - - auto_accept = yes - - ai_will_do = { - base = 0 - - # Struggle - modifier = { - scope:recipient = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_learned_new_language_important - } - } - scope:actor = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_learned_new_language_important - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_deescalation - } - } - add = 100 - } - else_if = { - limit = { - scope:actor = { - has_character_flag = agenda_towards_escalation - } - } - add = -50 - } - } - } - - modifier = { # Focus on befriending if that's the path you've chosen - add = -50 - scope:actor = { - has_perk = befriend_perk - } - } - - modifier = { # Prefer seducing if you've got the focus for it - add = -20 - scope:actor = { - has_focus = intrigue_temptation_focus - } - } - - modifier = { - add = 50 - scope:actor = { - has_perk = open_minded_perk - } - } - - modifier = { - add = 50 - scope:actor = { - culture = { - has_cultural_parameter = rulers_want_to_learn_languages_of_coreligionists - } - } - scope:actor.religion = scope:recipient.religion - } - - modifier = { - add = 25 - scope:actor = { - has_trait = curious - } - } - - modifier = { - add = 50 - scope:actor = { - is_adult = no - } - } - - modifier = { - add = 25 - scope:recipient = { - has_relation_friend = scope:actor - } - } - - modifier = { - add = 25 - scope:recipient = { - has_relation_lover = scope:actor - } - } - - modifier = { - add = 10 - scope:recipient = { - has_relation_potential_friend = scope:actor - } - } - - modifier = { - add = 5 - scope:recipient = { - is_close_family_of = scope:actor - is_ruler = yes - } - } - - modifier = { # Muslims want to learn arabic - add = 25 - scope:actor = { - faith.religion = religion:islam_religion - NOT = { - knows_language = language_arabic - } - } - scope:recipient = { - culture = { - has_cultural_pillar = language_arabic - } - } - } - - modifier = { # Catholic clergy/pious people want to learn latin - add = 50 - scope:actor = { - faith = faith:catholic - OR = { - has_trait = zealous - has_trait = humble - is_clergy = yes - } - NOT = { - knows_language = language_latin - } - } - scope:recipient = { - culture = { - has_cultural_pillar = language_latin - } - } - } - - modifier = { # Catholic clergy/pious people want to learn Italian - add = 50 - scope:actor = { - faith = faith:catholic - OR = { - has_trait = zealous - has_trait = humble - is_clergy = yes - } - NOT = { - knows_language = language_italian - } - } - scope:recipient = { - culture = { - has_cultural_pillar = language_italian - } - } - } - - modifier = { # Clergy/pious people want to learn their HoF's language - add = 50 - scope:actor = { - exists = faith.religious_head - OR = { - has_trait = zealous - is_clergy = yes - } - NOT = { knows_language_of_culture = scope:actor.faith.religious_head.culture } - } - scope:recipient = { knows_language_of_culture = scope:actor.faith.religious_head.culture } - } - - modifier = { # Coptic/Orthodox clergy/pious people want to learn greek - add = 50 - scope:actor = { - OR = { - faith = faith:orthodox - faith = faith:coptic - } - OR = { - has_trait = zealous - has_trait = humble - is_clergy = yes - } - NOT = { - knows_language = language_greek - } - } - scope:recipient = { - culture = { - has_cultural_pillar = language_greek - } - } - } - - modifier = { # Nestorian clergy/pious people want to learn aramaic - add = 50 - scope:actor = { - faith = faith:nestorian - OR = { - has_trait = zealous - has_trait = humble - is_clergy = yes - } - NOT = { - knows_language = language_aramaic - } - } - scope:recipient = { - culture = { - has_cultural_pillar = language_aramaic - } - } - } - - modifier = { - add = 20 - scope:actor = { - has_focus = diplomacy_foreign_affairs_focus - any_neighboring_realm_same_rank_owner = { - this = scope:recipient - } - } - } - - modifier = { - add = 20 - scope:actor = { - OR = { - has_focus = learning_scholarship_focus - has_focus = stewardship_duty_focus - } - } - scope:recipient = { - is_vassal_of = scope:actor - } - } - - modifier = { - add = 10 - exists = scope:actor.capital_county - scope:recipient.culture = { - has_same_culture_language = scope:actor.capital_county.culture - } - } - - modifier = { - add = 100 - scope:actor.culture = { - has_cultural_tradition = tradition_loyal_soldiers - } - top_liege != this - scope:actor = { - liege = scope:recipient - } - } - - modifier = { - factor = 2 - scope:recipient = { - is_powerful_vassal_of = scope:actor - } - } - - modifier = { - factor = 2 - scope:actor = { - learning >= 12 - } - } - - modifier = { - factor = 0.5 - scope:actor = { - learning <= 6 - } - } - - modifier = { - factor = 0 - - scope:actor.num_of_known_languages >= 5 - scope:actor = { - NOR = { - has_perk = pedagogy_perk - has_trait = intellect_good_2 - has_trait = intellect_good_3 - age < 25 - } - } - } - - modifier = { - factor = 0 - - scope:actor.num_of_known_languages >= language_soft_cap - } - } -} - diff --git a/common/character_interactions/00_tribal_interactions.txt b/common/character_interactions/00_tribal_interactions.txt deleted file mode 100644 index ed8efab9..00000000 --- a/common/character_interactions/00_tribal_interactions.txt +++ /dev/null @@ -1,948 +0,0 @@ -feudalize_holding_interaction = { - category = interaction_category_uncategorized - hidden = yes - special_interaction = feudalize_holding - - desc = feudalize_holding_interaction_desc - - target_type = title - target_filter = actor_domain_titles - - auto_accept = yes - - is_shown = { - scope:actor = { - this = scope:recipient - NOR = { - government_has_flag = government_is_tribal - government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder - } - } - } - - can_be_picked_title = { - scope:target = { - holder = scope:actor - is_capital_barony = no # we'll use the county in that case - trigger_if = { - limit = { tier <= tier_county } - title_province = { - OR = { - has_holding_type = tribal_holding - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - trigger_else = { - custom_description = { - text = "feudalize_holding_interaction_title_not_county_or_below" - always = no - } - } - } - } - - has_valid_target_showing_failures_only = { - scope:target = { - trigger_if = { - limit = { tier <= tier_county } - title_province = { - barony_controller = scope:actor - has_ongoing_construction = no - } - } - } - } - - cost = { - treasury_or_gold = { - scope:actor = { - if = { - limit = { - scope:target.county = { - has_variable = was_razed - } - } - add = { - value = 50 - desc = BASE - } - } - else_if = { - limit = { - scope:target.county = { - culture = scope:actor.culture - } - } - add = { - value = 200 - desc = BASE - } - } - else = { - add = { - value = feudalize_holding_interaction_cost - desc = BASE - } - } - if = { - limit = { # More expensive for admin to make barbarians civilized... - government_has_flag = government_is_administrative - } - add = { - value = feudalize_holding_interaction_cost - multiply = 0.25 - desc = has_admin_government - } - if = { - limit = { # Admin get a bonus for high bureaucracy levels - OR = { - has_realm_law = imperial_bureaucracy_2 - has_realm_law = imperial_bureaucracy_3 - } - } - subtract = { - value = feudalize_holding_interaction_cost - multiply = { - value = 0.1 - if = { - limit = { - has_realm_law = imperial_bureaucracy_3 - } - add = 0.15 - } - } - desc = imperial_bureaucracy - } - } - } - } - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = feudalize_holding_interaction_notification - - right_icon = scope:actor - - if = { - limit = { - scope:target.title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - if = { - limit = { - OR = { - scope:target.county.culture = scope:actor.culture - scope:target.county = { has_variable = was_razed } - } - } - } - else_if = { - limit = { - OR = { - government_has_flag = government_is_tribal - scope:target.county.culture = { has_same_culture_heritage = scope:actor.culture } - } - } - scope:target.county = { - add_county_modifier = { - modifier = mpo_feudalize_nomadic_land_modifier - years = 5 - } - } - } - else = { - scope:target.county = { - add_county_modifier = { - modifier = mpo_feudalize_nomadic_land_modifier - years = 30 - } - } - } - # SILK ROAD - scope:target = { - tgp_silk_road_feudalize_holding_effect = yes - } - } - - if = { - limit = { exists = scope:target.title_province } - scope:target.title_province = { - set_holding_type = castle_holding - } - } - - if = { - limit = { - scope:target = { - title_province = { - geographical_region = geographical_region:mpo_region_permafrost - } - } - } - if = { - limit = { - scope:target = { has_county_modifier = mpo_siberian_permafrost_modifier } - } - scope:target = { remove_county_modifier = mpo_siberian_permafrost_modifier } - } - else_if = { - limit = { - scope:target = { has_county_modifier = mpo_siberian_permafrost_modifier_bad } - } - scope:target = { remove_county_modifier = mpo_siberian_permafrost_modifier_bad } - } - } - } - } - } - - # Interaction frequency determined by code, do not change - ai_frequency = 0 - - # Used to determine which holding should be feudalized over another AND how important this AI goal is compared to others, like creating titles and constructing new holdings - ai_will_do = { - base = 1500 - } -} - -tribalize_holding_interaction = { - category = interaction_category_uncategorized - hidden = yes - special_interaction = tribalize_holding - - desc = tribalize_holding_interaction_desc - - target_type = title - target_filter = actor_domain_titles - - auto_accept = yes - - is_shown = { - scope:actor = { - this = scope:recipient - government_has_flag = government_is_tribal - } - } - - can_be_picked_title = { - scope:target = { - holder = scope:actor - is_capital_barony = no # we'll use the county in that case - trigger_if = { - limit = { tier <= tier_county } - title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - trigger_else = { - custom_description = { - text = "feudalize_holding_interaction_title_not_county_or_below" - always = no - } - } - } - } - - has_valid_target_showing_failures_only = { - scope:target = { - trigger_if = { - limit = { tier <= tier_county } - title_province = { - barony_controller = scope:actor - has_ongoing_construction = no - } - } - } - } - - cost = { - gold = { - scope:actor = { - if = { - limit = { - scope:target.county = { - has_variable = was_razed - } - } - add = { - value = 15 - desc = BASE - } - } - else = { - add = { - value = 50 - desc = BASE - } - } - } - } - prestige = { - scope:actor = { - if = { - limit = { - scope:target.county = { - has_variable = was_razed - } - } - add = { - value = 25 - desc = BASE - } - } - else_if = { - limit = { - scope:target.county.culture = scope:actor.culture - } - add = { - value = 50 - desc = BASE - } - } - else_if = { - limit = { - scope:target.county.culture = { has_same_culture_heritage = scope:actor.culture } - } - add = { - value = 100 - desc = BASE - } - } - else = { - add = { - value = 300 - desc = BASE - } - } - } - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = feudalize_holding_interaction_notification - - right_icon = scope:actor - - if = { - limit = { - OR = { - scope:target.county.culture = scope:actor.culture - scope:target.county = { - has_variable = was_razed - } - } - } - } - else = { - scope:target.county = { - add_county_modifier = { - modifier = mpo_feudalize_nomadic_land_modifier - years = 5 - } - } - } - - if = { - limit = { exists = scope:target.title_province } - scope:target.title_province = { - set_holding_type = tribal_holding - } - } - - if = { - limit = { - scope:target = { - title_province = { - geographical_region = geographical_region:mpo_region_permafrost - } - } - } - if = { - limit = { - scope:target = { has_county_modifier = mpo_siberian_permafrost_modifier } - } - scope:target = { remove_county_modifier = mpo_siberian_permafrost_modifier } - } - else_if = { - limit = { - scope:target = { has_county_modifier = mpo_siberian_permafrost_modifier_bad } - } - scope:target = { remove_county_modifier = mpo_siberian_permafrost_modifier_bad } - } - } - } - } - } - - # Interaction frequency determined by code, do not change - ai_frequency = 0 - - # Used to determine which holding should be feudalized over another AND how important this AI goal is compared to others, like creating titles and constructing new holdings - ai_will_do = { - base = 1500 - } -} - -support_feudalize_tribal_holding_interaction = { - category = interaction_category_vassal - icon = request_funding_interaction - - desc = support_feudalize_tribal_holding_interaction_desc - - target_type = title - target_filter = recipient_domain_titles - - auto_accept = yes - - is_shown = { - scope:actor = { - NOR = { - government_has_flag = government_is_tribal - government_has_flag = government_is_nomadic - } - } - scope:recipient = { - target_is_liege_or_above = scope:actor - NOR = { - government_has_flag = government_is_tribal - government_has_flag = government_is_nomadic - } - this != scope:actor - any_held_title = { - tier <= tier_county - title_province = { - OR = { - has_holding_type = tribal_holding - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - } - } - - can_be_picked_title = { - scope:target = { - is_capital_barony = no # we'll use the county in that case - - trigger_if = { - limit = { tier <= tier_county } - title_province = { - barony_controller = scope:recipient - has_ongoing_construction = no - } - } - } - } - - has_valid_target_showing_failures_only = { - scope:target = { - trigger_if = { - limit = { tier <= tier_county } - title_province = { - OR = { - has_holding_type = tribal_holding - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - trigger_else = { - custom_description = { - text = "feudalize_holding_interaction_title_not_county_or_below" - always = no - } - } - } - } - - cost = { - gold = { - value = 0 - scope:actor = { - if = { - limit = { - has_treasury = no - } - add = { - value = feudalize_holding_interaction_cost - desc = BASE - } - if = { - limit = { # More expensive for admin to make these barbarians civilized... - government_has_flag = government_is_administrative - } - add = { - value = feudalize_holding_interaction_cost - multiply = 0.25 - desc = has_admin_government - } - if = { - limit = { # Admin get a bonus for high bureaucracy levels - OR = { - has_realm_law = imperial_bureaucracy_2 - has_realm_law = imperial_bureaucracy_3 - } - } - subtract = { - value = feudalize_holding_interaction_cost - multiply = { - value = 0.1 - if = { - limit = { - has_realm_law = imperial_bureaucracy_3 - } - add = 0.15 - } - } - desc = imperial_bureaucracy - } - } - } - } - } - } - treasury = { - value = 0 - scope:actor = { - if = { - limit = { - has_treasury = yes - } - add = { - value = feudalize_holding_interaction_cost - desc = BASE - } - if = { - limit = { # More expensive for admin to make these barbarians civilized... - government_has_flag = government_is_administrative - } - add = { - value = feudalize_holding_interaction_cost - multiply = 0.25 - desc = has_admin_government - } - if = { - limit = { # Admin get a bonus for high bureaucracy levels - OR = { - has_realm_law = imperial_bureaucracy_2 - has_realm_law = imperial_bureaucracy_3 - } - } - subtract = { - value = feudalize_holding_interaction_cost - multiply = { - value = 0.1 - if = { - limit = { - has_realm_law = imperial_bureaucracy_3 - } - add = 0.15 - } - } - desc = imperial_bureaucracy - } - } - } - } - } - } - } - - is_highlighted = { - # Highlight the interaction if we have the gold to spare - scope:actor = { - gold >= { - value = feudalize_holding_interaction_cost - if = { - limit = { # More expensive for admin to convert these... Barbarians... - government_has_flag = government_is_administrative - } - multiply = { - value = 1.25 - desc = has_admin_government - } - } - } - } - } - - on_accept = { - scope:recipient = { - # Add some opinion to make it worthwhile - add_opinion = { - target = scope:actor - modifier = grateful_opinion - opinion = 30 - } - - if = { - limit = { - scope:target.title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - if = { - limit = { - OR = { - scope:target.culture = scope:recipient.culture - scope:target = { has_variable = was_razed } - } - } - } - else_if = { - limit = { - OR = { - government_has_flag = government_is_tribal - scope:target.culture = { has_same_culture_heritage = scope:recipient.culture } - } - } - scope:target = { - add_county_modifier = { - modifier = mpo_feudalize_nomadic_land_modifier - years = 5 - } - } - } - else = { - scope:target = { - add_county_modifier = { - modifier = mpo_feudalize_nomadic_land_modifier - years = 30 - } - } - } - # SILK ROAD - scope:target = { - tgp_silk_road_feudalize_holding_effect = yes - } - } - - # Notify actor and recipient - scope:actor = { - if = { #Temple Citadel - limit = { government_has_flag = government_is_mandala } - send_interface_toast = { - type = event_toast_effect_good - title = sanctified_holding_interaction_notification - - left_icon = scope:actor - right_icon = scope:target - - if = { - limit = { exists = scope:target.title_province } - scope:target.title_province = { - set_holding_type = temple_citadel_holding - } - } - mandala_piety_gain_effect = { PIETY_AMOUNT = massive_piety_gain } - add_legitimacy_effect = { LEGITIMACY = medium_legitimacy_gain } - } - hidden_effect = { - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_good - title = liege_sanctified_holding_interaction_notification - - left_icon = scope:actor - right_icon = scope:target - - show_as_tooltip = { - if = { - limit = { exists = scope:target.title_province } - scope:target.title_province = { - set_holding_type = temple_citadel_holding - } - } - } - } - } - } - } - else = { #Castle - send_interface_toast = { - type = event_toast_effect_good - title = feudalize_holding_interaction_notification - - left_icon = scope:actor - right_icon = scope:target - - if = { - limit = { exists = scope:target.title_province } - scope:target.title_province = { - set_holding_type = castle_holding - } - } - add_legitimacy_effect = { LEGITIMACY = medium_legitimacy_gain } - } - hidden_effect = { - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_good - title = liege_feudalized_holding_interaction_notification - - left_icon = scope:actor - right_icon = scope:target - - show_as_tooltip = { - if = { - limit = { exists = scope:target.title_province } - scope:target.title_province = { - set_holding_type = castle_holding - } - } - } - } - } - } - } - } - } - scope:actor = { - # If you are admin, you get some influence for your efforts - if = { - limit = { government_has_flag = government_is_administrative } - change_influence = medium_influence_gain - } - } - } - - # The AI doesn't check this very often - So if they have more important expenses, they will put their gold to better use first. - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 72 - kingdom = 72 - empire = 72 - hegemony = 72 - } - - ai_targets = { - ai_recipients = vassals - max = 10 - } - - ai_potential = { - # Some basic triggers - is_at_war = no - is_adult = yes - # The AI only does this if they have plenty of gold to spare - gold >= { value = feudalize_holding_interaction_cost multiply = 4 } - # Warring AI don't do this - They want to spend their gold on war! - ai_has_warlike_personality = no - # Piety and Legitimacy, you say... ? - ai_has_pious_builder_personality = yes - NOT = { has_variable = conqueror } - } - - ai_will_do = { - base = 25 - modifier = { - scope:actor = { ai_has_economical_boom_personality = yes } - add = 50 - } - modifier = { - scope:actor = { ai_has_pious_builder_personality = yes } - add = 100 - } - } -} - -turn_subject_into_mandala_interaction = { - category = interaction_category_vassal - icon = icon_scheme_coerce_tributary - - ai_maybe = yes - ai_min_reply_days = 4 - ai_max_reply_days = 9 - can_send_despite_rejection = yes - ai_accept_negotiation = yes - popup_on_receive = yes - common_interaction = no - - interface_priority = 4 - - ai_targets = { - ai_recipients = vassals - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - desc = turn_subject_into_mandala_interaction_desc - - is_shown = { - scope:actor = { government_has_flag = government_is_mandala } - scope:recipient = { - NOT = { government_has_flag = government_is_mandala } - is_ai = yes - highest_held_title_tier >= tier_county - is_landed = yes - is_ruler = yes - OR = { - liege = scope:actor - AND = { - overlord = scope:actor - scope:actor = { - has_realm_law_flag = can_convert_all_subjects_to_mandalas - } - } - } - } - } - - cooldown_against_recipient = { years = 10 } - - is_valid_showing_failures_only = { - #Dharmic Mandalas require Dharmic converts - #Reformed Pagan Mandalas require reformed faiths - scope:actor.religion = { - switch = { - trigger = is_in_family - rf_eastern = { - scope:recipient.religion = { - is_in_family = rf_eastern - } - } - rf_pagan = { - scope:recipient.faith = { NOT = { has_doctrine_parameter = unreformed } } - scope:recipient.religion = { - is_in_family = rf_pagan - } - } - } - } - scope:recipient = { - NOT = { has_strong_hook = scope:actor } - is_at_war = no - } - scope:actor = { is_at_war = no } - custom_tooltip = { - text = cannot_take_overt_hostile_actions_against_diarch.tt - NOT = { scope:recipient ?= scope:actor.diarch } - } - custom_tooltip = { - text = head_of_faith_unable_to_change_government_desc - NOT = { - scope:recipient = { faith.religious_head ?= this } - } - } - } - - #Spend piety - send_option = { - flag = piety - is_valid = { - scope:actor.piety >= piety_bribe_value - } - localization = PAY_PIETY - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.piety >= piety_bribe_value } - desc = SCHEME_AGENT_PIETY_VALID - } - } - } - #Use hook - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - - on_send = { - scope:recipient = { - primary_title = { save_scope_as = demanded_mandala } - trigger_event = { - id = tgp_east_asia_interaction_events.1002 - days = 5 - } - } - } - - on_accept = { - show_as_tooltip = { - change_to_mandala_interaction_effect = yes - } - } - - on_decline = { - scope:recipient = { custom_tooltip = demand_mandala_interaction_vassal_refuses } - } - - ai_potential = { - government_has_flag = government_is_mandala - is_adult = yes - } - - ai_will_do = { - base = 100 - modifier = { - factor = 0 - scope:recipient = { highest_held_title_tier >= tier_county } - gold >= 300 - } - modifier = { - factor = 0 - scope:recipient = { highest_held_title_tier >= tier_duchy } - gold >= 600 - } - modifier = { - factor = 0 - scope:recipient = { highest_held_title_tier >= tier_kingdom } - gold >= 2000 - } - } - - ai_accept = { - base = -50 - turn_subject_into_mandala_acceptance_modifier = yes - } -} - diff --git a/common/character_interactions/00_tributary_interactions.txt b/common/character_interactions/00_tributary_interactions.txt deleted file mode 100644 index d926656f..00000000 --- a/common/character_interactions/00_tributary_interactions.txt +++ /dev/null @@ -1,6068 +0,0 @@ -#Interactions relating to tributary relationship management - -### Become Tributary - bilateral -# actor = offerer / potential tributary -# recipient = receiver / potential suzerain - -become_tributary_interaction = { - category = interaction_category_vassal - common_interaction = no - icon = become_tributary_interaction - - desc = become_tributary_interaction_desc - - is_shown = { - scope:actor = { - trigger_if = { - limit = { is_ai = yes } - current_military_strength < scope:recipient.one_and_a_half_times_current_military_strength - primary_title.tier < scope:recipient.primary_title.tier - } - } - scope:recipient = { - is_independent_ruler = yes # while it's possible for tributaries to have their own tributaries, it should not be possible to create a tributary relationship with a non-independent ruler - NOR = { - this = scope:actor - this = scope:actor.suzerain - top_suzerain = scope:actor - } - can_have_tributaries_trigger = yes - } - } - - is_valid_showing_failures_only = { - #These triggers need to match the Tribute Mission Decision - trigger_if = { - limit = { - scope:recipient = { primary_title.tier = tier_hegemony } - } - custom_tooltip = { - text = become_tributary_interaction_hegemony_not_neighbor_tt - scope:actor = { - OR = { - is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_china } - is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_roman_empire } - is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_eastern_roman_empire } - is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_dar_al_islam } - is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_india } - } - } - } - } - #Mandalas can into Mandalas and Tributaries - trigger_if = { - limit = { - scope:recipient = { government_has_flag = government_is_mandala } - scope:actor = { - OR = { - government_has_flag = government_is_tribal - government_has_flag = government_is_mandala - } - } - } - always = yes - } - #Rulers who aren't Mandala or Tribal should really only be interested if you're big enough - trigger_else = { - custom_tooltip = { - text = offer_tributarization_interaction_aibehavior_not_higher_rank - scope:recipient.highest_held_title_tier >= scope:actor.highest_held_title_tier - } - } - scope:actor = { - is_physically_able = yes - is_travelling = no - NOT = { exists = involved_activity } - is_confederation_member = no - is_at_war = no - } - trigger_if = { - limit = { scope:recipient = title:h_china.holder } - scope:actor = { - custom_tooltip = { - text = neighbor_is_china - is_tributary = no - is_independent_ruler = yes - OR = { - has_variable = wants_to_become_tributary_of_china - any_neighboring_and_across_water_top_liege_realm_owner = { - primary_title = title:h_china - } - } - } - } - } - } - - needs_confirmation = { - scope:recipient = { highest_held_title_tier < tier_hegemony } # acknowledging a hegemon requires a tribute mission; open the decision UI instead of confirming acceptance - } - - greeting = positive - notification_text = BECOME_TRIBUTARY_INTERACTION_NOTIFICATION - - # Low starting obligations - send_option = { - flag = low_obligations - localization = low_tributary_obligations - } - - # Medium starting obligations - send_option = { - flag = normal_obligations - localization = normal_tributary_obligations - starts_enabled = { always = yes } - } - - # High starting obligations - send_option = { - flag = high_obligations - localization = high_tributary_obligations - } - - send_options_exclusive = yes - - on_send = { - if = { - limit = { scope:recipient = { highest_held_title_tier >= tier_hegemony } } - if = { - limit = { scope:recipient.primary_title = title:h_china } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_china - player = scope:actor - } - } - else_if = { - limit = { scope:recipient.primary_title = title:h_roman_empire } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_roman_empire - player = scope:actor - } - } - else_if = { - limit = { scope:recipient.primary_title = title:h_eastern_roman_empire } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_eastern_roman_empire - player = scope:actor - } - } - else_if = { - limit = { scope:recipient.primary_title = title:h_dar_al_islam } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_dar_al_islam - player = scope:actor - } - } - else_if = { - limit = { scope:recipient.primary_title = title:h_india } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_india - player = scope:actor - } - } - } - } - - on_accept = { - if = { - limit = { scope:recipient = { highest_held_title_tier < tier_hegemony } } - scope:actor = { - if = { - limit = { is_tributary = yes } - mandala_end_tributary_with_notification_effect = yes - } - } - start_tributary_interaction_effect = { - TRIBUTARY = scope:actor - SUZERAIN = scope:recipient - } - scope:actor = { - trigger_event = char_interaction.0360 - } - scope:recipient = { - if = { - limit = { scope:high_obligations = yes } - add_opinion = { - modifier = tributary_volunteered_opinion - target = scope:actor - opinion = 20 - } - } - else_if = { - limit = { scope:normal_obligations = yes } - add_opinion = { - modifier = tributary_volunteered_opinion - target = scope:actor - } - } - - consume_all_criminal_reasons_effect = { - LIEGE = scope:recipient - CRIMINAL = scope:actor - } - } - } - else = {} # Do nothing if the recipient is hegemony-tier or higher; these require a tribute mission to establish - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0361 - } - } - - is_available = { - NOT = { government_has_flag = cannot_be_vassal_or_liege } - top_liege = this # You have to be independent - This check exists to prevent a lot of edge-cases where you can change liege - is_confederation_member = no - } - - ai_targets = { - ai_recipients = neighboring_rulers_including_tributary_borders - max = 5 - } - - ai_targets = { - ai_recipients = neighboring_top_overlords_connected_by_land - } - - # this might appear fairly frequent but is necessary in order to ensure AI can respond to sudden threats on their borders - ai_frequency_by_tier = { - barony = 0 - county = 6 - duchy = 6 - kingdom = 0 - empire = 0 - hegemony = 0 - } - - force_notification = yes - - ai_will_do = { - base = -50 - #MINOR MODIFIERS - ai_military_threat_modifier_with_cbs = { - SENDER = scope:actor - RECEIVER = scope:recipient - MULTIPLIER = 1 - } - #Obedience - modifier = { - is_obedient_to = scope:recipient - add = 40 - desc = obedient_interaction_reason - } - # Rivalry modifier - modifier = { - desc = offer_vassalization_interaction_aibehavior_rival_tt - trigger = { - scope:actor = { - has_relation_rival = scope:recipient - NOT = { has_relation_nemesis = scope:recipient } - } - } - add = -10 - } - # Nemesis modifier - modifier = { - desc = offer_vassalization_interaction_aibehavior_nemesis_tt - trigger = { - scope:actor = { - has_relation_nemesis = scope:recipient - } - } - add = -100 - } - # Different faith, no pluralism - modifier = { - desc = offer_vassalization_interaction_aibehavior_differentfaith_tt - trigger = { - scope:actor = { - NOR = { # Of two different faiths AND the potential vassal's faith is not pluralistic. - faith = scope:recipient.faith - faith = { has_doctrine = doctrine_pluralism_pluralistic } - } - } - } - add = { - value = -25 - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_hostile_level - } - } - } - add = -10 - } - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_evil_level - } - } - } - add = -25 - } - } - } - # Cultural Acceptance - modifier = { - scope:actor = { - NOT = { # cultural condition below doesn't have to apply if both actor and recipient have nomadic_philosophy - has_trait = nomadic_philosophy - scope:recipient = { has_trait = nomadic_philosophy } - } - NOT = { has_same_culture_as = scope:recipient } - culture = { - cultural_acceptance = { target = scope:recipient.culture value < 50 } - } - } - add = { - add = -10 - if = { - limit = { scope:actor.culture = { has_cultural_pillar = ethos_bellicose } } - add = -10 - } - } - desc = cultural_acceptance_interaction_reason - } - # Same language - modifier = { - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - ### MANDALA ### - #Added threshold for Mandalas who already are Tributaries - modifier = { - scope:recipient = { is_tributary = yes } - NOT = { scope:recipient.suzerain = scope:actor } - scope:recipient.suzerain = { primary_title.tier = tier_duchy } - add = -25 - desc = already_tributary_threshold - } - modifier = { - scope:recipient = { is_tributary = yes } - NOT = { scope:recipient.suzerain = scope:actor } - scope:recipient.suzerain = { primary_title.tier = tier_kingdom } - add = -50 - desc = already_tributary_threshold - } - modifier = { - scope:recipient = { is_tributary = yes } - NOT = { scope:recipient.suzerain = scope:actor } - scope:recipient.suzerain = { primary_title.tier >= tier_empire } - add = -75 - desc = already_tributary_threshold - } - #A devaraja should never willingly _offer_ to become a tributary - modifier = { - scope:actor = { - government_has_flag = government_is_mandala - OR = { - has_unruined_mandala_capital_trigger = yes - has_mandala_aspect_trigger = yes - has_variable = mandala_godking - } - } - add = -1000 - } - #I am a Tribal! ... and you're a Mandala - modifier = { - scope:actor = { government_has_flag = government_is_tribal } - scope:recipient = { government_has_flag = government_is_mandala } - add = 30 - desc = actor_is_a_tribal_government - } - #Mandala Piety Level - this is only checked if you are not a Devaraja/haven't got a capital temple complex - Otherwise we use Radiance - mandala_devaraja_piety_level_add_weight_modifier = { DEVARAJA = scope:recipient } - #Recipient Radiance - Radiance Value x2 - modifier = { - scope:recipient = { has_unruined_mandala_capital_trigger = yes } - add = { - value = scope:recipient.mandala_radiance_value - multiply = 2 - } - desc = recipient_positive_mandala_radiance - } - #Tributary Realm Size - subject_realm_size_lose_weight_modifier = { - DEVARAJA = scope:actor - SUBJECT = scope:recipient - } - #Devaraja Mandala Capital - mandala_devaraja_capital_add_weight_modifier = { - DEVARAJA = scope:actor - TRIBUTARY = scope:recipient - } - #Are they independent but a neighboring Mandala more Radiant than you? - #We reduce acceptance by the radiance difference x2 - modifier = { - trigger_if = { - limit = { - scope:recipient = { has_unruined_mandala_capital_trigger = yes } - scope:actor = { - is_tributary = no - OR = { - government_has_flag = government_is_mandala - government_has_flag = government_is_tribal - } - } - } - scope:recipient = { - OR = { - any_neighboring_top_liege_realm_owner = { - has_unruined_mandala_capital_trigger = yes - government_has_flag = government_is_mandala - NOR = { - this = scope:recipient - this = scope:actor - } - save_temporary_scope_as = suzerain_comparison - } - any_neighboring_top_suzerain_realm_owner = { - has_unruined_mandala_capital_trigger = yes - government_has_flag = government_is_mandala - NOR = { - this = scope:recipient - this = scope:actor - } - save_temporary_scope_as = suzerain_comparison - } - } - } - always = yes - } - trigger_else = { always = no } - add = { - #Double it as we would with your own radiance impact above and reduce acceptance by that value - value = { - value = scope:suzerain_comparison.mandala_radiance_value - multiply = 2 - } - multiply = -1 - } - desc = other_devaraja_radiance - } - #Prosperity Decree - modifier = { - desc = is_prosperity_mandala_tributary - scope:actor = { - is_tributary = yes - suzerain = { has_realm_law_flag = tributaries_less_likely_to_break_free } - } - add = 15 - } - #SEA legacy - modifier = { - desc = tgp_sea_legacy_2_modifier_desc - scope:recipient = { - dynasty ?= { - has_dynasty_perk = tgp_sea_legacy_2 - } - } - add = tgp_sea_legacy_tributary_acceptance_value - } - # I am higher rank than you - modifier = { - desc = tributary_interaction_aibehavior_recipient_tier_tt - trigger = { - scope:actor = { - highest_held_title_tier > scope:recipient.highest_held_title_tier - } - } - add = { - value = scope:actor.highest_held_title_tier - subtract = scope:recipient.highest_held_title_tier - multiply = 50 - multiply = -1 - } - } - # Same Faith and Actor is a god King - modifier = { - desc = embrace_as_tributary_interaction_same_faith - scope:recipient = { - faith = scope:actor.faith - has_unruined_mandala_capital_trigger = yes - } - add = { - value = 10 - } - } - # Different faith, no pluralism. - modifier = { - desc = offer_vassalization_interaction_aibehavior_differentfaith_tt - trigger = { - scope:recipient = { - faith = { - NOR = { # Of two different faiths AND the potential tributary's faith is not pluralistic - this = scope:actor.faith - has_doctrine = doctrine_pluralism_pluralistic - } - } - } - } - add = { - value = -25 - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_hostile_level - } - } - } - add = -10 - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_evil_level - } - } - } - add = -25 - } - } - } - # Different religion Family - We prefer god kings to be vaguely within our own world view - modifier = { - desc = embrace_as_tributary_interaction_other_religion_family - scope:actor = { - NOT = { government_has_flag = government_is_wanua } - } - scope:recipient.faith.religion = { - switch = { - trigger = is_in_family - rf_pagan = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_pagan } } - } - rf_sinitic = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_sinitic } } - } - rf_eastern = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_eastern } } - } - rf_abrahamic = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_abrahamic } } - } - } - } - add = -25 - } - # They are not Mandalas nor Tribes - modifier = { - trigger = { - scope:recipient = { - NOR = { - government_has_flag = government_is_mandala - government_has_flag = government_is_tribal - } - } - } - add = { - value = -50 - #Would cause a lot of issues - if = { - limit = { - scope:recipient = { - OR = { - government_allows = administrative - government_is_japanese_trigger = yes - government_has_flag = government_is_nomadic - } - } - } - subtract = 950 #Some governments are especially unlikely to agree - } - #Not radiant enough - if = { - limit = { - scope:recipient = { - government_has_flag = government_is_mandala - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value <= 40 - } - } - subtract = 100 - } - } - } - #Far away - modifier = { - desc = offer_vassalization_interaction_aibehavior_remoterealm_tt - trigger = { - scope:recipient = { - NOT = { - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:actor - } - } - } - trigger_if = { #Islands we can get farther away - limit = { - scope:actor.capital_county = { is_coastal_county = yes } - any_sub_realm_county = { is_coastal_county = yes } - } - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value >= squared_distance_huge } } - } - trigger_else = { #Inland is harder - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value >= squared_distance_major } } - } - } - add = -250 - } - #Legitimacy - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -15 - scope:recipient = { - has_legitimacy_flag = slightly_reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -25 - scope:recipient = { - has_legitimacy_flag = reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -50 - scope:recipient = { - has_legitimacy_flag = very_reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -75 - scope:recipient = { - has_legitimacy_flag = massively_reduced_tributarization_acceptance - } - } - # HIGH LEGITIMACY - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 25 - scope:recipient = { - has_legitimacy_flag = increased_tributarization_acceptance - } - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 50 - scope:recipient = { - has_legitimacy_flag = very_increased_tributarization_acceptance - } - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 75 - scope:recipient = { - has_legitimacy_flag = extra_increased_tributarization_acceptance - } - } - # OPINION INFLUENCE - opinion_modifier = { # Compare Opinion modifier. - who = scope:actor - opinion_target = scope:recipient - multiplier = 1 - } - } - - ai_min_reply_days = 5 - ai_max_reply_days = 10 - - auto_accept = { scope:recipient = { highest_held_title_tier >= tier_hegemony } } # Hegemons always "accepts", but this only opens the Tribute Mission UI - - ai_accept = { - base = 50 - - modifier = { - desc = interaction_is_nomadic - scope:recipient = { - government_has_flag = government_is_nomadic - } - add = 100 - } - - modifier = { # Can't flee the conqueror this way - add = -1000 - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - scope:actor = { has_variable = conqueror } - } - - modifier = { # Wide difference in rank - desc = offer_vassalization_interaction_aibehavior_widetitletier_tt - trigger = { - scope:actor = { - tier_difference = { - target = scope:recipient - value > 1 - } - } - } - add = 20 - } - modifier = { # Distant Realm. - desc = offer_vassalization_interaction_aibehavior_distantrealm_tt - trigger = { - scope:actor = { - NOT = { - any_neighboring_top_liege_realm_owner = { this = scope:recipient } - } - } - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value < squared_distance_major } } - } - add = -15 - } - modifier = { # Remote Realm. - desc = offer_vassalization_interaction_aibehavior_remoterealm_tt - trigger = { - scope:actor = { - NOT = { - any_neighboring_top_liege_realm_owner = { this = scope:recipient } - } - } - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value >= squared_distance_major } } - } - add = -25 - } - - # MINOR - modifier = { # Rivalry modifier. - desc = offer_vassalization_interaction_aibehavior_rival_tt - trigger = { - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - add = -10 - } - modifier = { # Nemesis modifier. - desc = offer_vassalization_interaction_aibehavior_nemesis_tt - trigger = { - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - add = -100 - } - modifier = { # Same Dynasty modifier. - desc = offer_vassalization_interaction_aibehavior_dynasty_tt - trigger = { - scope:recipient = { - dynasty = scope:actor.dynasty - } - } - add = 10 - } - - # PERSONALITY - ai_value_modifier = { - ai_greed = 0.75 - min = 0 - } - - # OPINION INFLUENCE - opinion_modifier = { # Compare Opinion modifier. - trigger = { - NOT = { - scope:recipient = { government_has_flag = government_is_mandala } - } - } - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - } - - # CONTRACT OPTIONS - modifier = { - add = -25 - scope:low_obligations = yes - desc = CONTRACT_LOW_TRIBUTARY_TAXES_REASON - } - modifier = { - add = 25 - scope:high_obligations = yes - desc = CONTRACT_HIGH_TRIBUTARY_TAXES_REASON - } - } -} - -### Demand Tributary - bilateral -# actor = offerer / potential suzerain -# recipient = receiver / potential tributary - -demand_tributary_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - icon = demand_tributary_interaction - - desc = demand_tributary_interaction_desc - - is_shown = { - scope:actor = { - NOT = { - this = scope:recipient - top_suzerain = scope:recipient.top_suzerain # ensures the actor and recipient is not already in the same "suzerain bloc" - } - can_get_tributaries_peacefully_trigger = yes - - highest_held_title_tier < tier_hegemony # hegemonies get tributaries from exacting tribute - - #Mandala Embraces; not Demand - trigger_if = { - limit = { - scope:actor = { government_has_flag = government_is_mandala } - } - always = no - } - trigger_else = { can_get_tributaries_peacefully_trigger = yes } - #Should be neighboring to increase growth organically - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:recipient - } - trigger_if = { - limit = { - is_ai = yes - } - current_military_strength >= scope:recipient.one_and_a_half_times_current_military_strength - primary_title.tier >= scope:recipient.primary_title.tier - } - } - scope:recipient = { - highest_held_title_tier >= tier_county - is_independent_ruler = yes # target cannot be a vassal - NOR = { - government_has_flag = cannot_be_vassal_or_liege - government_has_flag = government_is_mandala - } - } - # Temujin cannot make Jamukha his subject once he leaves him - NOT = { - scope:actor = { - has_variable = had_mpo_temujin_flavor_0010 - var:had_mpo_temujin_flavor_0010 ?= scope:recipient - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - NOT = { has_truce = scope:actor } - is_physically_able = yes - is_travelling = no - NOT = { exists = involved_activity } - } - scope:recipient = { - is_tributary = no - is_at_war = no - custom_tooltip = { - text = demand_tributary_interaction_cooldown_active_tt - NOT = { - has_opinion_modifier = { - modifier = tributary_demanded_opinion - target = scope:actor - } - } - } - is_confederation_member = no - } - scope:actor = { - custom_tooltip = { - text = mpo_interaction_not_neighbouring_tt - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:recipient - } - } - } - } - - cost = { - prestige = minor_prestige_value - } - - greeting = positive - notification_text = DEMAND_TRIBUTARY_INTERACTION_NOTIFICATION - - on_accept = { - start_tributary_interaction_effect = { - TRIBUTARY = scope:recipient - SUZERAIN = scope:actor - } - scope:actor = { - trigger_event = char_interaction.0362 - } - scope:recipient = { - add_opinion = { - modifier = tributary_demanded_opinion # this opinion also acts as a built-in cooldown - target = scope:actor - } - } - consume_all_criminal_reasons_effect = { - LIEGE = scope:actor - CRIMINAL = scope:recipient - } - } - - on_decline = { - scope:recipient = { - add_opinion = { - modifier = tributary_demanded_opinion # this opinion also acts as a built-in cooldown - target = scope:actor - } - custom_tooltip = demand_tributary_interaction_cooldown_tt - } - scope:actor = { - trigger_event = char_interaction.0363 - if = { - limit = { highest_held_title_tier >= tier_hegemony } - add_legitimacy = -50 - } - } - } - - ai_maybe = yes - - ai_potential = { - highest_held_title_tier > 1 # at least a count-level ruler - is_independent_ruler = yes - - # Hegemonic Tributary AIs never proactively demand tributaries, they wait for offers instead - NOT = { highest_held_title_tier >= tier_hegemony } - } - - ai_targets = { - ai_recipients = neighboring_rulers_including_tributary_borders - max = 5 - } - - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 4 - kingdom = 4 - empire = 4 - hegemony = 4 - } - - force_notification = yes - - ai_will_do = { # AI will often do this to valid targets that aren't a military threat to them, especially if they're rich - base = 0 - - modifier = { - add = { - add = scope:recipient.gold - divide = 10 - max = 100 - } - desc = accumulated_wealth_reason - } - - ai_military_threat_modifier_with_cbs = { - SENDER = scope:actor - RECEIVER = scope:recipient - MULTIPLIER = -1 - } - - modifier = { - scope:recipient = { is_obedient_to = scope:actor } - add = 40 - desc = obedient_interaction_reason - } - - modifier = { # Generally don't try to tributarize those of higher rank than you - trigger = { - "scope:recipient.tier_difference(scope:actor)" > 1 - } - add = -20 - } - - modifier = { # Generally don't try to tributarize those of higher dominance than you - trigger = { - scope:recipient.dominance_value > scope:actor.dominance_value - } - add = -30 - } - - modifier = { # Remote Realm. - trigger = { - scope:actor = { - NOT = { - any_neighboring_top_liege_realm_owner = { this = scope:recipient } - } - } - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value >= squared_distance_major } } - } - add = -25 - } - - modifier = { - trigger = { - scope:recipient = { government_has_flag = government_is_true_herder } - } - add = 1000 - } - } - - ai_min_reply_days = 5 - ai_max_reply_days = 10 - - auto_accept = { - custom_tooltip = { - text = scheme_agent_aptitude.is_herder - scope:recipient = { government_has_flag = government_is_true_herder } - } - } - - ai_accept = { - base = -60 - - modifier = { # Hegemonic Tributaries are gentler and kinder - trigger = { - scope:actor = { highest_held_title_tier >= tier_hegemony } - } - add = 100 - desc = tributary_interaction_aibehavior_actor_hegemon_tier_tt - } - - modifier = { # Special case for Confucian-style governments towards China - scope:actor = { - primary_title = title:h_china - } - government_has_flag = government_is_meritocratic - add = 25 - desc = tributary_interaction_aibehavior_recipient_confucian_government_tt - } - - modifier = { # Perk boost - desc = offer_vassalization_true_ruler_perk_tt - trigger = { - scope:actor = { has_perk = true_ruler_perk } - } - add = true_ruler_value - } - - #Yurt bonuses - modifier = { - desc = tributary_yurt_02_domicile_building - trigger = { - scope:actor.domicile ?= { has_domicile_parameter = nomad_yurt_increased_tributary_acceptance_lvl_1 } - } - add = 5 - } - - modifier = { - desc = tributary_yurt_02_domicile_building - trigger = { - scope:actor.domicile ?= { has_domicile_parameter = nomad_yurt_increased_tributary_acceptance_lvl_2 } - } - add = 10 - } - - modifier = { - desc = tributary_yurt_02_domicile_building - trigger = { - scope:actor.domicile ?= { has_domicile_parameter = nomad_yurt_increased_tributary_acceptance_lvl_3 } - } - add = 15 - } - - modifier = { # the bolder they are, the less likely they will agree to this and vice versa - NOT = { ai_boldness = 0 } - add = { - value = ai_boldness - multiply = -1 - divide = 2 - } - desc = TRIBUTARY_BOLDNESS_REASON - } - - modifier = { # the greedier they are, the less likely they will agree to this - ai_greed > 0 - add = { - value = ai_greed - multiply = -1 - divide = 4 - } - desc = TRIBUTARY_GREED_REASON - } - - modifier = { - is_obedient_to = scope:actor - add = 40 - desc = obedient_interaction_reason - } - - modifier = { - scope:actor = { is_gurkhan = yes } - scope:recipient = { government_has_flag = government_is_nomadic } - add = 20 - desc = gurkhan_interaction_reason - } - - # Easier to make Tributaries during the Zud season - modifier = { - any_character_situation = { - any_situation_sub_region = { - has_sub_region_phase_parameter = the_great_steppe_easier_tributaries - any_situation_sub_region_participant_group = { - participant_group_type = nomad_rulers_capital - participant_group_has_character = scope:actor - } - } - } - scope:recipient = { government_has_flag = government_is_nomadic } - add = 25 - desc = zud_season_reason - } - - # if the actor is a major threat to the recipient they're more likely to accept - ai_military_threat_modifier_with_cbs = { - SENDER = scope:recipient - RECEIVER = scope:actor - MULTIPLIER = 1 - } - - modifier = { # They are a King - desc = tributary_interaction_aibehavior_recipient_tier_tt - trigger = { - scope:recipient = { highest_held_title_tier = tier_kingdom } - } - add = -100 - } - - modifier = { # They are an Emperor or greater - desc = tributary_interaction_aibehavior_recipient_tier_tt - trigger = { - scope:recipient = { highest_held_title_tier >= tier_empire } - } - add = -200 - } - - modifier = { # Recipient has higher Dominance than the actor - desc = demand_tributary_interaction_aibehavior_dominance_tt - trigger = { - scope:actor = { government_has_flag = government_is_nomadic } - scope:recipient = { government_has_flag = government_is_nomadic } - scope:recipient.dominance_value > scope:actor.dominance_value - } - add = -20 - } - - modifier = { # Actor has higher Dominance than the recipient - desc = demand_tributary_interaction_aibehavior_dominance_tt - trigger = { - scope:actor = { government_has_flag = government_is_nomadic } - scope:recipient = { government_has_flag = government_is_nomadic } - scope:actor.dominance_value > scope:recipient.dominance_value - } - add = 20 - } - - modifier = { # Actor is a Meritocratic Khanate trying to tributarize a Nomad - desc = demand_tributary_interaction_steppe_admin - trigger = { - scope:actor = { government_has_flag = government_is_steppe_admin } - scope:recipient = { government_has_flag = government_is_nomadic } - } - add = 60 # This offsets base reluctance - } - - # Non-nomadic - modifier = { - desc = AI_FILTHY_HORSE_LORD_REASON - trigger = { - scope:actor = { government_has_flag = government_is_nomadic } - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - add = { - value = -50 - if = { - limit = { - scope:recipient = { government_has_flag = government_is_tribal } - } - multiply = 0.5 - } - } - } - - # MINOR - modifier = { # Rivalry modifier. - desc = offer_vassalization_interaction_aibehavior_rival_tt - trigger = { - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - add = -100 - } - modifier = { # Nemesis modifier. - desc = offer_vassalization_interaction_aibehavior_nemesis_tt - trigger = { - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - add = -200 - } - modifier = { # Same Dynasty modifier. - desc = offer_vassalization_interaction_aibehavior_dynasty_tt - trigger = { - scope:recipient = { - dynasty = scope:actor.dynasty - } - } - add = 10 - } - modifier = { # Different faith, no pluralism. - desc = offer_vassalization_interaction_aibehavior_differentfaith_tt - trigger = { - scope:actor = { - NOT = { # faith condition below doesn't have to apply if both actor and recipient have nomadic_philosophy - has_trait = nomadic_philosophy - scope:recipient = { has_trait = nomadic_philosophy } - } - faith = { - NOR = { # Of two different faiths AND the potential vassal's faith is not pluralistic - this = scope:recipient.faith - has_doctrine = doctrine_pluralism_pluralistic - } - } - } - } - add = { - value = -25 - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_hostile_level - } - } - } - add = -10 - } - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_evil_level - } - } - } - add = -25 - } - } - } - - modifier = { # Encircled - desc = offer_vassalization_interaction_aibehavior_encircled_tt - trigger = { - scope:recipient = { - NOT = { - any_neighboring_top_suzerain_realm_owner = { - exists = this - NOT = { this = scope:actor } - } - } - NOT = { - any_realm_county = { is_coastal_county = yes } - } - } - } - add = 30 - } - - modifier = { # Cultural Acceptance - scope:actor = { - NOT = { # cultural condition below doesn't have to apply if both actor and recipient have nomadic_philosophy - has_trait = nomadic_philosophy - scope:recipient = { has_trait = nomadic_philosophy } - } - NOT = { has_same_culture_as = scope:recipient } - culture = { - cultural_acceptance = { target = scope:recipient.culture value < 50 } - } - } - add = { - add = -10 - if = { - limit = { scope:actor.culture = { has_cultural_pillar = ethos_bellicose } } - add = -10 - } - } - desc = cultural_acceptance_interaction_reason - } - - modifier = { # Same language - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - #Legitimacy - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -15 - scope:actor = { - has_legitimacy_flag = slightly_reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -25 - scope:actor = { - has_legitimacy_flag = reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -50 - scope:actor = { - has_legitimacy_flag = very_reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -75 - scope:actor = { - has_legitimacy_flag = massively_reduced_tributarization_acceptance - } - } - - # HIGH LEGITIMACY - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 25 - scope:actor = { - has_legitimacy_flag = increased_tributarization_acceptance - } - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 50 - scope:actor = { - has_legitimacy_flag = very_increased_tributarization_acceptance - } - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 75 - scope:actor = { - has_legitimacy_flag = extra_increased_tributarization_acceptance - } - } - - # OPINION INFLUENCE - opinion_modifier = { # Compare Opinion modifier. - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - } - - #Severed head acceptance - modifier = { - add = 200 - scope:actor = { - has_variable = severed_head_vassalization - var:severed_head_vassalization = { - this = scope:recipient - } - } - } - } -} - - - -### Cease Paying Tribute - unilateral -### Name referenced in code! Don't change it without notification! -# actor = tributary -# recipient = suzerain - -cease_paying_tribute_interaction = { - category = interaction_category_vassal - common_interaction = yes - use_diplomatic_range = no - icon = cease_paying_tributary_interaction - - desc = cease_paying_tribute_interaction_desc - - is_shown = { - scope:actor = { - this != scope:recipient - suzerain = scope:recipient - is_tributary = yes - } - } - - is_valid_showing_failures_only = { - scope:actor = { - is_physically_able = yes - is_travelling = no - NOT = { exists = involved_activity } - trigger_if = { - limit = { - OR = { - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:recipient - } - scope:recipient = { - is_landed = no - } - } - } - NOT = { has_truce = scope:recipient } - } - trigger_else = { - NOT = { has_truce = scope:recipient } - subject_can_break_tributary = yes - } - } - } - - cost = { - prestige = { - value = 0 - if = { - limit = { - scope:actor = { - OR = { - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:recipient - } - scope:recipient = { - is_landed = no - } - } - } - } - add = minor_prestige_value - } - } - } - - auto_accept = yes - on_accept = { - scope:actor = { - end_tributary = yes - if = { - limit = { - scope:recipient = { government_has_flag = government_is_mandala } - } - add_opinion = { - modifier = tributary_ceased_payments_opinion - target = scope:recipient - opinion = -100 - } - } - - } - scope:recipient = { - # Losing legitimacy if you are the Chinese Hegemon in the Dynastic Cycle Instability phase - if = { - limit = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_external_tributaries_vassals_increased_independence_desire - } - } - add_legitimacy_effect = { LEGITIMACY = minor_legitimacy_loss } - } - - #Some cooldown for Mandala rulers - if = { - limit = { government_has_flag = government_is_mandala } - if = { - limit = { is_ai = yes } - set_variable = { - name = tributary_recently_ceased - years = 1 - } - } - else = { - set_variable = { - name = tributary_recently_ceased - months = 6 - } - } - - } - - if = { - limit = { is_ai = yes } - trigger_event = { - id = char_interaction.0370 - days = 14 # we delay the response from the AI for 2 weeks to make it feel more like a "diplomacy response" - } - } - else = { - trigger_event = char_interaction.0370 - } - - add_opinion = { - modifier = tributary_ceased_payments_opinion - target = scope:actor - } - } - } - - ai_potential = { - is_at_war = no - is_migrating = no - trigger_if = { - limit = { - suzerain = { - highest_held_title_tier >= tier_hegemony - } - } - subject_standing < 20 - } - suzerain = { - is_migrating = no - - OR = { - is_landed = no - NOT = { # disconnected tributaries can always do this, even herders - any_land_neighboring_realm_with_tributaries_owner = { - this = root - } - } - AND = { - NOT = { root = { government_has_flag = government_is_true_herder } } - trigger_if = { # Obedience is a hard blocker, but only if suzerain is landed - limit = { - is_landed = yes - } - root = { is_obedient = no } - } - } - } - trigger_if = { - limit = { - any_character_situation = { - situation_type = dynastic_cycle - } - } - OR = { - root.subject_standing <= 0 - any_character_situation = { - situation_type = dynastic_cycle - OR = { - situation_current_phase = situation_dynastic_cycle_phase_instability - situation_current_phase = situation_dynastic_cycle_phase_instability_conquest - } - } - } - } - } - } - - ai_targets = { - ai_recipients = suzerain - } - - # this must be 12 (1 year) in order to ensure the integrity of the UI-visualized chance the tributary will break the contract - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - # visualized in the UI as the annual chance the tributary will break the contract, based on a percentage chance per year - ai_will_do = { - base = 0 - #Base - modifier = { - NOT = { - suzerain = { government_has_flag = government_is_mandala } - } - add = -25 - desc = base_with_value - } - - # if the actor is sufficiently scared of the recipient they're way less likely to do this - ai_military_threat_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - MULTIPLIER = -2 - } - - ### Nomad - modifier = { - scope:recipient = { exists = obedience_target } - add = { - add = obedience_value - subtract = obedience_threshold - multiply = -1 - max = obedience_threshold - min = { - value = obedience_threshold - multiply = -1 - } - } - desc = obedience_value_reason - } - - modifier = { - scope:recipient = { - has_variable = temp_tributary_protection - } - add = -150 - desc = temp_tributary_protection_reason - } - - modifier = { - dominance_value > suzerain.dominance_value - add = 30 - desc = cease_tribute_higher_dominance_reason - } - - modifier = { - suzerain = { - any_memory = { - has_memory_type = nomad_showed_weakness_in_war - memory_age_years < 5 - } - } - add = 30 - desc = cease_tribute_showed_weakness_in_war_reason - } - - modifier = { - any_memory = { - has_memory_type = suzerain_defended_me_in_war - has_memory_participant = root.suzerain - memory_age_years < 10 - } - add = -100 - desc = cease_tribute_defended_me_in_war_reason - } - - modifier = { - suzerain = { - any_memory = { - has_memory_type = had_chaotic_kurultai_succession - memory_age_years < 5 - } - } - add = 30 - desc = cease_tribute_had_chaotic_kurultai_succession_reason - } - #General Modifiers - #Is the Tributary Connected? - modifier = { - scope:recipient = { - trigger_if = { #Mandalas, China, Wanua, and Meritocratic realms can keep overseas tributaries, if they are coastal. - limit = { - scope:actor = { - OR = { - government_has_flag = government_is_mandala - government_has_flag = government_is_celestial - government_has_flag = government_is_wanua - government_has_flag = government_is_meritocratic - } - } - } - NOR = { - scope:recipient.capital_county = { is_coastal_county = yes } - any_sub_realm_county = { is_coastal_county = yes } - any_tributary = { - any_sub_realm_county = { is_coastal_county = yes } - } - } - } - NOT = { - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:actor - } - } - } - add = 1000 - desc = cease_tribute_disconnected_suzerain - } - #Is the suzerain landless? - modifier = { - scope:recipient = { - is_landed = no - is_migrating = no - is_at_war = no - } - add = 10000 - desc = cease_tribute_landless_suzerain - } - #Subject Standing - modifier = { - subject_standing >= 0 # applied only if the subject contract uses Subject Standing - add = { # every point of subject standing reduces the chance by 5 - add = subject_standing - multiply = -5 - } - desc = ai_will_do_debug - } - # TGP Dynastic Cycle in Instability phase - modifier = { - desc = "FACTION_REASON_DYNASTIC_CYCLE_INSTABILITY" - add = 25 - scope:recipient = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_external_tributaries_vassals_increased_independence_desire - } - } - } - - #Legitimacy - modifier = { - desc = "RECIPIENT_LOW_LEGITIMACY_REASON" - add = 75 - scope:recipient = { - has_legitimacy_flag = massively_reduced_tributarization_acceptance - } - } - modifier = { - desc = "RECIPIENT_LOW_LEGITIMACY_REASON" - add = 50 - scope:recipient = { - has_legitimacy_flag = very_reduced_tributarization_acceptance - } - } - modifier = { - desc = "RECIPIENT_LOW_LEGITIMACY_REASON" - add = 25 - scope:recipient = { - has_legitimacy_flag = reduced_tributarization_acceptance - } - } - modifier = { - desc = "RECIPIENT_LOW_LEGITIMACY_REASON" - add = 15 - scope:recipient = { - has_legitimacy_flag = slightly_reduced_tributarization_acceptance - } - } - # HIGH LEGITIMACY - modifier = { - desc = "RECIPIENT_HIGH_LEGITIMACY_REASON" - add = -25 - scope:recipient = { - has_legitimacy_flag = increased_tributarization_acceptance - } - } - modifier = { - desc = "RECIPIENT_HIGH_LEGITIMACY_REASON" - add = -50 - scope:recipient = { - has_legitimacy_flag = very_increased_tributarization_acceptance - } - } - modifier = { - desc = "RECIPIENT_HIGH_LEGITIMACY_REASON" - add = -75 - scope:recipient = { - has_legitimacy_flag = extra_increased_tributarization_acceptance - } - } - ### MANDALA ### - #I am a Tribal! - modifier = { - scope:recipient = { government_has_flag = government_is_mandala } - scope:actor = { government_has_flag = government_is_tribal } - add = -20 - desc = actor_is_a_tribal_government - } - #Your Radiance - #Radiance Value x2 - modifier = { - scope:recipient = { - government_has_flag = government_is_mandala - has_unruined_mandala_capital_trigger = yes - } - add = { - value = { - value = scope:recipient.mandala_radiance_value - multiply = 2 - } - multiply = -1 - } - desc = recipient_negative_mandala_radiance - } - #You're Prosperity - modifier = { - desc = is_prosperity_mandala_tributary - scope:recipient = { has_realm_law_flag = tributaries_less_likely_to_break_free } - add = -15 - } - #Mandala Piety Level - This is only checked if you are not a Devaraja/haven't got a capital temple complex - Otherwise we use Radiance - mandala_devaraja_piety_level_remove_weight_modifier = { DEVARAJA = scope:recipient } - #Tributary Realm Size - subject_realm_size_add_weight_modifier = { - DEVARAJA = scope:recipient - SUBJECT = scope:actor - } - - ##Radience of other potential Suzerains is not calculated here since they can directly ask the tributary to switch over to them. - - #Pacing for Mandala Suzerains - modifier = { - scope:recipient = { - government_has_flag = government_is_mandala - has_variable = tributary_recently_ceased - } - factor = 0.1 - } - #You're Disbelieved, son - modifier = { - suzerain = { has_character_modifier = disbelieved_mandala_modifier } - add = 40 - desc = is_disbelieved_mandala - } - #SEA Legacy - modifier = { - desc = tgp_sea_legacy_2_modifier_desc - scope:recipient = { - dynasty ?= { - has_dynasty_perk = tgp_sea_legacy_2 - } - } - add = { - value = { - value = tgp_sea_legacy_tributary_acceptance_value - multiply = -1 - } - } - } - # I am higher rank than you - modifier = { - desc = tributary_interaction_aibehavior_actor_tier_tt - scope:actor = { highest_held_title_tier > scope:recipient.highest_held_title_tier } - add = { - value = scope:actor.highest_held_title_tier - subtract = scope:recipient.highest_held_title_tier - multiply = 50 - } - } - # I have a Capital Temple Complex of my own (I am also a God King) - modifier = { - desc = tributary_interaction_aibehavior_actor_capital_complex - scope:recipient = { government_has_flag = government_is_mandala } - scope:actor = { - government_has_flag = government_is_mandala - capital_province = { - has_building_with_flag = mandala_capital_building - has_ruined_great_building = no - } - } - add = 50 - } - #AI Godkings should NOT want to be subjects - modifier = { - has_variable = mandala_godking - add = 100 - desc = mandala_ai_godking_modifier - } - # Same Faith and Recipient is a God King - modifier = { - desc = tributary_interaction_aibehavior_recipient_same_faith - scope:recipient = { - government_has_flag = government_is_mandala - faith = scope:actor.faith - capital_province = { - has_building_with_flag = mandala_capital_building - has_ruined_great_building = no - } - } - add = -10 - } - # Different religion Family - We prefer god kings to be vaguely within our own world view - modifier = { - desc = tributary_interaction_aibehavior_recipient_other_religion_family - scope:actor = { - NOT = { government_has_flag = government_is_wanua } - } - scope:recipient.faith.religion = { - switch = { - trigger = is_in_family - rf_pagan = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_pagan } } - } - rf_sinitic = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_sinitic } } - } - rf_eastern = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_eastern } } - } - rf_abrahamic = { - scope:actor.faith.religion = { NOT = { is_in_family = rf_abrahamic } } - } - } - } - add = 25 - } - ### - # Rivalry modifier. - modifier = { - desc = embrace_tributarization_interaction_aibehavior_rival_tt - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - add = 30 - } - # Nemesis modifier. - modifier = { - desc = embrace_tributarization_interaction_aibehavior_nemesis_tt - scope:recipient = { has_relation_nemesis = scope:actor } - add = 50 - } - # OPINION INFLUENCE - opinion_modifier = { # Compare Opinion modifier. - who = scope:actor - opinion_target = scope:recipient - multiplier = -1 - } - } -} - -### Release Tributary - unilateral -# actor = suzerain -# recipient = tributary - -release_tributary_interaction = { - category = interaction_category_vassal - common_interaction = no - icon = release_tributary_interaction - - desc = release_tributary_interaction_desc - - is_shown = { - scope:recipient = { - this != scope:actor - suzerain = scope:actor - OR = { # AI should only ever consider releasing unruly subjects - scope:actor = { is_ai = no } - NOT = { is_obedient_to = scope:actor } - } - } - } - - is_valid_showing_failures_only = { - #scope:recipient = { - # trigger_if = { - # limit = { subject_standing >= 0 } - # subject_standing = 0 - # } - #} - } - - cost = { - prestige = { - value = minor_prestige_value - if = { - limit = { - scope:actor = { government_has_flag = government_is_mandala } - } - multiply = 0 - } - } - piety = { - value = medium_piety_value - if = { - limit = { - scope:actor = { - NOT = { government_has_flag = government_is_mandala } - } - } - multiply = 0 - } - } - } - - auto_accept = yes - on_accept = { - scope:recipient = { - end_tributary = yes - save_scope_as = tributary_loc - scope:actor = { save_scope_as = suzerain_loc } - add_truce_both_ways = { - character = scope:actor - years = 5 - name = TRUCE_TRIBUTARY_STOPPED - } - add_opinion = { - target = scope:actor - modifier = tributary_released_opinion - opinion = 25 - } - if = { - limit = { - scope:actor = { government_has_flag = government_is_mandala } - } - set_variable = { - name = recent_mandala_suzerain - value = scope:actor - years = 5 - } - } - trigger_event = char_interaction.0380 - } - } -} - -### Release as Tributary - unilateral -# actor = suzerain -# recipient = tributary - -release_as_tributary_interaction = { - category = interaction_category_vassal - common_interaction = no - icon = release_as_tributary - interface_priority = 4 - - desc = release_as_tributary_interaction_desc - - is_shown = { - scope:actor = { - OR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_mandala - government_has_flag = government_is_wanua - } - } - scope:recipient = { - is_vassal_of = scope:actor - highest_held_title_tier >= tier_county - } - } - - is_valid_showing_failures_only = { - scope:actor = { - is_independent_ruler = yes - is_at_war = no - } - } - - auto_accept = yes - - on_accept = { - scope:actor = { - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = release_as_tributary_interaction_toast - left_icon = scope:actor - right_icon = scope:recipient - - custom_tooltip = release_as_tributary_interaction_toast_desc - } - } - } - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = granted_independence_opinion - opinion = 10 - } - create_title_and_vassal_change = { - type = independency - save_scope_as = change - add_claim_on_loss = yes - } - becomes_independent = { - change = scope:change - } - - resolve_title_and_vassal_change = scope:change - } - start_tributary_interaction_effect = { - SUZERAIN = scope:actor - TRIBUTARY = scope:recipient - } - } - - ai_potential = { - OR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_mandala - government_has_flag = government_is_wanua - } - this = top_liege - vassal_count > vassal_limit - } - - ai_targets = { - ai_recipients = vassals - } - - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 36 - kingdom = 4 - empire = 4 - hegemony = 4 - } - - ai_will_do = { - base = 0 - modifier = { - scope:recipient = { # Only on your borders - any_held_title = { - tier = tier_county - is_coastal_county = yes - } - } - add = 10 - } - modifier = { - scope:recipient = { # Only on your borders - any_held_title = { - tier = tier_county - any_neighboring_county = { - holder.top_liege != scope:recipient.top_liege - } - } - } - add = 100 - } - } -} - -exact_tribute_interaction = { - category = interaction_category_vassal - icon = demand_tributary_interaction - - ai_maybe = yes - ai_min_reply_days = 4 - ai_max_reply_days = 9 - can_send_despite_rejection = yes - popup_on_receive = yes - common_interaction = yes - - interface_priority = 4 - - ai_targets = { - ai_recipients = tributaries - } - - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 9 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - desc = exact_tribute_interaction_desc - - is_shown = { - scope:recipient = { is_ai = yes } - scope:actor = { - OR = { - highest_held_title_tier >= tier_hegemony - AND = { - government_has_flag = government_is_mandala - scope:recipient = { is_tributary_of = scope:actor } - } - } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - is_available_adult = yes - #Has recently gone on a Tribute Mission (to you) - custom_tooltip = { - text = exact_tribute_interaction_recently_tribute_missioned_tt - NOT = { var:tribute_mission_grace ?= scope:actor } - } - - trigger_if = { - limit = { - scope:actor = { - highest_held_title_tier >= tier_hegemony - } - } - scope:recipient = { - trigger_if = { - limit = { is_tributary_of = scope:actor } - subject_standing < exact_tribute_subject_standing_value - } - trigger_else = { - is_independent_ruler = yes - highest_held_title_tier < tier_hegemony - is_tributary = no - custom_tooltip = { - text = exact_tribute_interaction_hegemony_not_neighbor_tt - any_neighboring_and_across_water_top_liege_realm_owner = { - this = scope:actor - } - } - } - } - } - trigger_else = { - scope:actor = { government_has_flag = government_is_mandala } - scope:recipient = { is_tributary_of = scope:actor } - } - - #Has something to offer as Tribute Mission - trigger_if = { - limit = { - NOR = { - var:declined_requested_tribute_recently ?= scope:actor - var:requested_tribute_mission ?= scope:actor - } - } - custom_tooltip = { - text = exact_tribute_interaction_no_tribute_tt - OR = { - has_gold_tribute_trigger = yes - has_herd_tribute_trigger = yes - has_artifact_tribute_trigger = yes - AND = { - any_courtier_or_guest = { - can_become_concubine_of_character_valid_trigger = { CHARACTER = scope:actor } - } - scope:actor = { - allowed_more_concubines = yes - is_adult = yes - } - } - AND = { - has_eunuch_tribute_trigger = yes - scope:actor = { - culture = { has_cultural_parameter = can_appoint_chief_eunuch } - } - } - } - } - } - #Has recently refused - custom_tooltip = { - text = exact_tribute_interaction_recently_refused_tt - NOT = { var:declined_requested_tribute_recently ?= scope:actor } - } - #Is already engaged - custom_tooltip = { - text = exact_tribute_interaction_already_engaged_tt - NOR = { - var:requested_tribute_mission ?= scope:actor - has_variable = tribute_mission_type - } - } - } - } - - greeting = positive - notification_text = EXACT_TRIBUTE_INTERACTION_NOTIFICATION - - #Request Gold - send_option = { - flag = gold - is_valid = { - scope:recipient ?= { has_gold_tribute_trigger = yes } - } - localization = request_gold_tribute - } - - #Request Herd - send_option = { - flag = herd - is_valid = { - scope:recipient ?= { has_herd_tribute_trigger = yes } - } - localization = request_herd_tribute - } - - #Request Artifact - send_option = { - flag = artifact - is_valid = { - scope:recipient = { - custom_tooltip = { - text = exact_tribute_interaction_no_suitable_artifact_tt - has_artifact_tribute_trigger = yes - } - } - } - localization = request_artifact_tribute - } - - #Request Concubine - send_option = { - flag = concubine - is_valid = { - scope:actor = { - is_adult = yes - can_have_concubines_trigger = { CHAR = scope:actor } - } - scope:recipient = { - custom_tooltip = { - text = exact_tribute_interaction_no_suitable_concubine_tt - any_courtier_or_guest = { - can_become_concubine_of_character_valid_trigger = { CHARACTER = scope:actor } - } - } - } - } - localization = request_concubine_tribute - } - - #Request Eunuch - send_option = { - flag = eunuch - is_valid = { - trigger_if = { - limit = { - scope:actor = { - can_employ_court_eunuchs_trigger = { CHAR = scope:actor } - } - } - scope:recipient = { - custom_tooltip = { - text = exact_tribute_interaction_no_suitable_eunuchs_tt - has_eunuch_tribute_trigger = yes - } - } - } - trigger_else = { - scope:actor = { - can_employ_court_eunuchs_trigger = { CHAR = scope:actor } - } - } - } - localization = request_eunuch_tribute - } - - send_options_exclusive = yes - - on_accept = { - scope:actor = { - if = { - limit = { is_ai = no } - trigger_event = tribute_mission.9010 - } - } - scope:recipient = { - set_variable = { - name = requested_tribute_mission - value = scope:actor - years = requested_tribute_mission_deadline_years - } - trigger_event = { - id = tribute_mission.9500 - years = requested_tribute_mission_deadline_years - } - switch = { - trigger = yes - scope:gold ?= { - set_variable = { - name = requested_tribute_mission_type_gold - years = requested_tribute_mission_deadline_years - } - custom_tooltip = exact_tribute_interaction_gold_tt - } - scope:herd ?= { - set_variable = { - name = requested_tribute_mission_type_herd - years = requested_tribute_mission_deadline_years - } - custom_tooltip = exact_tribute_interaction_herd_tt - } - scope:artifact ?= { - set_variable = { - name = requested_tribute_mission_type_artifact - years = requested_tribute_mission_deadline_years - } - custom_tooltip = exact_tribute_interaction_artifact_tt - random_character_artifact = { - limit = { is_suitable_artifact_tribute_trigger = yes } - scope:recipient = { - set_variable = { - name = predetermined_artifact_tribute - value = prev - } - } - } - } - scope:concubine ?= { - set_variable = { - name = requested_tribute_mission_type_concubine - years = requested_tribute_mission_deadline_years - } - custom_tooltip = exact_tribute_interaction_concubine_tt - every_courtier_or_guest = { - limit = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:recipient - CHARACTER = scope:actor - } - is_adult = yes - has_any_disease_trigger = no - has_easily_mocked_physical_attribute_trigger = no - } - add_to_list = potential_concubine_tribute_list - random_in_list = { - list = potential_concubine_tribute_list - weight = { - #Let's try to make a sane choice here - base = 0 - #No marginally relevant court people - modifier = { - add = 10 - NOR = { - is_councillor = yes - has_any_court_position = yes - } - } - #No knights - modifier = { - add = 5 - is_knight = no - } - #No inspired people? - modifier = { - add = 20 - NOT = { exists = inspiration } - } - #No close family - modifier = { - add = 15 - NOT = { is_close_or_extended_family_of = scope:recipient } - } - #No friends? - modifier = { - add = 20 - NOT = { has_relation_friend = scope:recipient } - } - #No children - modifier = { - add = 25 - NOT = { is_child_of = scope:recipient } - } - } - scope:recipient = { - set_variable = { - name = predetermined_concubine_tribute - value = prev - } - } - } - } - } - scope:eunuch ?= { - set_variable = { - name = requested_tribute_mission_type_eunuch - years = requested_tribute_mission_deadline_years - } - custom_tooltip = exact_tribute_interaction_eunuch_tt - every_courtier = { - limit = { - tribute_mission_is_available_eunuch_trigger = yes - NAND = { - faith = { has_doctrine = doctrine_theocracy_temporal } - this = scope:actor.cp:councillor_court_chaplain - } - has_any_disease_trigger = no - } - add_to_list = potential_eunuch_tribute_list - random_in_list = { - list = potential_eunuch_tribute_list - weight = { - #Let's try to make a sane choice here - base = 0 - #No marginally relevant court people - modifier = { - add = 10 - NOR = { - is_councillor = yes - has_any_court_position = yes - } - } - #No knights - modifier = { - add = 5 - is_knight = no - } - #No inspired people? - modifier = { - add = 20 - NOT = { exists = inspiration } - } - #No close family - modifier = { - add = 15 - NOT = { is_close_or_extended_family_of = scope:recipient } - } - #No friends? - modifier = { - add = 20 - NOT = { has_relation_friend = scope:recipient } - } - #No children - modifier = { - add = 25 - NOT = { is_child_of = scope:recipient } - } - } - scope:recipient = { - set_variable = { - name = predetermined_eunuch_tribute - value = prev - } - } - } - } - } - } - if = { - limit = { scope:actor = { government_has_flag = government_is_mandala } } - execute_decision = tribute_mission_decision_mandala - } - else_if = { - limit = { scope:actor.primary_title = title:h_china } - execute_decision = tribute_mission_decision_china - } - else_if = { - limit = { scope:actor.primary_title = title:h_roman_empire } - execute_decision = tribute_mission_decision_roman_empire - } - else_if = { - limit = { scope:actor.primary_title = title:h_eastern_roman_empire } - execute_decision = tribute_mission_decision_eastern_roman_empire - } - else_if = { - limit = { scope:actor.primary_title = title:h_dar_al_islam } - execute_decision = tribute_mission_decision_dar_al_islam - } - else_if = { - limit = { scope:actor.primary_title = title:h_india } - execute_decision = tribute_mission_decision_india - } - } - } - - on_decline = { - scope:recipient = { - if = { - limit = { has_legitimacy = yes } - add_legitimacy = minor_legitimacy_loss - } - set_variable = { - name = declined_requested_tribute_recently - value = scope:actor - years = requested_tribute_mission_deadline_years - } - if = { - limit = { is_ai = yes } - add_opinion = { - modifier = declined_tribute_mission_opinion - opinion = -30 - target = scope:actor - } - } - } - scope:actor = { - if = { - limit = { is_ai = yes } - add_opinion = { - modifier = declined_tribute_mission_opinion - opinion = -30 - target = scope:recipient - } - } - if = { - limit = { is_ai = no } - trigger_event = tribute_mission.9000 - } - } - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = 50 - modifier = { - scope:actor = { has_realm_law = mandala_decree_reverence } - factor = 2 - } - modifier = { - NOT = { ai_boldness = 0 } - add = { - value = ai_boldness - divide = 4 - } - desc = TRIBUTARY_BOLDNESS_REASON - } - modifier = { - ai_greed > 0 - add = { - value = ai_greed - divide = 4 - } - desc = TRIBUTARY_GREED_REASON - } - - } - - ai_accept = { - base = 0 - #Base - modifier = { - government_has_flag = government_is_mandala - add = -25 - desc = base_with_value - } - modifier = { # Special case for Hegemonic Tributaries - scope:actor = { - highest_held_title_tier >= tier_hegemony - } - add = { - add = 25 - if = { - limit = { - OR = { - NOT = { scope:recipient.primary_title = title:h_china } - government_has_flag = government_is_meritocratic - } - } - add = 25 - } - } - desc = tributary_interaction_aibehavior_recipient_hegemon_tier_tt - } - # Unstable Phase - modifier = { - scope:actor = { highest_held_title_tier >= tier_hegemony } - situation:dynastic_cycle ?= { - OR = { - situation_current_phase = situation_dynastic_cycle_phase_instability - situation_current_phase = situation_dynastic_cycle_phase_instability_conquest - } - } - add = -50 - desc = tributary_interaction_aibehavior_actor_unstable_cycle_tt - } - # Stable Phase - modifier = { - scope:actor = { - highest_held_title_tier >= tier_hegemony - legitimacy_level < dynastic_cycle_legitimacy_expectation - } - situation:dynastic_cycle ?= { - NOR = { - situation_current_phase = situation_dynastic_cycle_phase_instability - situation_current_phase = situation_dynastic_cycle_phase_instability_conquest - } - } - add = -25 - desc = tributary_interaction_aibehavior_actor_low_legitimacy_tt - } - modifier = { - scope:actor = { - highest_held_title_tier >= tier_hegemony - legitimacy_level > dynastic_cycle_legitimacy_expectation - } - situation:dynastic_cycle ?= { - NOR = { - situation_current_phase = situation_dynastic_cycle_phase_instability - situation_current_phase = situation_dynastic_cycle_phase_instability_conquest - } - } - add = 25 - desc = tributary_interaction_aibehavior_actor_high_legitimacy_tt - } - - #MINOR MODIFIERS - modifier = { # the bolder they are, the less likely they will agree to this and the more cowardly the more likely - NOT = { ai_boldness = 0 } - add = { - value = ai_boldness - multiply = -1 - divide = 4 - } - desc = TRIBUTARY_BOLDNESS_REASON - } - - modifier = { # the greedier they are, the less likely they will agree to this - ai_greed > 0 - add = { - value = ai_greed - multiply = -1 - divide = 4 - } - desc = TRIBUTARY_GREED_REASON - } - modifier = { # Rivalry modifier. - desc = embrace_tributarization_interaction_aibehavior_rival_tt - trigger = { - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - add = -30 - } - modifier = { # Nemesis modifier. - desc = embrace_tributarization_interaction_aibehavior_nemesis_tt - trigger = { - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - add = -100 - } - modifier = { # Same Dynasty modifier. - desc = embrace_tributarization_interaction_aibehavior_dynasty_tt - trigger = { - scope:recipient = { - dynasty = scope:actor.dynasty - } - } - add = 10 - } - #Prosperity Mandala - modifier = { - desc = is_prosperity_mandala_tributary - scope:recipient = { - is_tributary = yes - suzerain = { has_realm_law = mandala_decree_prosperity } - } - add = 15 - } - #Mandala Piety Level - #This is only checked if you are not a Devaraja/haven't got a capital temple complex - Otherwise we use Radiance - mandala_devaraja_piety_level_add_weight_modifier = { DEVARAJA = scope:actor } - - #Your Radiance - modifier = { - scope:actor = { has_unruined_mandala_capital_trigger = yes } - add = { - value = scope:actor.mandala_radiance_value - multiply = 2 - } - desc = actor_positive_mandala_radiance - } - opinion_modifier = { # Compare Opinion modifier. - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - } - - # if the actor is a major threat to the recipient they're more likely to accept - ai_military_threat_modifier = { - SENDER = scope:recipient - RECEIVER = scope:actor - MULTIPLIER = 1 - } - } -} - -#If the target is a player -exact_tribute_player_interaction = { - category = interaction_category_vassal - icon = demand_tributary_interaction - - ai_maybe = yes - ai_min_reply_days = 4 - ai_max_reply_days = 9 - can_send_despite_rejection = yes - ai_accept_negotiation = yes - popup_on_receive = yes - common_interaction = yes - - interface_priority = 4 - - ai_targets = { - ai_recipients = tributaries - } - - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 9 - kingdom = 6 - empire = 6 - hegemony = 6 - } - - desc = exact_tribute_player_interaction_desc - - is_shown = { - scope:recipient = { is_ai = no } - trigger_if = { - limit = { - scope:actor = { highest_held_title_tier >= tier_hegemony } - } - scope:recipient = { - trigger_if = { - limit = { is_tributary_of = scope:actor } - subject_standing < exact_tribute_subject_standing_value - } - trigger_else = { - is_tributary = no - is_independent_ruler = yes - any_neighboring_top_liege_realm_owner = { primary_title = title:h_china } - } - } - } - trigger_else = { - scope:actor = { government_has_flag = government_is_mandala } - scope:recipient = { is_tributary_of = scope:actor } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - is_available_adult = yes - #Has recently gone on a Tribute Mission (to you) - custom_tooltip = { - text = exact_tribute_interaction_recently_tribute_missioned_tt - NOT = { var:tribute_mission_grace ?= scope:actor } - } - #Has something to offer as Tribute Mission - trigger_if = { - limit = { - NOR = { - var:declined_requested_tribute_recently ?= scope:actor - var:requested_tribute_mission ?= scope:actor - } - } - custom_tooltip = { - text = exact_tribute_interaction_no_tribute_tt - OR = { - has_gold_tribute_trigger = yes - has_herd_tribute_trigger = yes - has_artifact_tribute_trigger = yes - AND = { - any_courtier_or_guest = { - can_become_concubine_of_character_valid_trigger = { CHARACTER = scope:actor } - } - scope:actor = { allowed_more_concubines = yes } - } - AND = { - has_eunuch_tribute_trigger = yes - scope:actor = { - culture = { has_cultural_parameter = can_appoint_chief_eunuch } - } - } - } - } - } - #Has recently refused - custom_tooltip = { - text = exact_tribute_interaction_recently_refused_tt - NOT = { var:declined_requested_tribute_recently ?= scope:actor } - } - #Is already engaged - custom_tooltip = { - text = exact_tribute_interaction_already_engaged_tt - NOR = { - var:requested_tribute_mission ?= scope:actor - has_variable = tribute_mission_type - } - } - } - } - - greeting = positive - notification_text = EXACT_TRIBUTE_PLAYER_INTERACTION_NOTIFICATION - - on_accept = { - scope:actor = { - if = { - limit = { is_ai = no } - trigger_event = tribute_mission.9010 - } - } - scope:recipient = { - set_variable = { - name = requested_tribute_mission - value = scope:actor - years = requested_tribute_mission_deadline_years - } - trigger_event = { - id = tribute_mission.9500 - years = requested_tribute_mission_deadline_years - } - custom_tooltip = exact_tribute_player_interaction_accept_tt - if = { - limit = { scope:actor = { highest_held_title_tier >= tier_hegemony } } - if = { - limit = { scope:actor.primary_title = title:h_china } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_china - player = scope:recipient - } - } - else_if = { - limit = { scope:actor.primary_title = title:h_roman_empire } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_roman_empire - player = scope:recipient - } - } - else_if = { - limit = { scope:actor.primary_title = title:h_eastern_roman_empire } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_eastern_roman_empire - player = scope:recipient - } - } - else_if = { - limit = { scope:actor.primary_title = title:h_dar_al_islam } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_dar_al_islam - player = scope:recipient - } - } - else_if = { - limit = { scope:actor.primary_title = title:h_india } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_india - player = scope:recipient - } - } - } - else_if = { - limit = { scope:actor = { government_has_flag = government_is_mandala } } - open_view_data = { - view = decision_detail - data = decision:tribute_mission_decision_mandala - player = scope:recipient - } - } - else = { - error_log = "Exacting tribute as an invalid actor!" - } - } - } - - on_decline = { - scope:recipient = { - add_legitimacy = minor_legitimacy_loss - set_variable = { - name = declined_requested_tribute_recently - value = scope:actor - years = requested_tribute_mission_deadline_years - } - } - scope:actor = { - if = { - limit = { is_ai = yes } - add_opinion = { - modifier = declined_tribute_mission_opinion - opinion = -30 - target = scope:recipient - } - } - if = { - limit = { is_ai = no } - trigger_event = tribute_mission.9000 - } - } - } - - ai_potential = { - always = yes - } - - ai_will_do = { - base = 50 - modifier = { - scope:actor = { has_realm_law = mandala_decree_reverence } - factor = 2 - } - } -} - -# Offer Courtier -offer_courtier_interaction = { - category = interaction_category_diplomacy - common_interaction = no - icon = courtier_interaction - interface_priority = 40 - - desc = offer_courtier_interaction_desc - - ai_targets = { - ai_recipients = suzerain - ai_recipients = liege - ai_recipients = scripted_relations - max = 5 - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - greeting = positive - notification_text = OFFER_COURTIER_NOTIFICATION - - needs_recipient_to_open = yes - - populate_actor_list = { - scope:actor = { - every_courtier = { - limit = { - is_available_healthy_ai_adult = yes - NOR = { - is_consort_of = scope:actor - is_heir_of = scope:actor - AND = { - is_female = yes - patrilinear_marriage = yes - } - AND = { - is_male = yes - matrilinear_marriage = yes - } - is_diarch = yes - is_designated_diarch = yes - has_character_flag = has_been_offered_as_concubine - } - } - add_to_list = characters - } - } - } - - is_shown = { - scope:actor != scope:recipient - scope:recipient = { - is_ruler = yes - NOT = { government_has_flag = government_is_true_herder } - } - } - - is_valid_showing_failures_only = { - custom_tooltip = { - text = offer_courtier_valid_courtier_tt - scope:actor = { - any_courtier = { - is_available_healthy_ai_adult = yes - NOR = { - is_consort_of = scope:actor - is_heir_of = scope:actor - AND = { - is_female = yes - patrilinear_marriage = yes - } - AND = { - is_male = yes - matrilinear_marriage = yes - } - is_diarch = yes - is_designated_diarch = yes - has_character_flag = has_been_offered_as_concubine - } - } - } - } - - trigger_if = { #For adventurers we check range - limit = { - scope:actor = { - is_landless_adventurer = yes - } - } - ep3_laamp_diplo_range_trigger = { - TARGET = scope:recipient - LAAMP = scope:actor - } - } - } - - can_be_picked = { - is_adult = yes - } - - can_send = { - custom_tooltip = { - text = no_heirs_can_be_sent_tt - scope:secondary_actor = { - NOT = { - is_heir_of = scope:actor - } - } - } - custom_tooltip = { - text = no_spouses_can_be_sent_tt - scope:secondary_actor = { - NOT = { - is_consort_of = scope:actor - } - } - } - } - - auto_accept = { - scope:actor = { - has_title = title:e_minister_of_personnel - custom_tooltip = { - text = same_realm_tt - top_liege = scope:recipient.top_liege - } - } - scope:recipient = { - is_ai = yes - } - } - - ai_accept = { - base = -10 - - modifier = { - add = 100 - scope:secondary_actor = { - OR = { - sum_of_all_skills_value >= sum_of_all_skills_threshold_good - martial >= monumentally_high_skill_rating - prowess >= extremely_high_skill_rating - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_chancellor ?= { diplomacy < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_steward ?= { stewardship < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_spymaster ?= { intrigue < monumentally_high_skill_rating } - } - has_relation_lover = scope:recipient # Shhh, don't tell anyone, of course you're 'skilled'! - trigger_if = { - limit = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - OR = { - AND = { - sum_of_all_skills_value >= sum_of_all_skills_threshold_average - scope:recipient = { - any_courtier = { - count < 10 - } - } - } - aptitude:master_of_hunt_court_position >= 4 - aptitude:keeper_of_the_horses_court_position >= 4 - aptitude:boyan_court_position >= 4 - aptitude:siege_engineer_court_position >= 4 - aptitude:yurtchi_court_position >= 4 - aptitude:cherbi_court_position >= 4 - aptitude:yeke_jarquchi_court_position >= 4 - aptitude:foreign_emissary_court_position >= 4 - } - } - } - } - desc = AI_INTERESTING_COURTIER_REASON - } - - modifier = { - add = 100 - scope:secondary_actor.prowess >= decent_skill_rating - scope:recipient.number_of_knights < scope:recipient.max_number_of_knights - desc = AI_KNIGHT_REASON - } - - modifier = { - add = 100 - exists = scope:secondary_actor.inspiration - desc = AI_INSPIRED_REASON - } - - modifier = { - add = 100 - scope:secondary_actor = { - is_close_or_extended_family_of = scope:recipient - } - desc = AI_FAMILY_REASON - } - - modifier = { - add = 100 - scope:secondary_actor = { - is_consort_of = scope:recipient - } - desc = AI_SPOUSE_REASON - } - - modifier = { - add = 100 - scope:secondary_actor = { - has_relation_friend = scope:recipient - } - desc = AI_FRIEND_REASON - } - - modifier = { - add = -200 - scope:secondary_actor = { - has_relation_rival = scope:recipient - } - desc = AI_RIVAL_REASON - } - - modifier = { - add = 100 - scope:recipient = { - any_courtier = { - is_consort_of = scope:secondary_actor - } - } - desc = AI_SPOUSE_OF_COURTIER_REASON - } - - modifier = { - add = 100 - scope:recipient = { - any_courtier = { - count < 5 - } - } - desc = AI_LACK_COURTIERS_REASON - } - } - - ai_potential = { - OR = { - ai_greed <= 25 - is_obedient = yes - } - OR = { - is_tributary = yes - num_of_relation_friend > 0 - num_of_relation_lover > 0 - } - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - } - } - } - - modifier = { - add = 100 - scope:recipient = { - is_tributary_of = scope:actor - OR = { - ai_greed <= -50 - is_obedient_to = scope:actor - opinion = { - target = scope:actor - value >= 50 - } - } - } - } - - modifier = { - factor = 0 - scope:secondary_actor = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - } - } - } - - modifier = { - factor = 0 - scope:actor = { - NOR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder - } - } - scope:secondary_actor = { - is_close_or_extended_family_of = scope:actor - } - } - - modifier = { # The AI only offers really good characters - factor = 0 - scope:secondary_actor = { - NOR = { - sum_of_all_skills_value >= sum_of_all_skills_threshold_good - martial >= monumentally_high_skill_rating - prowess >= extremely_high_skill_rating - exists = inspiration - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_chancellor ?= { diplomacy < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_steward ?= { stewardship < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_spymaster ?= { intrigue < monumentally_high_skill_rating } - } - trigger_if = { - limit = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - OR = { - AND = { - sum_of_all_skills_value >= sum_of_all_skills_threshold_average - scope:recipient = { - any_courtier = { - count < 10 - } - } - } - aptitude:master_of_hunt_court_position >= 4 - aptitude:keeper_of_the_horses_court_position >= 4 - aptitude:boyan_court_position >= 4 - aptitude:siege_engineer_court_position >= 4 - aptitude:yurtchi_court_position >= 4 - aptitude:cherbi_court_position >= 4 - aptitude:yeke_jarquchi_court_position >= 4 - aptitude:foreign_emissary_court_position >= 4 - } - } - } - } - } - modifier = { - factor = 0 - scope:actor = { - has_title = title:e_minister_of_personnel - } - } - } - - on_send = { - scope:secondary_actor = { # to block the same character from being offered twice - add_character_flag = { - flag = has_been_offered_as_concubine - days = 5 - } - } - } - - on_accept = { - if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_personnel - } - scope:recipient = { - top_liege = scope:actor.top_liege - } - } - scope:recipient = { - add_courtier = scope:secondary_actor - scope:secondary_actor = { - every_consort = { - limit = { - is_courtier_of = scope:actor - } - scope:recipient = { - add_courtier = prev - } - } - every_child = { - limit = { - is_adult = no - is_courtier_of = scope:recipient - } - scope:actor = { - add_courtier = prev - } - } - } - } - scope:actor = { - if = { - limit = { - government_has_flag = government_has_influence - } - change_influence = { - value = scope:secondary_actor.average_of_all_skills_and_prowess - multiply = 5 - if = { - limit = { - scope:secondary_actor = { - is_close_or_extended_family_of = scope:actor - } - } - add = 100 - } - } - } - } - } - else = { - scope:secondary_actor = { - add_opinion = { - target = scope:recipient - modifier = annoyed_opinion - opinion = 10 - } - } - scope:recipient = { - add_courtier = scope:secondary_actor - scope:secondary_actor = { - every_consort = { - limit = { - is_courtier_of = scope:actor - } - scope:recipient = { - add_courtier = prev - } - } - every_child = { - limit = { - is_adult = no - is_courtier_of = scope:recipient - } - scope:actor = { - add_courtier = prev - } - } - } - add_opinion = { - target = scope:actor - modifier = grateful_opinion - opinion = 10 - } - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = msg_courtier_offer_rejected_title - right_icon = scope:recipient - left_icon = scope:secondary_actor - custom_tooltip = msg_courtier_offer_rejected - } - } - } -} - -# Demand Courtier -demand_courtier_interaction = { - category = interaction_category_vassal - common_interaction = no - icon = request_courtier_interaction - interface_priority = 45 - - desc = demand_courtier_interaction_desc - - ai_targets = { - ai_recipients = tributaries - ai_recipients = vassals - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 60 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - cooldown_against_recipient = { years = 3 } - - greeting = positive - notification_text = DEMAND_COURTIER_NOTIFICATION - - highlighted_reason = HIGHLIGHTED_SKILLED_COURTIER - is_highlighted = { - scope:recipient = { - any_courtier = { - is_available_healthy_ai_adult = yes - NOR = { - is_consort_of = scope:recipient - is_heir_of = scope:recipient - AND = { - is_female = yes - patrilinear_marriage = yes - } - AND = { - is_male = yes - matrilinear_marriage = yes - } - is_diarch = yes - is_designated_diarch = yes - has_character_flag = has_been_offered_as_concubine - } - OR = { - sum_of_all_skills_value >= sum_of_all_skills_threshold_good - martial >= monumentally_high_skill_rating - prowess >= extremely_high_skill_rating - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_chancellor ?= { diplomacy < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_steward ?= { stewardship < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_spymaster ?= { intrigue < monumentally_high_skill_rating } - } - trigger_if = { - limit = { - scope:actor = { - government_has_flag = government_is_nomadic - } - } - OR = { - aptitude:master_of_hunt_court_position >= 4 - aptitude:keeper_of_the_horses_court_position >= 4 - aptitude:boyan_court_position >= 4 - aptitude:siege_engineer_court_position >= 4 - aptitude:yurtchi_court_position >= 4 - aptitude:cherbi_court_position >= 4 - aptitude:yeke_jarquchi_court_position >= 4 - aptitude:foreign_emissary_court_position >= 4 - } - } - } - } - } - } - - needs_recipient_to_open = yes - - populate_actor_list = { - scope:recipient = { - every_courtier = { - limit = { - is_available_healthy_ai_adult = yes - NOR = { - is_consort_of = scope:recipient - is_heir_of = scope:recipient - AND = { - is_female = yes - patrilinear_marriage = yes - } - AND = { - is_male = yes - matrilinear_marriage = yes - } - is_diarch = yes - is_designated_diarch = yes - has_character_flag = has_been_offered_as_concubine - } - } - add_to_list = characters - } - } - } - - is_shown = { - scope:actor != scope:recipient - scope:recipient = { - OR = { - trigger_if = { - limit = { - scope:actor = { - government_allows = obedience - } - } - is_vassal_of = scope:actor - } - is_tributary_of = scope:actor - AND = { # Celestial has this available towards vassals - scope:actor = { government_has_flag = government_is_celestial } - liege = scope:actor - } - AND = { # The minister of personnel can use it against every ruler in the realm - scope:actor = { has_title = title:e_minister_of_personnel } - is_ruler = yes - top_liege = scope:actor.top_liege - # Except the top liege - top_liege != this - } - } - } - } - - is_valid_showing_failures_only = { - custom_tooltip = { - text = demand_courtier_valid_courtier_tt - scope:recipient = { - any_courtier = { - is_available_healthy_ai_adult = yes - NOR = { - is_consort_of = scope:recipient - is_heir_of = scope:recipient - AND = { - is_female = yes - patrilinear_marriage = yes - } - AND = { - is_male = yes - matrilinear_marriage = yes - } - is_diarch = yes - is_designated_diarch = yes - has_character_flag = has_been_offered_as_concubine - } - } - } - } - } - - can_be_picked = { - is_adult = yes - } - - can_send = { - } - - auto_accept = { - scope:actor = { - has_title = title:e_minister_of_personnel - custom_tooltip = { - text = same_realm_tt - top_liege = scope:recipient.top_liege - } - } - scope:recipient = { - is_ai = yes - } - } - - send_options_exclusive = no - - # Use hook - send_option = { - is_shown = { # Not available towards tributaries - scope:recipient = { - NOT = { is_tributary_of = scope:actor } - } - } - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { - has_usable_hook = scope:recipient - } - scope:recipient = { - NOT = { is_tributary_of = scope:actor } - } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - ai_accept = { - base = 0 - - modifier = { - add = 1000 - scope:recipient = { - is_obedient_to = scope:actor - } - desc = AI_OBEDIENT_REASON - } - - modifier = { - add = 25 - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - - modifier = { - add = 50 - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - modifier = { - add = -25 - scope:secondary_actor = { - OR = { - is_councillor = yes - has_any_court_position = yes - } - } - desc = AI_EMPLOYED_COURTIER_REASON - } - - modifier = { - add = -15 - scope:secondary_actor = { - is_knight = yes - } - desc = AI_IS_KNIGHT_REASON - } - - modifier = { - add = -50 - exists = scope:secondary_actor.inspiration - desc = AI_INSPIRED_REASON - } - - modifier = { - add = -25 - scope:secondary_actor = { - is_close_or_extended_family_of = scope:recipient - } - desc = AI_FAMILY_REASON - } - - modifier = { - add = -50 - scope:secondary_actor = { - has_relation_friend = scope:recipient - } - desc = AI_FRIEND_REASON - } - - # Used a hook - modifier = { - add = 100 - scope:hook ?= yes - desc = SCHEME_WEAK_HOOK_USED - } - - modifier = { - add = 1000 - scope:secondary_actor = { - has_relation_rival = scope:recipient - } - desc = AI_RIVAL_REASON - } - } - - ai_potential = { - ai_greed >= 0 - any_tributary = { } - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:secondary_actor = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - sum_of_all_skills_value >= sum_of_all_skills_threshold_good - martial >= monumentally_high_skill_rating - prowess >= extremely_high_skill_rating - exists = inspiration - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_chancellor ?= { diplomacy < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_steward ?= { stewardship < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_spymaster ?= { intrigue < monumentally_high_skill_rating } - } - trigger_if = { - limit = { - scope:actor = { - government_allows = obedience - } - } - OR = { - AND = { - sum_of_all_skills_value >= sum_of_all_skills_threshold_average - scope:actor = { - any_courtier = { - count < 10 - } - } - } - aptitude:master_of_hunt_court_position >= 4 - aptitude:keeper_of_the_horses_court_position >= 4 - aptitude:boyan_court_position >= 4 - aptitude:siege_engineer_court_position >= 4 - aptitude:yurtchi_court_position >= 4 - aptitude:cherbi_court_position >= 4 - aptitude:yeke_jarquchi_court_position >= 4 - aptitude:foreign_emissary_court_position >= 4 - } - } - } - } - } - - modifier = { - factor = 0 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - } - } - } - modifier = { - factor = 0 - scope:actor = { - has_title = title:e_minister_of_personnel - } - } - } - - on_send = { - scope:secondary_actor = { # to block the same character from being offered twice - add_character_flag = { - flag = has_been_offered_as_concubine - days = 5 - } - } - } - - on_accept = { - if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_personnel - } - scope:recipient = { - top_liege = scope:actor.top_liege - } - } - scope:actor = { - add_courtier = scope:secondary_actor - scope:secondary_actor = { - every_consort = { - limit = { - is_courtier_of = scope:recipient - } - scope:actor = { - add_courtier = prev - } - } - every_child = { - limit = { - is_adult = no - is_courtier_of = scope:recipient - } - scope:actor = { - add_courtier = prev - } - } - } - } - } - else = { - scope:secondary_actor = { - add_opinion = { - target = scope:recipient - modifier = annoyed_opinion - opinion = -10 - } - } - scope:actor = { - add_courtier = scope:secondary_actor - scope:secondary_actor = { - every_consort = { - limit = { - is_courtier_of = scope:recipient - } - scope:actor = { - add_courtier = prev - } - } - every_child = { - limit = { - is_adult = no - is_courtier_of = scope:recipient - } - scope:actor = { - add_courtier = prev - } - } - } - add_opinion = { - target = scope:recipient - modifier = pleased_opinion - opinion = 20 - } - # Use Hook - if = { - limit = { scope:hook = yes } - use_hook = scope:recipient - } - } - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = upset_opinion - opinion = -15 - } - } - } - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = msg_courtier_demand_rejected_title - right_icon = scope:recipient - left_icon = scope:secondary_actor - custom_tooltip = msg_courtier_demand_rejected - } - } - scope:actor = { - add_opinion = { - target = scope:recipient - modifier = upset_opinion - opinion = -15 - } - } - } -} - -# Demand Concubine -demand_concubine_interaction = { - category = interaction_category_vassal - common_interaction = no - icon = request_concubine_interaction - interface_priority = 44 - - desc = demand_concubine_interaction_desc - - ai_targets = { - ai_recipients = tributaries - ai_recipients = vassals - } - ai_target_quick_trigger = { - adult = yes - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - cooldown_against_recipient = { years = 3 } - - greeting = positive - notification_text = DEMAND_CONCUBINE_NOTIFICATION - - needs_recipient_to_open = yes - - populate_actor_list = { - scope:recipient = { - every_courtier = { - limit = { - is_physically_able_adult = yes - is_ruler = no - could_marry_character_trigger = { CHARACTER = scope:actor } - } - add_to_list = characters - } - } - } - - is_shown = { - scope:actor != scope:recipient - scope:actor = { - allowed_concubines = yes - NOR = { # We expect scope:actor to Exact Tribute for this purpose when Merit- or Mandala-based instead - government_has_flag = government_has_merit - government_has_flag = government_is_mandala - } - } - scope:recipient = { - OR = { - trigger_if = { - limit = { - scope:actor = { - government_has_flag = government_is_nomadic - } - } - is_vassal_of = scope:actor - } - is_tributary_of = scope:actor - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - allowed_more_concubines = yes - is_physically_able_adult = yes - } - custom_tooltip = { - text = must_have_valid_concubine_tt - scope:recipient = { - any_courtier = { - is_physically_able_adult = yes - is_ruler = no - could_marry_character_trigger = { CHARACTER = scope:actor } - } - } - } - } - - can_be_picked = { - is_adult = yes - } - - can_send = { - } - - auto_accept = no - - ai_accept = { - base = 0 - - modifier = { - add = 1000 - scope:recipient = { - is_obedient_to = scope:actor - } - desc = AI_OBEDIENT_REASON - } - - modifier = { - add = 25 - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - - modifier = { - add = 50 - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - modifier = { - add = -25 - scope:secondary_actor = { - OR = { - is_councillor = yes - has_any_court_position = yes - } - } - desc = AI_EMPLOYED_COURTIER_REASON - } - - modifier = { - add = -15 - scope:secondary_actor = { - is_knight = yes - } - desc = AI_IS_KNIGHT_REASON - } - - modifier = { - add = -50 - exists = scope:secondary_actor.inspiration - desc = AI_INSPIRED_REASON - } - - modifier = { - add = -25 - scope:secondary_actor = { - is_close_or_extended_family_of = scope:recipient - } - desc = AI_FAMILY_REASON - } - - modifier = { - add = -50 - scope:secondary_actor = { - has_relation_friend = scope:recipient - } - desc = AI_FRIEND_REASON - } - - modifier = { - add = -50 - scope:secondary_actor = { - is_consort_of = scope:recipient - } - desc = AI_SPOUSE_REASON - } - - modifier = { - add = -50 - scope:secondary_actor = { - is_child_of = scope:recipient - } - desc = AI_CHILD_REASON - } - - modifier = { - add = 1000 - scope:secondary_actor = { - has_relation_rival = scope:recipient - } - desc = AI_RIVAL_REASON - } - } - - ai_potential = { - OR = { - has_trait = lustful - ai_honor <= 0 - } - any_tributary = { } - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:secondary_actor = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - sum_of_all_skills_value >= sum_of_all_skills_threshold_good - martial >= monumentally_high_skill_rating - prowess >= extremely_high_skill_rating - exists = inspiration - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_chancellor ?= { diplomacy < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_steward ?= { stewardship < monumentally_high_skill_rating } - } - AND = { - diplomacy >= monumentally_high_skill_rating - scope:actor.cp:councillor_spymaster ?= { intrigue < monumentally_high_skill_rating } - } - has_conventionally_attractive_trigger = yes - num_of_good_genetic_traits > 1 - } - } - } - - modifier = { - factor = 0 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_lover = scope:actor - } - } - } - - modifier = { - factor = 0 - scope:secondary_actor = { - OR = { - has_conventionally_ugly_trigger = yes - age >= 30 - is_visibly_fertile = no - } - } - } - } - - on_send = { - scope:secondary_actor = { # to block the same character from being offered twice - add_character_flag = { - flag = has_been_offered_as_concubine - days = 5 - } - } - } - - on_accept = { - scope:recipient = { - if = { - limit = { - scope:secondary_actor = { - NOR = { - is_consort_of = scope:recipient - is_close_or_extended_family_of = scope:recipient - } - } - } - add_opinion = { - target = scope:actor - modifier = upset_opinion - opinion = -15 - } - } - else = { - scope:secondary_actor = { save_scope_as = relationship_reason_involved_character } - progress_towards_rival_effect = { - REASON = rival_demanded_concubine - CHARACTER = scope:actor - OPINION = 0 - } - add_opinion = { - target = scope:actor - modifier = upset_opinion - opinion = -50 - } - clear_saved_scope = secondary_actor - } - } - demand_concubine_interaction_on_accept_effect = yes - } - - on_decline = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = msg_concubine_demand_rejected_title - right_icon = scope:recipient - left_icon = scope:secondary_actor - custom_tooltip = msg_courtier_demand_rejected - } - } - scope:actor = { - add_opinion = { - target = scope:recipient - modifier = upset_opinion - opinion = -15 - } - } - } -} - -### Offer Tributary Status - bilateral -# actor = suzerain -# recipient = tributary - -offer_tributary_status_interaction = { #Embrace as Tributary - category = interaction_category_vassal - common_interaction = yes - icon = icon_liege - - desc = offer_tributary_status_interaction_desc - - is_shown = { - scope:actor = { - government_allows = ask_for_tribute #Mandala Government - is_landed = yes - NOT = { - this = scope:recipient - top_suzerain = scope:recipient.top_suzerain # ensures the actor and recipient is not already in the same "suzerain bloc" - } - } - scope:recipient = { - this != scope:actor - is_independent_ruler = yes # target cannot be a vassal - is_landed = yes - NOT = { government_has_flag = cannot_be_vassal_or_liege } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - NOT = { has_truce = scope:actor } - is_physically_able = yes - custom_tooltip = { - text = offer_tributary_status_interaction_cant_use_tributaries_tt - can_have_tributaries_trigger = yes - } - } - scope:recipient = { - trigger_if = { - limit = { is_tributary = yes } - NOT = { scope:actor = scope:recipient.suzerain } - custom_tooltip = { - text = offer_tributary_status_interaction_tributary_was_recently_subjugated - NOT = { has_truce = scope:recipient.suzerain } - } - } - trigger_else = { is_tributary = no } - custom_tooltip = { - text = offer_tributary_status_interaction_cooldown_active_tt - NOT = { - has_opinion_modifier = { - modifier = tributary_request_denied_opinion - target = scope:actor - } - } - } - custom_tooltip = { - text = offer_tributary_status_interaction_warred_cooldown_active_tt - NOT = { - has_opinion_modifier = { - modifier = warred_into_submission_opinion - target = scope:actor - } - } - } - trigger_if = { - limit = { government_has_flag = government_is_celestial } - highest_held_title_tier <= tier_duchy - } - trigger_else = { highest_held_title_tier < tier_hegemony } #Hegemons bow to one - } - } - - cost = { - piety = { - value = { - value = { - value = minor_piety_value - divide = 2 - } - multiply = scope:actor.primary_title.tier - if = { - limit = { - scope:recipient = { - has_opinion_modifier = { - modifier = tributary_ceased_payments_opinion - target = scope:actor - } - } - } - multiply = activity_cost_scale_by_era - } - #Mandala Godking AI - if = { - limit = { - scope:actor = { - has_variable = mandala_godking - is_ai = yes - } - } - multiply = 0.25 - } - } - } - } - - greeting = positive - notification_text = OFFER_TRIBUTARY_STATUS_INTERACTION_NOTIFICATION - - # Low starting obligations - send_option = { - flag = low_obligations - localization = low_tributary_obligations - starts_enabled = { - scope:actor = { is_ai = yes } - } - } - - # Medium starting obligations - send_option = { - flag = normal_obligations - localization = normal_tributary_obligations - starts_enabled = { - scope:actor = { is_ai = no } - } - is_valid = { - scope:actor = { is_ai = no } - } - } - - # High starting obligations - send_option = { - flag = high_obligations - localization = high_tributary_obligations - is_valid = { - scope:actor = { is_ai = no } - } - } - - send_options_exclusive = yes - - on_accept = { - #They have a Suzerain? Uh-oh - if = { - limit = { - scope:recipient = { is_tributary = yes } - } - show_as_tooltip = { - scope:recipient = { - end_tributary = yes - } - random_list = { - 50 = { - show_chance = no - desc = offer_tributary_status_interaction_suzerain_intervene.t - custom_tooltip = offer_tributary_status_interaction_suzerain_starts_war_tt - } - 50 = { - show_chance = no - desc = offer_tributary_status_interaction_suzerain_nothing.t - mandala_embrace_tributary_effect = yes - } - } - } - #Trigger the Suzerain - scope:recipient.suzerain = { trigger_event = tgp_east_asia_interaction_events.0030 } - } - #No Suzerain? No problem! - else = { - mandala_embrace_tributary_effect = yes - } - #Drop the Confederation pls - scope:recipient = { - if = { - limit = { - is_confederation_member = yes - confederation ?= { is_house_based = no } - } - confederation = { remove_confederation_member = scope:recipient } - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0363 - } - scope:recipient = { - add_opinion = { - modifier = tributary_request_denied_opinion # this opinion also acts as a built-in cooldown - target = scope:actor - years = 3 - } - } - } - - ai_maybe = yes - - ai_potential = { - is_independent_ruler = yes - } - - ai_targets = { - ai_recipients = neighboring_rulers_including_tributary_borders - } - - ai_frequency_by_tier = { - barony = 0 - county = 24 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - force_notification = yes - - ai_will_do = { - base = 0 - - modifier = { - add = { - add = scope:recipient.gold - divide = 10 - max = 100 - } - desc = accumulated_wealth_reason - } - - ai_military_threat_modifier = { SENDER = scope:actor RECEIVER = scope:recipient MULTIPLIER = -1 } - - modifier = { # Generally don't try to tributarize those of higher rank than you - trigger = { - "scope:recipient.tier_difference(scope:actor)" > 1 - } - add = -20 - } - - modifier = { # Generally don't try to tributarize those of higher piety_level than you - trigger = { - scope:recipient.piety_level > scope:actor.piety_level - } - add = -30 - } - - modifier = { # Remote Realm. - trigger = { - scope:actor = { - NOT = { - any_neighboring_top_liege_realm_owner = { this = scope:recipient } - } - } - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value >= squared_distance_major } } - } - add = -25 - } - - modifier = { # Remote Realm. - trigger = { - NOT = { - scope:recipient = { - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:actor - } - } - } - } - add = -25 - } - - #Generally don't try to Tributarize those larger than you - modifier = { - trigger = { - scope:actor.realm_size < scope:recipient.realm_size - } - factor = 0 - } - } - - ai_min_reply_days = 5 - ai_max_reply_days = 10 - - ai_accept = { - base = -50 - #I am a Tribal! - modifier = { - scope:recipient = { government_has_flag = government_is_tribal } - add = 30 - desc = recipient_is_a_tribal_government - } - #... but I am in a confederation - modifier = { - scope:recipient = { is_confederation_member = yes } - add = -50 - desc = recipient_is_in_a_confederation - } - - #Your Radiance - #Radiance Value x2 - modifier = { - scope:actor = { has_unruined_mandala_capital_trigger = yes } - add = { - value = scope:actor.mandala_radiance_value - multiply = 2 - } - desc = actor_positive_mandala_radiance - } - #Are they independent but a neighboring Mandala more Radiant than you? - #We reduce acceptance by the radience difference x2 - modifier = { - trigger_if = { - limit = { - scope:actor = { has_unruined_mandala_capital_trigger = yes } - scope:recipient = { - is_tributary = no - OR = { - government_has_flag = government_is_mandala - government_has_flag = government_is_tribal - } - } - } - scope:recipient = { - OR = { - any_neighboring_top_liege_realm_owner = { - has_unruined_mandala_capital_trigger = yes - government_has_flag = government_is_mandala - NOR = { - this = scope:actor - this = scope:recipient - } - save_temporary_scope_as = suzerain_comparison - } - any_neighboring_top_suzerain_realm_owner ?= { - has_unruined_mandala_capital_trigger = yes - government_has_flag = government_is_mandala - NOR = { - this = scope:actor - this = scope:recipient - } - save_temporary_scope_as = suzerain_comparison - } - } - } - always = yes - } - trigger_else = { always = no } - add = { - #Double it as we would with your own radiance impact above and reduce acceptance by that value - value = { - value = scope:suzerain_comparison.mandala_radiance_value - multiply = 2 - } - multiply = -1 - } - desc = other_devaraja_radiance - } - #Is their current Devaraja Suzerain more Radiant than you? - #We reduce acceptance by the radiance difference x2 - modifier = { - trigger_if = { - limit = { - scope:recipient = { - is_tributary = yes - overlord = { - government_has_flag = government_is_mandala - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value > 0 - } - } - scope:actor = { - has_unruined_mandala_capital_trigger = yes - } - } - always = yes - } - trigger_else = { always = no } - add = { - #Double it as we would with your own radiance impact above and reduce acceptance by that value - value = { - value = scope:recipient.overlord.mandala_radiance_value - multiply = 2 - } - multiply = -1 - } - desc = devaraja_overlord_radiance - } - - modifier = { - desc = is_prosperity_mandala_tributary - scope:recipient = { - is_tributary = yes - suzerain = { has_realm_law_flag = tributaries_less_likely_to_break_free } - } - add = 15 - } - - # - modifier = { - desc = tgp_sea_legacy_2_modifier_desc - scope:actor = { - dynasty ?= { - has_dynasty_perk = tgp_sea_legacy_2 - } - } - add = tgp_sea_legacy_tributary_acceptance_value - } - - #Mandala Piety Level - #This is only checked if you are not a Devaraja/haven't got a capital temple complex - Otherwise we use Radiance - mandala_devaraja_piety_level_add_weight_modifier = { DEVARAJA = scope:actor } - - #Tributary Realm Size - subject_realm_size_lose_weight_modifier = { - DEVARAJA = scope:actor - SUBJECT = scope:recipient - } - - ai_military_threat_modifier = { SENDER = scope:recipient RECEIVER = scope:actor MULTIPLIER = 1 } # if the actor is a major threat to the recipient they're more likely to accept - - modifier = { # I have a Capital Temple Complex of my own (I am also a God King) - desc = tributary_interaction_aibehavior_recipient_capital_complex - trigger = { - scope:recipient.capital_province ?= { - has_building_with_flag = mandala_capital_building - has_ruined_great_building = no - } - } - add = -200 - } - - modifier = { # I am higher rank than you - desc = tributary_interaction_aibehavior_recipient_tier_tt - trigger = { - scope:recipient = { - highest_held_title_tier > scope:actor.highest_held_title_tier - } - } - add = { - value = scope:recipient.highest_held_title_tier - subtract = scope:actor.highest_held_title_tier - multiply = 50 - multiply = -1 - } - } - - modifier = { # Same Faith and Actor is a god King - desc = embrace_as_tributary_interaction_same_faith - trigger = { - scope:actor.faith = scope:recipient.faith - scope:actor.capital_province = { - has_building_with_flag = mandala_capital_building - has_ruined_great_building = no - } - } - add = { - value = 10 - } - } - - modifier = { # Different faith, no pluralism. - desc = offer_vassalization_interaction_aibehavior_differentfaith_tt - trigger = { - scope:recipient = { - faith = { - NOR = { # Of two different faiths AND the potential tributary's faith is not pluralistic - this = scope:actor.faith - has_doctrine = doctrine_pluralism_pluralistic - } - } - } - } - add = { - value = -25 - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_hostile_level - } - } - } - add = -10 - } - if = { - limit = { - scope:recipient.faith = { - faith_hostility_level = { - target = scope:actor.faith - value >= faith_evil_level - } - } - } - add = -25 - } - } - } - - modifier = { # Different religion Family - We prefer god kings to be vaguely within our own world view - desc = embrace_as_tributary_interaction_other_religion_family - trigger = { - scope:recipient = { - NOT = { government_has_flag = government_is_wanua } - } - scope:actor.faith.religion = { - switch = { - trigger = is_in_family - rf_pagan = { - scope:recipient.faith.religion = { NOT = { is_in_family = rf_pagan } } - } - rf_sinitic = { - scope:recipient.faith.religion = { NOT = { is_in_family = rf_sinitic } } - } - rf_eastern = { - scope:recipient.faith.religion = { NOT = { is_in_family = rf_eastern } } - } - rf_abrahamic = { - scope:recipient.faith.religion = { NOT = { is_in_family = rf_abrahamic } } - } - } - } - } - add = { - value = -25 - if = { - limit = { - government_has_flag = government_is_theocracy - } - subtract = 975 #Bishops, popes, etc, feel more strongly about this. - } - } - } - # They are not Mandalas nor Tribes - modifier = { - desc = embrace_as_tributary_interaction_wrong_government - scope:recipient = { - NOR = { - government_has_flag = government_is_mandala - government_has_flag = government_is_tribal - } - } - add = { - value = -50 - if = { - limit = { - scope:recipient = { - OR = { - government_allows = administrative - government_has_flag = government_is_nomadic - } - } - #If you're radiant enough... - scope:actor = { - trigger_if = { - limit = { has_unruined_mandala_capital_trigger = yes } - mandala_radiance_value < 80 - } - } - } - subtract = 950 #Some governments are especially unlikely to agree - } - #Not radiant enough - if = { - limit = { - scope:actor = { - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value <= 40 - } - } - subtract = 100 - } - } - } - #We single out Japan specifically - modifier = { - desc = embrace_as_tributary_interaction_wrong_government - scope:recipient = { government_is_japanese_trigger = yes } - add = -1000 - } - #Far away - modifier = { - desc = offer_vassalization_interaction_aibehavior_remoterealm_tt - trigger = { - scope:recipient = { - NOT = { - any_neighboring_top_liege_realm_owner = { - OR = { - this = scope:actor - top_overlord ?= scope:actor - } - } - } - } - trigger_if = { #Islands we can get farther away - limit = { - scope:recipient.capital_county ?= { is_coastal_county = yes } - any_sub_realm_county = { is_coastal_county = yes } - } - scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value >= squared_distance_huge } } - } - trigger_else = { #Inland is harder - scope:recipient.capital_province ?= { squared_distance = { target = scope:actor.capital_province value >= squared_distance_major } } - } - } - add = -250 - } - - #Monotheist targets really shouldn't want to... unless you're Radiant enough - modifier = { - scope:recipient = { - faith = { has_doctrine = doctrine_monotheist } - } - #If you're radiant enough... - scope:actor = { - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value < 25 - } - add = -200 - desc = they_are_monotheist - } - modifier = { - scope:recipient = { - faith = { has_doctrine = doctrine_monotheist } - } - #If you're radiant enough... - scope:actor = { - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value >= 25 - mandala_radiance_value < 50 - } - add = -175 - desc = they_are_monotheist - } - modifier = { - scope:recipient = { - faith = { has_doctrine = doctrine_monotheist } - } - #If you're radiant enough... - scope:actor = { - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value >= 75 - mandala_radiance_value < 100 - } - add = -150 - desc = they_are_monotheist - } - modifier = { - scope:recipient = { - faith = { has_doctrine = doctrine_monotheist } - } - #If you're radiant enough... - scope:actor = { - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value >= 100 - } - add = -100 - desc = they_are_monotheist - } - - ### MANDALA ### - #Added threshold for Mandalas who already are Tributaries - modifier = { - scope:recipient = { is_tributary = yes } - NOT = { scope:recipient.suzerain = scope:actor } - add = { - value = 0 - if = { - limit = { - scope:recipient.suzerain = { has_unruined_mandala_capital_trigger = yes } - } - subtract = { - value = scope:recipient.mandala_radiance_value - multiply = 3 - } - } - else = { add = -15 } - max = -10 - } - desc = already_tributary_threshold_duchy_suzerain - } - - #AI Godkings should NOT want to become subjects - modifier = { - has_variable = mandala_godking - add = -1000 - desc = mandala_ai_godking_modifier - } - - #MINOR MODIFIERS - modifier = { # the bolder they are, the less likely they will agree to this and the more cowardly the more likely - NOT = { ai_boldness = 0 } - add = { - value = ai_boldness - multiply = -1 - divide = 4 - } - desc = TRIBUTARY_BOLDNESS_REASON - } - - modifier = { # the greedier they are, the less likely they will agree to this - ai_greed > 0 - add = { - value = ai_greed - multiply = -1 - divide = 4 - } - desc = TRIBUTARY_GREED_REASON - } - modifier = { # Rivalry modifier. - desc = embrace_tributarization_interaction_aibehavior_rival_tt - trigger = { - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - add = -30 - } - modifier = { # Nemesis modifier. - desc = embrace_tributarization_interaction_aibehavior_nemesis_tt - trigger = { - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - add = -100 - } - modifier = { # Same Dynasty modifier. - desc = embrace_tributarization_interaction_aibehavior_dynasty_tt - trigger = { - scope:recipient = { - dynasty = scope:actor.dynasty - } - } - add = 10 - } - - modifier = { # Cultural Acceptance - add = -5 - desc = cultural_acceptance_interaction_reason - trigger = { - scope:actor = { - NOT = { # cultural condition below doesn't have to apply if both actor and recipient have nomadic_philosophy - has_trait = nomadic_philosophy - scope:recipient = { has_trait = nomadic_philosophy } - } - NOT = { has_same_culture_as = scope:recipient } - culture = { - cultural_acceptance = { target = scope:recipient.culture value < 50 } - } - } - } - } - - modifier = { # Same language - add = 5 - desc = speaks_same_language_interaction_reason - trigger = { - scope:actor = { - knows_language_of_culture = scope:recipient.culture - } - } - } - - modifier = { # Encircled - desc = offer_vassalization_interaction_aibehavior_encircled_tt - trigger = { - scope:recipient = { - NOT = { - any_neighboring_top_liege_realm_owner = { this != scope:actor } - } - NOT = { - any_realm_county = { is_coastal_county = yes } - } - } - } - add = 20 - } - - #Mandala Obligation level matters - modifier = { - trigger_if = { - limit = { exists = scope:low_obligations } - scope:low_obligations = yes - } - trigger_else = { always = no } - add = 15 - desc = proposed_obligation_level_low - } - modifier = { - trigger_if = { - limit = { exists = scope:high_obligations } - scope:high_obligations = yes - } - trigger_else = { always = no } - add = -30 - desc = proposed_obligation_level_high - } - - #Legitimacy - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -15 - scope:actor = { - has_legitimacy_flag = slightly_reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -25 - scope:actor = { - has_legitimacy_flag = reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -50 - scope:actor = { - has_legitimacy_flag = very_reduced_tributarization_acceptance - } - } - modifier = { - desc = "LOW_LEGITIMACY_REASON" - add = -75 - scope:actor = { - has_legitimacy_flag = massively_reduced_tributarization_acceptance - } - } - - # HIGH LEGITIMACY - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 25 - scope:actor = { - has_legitimacy_flag = increased_tributarization_acceptance - } - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 50 - scope:actor = { - has_legitimacy_flag = very_increased_tributarization_acceptance - } - } - modifier = { - desc = "HIGH_LEGITIMACY_REASON" - add = 75 - scope:actor = { - has_legitimacy_flag = extra_increased_tributarization_acceptance - } - } - - - # OPINION INFLUENCE - opinion_modifier = { # Compare Opinion modifier. - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - } - - } -} - -### Reassert Tributary - unilateral -# actor = suzerain -# recipient = tributary - -reassert_tributary_interaction = { - category = interaction_category_vassal - common_interaction = yes - icon = icon_liege - - desc = reassert_tributary_interaction_desc - - is_shown = { - scope:actor = { - government_has_flag = government_is_mandala - } - scope:recipient = { - is_tributary_of = scope:actor - is_ai = yes - cease_tribute_payments_ai_chance > 0 - } - } - - is_valid_showing_failures_only = { - scope:actor = { - is_physically_able = yes - } - scope:recipient = { - custom_tooltip = { - text = reassert_tributary_interaction_cooldown_active_tt - NOT = { - has_opinion_modifier = { - modifier = reassertion_request_denied_opinion - target = scope:actor - } - } - } - custom_tooltip = { - text = reassert_tributary_interaction_reasserted_recently_tt - NOT = { has_variable = tributary_has_been_reasserted_recently } - } - } - } - - cost = { - piety = { - value = minor_piety_value - multiply = activity_cost_scale_by_era - #Mandala Godking AI - if = { - limit = { - scope:actor = { - has_variable = mandala_godking - is_ai = yes - } - } - multiply = 0.25 - } - } - } - - greeting = positive - notification_text = OFFER_TRIBUTARY_STATUS_INTERACTION_NOTIFICATION - - #Lower Obligations - ##Taxes - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - OR = { - vassal_contract_obligation_level:mandala_government_taxes = 1 - vassal_contract_obligation_level:mandala_government_taxes = 0 - } - } - } - is_valid = { - custom_tooltip = { - text = ALREADY_LOWEST_TAX_OBLIGATION - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_taxes = 1 - } - } - } - flag = decrease_tax_obligation_1 - localization = DECREASE_TAX_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_taxes = 2 - } - } - flag = decrease_tax_obligation_2 - localization = DECREASE_TAX_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_taxes = 3 - } - } - flag = decrease_tax_obligation_3 - localization = DECREASE_TAX_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_taxes = 4 - } - } - flag = decrease_tax_obligation_4 - localization = DECREASE_TAX_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_taxes = 5 - } - } - flag = decrease_tax_obligation_5 - localization = DECREASE_TAX_OBLIGATIONS - } - - ##Piety - send_option = { - is_shown = { - scope:recipient = { - has_subject_contract_group = tributary_mandala - OR = { - vassal_contract_obligation_level:mandala_government_piety = 1 - vassal_contract_obligation_level:mandala_government_piety = 0 - } - } - } - is_valid = { - custom_tooltip = { - text = ALREADY_LOWEST_PIETY_OBLIGATION - scope:recipient = { - has_subject_contract_group = tributary_mandala - vassal_contract_obligation_level:mandala_government_piety = 1 - } - } - } - flag = decrease_piety_obligation_1 - localization = DECREASE_PIETY_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - has_subject_contract_group = tributary_mandala - vassal_contract_obligation_level:mandala_government_piety = 2 - } - } - flag = decrease_piety_obligation_2 - localization = DECREASE_PIETY_OBLIGATIONS - } - - ##Prestige - send_option = { - is_shown = { - scope:recipient = { - has_subject_contract_group = tributary_mandala_tribal - OR = { - vassal_contract_obligation_level:mandala_government_prestige = 1 - vassal_contract_obligation_level:mandala_government_prestige = 0 - } - } - } - is_valid = { - custom_tooltip = { - text = ALREADY_LOWEST_PRESTIGE_OBLIGATION - scope:recipient = { - has_subject_contract_group = tributary_mandala - vassal_contract_obligation_level:mandala_government_prestige = 1 - } - } - } - flag = decrease_prestige_obligation_1 - localization = DECREASE_PRESTIGE_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - has_subject_contract_group = tributary_mandala_tribal - vassal_contract_obligation_level:mandala_government_prestige = 2 - } - } - flag = decrease_prestige_obligation_2 - localization = DECREASE_PRESTIGE_OBLIGATIONS - } - - ##Levies - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - OR = { - vassal_contract_obligation_level:mandala_government_levies = 1 - vassal_contract_obligation_level:mandala_government_levies = 0 - } - } - } - is_valid = { - custom_tooltip = { - text = ALREADY_LOWEST_LEVY_OBLIGATION - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_levies = 1 - } - } - } - flag = decrease_levy_obligation_1 - localization = DECREASE_LEVY_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_levies = 2 - } - } - flag = decrease_levy_obligation_2 - localization = DECREASE_LEVY_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_levies = 3 - } - } - flag = decrease_levy_obligation_3 - localization = DECREASE_LEVY_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_levies = 4 - } - } - flag = decrease_levy_obligation_4 - localization = DECREASE_LEVY_OBLIGATIONS - } - send_option = { - is_shown = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_mandala - has_subject_contract_group = tributary_mandala_tribal - } - vassal_contract_obligation_level:mandala_government_levies = 5 - } - } - flag = decrease_levy_obligation_5 - localization = DECREASE_LEVY_OBLIGATIONS - } - - #Dread - send_option = { - is_valid = { - scope:actor = { dread >= high_dread } - } - flag = dread - localization = GENERIC_USE_DREAD - } - - #Strong Hook - send_option = { - is_shown = { - NOT = { - scope:actor = { - house = { has_house_head_parameter = unlock_weak_hooks_to_reassert_tributaries } - } - } - } - is_valid = { - scope:actor = { has_strong_usable_hook = scope:recipient } - } - flag = hook - localization = GENERIC_USE_STRONG_HOOK - } - should_use_extra_icon = { - scope:actor = { has_strong_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_strong.dds" - - #Any Hook - send_option = { - is_shown = { - scope:actor = { - house = { has_house_head_parameter = unlock_weak_hooks_to_reassert_tributaries } - } - } - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = any_hook - localization = GENERIC_USE_HOOK - } - - #Pay Piety - send_option = { - is_shown = { - scope:actor = { has_realm_law_flag = can_use_piety_to_reassert_tributary } - } - is_valid = { - scope:actor.piety >= piety_bribe_value - } - flag = pay_piety - localization = PAY_PIETY - current_description = { - # Triggered desc so that we don't get a weird double tooltip. - triggered_desc = { - trigger = { scope:actor.piety >= piety_bribe_value } - desc = SCHEME_AGENT_PIETY_VALID - } - } - } - - send_options_exclusive = no - - on_accept = { - scope:recipient = { - custom_tooltip = { - text = reassert_tributary_interaction_effect_tt - set_variable = { - name = tributary_has_been_reasserted_recently - value = flag:yes - months = reassert_stickiness_months - } - } - } - - #LOWER OBLIGATIONS - ##Taxes - if = { - limit = { - OR = { - scope:decrease_tax_obligation_1 = yes - scope:decrease_tax_obligation_2 = yes - scope:decrease_tax_obligation_3 = yes - scope:decrease_tax_obligation_4 = yes - scope:decrease_tax_obligation_5 = yes - } - } - scope:recipient = { - if = { - limit = { vassal_contract_obligation_level:mandala_government_taxes = 5 } - tributary_contract_set_obligation_level = { - type = mandala_government_taxes - level = 4 - } - } - else_if = { - limit = { vassal_contract_obligation_level:mandala_government_taxes = 4 } - tributary_contract_set_obligation_level = { - type = mandala_government_taxes - level = 3 - } - } - else_if = { - limit = { vassal_contract_obligation_level:mandala_government_taxes = 3 } - tributary_contract_set_obligation_level = { - type = mandala_government_taxes - level = 2 - } - } - else_if = { - limit = { vassal_contract_obligation_level:mandala_government_taxes = 2 } - tributary_contract_set_obligation_level = { - type = mandala_government_taxes - level = 1 - } - } - else = { - tributary_contract_set_obligation_level = { - type = mandala_government_taxes - level = 0 - } - } - } - } - ##Piety - if = { - limit = { - OR = { - scope:decrease_piety_obligation_1 = yes - scope:decrease_piety_obligation_2 = yes - } - } - scope:recipient = { - if = { - limit = { vassal_contract_obligation_level:mandala_government_piety = 2 } - tributary_contract_set_obligation_level = { - type = mandala_government_piety - level = 1 - } - } - else = { - tributary_contract_set_obligation_level = { - type = mandala_government_piety - level = 0 - } - } - } - } - ##Prestige - if = { - limit = { - OR = { - scope:decrease_prestige_obligation_1 = yes - scope:decrease_prestige_obligation_2 = yes - } - } - scope:recipient = { - if = { - limit = { vassal_contract_obligation_level:mandala_government_prestige = 2 } - tributary_contract_set_obligation_level = { - type = mandala_government_prestige - level = 1 - } - } - else = { - tributary_contract_set_obligation_level = { - type = mandala_government_prestige - level = 0 - } - } - } - } - ##Levies - if = { - limit = { - OR = { - scope:decrease_levy_obligation_1 = yes - scope:decrease_levy_obligation_2 = yes - scope:decrease_levy_obligation_3 = yes - scope:decrease_levy_obligation_4 = yes - scope:decrease_levy_obligation_5 = yes - } - } - scope:recipient = { - if = { - limit = { vassal_contract_obligation_level:mandala_government_levies = 5 } - tributary_contract_set_obligation_level = { - type = mandala_government_levies - level = 4 - } - } - else_if = { - limit = { vassal_contract_obligation_level:mandala_government_levies = 4 } - tributary_contract_set_obligation_level = { - type = mandala_government_levies - level = 3 - } - } - else_if = { - limit = { vassal_contract_obligation_level:mandala_government_levies = 3 } - tributary_contract_set_obligation_level = { - type = mandala_government_levies - level = 2 - } - } - else_if = { - limit = { vassal_contract_obligation_level:mandala_government_levies = 2 } - tributary_contract_set_obligation_level = { - type = mandala_government_levies - level = 1 - } - } - else = { - tributary_contract_set_obligation_level = { - type = mandala_government_levies - level = 0 - } - } - } - } - - #Strong hook - if = { - limit = { - scope:hook = yes - scope:actor = { has_strong_usable_hook = scope:recipient } - } - scope:actor = { - use_hook = scope:recipient - } - } - #Weak Hook - if = { - limit = { - scope:any_hook = yes - scope:actor = { has_usable_hook = scope:recipient } - } - scope:actor = { - use_hook = scope:recipient - } - } - #Dread - if = { - limit = { scope:dread = yes } - scope:actor = { - add_piety = minor_piety_loss - } - scope:recipient = { - add_opinion = { - modifier = intimidated_tributary_opinion - target = scope:actor - opinion = -20 - } - } - } - #Piety - if = { - limit = { scope:pay_piety = yes } - scope:actor = { - add_piety = { - value = { - add = piety_bribe_half_value - multiply = -1 - } - } - } - scope:recipient = { add_piety = piety_bribe_half_value } - } - - #Look ma', no hands! - if = { - limit = { - NOR = { - scope:decrease_tax_obligation_1 = yes - scope:decrease_tax_obligation_2 = yes - scope:decrease_tax_obligation_3 = yes - scope:decrease_tax_obligation_4 = yes - scope:decrease_tax_obligation_5 = yes - scope:decrease_piety_obligation_1 = yes - scope:decrease_piety_obligation_2 = yes - scope:decrease_prestige_obligation_1 = yes - scope:decrease_prestige_obligation_2 = yes - scope:decrease_levy_obligation_1 = yes - scope:decrease_levy_obligation_2 = yes - scope:decrease_levy_obligation_3 = yes - scope:decrease_levy_obligation_4 = yes - scope:decrease_levy_obligation_5 = yes - scope:hook = yes - scope:dread = yes - scope:any_hook = yes - scope:pay_piety = yes - } - } - #You're quite the smooth-talker huh - show_as_tooltip = { - scope:actor.dynasty ?= { - add_dynasty_prestige = { - value = miniscule_dynasty_prestige_value - divide = 2 - } - } - } - } - - scope:actor = { - trigger_event = tgp_east_asia_interaction_events.0020 - } - - } - - on_decline = { - scope:actor = { - show_as_tooltip = { add_prestige = medium_prestige_loss } - trigger_event = tgp_east_asia_interaction_events.0025 - } - scope:recipient = { - show_as_tooltip = { - add_opinion = { - modifier = reassertion_request_denied_opinion # this opinion also acts as a built-in cooldown - target = scope:actor - opinion = -20 - } - } - } - } - - auto_accept = { - switch = { - trigger = always - scope:any_hook = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - OR = { - AND = { - scope:hook = yes - scope:actor = { has_strong_usable_hook = scope:recipient } - } - AND = { - scope:any_hook = yes - scope:actor = { has_usable_hook = scope:recipient } - } - } - } - } - scope:dread = { - custom_description = { - text = "leverage_dread_tt" - subject = scope:actor - object = scope:recipient - scope:dread = yes - } - } - scope:pay_piety = { - custom_description = { - text = "pay_piety_tt" - subject = scope:actor - object = scope:recipient - scope:pay_piety = yes - } - } - scope:decrease_tax_obligation_1 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_tax_obligation_1 = yes - } - } - scope:decrease_tax_obligation_2 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_tax_obligation_2 = yes - } - } - scope:decrease_tax_obligation_3 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_tax_obligation_3 = yes - } - } - scope:decrease_tax_obligation_4 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_tax_obligation_4 = yes - } - } - scope:decrease_tax_obligation_5 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_tax_obligation_5 = yes - } - } - scope:decrease_piety_obligation_1 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_piety_obligation_1 = yes - } - } - scope:decrease_piety_obligation_2 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_prestige_obligation_2 = yes - } - } - scope:decrease_levy_obligation_1 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_levy_obligation_1 = yes - } - } - scope:decrease_levy_obligation_2 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_levy_obligation_2 = yes - } - } - scope:decrease_levy_obligation_3 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_levy_obligation_3 = yes - } - } - scope:decrease_levy_obligation_4 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_levy_obligation_4 = yes - } - } - scope:decrease_levy_obligation_5 = { - custom_description = { - text = "reduce_obligation_tt" - subject = scope:actor - object = scope:recipient - scope:decrease_levy_obligation_5 = yes - } - } - } - } - - ai_maybe = yes - - ai_potential = { - government_has_flag = government_is_mandala - } - - ai_targets = { - ai_recipients = tributaries - } - - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - force_notification = yes - - ai_will_do = { # AI will often do this to valid targets that aren't a military threat to them, especially if they're rich - base = 50 - - modifier = { # Remote Realm. - trigger = { - scope:actor = { - NOT = { - any_neighboring_top_liege_realm_owner = { this = scope:recipient } - } - } - scope:actor.capital_province = { squared_distance = { target = scope:recipient.capital_province value >= squared_distance_major } } - } - add = -25 - } - } - - ai_min_reply_days = 3 - ai_max_reply_days = 7 - - ai_accept = { - base = -100 - - ai_military_threat_modifier = { SENDER = scope:recipient RECEIVER = scope:actor MULTIPLIER = 1 } # if the actor is a major threat to the recipient they're more likely to accept - - # MINOR - modifier = { # Rivalry modifier. - desc = embrace_tributarization_interaction_aibehavior_rival_tt - trigger = { - scope:recipient = { - has_relation_rival = scope:actor - NOT = { has_relation_nemesis = scope:actor } - } - } - add = -10 - } - modifier = { # Nemesis modifier. - desc = embrace_tributarization_interaction_aibehavior_nemesis_tt - trigger = { - scope:recipient = { - has_relation_nemesis = scope:actor - } - } - add = -100 - } - modifier = { # Same Dynasty modifier. - desc = embrace_tributarization_interaction_aibehavior_dynasty_tt - trigger = { - scope:recipient = { - dynasty = scope:actor.dynasty - } - } - add = 10 - } - - modifier = { - suzerain = { - government_has_flag = government_is_mandala - has_unruined_mandala_capital_trigger = yes - mandala_radiance_value > 0 - } - add = { - value = suzerain.mandala_radiance_value - multiply = 2 - } - desc = devaraja_overlord_radiance - } - - #Devaraja Piety Level - mandala_devaraja_piety_level_add_weight_modifier = { DEVARAJA = scope:actor } - - #Tributary Realm Size - subject_realm_size_lose_weight_modifier = { - DEVARAJA = scope:actor - SUBJECT = scope:recipient - } - - #Devaraja Mandala Capital - mandala_devaraja_capital_add_weight_modifier = { - DEVARAJA = scope:actor - TRIBUTARY = scope:recipient - } - - # OPINION INFLUENCE - opinion_modifier = { # Compare Opinion modifier. - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - } - } -} diff --git a/common/character_interactions/00_vassal_interactions.txt b/common/character_interactions/00_vassal_interactions.txt deleted file mode 100644 index 468d3fa4..00000000 --- a/common/character_interactions/00_vassal_interactions.txt +++ /dev/null @@ -1,4033 +0,0 @@ -#Interactions relating to vassals - -grant_vassal_interaction = { - category = interaction_category_vassal - common_interaction = yes - interface = transfer_vassal - icon = icon_vassal - - special_interaction = grant_vassal_interaction - - populate_actor_list = { - scope:actor = { - every_vassal = { - add_to_list = characters - } - } - } - - desc = grant_vassal_interaction_desc - - prompt = GRANT_VASSAL_SELECT_VASSAL_TO_TRANSFER - - greeting = positive - notification_text = GRANT_VASSAL_PROPOSAL - - pre_answer_yes_key = ACCEPT - pre_answer_no_key = DECLINE - - is_shown = { - scope:recipient != scope:actor - OR = { - AND = { - exists = scope:recipient.liege - scope:recipient.liege = scope:actor - } - AND = { - exists = scope:actor.liege - scope:actor.liege = scope:recipient - } - AND = { - scope:actor.faith.religious_head = scope:recipient - scope:recipient = { - top_liege = this - } - } - } - scope:recipient.highest_held_title_tier > tier_barony - } - - is_valid_showing_failures_only = { - scope:recipient = { - is_landed = yes # Landless rulers should not have Vassals - # Gallivanters won't accept additional responsibilities. - NOT = { has_trait = gallivanter } - } - NOT = { scope:actor = { is_at_war_with = scope:recipient } } - trigger_if = { - limit = { exists = scope:secondary_actor } - NOT = { scope:secondary_actor = { is_at_war_with = scope:recipient } } - scope:recipient.primary_title.tier > scope:secondary_actor.primary_title.tier - } - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - exists = scope:secondary_actor - } - trigger_if = { - limit = { - NOT = { - scope:recipient.primary_title = { - any_in_de_jure_hierarchy = { - holder = scope:secondary_actor - } - } - } - } - scope:recipient.vassal_count < scope:recipient.vassal_limit # Avoid creating vassals with unsustainable situations - } - scope:secondary_actor = { - NOT = { has_character_flag = ai_should_not_transfer } - } - } - trigger_if = { - limit = { scope:recipient.highest_held_title_tier <= tier_county } - scope:recipient = { highest_held_title_tier > tier_county } - } - trigger_else = { - scope:actor = { - custom_description = { - text = "basic_valid_vassal_to_tranfer" - object = scope:recipient - any_vassal = { - NOT = { highest_held_title_tier = tier_barony } - scope:recipient.highest_held_title_tier > highest_held_title_tier - } - } - } - } - # Prevent Admin AI transferring admin vassals under non-admin vassals - NAND = { - scope:actor ?= { - is_ai = yes - government_allows = administrative - } - scope:recipient ?= { - NOT = { government_allows = administrative } - } - scope:secondary_actor ?= { government_allows = administrative } - } - # Ritsuryo cannot transfer Soryo to Ritsuryo - custom_tooltip = { - text = ritsuryo_to_soryo_invalid_to_transfer - NAND = { - scope:actor ?= { has_government = japan_administrative_government } - scope:recipient ?= { has_government = japan_administrative_government } - scope:secondary_actor ?= { has_government = japan_feudal_government } - } - } - custom_tooltip = { - text = cannot_transfer_bloc_leader_as_vassal_tt - NOT = { - scope:secondary_actor ?= { - exists = house.house_confederation.leading_house - house.house_confederation.leading_house ?= house - is_house_head = yes - } - } - } - } - - can_be_picked = { - scope:recipient != root - highest_held_title_tier > tier_barony - highest_held_title_tier < scope:recipient.highest_held_title_tier - - trigger_if = { - limit = { scope:actor.liege = scope:recipient } - custom_tooltip = { - text = is_de_jure_liege_of_target - NOT = { - primary_title = { - any_this_title_or_de_jure_above = { - holder = scope:actor - } - } - } - } - } - - # You can't give your diarch away as a vassal. - custom_description = { - text = cannot_grant_own_diarch_as_vassal - subject = scope:actor.diarch - NOT = { root ?= scope:actor.diarch } - } - - # Not at war with the vassal being transferred (blocks explicit transfer of war enemies, which invalidates the war). - custom_description = { - text = "basic_is_at_war_with_vassal" - subject = root - object = scope:actor - NOT = { - root = { - is_at_war_with = scope:actor - } - } - } - - # Not at war with a vassal under the vassal being transferred (blocks implicit transfers of war enemies). - custom_description = { - text = "basic_is_at_war_with_sub_vassal" - subject = root - object = scope:actor - NOT = { - any_vassal_or_below = { - is_at_war_with = root - } - } - } - - # EP3 Admin - You cannot give away noble families - custom_description = { - text = admin_cannot_grant_vassal_noble_family - subject = root - trigger_if = { - limit = { - government_allows = administrative - } - any_held_title = { - is_noble_family_title = no - } - } - } - } - - auto_accept = { - scope:recipient = { - custom_description = { - text = wants_more_vassals - is_ai = yes - } - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = grant_vassal_interaction_notification - right_icon = scope:recipient - left_icon = scope:secondary_actor - - # If we're granting a vassal to our liege, gain a truce with our former vassal (we can't immediately reconquer them, and they can't attack us either). - if = { - limit = { - scope:actor = { - is_vassal_of = scope:recipient - } - } - add_truce_both_ways = { - character = scope:secondary_actor - days = 3650 - name = TRUCE_GRANT_INDEPENDENCE - } - } - - # Transfer the vassal over to their new liege. - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = no - } - scope:secondary_actor = { - change_liege = { - liege = scope:recipient - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - - # Gain an opinion bonus with the person we gave a vassal to. - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = granted_vassal - } - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = miniscule_unity_gain - DESC = clan_unity_grant_vassal.desc - REVERSE_NON_HOUSE_TARGET = yes - } - - hidden_effect = { - # Struggle catalyst - if = { - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:actor - SECOND = scope:recipient - } - scope:actor = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_grants_vassal_to_de_jure_liege_supporter_detractor - is_secondary_character_involvement_involved_trigger = { - CHAR = scope:recipient - } - } - } - scope:recipient.primary_title = { - any_this_title_or_de_jure_above = { - holder = scope:secondary_actor - } - } - } - scope:actor = { - every_character_struggle = { - involvement = involved - activate_struggle_catalyst = { - catalyst = catalyst_grants_vassal_to_de_jure_liege_supporter_detractor - character = scope:actor - } - log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_grants_vassal_to_de_jure_liege_supporter_detractor } - } - } - } - if = { - limit = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - while = { - limit = { - scope:secondary_actor ?= { - any_held_title = { - vassal_grant_de_jure_shift_trigger = yes - } - } - } - scope:secondary_actor ?= { - random_held_title = { - limit = { - vassal_grant_de_jure_shift_trigger = yes - } - set_de_jure_liege_title = scope:recipient.primary_title - } - } - } - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0211 - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:recipient - TARGET = scope:actor - VALUE = miniscule_unity_loss - DESC = clan_unity_grant_vassal_decline.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - # AI handled entirely though code -} - -retract_vassal_interaction = { - category = interaction_category_vassal - special_interaction = retract_vassal_interaction - interface = transfer_vassal - ai_maybe = yes - ai_min_reply_days = 4 - ai_max_reply_days = 9 - popup_on_receive = yes - pause_on_receive = yes - icon = icon_liege - - interface_priority = 109 #after revoke title - - desc = retract_vassal_interaction_desc - - on_decline_summary = general_rebellion_decline_summary - - prompt = RETRACT_VASSAL_SELECT_VASSAL_TO_RETRACT - - notification_text = RETRACT_VASSAL_PROPOSAL - - populate_recipient_list = { - scope:recipient = { - every_vassal = { - add_to_list = characters - } - } - } - - is_shown = { - scope:recipient != scope:actor - scope:recipient = { - highest_held_title_tier > tier_barony - liege = scope:actor - } - } - - is_valid_showing_failures_only = { - vassal_retraction_standard_valid_showing_failures_only_trigger = yes - # Make sure this exactly matches "can_be_picked" section below - scope:recipient = { - custom_description = { - text = "basic_vassal_to_retract" - any_vassal = { - highest_held_title_tier > tier_barony - } - } - } - # Plus make sure there's a legal right to retract. - scope:actor = { - trigger_if = { - limit = { - government_has_flag = government_is_tribal - } - custom_description = { - text = "has_law_allowing_vassal_retraction_tribal" - has_realm_law_flag = vassal_retraction_allowed - } - } - trigger_else_if = { - limit = { - government_has_flag = government_is_administrative - } - custom_description = { - text = "has_law_allowing_vassal_retraction_admin" - has_realm_law_flag = vassal_retraction_allowed - } - } - trigger_else = { - custom_description = { - text = "has_law_allowing_vassal_retraction_crown" - has_realm_law_flag = vassal_retraction_allowed - } - } - } - scope:recipient = { - NOT = { has_strong_hook = scope:actor } - } - custom_tooltip = { - text = cannot_take_overt_hostile_actions_against_diarch.tt - NOT = { scope:recipient ?= scope:actor.diarch } - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - } - } - - can_be_picked = { - highest_held_title_tier > tier_barony - } - - cost = { - # Usually, this action is free, but during certain diarchies, we want it to cost. - prestige = liege_diarchy_surcharge_interaction_retract_vassal_interaction_value - } - - on_send = { - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - } - hidden_effect = { - scope:secondary_recipient = { - add_character_flag = { - flag = ai_should_not_transfer - years = 3 - } - } - } - } - - on_accept = { - retract_vassal_interaction_effect = yes - - if = { - limit = { - scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } - } - scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } - } - - scope:actor = { - trigger_event = char_interaction.0220 - } - } - - on_decline = { - scope:actor = { vassal_revocation_tyranny_effect = yes } - war_for_retraction_effect = yes - scope:recipient = { - add_opinion = { - target = scope:actor - modifier = retracted_vassal - } - } - if = { - limit = { - scope:actor = { has_realm_law_flag = vassal_refusal_is_treason } - } - scope:actor = { - add_opinion = { - target = scope:recipient - modifier = treasonous_retract_refusal - } - } - } - if = { - limit = { - scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } - } - scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } - } - } - - auto_accept = { - OR = { - scope:recipient = { - is_imprisoned_by = scope:actor - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - can_be_blocked = { - custom_description = { #Hook from Recipient can counteract, but only if Actor is not forcing the action via Strong Hook. - text = "spending_hook" - subject = scope:recipient - object = scope:actor - scope:recipient = { has_hook = scope:actor } - NAND = { - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - on_blocked_effect = { - scope:recipient = { - remove_hook = { - target = scope:actor - } - } - } - - ai_accept = { - base = 0 # Try to make it 0 for most interactions - - modifier = { - has_game_rule = hard_difficulty - scope:actor = { is_ai = no } - add = -50 - desc = FACTION_REASON_DIFFICULTY_HARD - } - - modifier = { - has_game_rule = very_hard_difficulty - scope:actor = { is_ai = no } - add = -100 - desc = FACTION_REASON_DIFFICULTY_VERY_HARD - } - - modifier = { - has_game_rule = hard_difficulty - scope:actor = { is_ai = yes } - add = 50 - } - - modifier = { - has_game_rule = very_hard_difficulty - scope:actor = { is_ai = yes } - add = 100 - } - - modifier = { - scope:hook = yes - add = 40 - desc = SCHEME_WEAK_HOOK_USED - } - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - modifier = { - add = 25 - scope:actor = { - has_realm_law_flag = vassal_refusal_is_treason - } - desc = AI_REFUSAL_IS_TREASON - } - - modifier = { - add = 20 - scope:recipient = { - has_trait = trusting - } - desc = TAKE_THE_VOWS_TRUSTING - } - - modifier = { - add = 20 - scope:recipient = { - has_trait = content - } - desc = INTERACTION_CONTENT - } - - modifier = { - add = 20 - scope:actor.current_military_strength > scope:recipient.current_military_strength - scope:recipient = { - has_trait = craven - } - desc = INTERACTION_CRAVEN - } - - ai_value_modifier = { - who = scope:recipient - ai_greed = { - if = { - limit = { - scope:recipient = { NOT = { ai_greed = 0 } } - } - value = -0.25 - } - } - ai_honor = { - if = { - limit = { - scope:recipient = { #If AI is honorable and the law compels to obey the liege, AI will be more likely to obey. - ai_honor > 0 - } - scope:actor = { - has_realm_law_flag = vassal_refusal_is_treason - } - } - value = 0.75 - } - } - } - modifier = { - exists = scope:actor.primary_title.title_capital_county - scope:secondary_recipient = { - OR = { - any_sub_realm_county = { - this = scope:actor.primary_title.title_capital_county - } - any_sub_realm_duchy = { - this = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - } - add = 50 - desc = AI_VASSAL_HOLDS_REALM_CAPITAL - } - - modifier = { - exists = scope:actor.primary_title.title_capital_county - scope:secondary_recipient = { - NOR = { - any_sub_realm_county = { - this = scope:actor.primary_title.title_capital_county - } - any_sub_realm_duchy = { - this = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - primary_title.tier = tier_county - any_sub_realm_county = { - de_jure_liege = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - add = 30 - desc = AI_VASSAL_IS_IN_CAPITAL_DUCHY - } - - modifier = { #Sub-Vassal is NOT De jure of current Vassal. - add = 25 - NOT = { - scope:recipient = { - any_held_title = { - is_de_jure_liege_or_above_target = scope:secondary_recipient.primary_title - } - } - } - desc = AI_REFUSAL_IS_NOT_DE_JURE_LIEGE - } - modifier = { #Sub-Vassal is De jure of liege title. - add = 15 - scope:actor = { - any_held_title = { - this = scope:secondary_recipient.primary_title.de_jure_liege - } - } - desc = AI_REFUSAL_IS_DE_JURE_LIEGE - } - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - modifier = { #Comparative military strength. - desc = offer_vassalization_interaction_aibehavior_power_tt - add = { - value = 1 - subtract = { - value = scope:recipient.current_military_strength - divide = { value = scope:actor.current_military_strength min = 1 } - } - multiply = 100 - } - } - modifier = { #Different faith, no pluralism. - desc = AI_REFUSAL_SPLITTING_SAME_FAITH_VASSALS - trigger = { - scope:actor.faith = scope:secondary_recipient.faith #Will not care as much if the vassal being retracted is of a different faith. - scope:actor = { - NOR = { #Of two different faiths AND the potential vassal's faith is not pluralistic. - faith = scope:recipient.faith - faith = { has_doctrine = doctrine_pluralism_pluralistic } - } - } - } - add = { - value = -25 - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_hostile_level - } - } - } - add = -10 - } - if = { - limit = { - scope:actor.faith = { - faith_hostility_level = { - target = scope:recipient.faith - value >= faith_evil_level - } - } - } - add = -25 - } - } - } - modifier = { # AI Mongols, tyranny wars just delay the inevitable fun! - scope:actor = { - is_ai = yes - OR = { - has_trait = greatest_of_khans - has_character_modifier = the_great_khan_modifier - } - } - scope:recipient = { - is_ai = yes - } - add = 500 - } - modifier = { - add = -25 - scope:recipient = { - culture = { has_cultural_parameter = vassals_more_likely_to_refuse_demands } - } - desc = VASSALS_REFUSAL_indomitable_azatani - } - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - can_send_despite_rejection = yes - - # AI - ai_targets = { - ai_recipients = vassals - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - ai_potential = { - has_realm_law_flag = title_revocation_allowed - primary_title.tier > tier_county - } - - ai_will_do = { - base = -1000 - - # We want to avoid tyranny unless we've got a good reason - # And even if we can avoid tyranny we don't want to retract just because we can, so this only gets us to -10 - # Certain characters will retract despite tyranny, if their rationality is sufficiently low - modifier = { - scope:actor = { - OR = { - has_revoke_title_reason = scope:recipient - AND = { - ai_rationality <= very_high_negative_ai_value - OR = { - has_trait = lunatic - has_trait = possessed - has_trait = arbitrary - } - } - } - } - - add = 990 - } - # Always retract preferred capital if you hold the duchy, or the duchy is uncreated - modifier = { - years_from_game_start >= 3 - OR = { - scope:actor = { - is_at_war = no - gold > 0 - } - scope:recipient = { - is_imprisoned_by = scope:actor - } - } - scope:actor = { # The HRE doesn't need endless civil wars - NOT = { - primary_title = title:e_hre - } - } - exists = scope:actor.primary_title.title_capital_county - OR = { - scope:actor = { - any_held_title = { - this = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - scope:actor.primary_title.title_capital_county.de_jure_liege = { - is_title_created = no - } - } - scope:secondary_recipient = { - any_sub_realm_county = { - this = scope:actor.primary_title.title_capital_county - } - } - NAND = { # Don't retract player vassals tyrannically - scope:recipient = { - is_ai = no - } - scope:actor = { - NOT = { has_revoke_title_reason = scope:recipient } - } - } - add = 1100 - } - # If below domain limit, try to revoke counties in your capital duchy despite tyranny, sometimes - modifier = { - years_from_game_start >= 3 - scope:actor = { is_at_war = no } - scope:actor = { # The HRE doesn't need endless civil wars - NOT = { - primary_title = title:e_hre - } - } - scope:actor.domain_size < scope:actor.domain_limit - scope:actor.primary_title.tier >= tier_kingdom - trigger_if = { - limit = { - scope:actor = { - domain_size > 3 - } - } - scope:actor = { - NOR = { - has_trait = generous - has_trait = just - } - } - } - exists = scope:actor.primary_title.title_capital_county - OR = { - scope:actor.primary_title.title_capital_county.holder = scope:actor # You have your de jure capital already - NOT = { - scope:actor.primary_title.title_capital_county.holder.top_liege = scope:actor.top_liege # Or your De Jure capital isn't in your realm - } - } - scope:secondary_recipient = { - primary_title.tier = tier_county - any_sub_realm_county = { - de_jure_liege = scope:actor.primary_title.title_capital_county.de_jure_liege # Under the same Duchy as your capital - } - } - OR = { # And the capital duchy, if it exists at all - AND = { - exists = scope:actor.primary_title.title_capital_county.de_jure_liege.holder - scope:actor.primary_title.title_capital_county.de_jure_liege.holder = scope:actor - } - AND = { - exists = scope:actor.primary_title.title_capital_county.de_jure_liege.holder - scope:actor.primary_title.title_capital_county.de_jure_liege.holder.top_liege != scope:actor.top_liege - } - scope:actor.primary_title.title_capital_county.de_jure_liege = { - is_title_created = no - } - } - - scope:recipient = { # Not from players - is_ai = yes - } - - OR = { # Tyranny tolernance is based on rationality - AND = { - scope:actor.ai_rationality < 0 - scope:actor.tyranny <= 15 # Don't go crazy with tyranny, just a bit is fine - } - AND = { - scope:actor.ai_rationality >= 0 - scope:actor.ai_rationality < 50 - scope:actor.tyranny <= 5 # Don't go crazy with tyranny, just a bit is fine - } - AND = { - scope:actor.ai_rationality >= 50 - scope:actor.tyranny <= 0 # Don't go crazy with tyranny, just a bit is fine - } - AND = { - scope:actor.ai_rationality >= 0 - scope:recipient = { - is_imprisoned_by = scope:actor - } - scope:actor = { has_revoke_title_reason = scope:recipient } - } - AND = { - scope:actor.ai_rationality < 0 - scope:recipient = { - is_imprisoned_by = scope:actor - } - } - } - # To do this, the target must be weak or willing in some way - OR = { - scope:actor.current_military_strength > scope:recipient.current_military_strength # Must be stronger - scope:recipient = { - is_imprisoned_by = scope:actor - } - } - scope:recipient = { - OR = { - has_trait = craven - has_trait = content - has_trait = trusting - has_dread_level_towards = { - target = scope:actor - level >= 1 - } - opinion = { target = scope:actor value >= 40 } - is_imprisoned_by = scope:actor - scope:actor = { has_revoke_title_reason = scope:recipient } - } - } - - add = 1100 - } - # Always retract preferred capital duchy - modifier = { - exists = scope:actor.primary_title.title_capital_county - scope:secondary_recipient = { - any_sub_realm_duchy = { - this = scope:actor.primary_title.title_capital_county.de_jure_liege - } - } - NAND = { # Don't retract player vassals tyranically - scope:recipient = { - is_ai = no - } - scope:actor = { - NOT = { has_revoke_title_reason = scope:recipient } - } - } - add = 1000 - } - # Retract vassal we're dejure liege of if below domain limit - modifier = { - scope:actor = { - vassal_limit_available > 0 - } - scope:secondary_recipient.primary_title.de_jure_liege.holder = scope:actor - add = 500 - } - # Retract non-De Jure vassals from Megadukes (only if a revoke reason is present, so we don't end up in massive tyranny war spirals) - modifier = { - scope:actor = { - has_revoke_title_reason = scope:recipient - } - scope:recipient = { - primary_title.tier = tier_duchy - any_sub_realm_county = { - count > 30 - } - } - scope:secondary_recipient.primary_title.de_jure_liege.holder != scope:recipient - add = 500 - } - # Do not revoke titles from certain characters - modifier = { - scope:actor = { - OR = { - has_relation_friend = scope:recipient - has_relation_best_friend = scope:recipient - has_relation_lover = scope:recipient - has_relation_soulmate = scope:recipient - is_heir_of = scope:recipient - } - } - add = -2000 - } - # Do not revoke titles when the chance of success if exceedingly low - modifier = { - NOT = { - scope:recipient = { - is_imprisoned_by = scope:actor - } - } - scope:actor = { - OR = { - gold < minimum_ai_gold_value_for_tyranny_wars - AND = { - scope:actor.current_military_strength < scope:recipient.current_military_strength - gold < comfortable_ai_gold_value_for_tyranny_wars - } - } - } - add = -2000 - } - - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:hook = yes - add = -1 - } - - modifier = { # The AI shouldn't ruin the player's fun - add = -2000 - scope:recipient = { has_character_flag = is_party_baron } - } - - modifier = { # Avoid triggering Tyranny wars mid-war - factor = 0 - scope:actor = { - is_at_war = yes - } - scope:recipient = { - NOT = { - is_imprisoned_by = scope:actor - } - } - } - - modifier = { # Avoid triggering Tyranny wars mid-grand activity - factor = 0 - scope:actor = { - has_ongoing_grand_activity_trigger = yes - } - NOR = { - scope:recipient = { - is_imprisoned_by = scope:actor - } - scope:recipient = { - highest_held_title_tier = tier_barony - } - } - } - } -} - -start_independence_faction_interaction = { - icon = independence - category = interaction_category_vassal - desc = start_independence_faction_interaction_desc - - is_shown = { - scope:actor != scope:recipient - scope:actor = { - highest_held_title_tier > tier_barony - liege = scope:recipient - is_a_faction_member = no - } - scope:recipient = { - is_landed_or_landless_administrative = no - NOT = { - any_targeting_faction = { - faction_type = independence_faction - } - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - can_create_faction = { - target = scope:recipient - type = independence_faction - } - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = start_independence_faction_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - create_faction = { - type = independence_faction - target = scope:recipient - } - if = { - limit = { - is_de_jure_vassal_of_liege_trigger = yes - } - stress_impact = { - just = medium_stress_impact_gain - } - } - } - } - } - - auto_accept = yes -} - -join_independence_faction_interaction = { - icon = independence - category = interaction_category_vassal - desc = join_independence_faction_interaction_desc - - is_shown = { - scope:actor != scope:recipient - scope:actor.liege = scope:recipient - scope:actor = { - is_landed_or_landless_administrative = no - is_a_faction_member = no - highest_held_title_tier > tier_barony - } - scope:recipient = { - highest_held_title_tier > tier_barony - any_targeting_faction = { - faction_type = independence_faction - } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - custom_description = { - text = "basic_independence_faction_at_war" - object = scope:recipient - any_targeting_faction = { - faction_type = independence_faction - faction_is_at_war = no - } - } - } - scope:actor = { - can_join_or_create_faction_against = { - who = scope:recipient - faction = independence_faction - } - } - } - - on_accept = { - scope:recipient = { - random_targeting_faction = { - faction_type = independence_faction - save_scope_as = faction_target - } - } - - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = join_independence_faction_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - join_faction = scope:faction_target - if = { - limit = { - is_de_jure_vassal_of_liege_trigger = yes - } - stress_impact = { - just = minor_stress_impact_gain - } - } - } - } - } - - auto_accept = yes -} - -create_claimant_faction_against_interaction = { - icon = vassal_claim_liege_title_interaction - category = interaction_category_vassal - interface_priority = 270 - use_diplomatic_range = no - needs_recipient_to_open = no - - desc = create_claimant_faction_against_interaction_desc - - special_interaction = create_claimant_faction_against_interaction - interface = create_claimant_faction_against - - is_shown = { - scope:actor = { - NOT = { scope:secondary_actor ?= this } - scope:secondary_actor ?= liege - custom_description = { - text = "faction_can_join_create_in_another_faction" - is_a_faction_member = no - } - highest_held_title_tier > tier_barony - } - } - - is_valid_showing_failures_only = { - NOT = { - scope:actor = { has_truce = scope:secondary_actor } - } - scope:secondary_actor = { - trigger_if = { - limit = { - NOT = { - any_held_title = { - any_claimant = {} - } - } - } - custom_description = { - text = "basic_claimant_found" - always = no - } - } - trigger_else = { - custom_description = { - text = "basic_capable_claimant_found" - any_held_title = { - any_claimant = { - NOT = { has_trait = incapable } - } - } - } - } - trigger_if = { - limit = { - exists = scope:landed_title - } - custom_description = { - text = "claimant_faction_already_exists" - subject = scope:landed_title - object = scope:recipient - NOT = { - any_targeting_faction = { - faction_type = claimant_faction - special_character = scope:recipient - special_title = scope:landed_title - } - } - } - } - } - scope:actor = { - can_join_or_create_faction_against = { - who = scope:secondary_actor - faction = claimant_faction - check_in_a_faction = no # already checked in is_shown. Via the faction interface we'd see this twice if it fails (TIT-11380) - } - } - trigger_if = { - limit = { - exists = scope:recipient - } - scope:recipient = { - NOT = { is_at_war_with = scope:actor } - NOT = { has_trait = incapable } - } - } - scope:secondary_actor = { NOT = { has_strong_hook = scope:actor } } - - # Admin vassals can only start and join a claimant faction if the target is independent - trigger_if = { - limit = { - scope:actor = { government_allows = administrative } - } - trigger_if = { - limit = { - scope:secondary_actor = { government_allows = administrative } - } - scope:secondary_actor = { is_independent_ruler = yes } - } - } - - # Under Byzantine law, a ruler must be unblemished - trigger_if = { - limit = { - scope:landed_title.holder.culture ?= { has_cultural_parameter = physical_disfigurement_blocks_inheritance } - } - scope:recipient ?= { - custom_description = { - text = "byzantine_claimant_is_disfigured" - object = scope:recipient - valid_for_byz_succession_trigger = yes - } - } - } - # Ceremonial Liege - trigger_if = { - limit = { - exists = scope:landed_title - scope:actor.top_liege.primary_title.var:administrative_ui_special_title ?= scope:landed_title - } - scope:recipient = { - tgp_is_in_ceremonial_house_trigger = yes - trigger_if = { - limit = { - scope:landed_title = { - holder.faith = { has_doctrine = doctrine_gender_male_dominated } - any_claimant = { is_male = yes } - } - } - is_male = yes - } - trigger_else_if = { - limit = { - scope:landed_title = { - holder.faith = { has_doctrine = doctrine_gender_female_dominated } - any_claimant = { is_female = yes } - } - } - is_female = yes - } - trigger_else = { always = yes } - } - } - # TGP - Use Coup against Kampaku instead - trigger_if = { - limit = { - scope:recipient ?= { tgp_realm_has_ceremonial_liege_trigger = yes } - } - custom_tooltip = { - text = cannot_create_claimant_faction_against_kampaku_tooltip - scope:recipient ?= { - # TGP - Use Coup against Kampaku instead - tgp_is_ceremonial_regent_trigger = no - } - } - } - # Ministers cannot be claimants unless we are targeting h_china - trigger_if = { - limit = { - exists = scope:recipient - exists = scope:landed_title - scope:recipient = { - OR = { - has_title = title:e_minister_chancellor - has_title = title:e_minister_censor - has_title = title:e_minister_grand_marshal - has_title = title:e_minister_of_personnel - has_title = title:e_minister_of_revenue - has_title = title:e_minister_of_rites - has_title = title:e_minister_of_war - has_title = title:e_minister_of_justice - has_title = title:e_minister_of_works - } - } - } - scope:recipient = { - custom_description = { - text = target_is_a_minister_desc - subject = this - scope:landed_title = { this = title:h_china } - } - } - } - } - - can_send = { - NOT = { - scope:recipient ?= { has_title = title:e_japan } - } - } - - on_send = { - scope:actor = { - set_variable = { - name = claiming_title - value = scope:landed_title - } - - if = { - limit = { - can_create_faction = { - type = claimant_faction - target = scope:secondary_actor - } - } - - create_faction = { - type = claimant_faction - target = scope:secondary_actor - } - joined_faction = { - set_special_character = scope:recipient - set_special_title = scope:landed_title - } - scope:recipient = { - add_to_variable_list = { - name = claimant_factions - target = scope:actor.joined_faction - } - } - - if = { - limit = { this != scope:recipient } - save_scope_as = faction_invite_from - joined_faction = { save_scope_as = faction } - scope:secondary_actor = { save_scope_as = faction_target } - scope:recipient = { - trigger_event = faction_invitation.0001 - } - } - } - - remove_variable = claiming_title - } - } - - auto_accept = yes -} - -invite_to_council_position_interaction = { - category = interaction_category_vassal - popup_on_receive = yes - pause_on_receive = yes - - hidden = yes - - special_interaction = invite_to_council_interaction - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - is_councillor_of = scope:actor - } - } - desc = liege_offer_council_position_exchange - } - triggered_desc = { - trigger = { - scope:actor = { - opinion = { - value >= 30 - target = scope:recipient - } - } - } - desc = liege_offer_council_position_liked - } - triggered_desc = { - trigger = { - scope:actor = { - opinion = { - value <= -30 - target = scope:recipient - } - } - } - desc = liege_offer_council_position_disliked - } - triggered_desc = { - trigger = { - scope:recipient = { - is_powerful_vassal_of = scope:actor - } - } - desc = liege_offer_council_position_powerful - } - triggered_desc = { - trigger = { - scope:recipient = { - OR = { - diplomacy > high_skill_rating - martial > high_skill_rating - stewardship > high_skill_rating - intrigue > high_skill_rating - learning > high_skill_rating - } - } - } - desc = liege_offer_council_position_skilled - } - desc = liege_offer_council_position_fallback - } - } - - is_valid_showing_failures_only = { - ALL_FALSE = { - scope:recipient.council_task = scope:target - scope:actor = { is_at_war_with = scope:recipient } - } - trigger_if = { - limit = { - exists = scope:target.councillor - } - scope:target = { can_fire_position = yes } - NOT = { - scope:target.councillor = { - is_blocked_from_being_fired_from_council_trigger = { COURT_OWNER = scope:actor } - } - } - } - } - - on_accept = { - # Assign the councillor to their new responsibilities. - scope:actor = { - assign_council_task = { - target = scope:recipient - council_task = scope:target - } - } - - # If the new councillor is a player, inform their liege that they have accepted the offer. - if = { - limit = { - scope:recipient = { - is_ai = no - } - } - scope:actor = { - trigger_event = { - id = council_interaction.0001 - days = 1 - } - } - } - # If we're a clan this interaction affects unity - #if = { - # limit = { scope:actor = { NOT = { has_character_flag = fp3_consulted_house } } } - # add_clan_unity_interaction_effect = { - # CHARACTER = scope:actor - # TARGET = scope:recipient - # VALUE = miniscule_unity_gain - # DESC = clan_unity_council_position.desc - # REVERSE_NON_HOUSE_TARGET = yes - # } - #} - } - - on_decline = { - # If the requested councillor is a player, inform their liege that they have declined the offer. - if = { - limit = { - scope:recipient = { - is_ai = no - } - } - scope:actor = { - trigger_event = { - id = council_interaction.0002 - days = 1 - } - } - } - } - - auto_accept = { - custom_description = { - text = auto_accept_interaction_ai - object = scope:recipient - scope:recipient = { - is_ai = yes - } - } - } -} - -force_onto_council = { - category = interaction_category_vassal - interface_priority = 120 - icon = council - - desc = force_onto_council_desc - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:actor = { has_strong_hook = scope:recipient } - } - desc = force_onto_council.notification.strong_hook - } - desc = force_onto_council.notification.fallback - } - } - - special_interaction = force_onto_council_interaction - interface = council_task_interaction - - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - is_shown = { - scope:recipient != scope:actor - scope:actor = { - liege = scope:recipient - NOT = { - is_councillor = yes - } - # Merit based realms cannot force themselves onto the council - they should compete with merit and score instead - NOT = { government_allows = merit } - } - - trigger_if = { - limit = { - exists = scope:target.councillor - } - scope:target = { can_fire_position = yes } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - custom_description = { - text = "has_usable_hook_or_council_rights_through_vassal_contract" - subject = scope:actor - OR = { - has_usable_hook = scope:recipient - vassal_contract_has_flag = can_demand_council_seat - vassal_contract_has_flag = can_demand_kurultai_seat - } - } - is_adult = yes - NOT = { - is_at_war_with = scope:recipient - } - NAND = { - has_council_position = councillor_court_chaplain - faith = { - OR = { - has_doctrine = doctrine_clerical_succession_temporal_fixed_appointment - has_doctrine = doctrine_clerical_succession_spiritual_fixed_appointment - } - } - } - } - } - - has_valid_target_showing_failures_only = { - trigger_if = { - limit = { - exists = scope:target.councillor - } - scope:target.councillor = { - NOT = { - is_blocked_from_being_fired_from_council_trigger = { - COURT_OWNER = scope:recipient - } - } - } - } - } - - on_accept = { - scope:target = { - save_scope_as = council_task - } - scope:actor = { - if = { - limit = { - NOR = { - vassal_contract_has_flag = can_demand_council_seat - vassal_contract_has_flag = can_demand_kurultai_seat - } - } - save_scope_value_as = { - name = used_hook - value = yes - } - } - block_firing_councillor_effect = { COURT_OWNER = scope:recipient } - #And notify exactly which councillor type they've become. - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_good - title = force_onto_council.actor.tt - left_icon = scope:recipient - custom_tooltip = force_onto_council.actor.tt.duration - } - } - stress_impact = { content = minor_stress_impact_gain } - } - scope:recipient = { - assign_council_task = { - target = scope:actor - council_task = scope:council_task - } - custom_tooltip = force_onto_council.desc.tt - #And notify exactly which councillor type they've become. - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = force_onto_council.recipient.tt - left_icon = scope:actor - if = { - limit = { exists = scope:used_hook } - show_as_tooltip = { scope:actor = { use_hook = scope:recipient } } - } - custom_tooltip = force_onto_council.recipient.tt.duration - } - } - } - #Done in the end so that all tooltips will show correct information - scope:actor = { - if = { - limit = { - exists = scope:used_hook - } - use_hook = scope:recipient - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_forced_unto_council.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - ai_set_target = { - scope:actor = { - random_list = { - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_chancellor - can_be_chancellor_trigger = { COURT_OWNER = scope:recipient } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_kurultai_seat } - } - } - modifier = { - factor = diplomacy - } - modifier = { - trigger = { highest_skill = diplomacy } - factor = 10 - } - scope:recipient.council_task:councillor_chancellor = { - save_scope_as = target - } - } - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_steward - can_be_steward_trigger = { COURT_OWNER = scope:recipient } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_kurultai_seat } - } - } - modifier = { - factor = stewardship - } - modifier = { - trigger = { highest_skill = stewardship } - factor = 10 - } - scope:recipient.council_task:councillor_steward = { - save_scope_as = target - } - } - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_marshal - can_be_marshal_trigger = { COURT_OWNER = scope:recipient } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_kurultai_seat } - } - } - modifier = { - factor = martial - } - modifier = { - trigger = { highest_skill = martial } - factor = 10 - } - scope:recipient.council_task:councillor_marshal = { - save_scope_as = target - } - } - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_spymaster - can_be_spymaster_trigger = { COURT_OWNER = scope:recipient } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_kurultai_seat } - } - } - modifier = { - factor = intrigue - } - modifier = { - trigger = { highest_skill = intrigue } - factor = 10 - } - scope:recipient.council_task:councillor_spymaster = { - save_scope_as = target - } - } - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_court_chaplain - can_be_court_chaplain_trigger = { COURT_OWNER = scope:recipient } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_kurultai_seat } - } - } - modifier = { - factor = learning - } - modifier = { - trigger = { highest_skill = learning } - factor = 10 - } - scope:recipient.council_task:councillor_court_chaplain = { - save_scope_as = target - } - } - # Kurultai Demanded - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_kurultai_1 - can_be_kurultai_trigger = { - COURT_OWNER = scope:actor.liege_or_court_owner - CP1 = councillor_kurultai_2 - CP2 = councillor_kurultai_3 - CP3 = councillor_kurultai_4 - } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_council_seat } - } - } - modifier = { - factor = martial - } - modifier = { - trigger = { highest_skill = martial } - factor = 10 - } - scope:recipient.council_task:councillor_kurultai_1 = { - save_scope_as = target - } - } - # Repeated so they don't always demand the same position - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_kurultai_2 - can_be_kurultai_trigger = { - COURT_OWNER = scope:actor.liege_or_court_owner - CP1 = councillor_kurultai_1 - CP2 = councillor_kurultai_3 - CP3 = councillor_kurultai_4 - } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_council_seat } - } - } - modifier = { - factor = martial - } - modifier = { - trigger = { highest_skill = martial } - factor = 10 - } - scope:recipient.council_task:councillor_kurultai_2 = { - save_scope_as = target - } - } - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_kurultai_3 - can_be_kurultai_trigger = { - COURT_OWNER = scope:actor.liege_or_court_owner - CP1 = councillor_kurultai_1 - CP2 = councillor_kurultai_2 - CP3 = councillor_kurultai_4 - } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_council_seat } - } - } - modifier = { - factor = martial - } - modifier = { - trigger = { highest_skill = martial } - factor = 10 - } - scope:recipient.council_task:councillor_kurultai_3 = { - save_scope_as = target - } - } - 10 = { - trigger = { - exists = scope:recipient.council_task:councillor_kurultai_4 - can_be_kurultai_trigger = { - COURT_OWNER = scope:actor.liege_or_court_owner - CP1 = councillor_kurultai_1 - CP2 = councillor_kurultai_2 - CP3 = councillor_kurultai_3 - } - scope:recipient = { - NOT = { vassal_contract_has_flag = can_demand_council_seat } - } - } - modifier = { - factor = martial - } - modifier = { - trigger = { highest_skill = martial } - factor = 10 - } - scope:recipient.council_task:councillor_kurultai_4 = { - save_scope_as = target - } - } - } - } - } - - ai_potential = { - top_liege != this - is_councillor = no - } - - ai_targets = { - ai_recipients = liege - } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 36 - kingdom = 24 - empire = 24 - hegemony = 0 - } - - auto_accept = yes - force_notification = yes - - ai_will_do = { - base = 100 - - modifier = { - factor = 0 - scope:actor = { - ai_greed <= medium_positive_ai_value - OR = { - has_relation_friend = scope:recipient - has_relation_lover = scope:recipient - has_relation_best_friend = scope:recipient - has_relation_soulmate = scope:recipient - } - } - } - - modifier = { - factor = 0 - is_councillor = yes - } - } -} - -stop_attacker_vassal_war_interaction = { - category = interaction_category_vassal - interface = interfere_in_war - special_interaction = interfere_in_war_interaction - ai_accept_negotiation = yes - popup_on_receive = yes - pause_on_receive = yes - icon = icon_retreat - - send_name = "stop_attacker_vassal_war_interaction" - - ai_maybe = yes - - prompt = STOP_VASSAL_WAR_ATTACKER - - desc = { - desc = stop_vassal_war_negotiation - triggered_desc = { - trigger = { scope:actor = { has_usable_hook = scope:recipient } } - desc = stop_vassal_war_use_hook - } - desc = might_ask_for_something_in_return_warning_double_line_break - } - - on_decline_summary = stop_attacker_vassal_war_decline_summary - - is_shown = { - scope:recipient != scope:actor - scope:recipient = { - liege ?= scope:actor - highest_held_title_tier > tier_barony - any_character_war = { - primary_attacker = scope:recipient - save_temporary_scope_as = target_war - } - } - scope:actor = { - NOT = { is_participant_in_war = scope:target_war } - } - } - - is_valid_showing_failures_only = { - custom_description = { - text = cannot_stop_war_when_already_fighting - object = scope:recipient - scope:recipient = { - NOT = { - any_war_enemy = { - this = scope:actor - } - } - } - } - custom_description = { - text = cannot_stop_war_timer - object = scope:recipient - NOT = { - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = attempt_to_force_end_war_opinion - } - } - } - } - NOT = { - scope:recipient = { - has_strong_hook = scope:actor - } - } - } - - can_be_picked = { - scope:target.primary_attacker = scope:recipient - } - - on_accept = { - scope:recipient = { - add_opinion = { - modifier = attempt_to_force_end_war_opinion - target = scope:actor - } - } - hidden_effect = { - scope:recipient = { - trigger_event = vassal_interaction.0001 #Starts "negotiations" - } - } - show_as_tooltip = { - scope:target ?= { end_war = white_peace } - } - - # If we're a clan this interaction affects unity - But we only show it in the tooltip, actual effect is applied in the respective follow-up events - show_as_tooltip = { - if = { - limit = { # If we are asking a non-house member to stop attacking a house member, gain unity - exists = scope:recipient.house - exists = scope:actor.house - scope:recipient.house != scope:actor.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:target.primary_defender - VALUE = medium_unity_gain - DESC = clan_unity_aided_in_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else_if = { - limit = { # If we are asking a house member to stop attacking a non-house member, lose unity - exists = scope:actor.house - exists = scope:target.primary_defender.house - scope:target.primary_defender.house != scope:actor.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_stopped_vassal_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - } - - on_decline = { - show_as_tooltip = { - scope:recipient = { - add_opinion = { - modifier = attempt_to_force_end_war_opinion - target = scope:actor - } - } - scope:actor = { add_prestige = minor_prestige_loss } - } - } - - auto_accept = yes -} - -stop_defender_vassal_war_interaction = { - category = interaction_category_vassal - interface = interfere_in_war - special_interaction = interfere_in_war_interaction - ai_accept_negotiation = yes - popup_on_receive = yes - pause_on_receive = yes - send_name = "SEND_DEMAND" - icon = icon_retreat - - ai_maybe = yes - - prompt = STOP_VASSAL_WAR_DEFENDER - - desc = { - desc = stop_vassal_war_negotiation - triggered_desc = { - trigger = { scope:actor = { has_usable_hook = scope:recipient } } - desc = stop_vassal_war_use_hook - } - desc = might_ask_for_something_in_return_warning_double_line_break - } - - on_decline_summary = stop_attacker_vassal_war_decline_summary - - is_shown = { - scope:recipient != scope:actor - scope:recipient = { - liege ?= scope:actor - highest_held_title_tier > tier_barony - any_character_war = { - primary_defender = scope:recipient - save_temporary_scope_as = target_war - } - } - scope:actor = { - NOT = { is_participant_in_war = scope:target_war } - } - } - - is_valid_showing_failures_only = { - custom_description = { - text = cannot_stop_war_when_already_fighting - object = scope:recipient - NOT = { - scope:recipient = { - any_war_enemy = { - this = scope:actor - } - } - } - } - custom_description = { - text = cannot_stop_war_timer - object = scope:recipient - NOT = { - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = attempt_to_force_surrender_opinion - } - } - } - } - NOT = { - scope:recipient = { - has_strong_hook = scope:actor - } - } - } - - can_be_picked = { - scope:target.primary_defender = scope:recipient - } - - on_accept = { - scope:recipient = { - add_opinion = { - modifier = attempt_to_force_surrender_opinion - target = scope:actor - } - } - hidden_effect = { - scope:recipient = { - trigger_event = vassal_interaction.0011 #Starts "negotiations" - } - } - - # If we're a clan this interaction affects unity - But we only show it in the tooltip, actual effect is applied in the respective follow-up events - show_as_tooltip = { - if = { - limit = { # If recipient is a house member and the attacker is not, lose unity - exists = scope:actor.house - exists = scope:target.primary_attacker.house - scope:target.primary_attacker.house != scope:actor.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_stop_defender_vassal_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - else_if = { - limit = { # If recipient is a non-house member and the attacker is, gain unity - exists = scope:actor.house - exists = scope:recipient.house - scope:recipient.house != scope:actor.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:target.primary_attacker - VALUE = medium_unity_gain - DESC = clan_unity_aided_in_war.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - } - - auto_accept = yes -} - -ask_for_pardon_interaction = { - category = interaction_category_vassal - icon = scroll_scales - - filter_tags = { celestial_ministry } - - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:actor != scope:recipient.liege - } - desc = ask_for_pardon_interaction_minister_desc - } - desc = ask_for_pardon_interaction_desc - } - } - notification_text = ASK_FOR_PARDON_NOTIFICATION - - is_shown = { - ask_for_pardon_available_trigger = { ACTOR = scope:actor } - OR = { - scope:actor.top_liege = scope:recipient - scope:recipient = { - top_liege = scope:actor.top_liege - has_title = title:e_minister_of_justice - } - } - } - - - is_valid_showing_failures_only = { - scope:actor = { - NOT = { is_at_war_with = scope:recipient } - NOT = { is_imprisoned_by = scope:recipient }#Then you use the regular ransom interactions - } - } - - highlighted_reason = { - triggered_desc = { - trigger = { - scope:recipient = { - has_title = title:e_minister_of_justice - } - } - desc = HIGHLIGHTED_MINISTER_WILLING_TO_PARDON - } - } - - is_highlighted = { - OR = { - has_usable_hook = scope:recipient - AND = { - scope:recipient = { - has_title = title:e_minister_of_justice - } - scope:recipient = { - is_character_interaction_potentially_accepted = { - recipient = scope:recipient - interaction = ask_for_pardon_interaction - } - } - } - } - } - - ai_accept = { - base = -50 - - #How bad is it, really? - modifier = { - scope:recipient = { - has_banish_reason = scope:actor - NOR = { #These are worse - has_execute_reason = scope:actor - has_revoke_title_reason = scope:actor - } - } - desc = AI_BANISHMENT_REASON_MODIFIER - add = -20 - } - modifier = { - scope:recipient = { - has_revoke_title_reason = scope:actor - NOT = { #This is worse are worse - has_execute_reason = scope:actor - } - } - desc = AI_REVOKE_TITLE_REASON_MODIFIER - add = -30 - } - modifier = { - scope:recipient = { - has_execute_reason = scope:actor - } - desc = AI_EXECUTE_REASON_MODIFIER - add = -40 - } - - #Willing to forgive - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 1 - desc = AI_OPINION_REASON - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook = yes - } - } - - ai_min_reply_days = 1 - ai_max_reply_days = 5 - - on_accept = { - ask_for_pardon_interaction_effect = yes - scope:actor = { - trigger_event = vassal_interaction.0030 - } - - scope:recipient = { - if = { - limit = { - culture = { - has_cultural_parameter = pardoning_gives_prestige - } - } - add_prestige = minor_prestige_gain - } - add_merit_if_relevant_effect = { - MERIT = minor_merit_value - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_pardon_granted.desc - REVERSE_NON_HOUSE_TARGET = no - } - - hidden_effect = { - # Struggle catalysts - if = { - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:actor - SECOND = scope:recipient - } - scope:recipient = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_grants_pardon_supporter_detractor - is_secondary_character_involvement_involved_trigger = { - CHAR = scope:actor - } - } - } - } - scope:recipient = { - every_character_struggle = { - involvement = involved - activate_struggle_catalyst = { - catalyst = catalyst_grants_pardon_supporter_detractor - character = scope:recipient - } - log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_grants_pardon_supporter_detractor } - } - } - } - } - } - - on_auto_accept = { - scope:recipient = { - trigger_event = char_interaction.0240 - } - } - - on_decline = { - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_bad - title = ask_for_pardon_interaction_decline_toast - left_icon = scope:actor - - custom_tooltip = ask_for_pardon_interaction_accept_decline - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:recipient - TARGET = scope:actor - VALUE = minor_unity_loss - DESC = clan_unity_refused_pardon.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no - - ai_targets = { - ai_recipients = liege - } - ai_frequency_by_tier = { - barony = 0 - county = 24 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 0 - } - - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:actor = { - has_usable_hook = scope:recipient - } - } - - modifier = { - add = 100 - scope:hook = yes - } - } -} - -pardon_interaction = { - category = interaction_category_friendly - icon = scroll_scales - - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:actor != scope:recipient.liege - } - desc = pardon_interaction_minister_desc - } - desc = pardon_interaction_desc - } - triggered_desc = { - trigger = { - scope:actor = { - culture = { - has_cultural_parameter = pardoning_gives_prestige - } - } - } - desc = pardon_interaction_has_jirga_desc - } - } - is_shown = { - scope:actor = { - OR = { - has_imprisonment_reason = scope:recipient - AND = { - has_title = title:e_minister_of_justice - scope:recipient = { - any_liege_or_above = { - has_imprisonment_reason = scope:recipient - } - } - } - } - } - scope:recipient = { - OR = { - scope:actor = { - has_title = title:e_minister_of_justice - top_liege = scope:recipient.top_liege - } - target_is_liege_or_above = scope:actor - } - } - } - cost = { - influence = { - value = 0 - if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_justice - NOT = { has_imprisonment_reason = scope:recipient } - } - } - add = { - value = 25 - if = { - limit = { - scope:actor.top_liege = { - has_realm_law = celestial_bureaucracy_0 - } - } - add = 75 - } - else_if = { - limit = { - scope:actor.top_liege = { - has_realm_law = celestial_bureaucracy_1 - } - } - add = 50 - } - else_if = { - limit = { - scope:actor.top_liege = { - has_realm_law = celestial_bureaucracy_2 - } - } - add = 25 - } - } - } - } - treasury = { - value = 0 - if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_justice - has_treasury = yes - NOT = { has_imprisonment_reason = scope:recipient } - } - } - add = scope:actor.minor_treasury_value - } - } - } - - auto_accept = yes - - is_highlighted = { - scope:recipient = { - is_imprisoned = no - } - scope:actor = { - has_title = title:e_minister_of_justice - } - } - - on_accept = { - if = { - limit = { - scope:actor = { - has_title = title:e_minister_of_justice - } - } - scope:actor = { - add_merit_if_relevant_effect = { - MERIT = minor_merit_value - } - if = { - limit = { - government_has_flag = government_has_influence - } - change_influence = { - value = minor_influence_gain - multiply = scope:recipient.highest_held_title_tier - } - } - } - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_neutral - title = pardon_interaction_toast_title - desc = pardon_interaction_toast_minister - right_icon = scope:actor - if = { - limit = { - OR = { - scope:recipient.liege = { - has_extra_criminal_reason_against_trigger = { - CRIMINAL = scope:recipient - } - } - is_close_or_extended_family_of = scope:actor - } - } - scope:actor = { - change_strife_opinion = massive_strife_gain - situation:dynastic_cycle = { - trigger_situation_catalyst = { - catalyst = catalyst_minister_pardoned_dangerous_criminal - character = scope:actor - } - } - } - } - consume_all_criminal_reasons_effect = { - LIEGE = scope:recipient.liege - CRIMINAL = scope:recipient - } - } - } - hidden_effect = { - scope:recipient.liege = { - send_interface_toast = { - type = event_toast_effect_neutral - title = pardon_interaction_toast_title - desc = pardon_interaction_toast_minister_liege - right_icon = scope:actor - left_icon = scope:recipient - show_as_tooltip = { - if = { - limit = { - OR = { - has_extra_criminal_reason_against_trigger = { - CRIMINAL = scope:recipient - } - scope:recipient = { - is_close_or_extended_family_of = scope:actor - } - } - } - scope:actor = { - change_strife_opinion = massive_strife_gain - situation:dynastic_cycle = { - trigger_situation_catalyst = { - catalyst = catalyst_minister_pardoned_dangerous_criminal - character = scope:actor - } - } - } - } - consume_all_criminal_reasons_effect = { - LIEGE = scope:recipient.liege - CRIMINAL = scope:recipient - } - } - } - } - } - } - else = { - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_neutral - title = pardon_interaction_toast_title - desc = pardon_interaction_toast - right_icon = scope:actor - consume_all_criminal_reasons_effect = { - LIEGE = scope:actor - CRIMINAL = scope:recipient - } - } - } - } - - scope:actor = { - stress_impact = { - forgiving = medium_stress_loss - } - } - - scope:actor = { - if = { - limit = { - culture = { - has_cultural_parameter = pardoning_gives_prestige - } - } - add_prestige = minor_prestige_gain - } - - hidden_effect = { - # Struggle catalysts - if = { - limit = { - fp3_struggle_involves_one_supporter_and_one_detractor = { - FIRST = scope:actor - SECOND = scope:recipient - } - scope:recipient = { - any_character_struggle = { - involvement = involved - phase_has_catalyst = catalyst_grants_pardon_supporter_detractor - is_secondary_character_involvement_involved_trigger = { - CHAR = scope:actor - } - } - } - } - every_character_struggle = { - involvement = involved - activate_struggle_catalyst = { - catalyst = catalyst_grants_pardon_supporter_detractor - character = scope:recipient - } - log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_grants_pardon_supporter_detractor } - } - } - } - } - - scope:recipient = { - if = { - limit = { - scope:actor = { - culture = { - has_cultural_parameter = pardoning_gives_loyalty - } - } - } - add_opinion = { - modifier = loyal_servant - target = scope:actor - } - scope:actor = { - if = { - limit = { - can_add_hook = { - target = scope:recipient - type = loyalty_hook - } - } - add_hook = { - type = loyalty_hook - target = scope:recipient - } - } - } - } - else = { - add_opinion = { - target = scope:actor - modifier = grateful_opinion - opinion = 15 - } - } - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_gain - DESC = clan_unity_forgiveness.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - ai_potential = { - OR = { - ai_vengefulness <= 0 - culture = { - has_cultural_parameter = pardoning_gives_loyalty - } - } - } - ai_targets = { - ai_recipients = vassals - } - ai_targets = { - ai_recipients = courtiers - chance = 0.25 - } - ai_frequency_by_tier = { - barony = 0 - county = 144 - duchy = 72 - kingdom = 36 - empire = 36 - hegemony = 36 - } - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - has_relation_lover = scope:actor - has_relation_soulmate = scope:actor - is_primary_heir_of = scope:actor - } - } - } - - modifier = { - add = 25 - scope:actor = { - scope:actor.ai_vengefulness <= 0 - culture = { - has_cultural_parameter = pardoning_gives_loyalty - } - } - } - - modifier = { - add = { - value = ai_vengefulness - multiply = -1 - } - scope:actor.ai_vengefulness <= -25 - } - } -} - -vassal_claim_liege_title_interaction = { - category = interaction_category_vassal - interface_priority = 269 # after Start Claimant Faction - desc = vassal_claim_liege_title_interaction_desc - target_type = title - target_filter = recipient_domain_titles - ignores_pending_interaction_block = yes - icon = vassal_claim_liege_title_interaction - - cost = { - prestige = { - value = { - add = monumental_prestige_value - if = { - limit = { - scope:actor.prestige_level > scope:recipient.prestige_level - } - subtract = { - value = major_prestige_value - multiply = { - value = scope:actor.prestige_level - subtract = scope:recipient.prestige_level - } - desc = higher_prestige_level_than_liege - } - } - else_if = { - limit = { - scope:actor.prestige_level < scope:recipient.prestige_level - } - add = { - value = major_prestige_value - multiply = { - value = scope:recipient.prestige_level - subtract = scope:actor.prestige_level - } - desc = lower_prestige_level_than_liege - } - } - min = 0 - } - } - } - - is_shown = { - scope:recipient != scope:actor - - scope:actor = { - is_physically_able_adult = yes - } - - scope:recipient = scope:actor.liege - - scope:recipient = { - is_playable_character = yes - any_held_title = { - title_tier >= duchy - NOR = { - has_title_law = noble_family_succession_law - has_title_law = landless_adventurer_succession_law - has_title_law = mandala_succession_law - } - scope:actor = { - NOT = { - has_claim_on = prev - } - } - } - } - } - - is_highlighted = { - scope:actor.prestige >= vassal_claim_liege_title_interaction_highlight_value - } - - can_be_picked = { - trigger_if = { - limit = { - scope:actor = { - any_character_struggle = { - involvement = involved - has_struggle_phase_parameter = powerful_vassal_can_claim_liege_titles - } - } - } - scope:actor = { is_powerful_vassal_of = scope:recipient } - } - trigger_if = { - limit = { - scope:actor = { legitimacy_level = 5 } - } - scope:target = { - tier >= tier_duchy - custom_description = { - text = has_15_percent_of_a_dejure_title - any_in_de_jure_hierarchy = { - filter = { - tier = tier_county - } - continue = { - tier > tier_county - } - OR = { - holder = scope:actor - holder = { - target_is_liege_or_above = scope:actor - } - } - percent >= 0.15 - } - } - } - } - trigger_if = { - limit = { - scope:actor = { legitimacy_level = 4 } - } - scope:target = { - tier >= tier_duchy - custom_description = { - text = has_21_percent_of_a_dejure_title - any_in_de_jure_hierarchy = { - filter = { - tier = tier_county - } - continue = { - tier > tier_county - } - OR = { - holder = scope:actor - holder = { - target_is_liege_or_above = scope:actor - } - } - percent >= 0.21 - } - } - } - } - trigger_if = { - limit = { - scope:actor = { legitimacy_level = 3 } - } - scope:target = { - tier >= tier_duchy - custom_description = { - text = has_31_percent_of_a_dejure_title - any_in_de_jure_hierarchy = { - filter = { - tier = tier_county - } - continue = { - tier > tier_county - } - OR = { - holder = scope:actor - holder = { - target_is_liege_or_above = scope:actor - } - } - percent >= 0.31 - } - } - } - } - trigger_if = { - limit = { - scope:actor = { legitimacy_level = 2 } - } - scope:target = { - tier >= tier_duchy - custom_description = { - text = has_41_percent_of_a_dejure_title - any_in_de_jure_hierarchy = { - filter = { - tier = tier_county - } - continue = { - tier > tier_county - } - OR = { - holder = scope:actor - holder = { - target_is_liege_or_above = scope:actor - } - } - percent >= 0.41 - } - } - } - } - trigger_if = { - limit = { - scope:actor = { - OR = { - legitimacy_level = 1 - legitimacy_level = 0 - has_legitimacy = no #if you don't have legitimacy at all we fall back to the default - } - } - } - scope:target = { - tier >= tier_duchy - custom_description = { - text = has_51_percent_of_a_dejure_title - any_in_de_jure_hierarchy = { - filter = { - tier = tier_county - } - continue = { - tier > tier_county - } - OR = { - holder = scope:actor - holder = { - target_is_liege_or_above = scope:actor - } - } - percent >= 0.51 - } - } - } - } - - custom_description = { - NOT = { - scope:actor = { - has_claim_on = scope:target - } - } - text = "already_have_a_claim_on_this_title" - } - trigger_if = { - limit = { - scope:target = { - tier = tier_duchy - } - } - custom_description = { - text = not_family_or_adventurer_title - scope:target = { - NOR = { - has_title_law = noble_family_succession_law - has_title_law = landless_adventurer_succession_law - has_title_law = mandala_succession_law - } - } - } - } - } - - has_valid_target_showing_failures_only = { - scope:target = { - tier >= tier_duchy - } - } - - is_valid_showing_failures_only = { - custom_description = { - scope:recipient = { - any_held_title = { - title_tier >= county - NOT = { any_claimant = { this = scope:actor } } - } - } - - object = scope:recipient - text = "already_have_claims_on_all_titles" - } - scope:recipient = { NOT = { has_strong_hook = scope:actor } } - NOT = { - scope:actor = { - is_allied_to = scope:recipient - } - } - } - - on_auto_accept = { - scope:target = { - random_in_de_jure_hierarchy = { - limit = { - tier = tier_county - OR = { - holder = scope:actor - holder = { - target_is_liege_or_above = scope:actor - } - } - } - title_province = { - save_scope_as = county_in_title - } - } - } - scope:recipient = { - trigger_event = vassal_interaction.0040 - } - } - - on_accept = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = buy_claim_interaction.message - left_icon = scope:actor - right_icon = scope:recipient - vassal_claim_liege_title_interaction_effect = yes - } - claim_title_achievement_effect = yes - } - - # If we're a clan this interaction affects unity - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = major_unity_loss - DESC = clan_unity_title_claim.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - - auto_accept = yes - - ai_targets = { - ai_recipients = liege - } - ai_frequency_by_tier = { - barony = 0 - county = 48 - duchy = 24 - kingdom = 24 - empire = 24 - hegemony = 0 - } - - ai_potential = { - domain_size > 1 - NOR = { - has_trait = content - has_trait = craven - } - } - - ai_will_do = { - base = 25 - - ai_value_modifier = { - who = scope:actor - ai_greed = 1 - ai_boldness = 0.5 - ai_honor = -0.5 - } - - modifier = { - add = scope:actor.ai_zeal - scope:actor = { - ai_zeal > 0 - } - scope:actor.faith != scope:recipient.faith - } - - modifier = { - add = 25 - scope:actor = { - is_powerful_vassal_of = scope:recipient - } - } - - modifier = { - add = 50 - scope:actor = { - opinion = { - target = scope:recipient - value <= 0 - } - } - } - - modifier = { - add = 25 - scope:recipient = { - OR = { - has_relation_rival = scope:actor - has_relation_nemesis = scope:actor - } - } - } - - modifier = { - add = -15 - scope:recipient = { - has_relation_lover = scope:actor - } - } - - # Agenda impact - modifier = { - scope:actor = { - any_character_struggle = { - involvement = involved - is_struggle_type = iberian_struggle - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_gain_claim_on_title_fp2 - } - has_character_flag = agenda_towards_escalation - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_gain_claim_on_title_fp2 - } - } - } - add = -100 - } - } - } - - modifier = { - scope:actor = { - any_character_struggle = { - involvement = involved - is_struggle_type = persian_struggle - } - } - add = { - value = 0 - if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_gain_claim_on_title_fp3 - } - has_trait = fp3_struggle_detractor - } - } - add = 200 - } - else_if = { - limit = { - scope:actor = { - any_character_struggle = { - phase_has_catalyst = catalyst_gain_claim_on_title_fp3 - } - } - } - add = -100 - } - } - } - - modifier = { - factor = 0.25 - scope:actor = { - ai_greed < 100 - opinion = { - target = scope:recipient - value >= 50 - } - } - } - - modifier = { - factor = 0 - scope:actor = { - ai_greed < 100 - opinion = { - target = scope:recipient - value >= 75 - } - } - } - - modifier = { - add = -25 - scope:actor = { - has_dread_level_towards = { - target = scope:recipient - level = 1 - } - } - } - - modifier = { - factor = 0 - scope:actor = { - has_dread_level_towards = { - target = scope:recipient - level = 2 - } - } - } - - modifier = { - factor = 0 - scope:recipient = { - OR = { - has_relation_friend = scope:actor - has_relation_best_friend = scope:actor - has_relation_soulmate = scope:actor - } - } - } - } -} - -give_vassal_directive_interaction = { - category = interaction_category_vassal - icon = icon_scheme_challenge_status - interface_priority = 60 - desc = give_vassal_directive_interaction_desc - - auto_accept = yes - - is_shown = { - scope:recipient = { - trigger_if = { - limit = { - scope:actor = { government_allows = administrative } - } - is_vassal_or_below_of = scope:actor - } - trigger_else = { - is_vassal_of = scope:actor - } - is_landed = yes - NOT = { government_has_flag = government_is_true_herder } - highest_held_title_tier >= tier_county - is_ai = yes - } - } - - is_valid = { - vassal_follows_directive_trigger = { VASSAL = scope:recipient LIEGE = scope:actor } - } - - is_valid_showing_failures_only = { - vassal_follows_directive_valid_trigger = { VASSAL = scope:recipient LIEGE = scope:actor } - scope:recipient = { is_physically_able = yes } - } - - send_option = { - flag = improve_development - is_shown = { - scope:recipient = { - government_allows = administrative - } - } - is_valid = { - scope:recipient = { - highest_held_title_tier >= tier_duchy - } - } - } - - send_option = { - flag = train_commanders - is_shown = { - scope:recipient = { - government_allows = administrative - } - } - is_valid = { - } - } - - send_option = { - flag = build_maa - is_shown = { - scope:recipient = { - government_allows = administrative - } - } - is_valid = { - } - } - - send_option = { - flag = convert_faith - is_shown = { - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - is_valid = { - scope:recipient = { - custom_tooltip = { - text = subrealm_has_county_of_other_faith - any_sub_realm_county = { - faith != scope:recipient.faith - } - } - } - } - } - - send_option = { - flag = convert_culture - is_shown = { - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - is_valid = { - scope:recipient = { - custom_tooltip = { - text = subrealm_has_county_of_other_culture - any_sub_realm_county = { - culture != scope:recipient.culture - } - } - } - } - } - - send_option = { - flag = improve_cultural_acceptance - is_shown = { - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - is_valid = { - scope:recipient = { - highest_held_title_tier >= tier_duchy - custom_tooltip = { - text = subrealm_has_county_of_other_culture - any_sub_realm_county = { - culture != scope:recipient.culture - } - } - } - } - } - - send_option = { - flag = building_focus_fortification - is_shown = { - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - is_valid = { - } - } - - send_option = { - flag = building_focus_military - is_shown = { - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - is_valid = { - } - } - - send_option = { - flag = building_focus_economy - is_shown = { - scope:recipient = { - NOT = { government_has_flag = government_is_nomadic } - } - } - is_valid = { - } - } - - send_option = { - flag = manage_fertility - is_shown = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - is_valid = { - } - } - send_option = { - flag = explore_cultures - is_shown = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - is_valid = { - scope:recipient = { - custom_tooltip = { - text = subrealm_has_county_of_other_culture - any_sub_realm_county = { - NOT = { culture = scope:recipient.culture } - } - } - } - } - } - send_option = { - flag = raid_innovation_intent - is_shown = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - is_valid = { - custom_tooltip = { - text = has_any_directive - scope:recipient = { - NOT = { - has_character_flag = vassal_directive_raid_innovation_intent - } - } - } - } - } - send_option = { - flag = raid_herd_intent - is_shown = { - scope:recipient = { - government_has_flag = government_is_nomadic - } - } - is_valid = { - } - } - - send_option = { - flag = remove_directive - is_shown = { - } - is_valid = { - custom_tooltip = { - text = has_any_directive - scope:recipient = { - OR = { - has_character_flag = vassal_directive_improve_development - has_character_flag = vassal_directive_train_commanders - has_character_flag = vassal_directive_build_maa - has_character_flag = vassal_directive_convert_faith - has_character_flag = vassal_directive_convert_culture - has_character_flag = vassal_directive_improve_cultural_acceptance - has_character_flag = vassal_directive_building_focus_fortification - has_character_flag = vassal_directive_building_focus_military - has_character_flag = vassal_directive_building_focus_economy - has_character_flag = vassal_directive_manage_fertility - has_character_flag = vassal_directive_explore_cultures - has_character_flag = vassal_directive_raid_innovation_intent - has_character_flag = vassal_directive_raid_herd_intent - } - } - } - } - } - - on_accept = { - scope:recipient = { - if = { - limit = { - OR = { - has_character_flag = vassal_directive_improve_development - has_character_flag = vassal_directive_train_commanders - has_character_flag = vassal_directive_build_maa - has_character_flag = vassal_directive_convert_faith - has_character_flag = vassal_directive_convert_culture - has_character_flag = vassal_directive_improve_cultural_acceptance - has_character_flag = vassal_directive_building_focus_fortification - has_character_flag = vassal_directive_building_focus_military - has_character_flag = vassal_directive_building_focus_economy - has_character_flag = vassal_directive_manage_fertility - has_character_flag = vassal_directive_explore_cultures - has_character_flag = vassal_directive_raid_innovation_intent - has_character_flag = vassal_directive_raid_herd_intent - } - } - custom_tooltip = { - text = vassal_directive_remove_directive - remove_vassal_directives = yes - } - } - switch = { - trigger = yes - - scope:improve_development ?= { - custom_tooltip = { - text = vassal_directive_improve_development - remove_vassal_directives = yes - add_character_flag = vassal_directive_improve_development - } - } - - scope:train_commanders ?= { - custom_tooltip = { - text = vassal_directive_train_commanders - remove_vassal_directives = yes - add_character_flag = vassal_directive_train_commanders - } - } - - scope:build_maa ?= { - custom_tooltip = { - text = vassal_directive_build_maa - remove_vassal_directives = yes - add_character_flag = vassal_directive_build_maa - } - } - - scope:convert_faith ?= { - custom_tooltip = { - text = vassal_directive_convert_faith - remove_vassal_directives = yes - add_character_flag = vassal_directive_convert_faith - } - } - - scope:convert_culture ?= { - custom_tooltip = { - text = vassal_directive_convert_culture - remove_vassal_directives = yes - add_character_flag = vassal_directive_convert_culture - } - } - - scope:improve_cultural_acceptance ?= { - custom_tooltip = { - text = vassal_directive_improve_cultural_acceptance - remove_vassal_directives = yes - add_character_flag = vassal_directive_improve_cultural_acceptance - } - } - - scope:building_focus_fortification ?= { - custom_tooltip = { - text = vassal_directive_building_focus_fortification - remove_vassal_directives = yes - add_character_flag = vassal_directive_building_focus_fortification - } - } - - scope:building_focus_military ?= { - custom_tooltip = { - text = vassal_directive_building_focus_military - remove_vassal_directives = yes - add_character_flag = vassal_directive_building_focus_military - } - } - - scope:building_focus_economy ?= { - custom_tooltip = { - text = vassal_directive_building_focus_economy - remove_vassal_directives = yes - add_character_flag = vassal_directive_building_focus_economy - } - } - - scope:manage_fertility ?= { - custom_tooltip = { - text = vassal_directive_manage_fertility - remove_vassal_directives = yes - add_character_flag = vassal_directive_manage_fertility - } - } - scope:explore_cultures ?= { - custom_tooltip = { - text = vassal_directive_explore_cultures - remove_vassal_directives = yes - add_character_flag = vassal_directive_explore_cultures - } - } - scope:raid_innovation_intent ?= { - custom_tooltip = { - text = vassal_directive_raid_innovation_intent - remove_vassal_directives = yes - add_character_flag = vassal_directive_raid_innovation_intent - } - } - scope:raid_herd_intent ?= { - custom_tooltip = { - text = vassal_directive_raid_herd_intent - remove_vassal_directives = yes - add_character_flag = vassal_directive_raid_herd_intent - } - } - - scope:remove_directive ?= { - custom_tooltip = { - text = vassal_directive_remove_directive - remove_vassal_directives = yes - } - } - } - } - } - - ai_potential = { - government_allows = administrative - } - ai_targets = { - ai_recipients = vassals - } - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 12 - empire = 1 - hegemony = 1 - } - ai_will_do = { - base = 0 - - modifier = { - add = 100 - scope:improve_development ?= yes - scope:recipient = { - NOR = { - has_character_flag = vassal_directive_building_focus_economy - has_character_flag = vassal_directive_improve_development - } - OR = { - vassal_contract_has_flag = admin_theme_civilian - vassal_contract_has_flag = admin_theme_balanced - } - } - } - - modifier = { - add = 100 - scope:building_focus_economy ?= yes - scope:recipient = { - NOR = { - has_character_flag = vassal_directive_building_focus_economy - has_character_flag = vassal_directive_improve_development - } - OR = { - vassal_contract_has_flag = admin_theme_civilian - vassal_contract_has_flag = admin_theme_balanced - } - } - } - - modifier = { - add = 100 - scope:building_focus_fortification ?= yes - scope:recipient = { - NOR = { - has_character_flag = vassal_directive_building_focus_fortification - has_character_flag = vassal_directive_build_maa - } - vassal_contract_has_flag = admin_theme_frontier - } - } - - modifier = { - add = 100 - scope:build_maa ?= yes - scope:recipient = { - NOR = { - has_character_flag = vassal_directive_building_focus_fortification - has_character_flag = vassal_directive_building_focus_military - has_character_flag = vassal_directive_build_maa - } - OR = { - vassal_contract_has_flag = admin_theme_military - vassal_contract_has_flag = admin_theme_frontier - } - } - } - - modifier = { - add = 100 - scope:building_focus_military ?= yes - scope:recipient = { - NOR = { - has_character_flag = vassal_directive_building_focus_military - has_character_flag = vassal_directive_build_maa - } - OR = { - vassal_contract_has_flag = admin_theme_military - vassal_contract_has_flag = admin_theme_naval - } - } - } - } -} - - - -request_court_position = { - category = interaction_category_vassal - interface_priority = 120 - icon = seneschal_court_position - - desc = request_court_position_desc - - special_interaction = request_court_position - interface = court_task_interaction - target_type = court_position_type - - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - is_shown = { - NOT = { scope:recipient = scope:actor } - scope:actor.liege ?= scope:recipient - } - - is_valid_showing_failures_only = { - scope:actor = { - tgp_is_ceremonial_liege_trigger = no - } - } - - on_accept = { - scope:recipient = { - appoint_court_position = { - recipient = scope:actor - court_position = scope:target - } - } - scope:actor = { - if = { - limit = { always = scope:claim_hook } - use_hook = scope:recipient - } - } - } - - auto_accept = { - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:claim_hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - - send_option = { - is_shown = { - NOT = { scope:actor = scope:recipient } - } - is_valid = { - scope:actor = { - has_usable_hook = scope:recipient - } - } - flag = claim_hook - localization = GENERIC_SPEND_A_HOOK - } - - send_options_exclusive = no - - ai_accept = { - base = -75 - - modifier = { - scope:claim_hook ?= yes - add = 100 - desc = SCHEME_WEAK_HOOK_USED - } - - opinion_modifier = { # More likely if Recipient likes Actor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - } - - force_notification = yes -} - -grant_court_position = { - category = interaction_category_vassal - interface_priority = 120 - icon = seneschal_court_position - - desc = grant_court_position_desc - - special_interaction = grant_court_position - interface = court_task_interaction - target_type = court_position_type - - is_shown = { - NOT = { scope:recipient = scope:actor } - scope:recipient = { - liege ?= scope:actor - tgp_is_ceremonial_liege_trigger = no - } - } - - is_valid_showing_failures_only = { - scope:recipient = { - NOT = { - is_imprisoned_by = scope:actor - } - is_adult = yes - } - } - - on_accept = { - scope:actor = { - appoint_court_position = { - recipient = scope:recipient - court_position = scope:target - } - } - } - - auto_accept = yes -} diff --git a/common/character_interactions/00_war.txt b/common/character_interactions/00_war.txt deleted file mode 100644 index 2867e253..00000000 --- a/common/character_interactions/00_war.txt +++ /dev/null @@ -1,2372 +0,0 @@ -declare_war_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - special_interaction = declare_war_interaction - interface = declare_war - interface_priority = 70 - popup_on_receive = yes - pause_on_receive = no # this is handled by the interface instead - - desc = declare_war_desc - - is_shown = { - scope:recipient != scope:actor - scope:recipient = { - is_playable_character = yes - } - scope:actor = { - NOT = { - is_at_war_with = scope:recipient - } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - custom_tooltip = { - text = sworn_peace_tt - NOT = { has_character_flag = sworn_peace } - } - NOT = { has_trait = incapable } - can_attack_in_hierarchy = scope:recipient - trigger_if = { - limit = { - NOT = { - government_has_flag = can_start_war_with_raised_troops - } - } - NOT = { - has_raised_armies = yes - } - } - trigger_else = { - custom_description = { - text = army_blocks_defender_army - NOT = { - any_army = { - location.county.holder ?= scope:recipient - } - } - } - } - has_any_display_cb_on = scope:recipient - NOT = { - is_allied_in_war = scope:recipient - } - custom_description = { - text = "is_not_bankrupt" - is_in_debt = no - } - NOT = { - custom_description = { - text = "is_in_an_activity" - exists = involved_activity - } - } - trigger_if = { - limit = { - culture = { has_cultural_parameter = cannot_attack_allies } - } - NOT = { - is_allied_to = scope:recipient - } - } - trigger_if = { - limit = { - culture = { has_cultural_parameter = cannot_attack_truces } - } - NOT = { - has_truce = scope:recipient - } - } - is_imprisoned = no - trigger_if = { - limit = { - has_variable_list = subjugation_offer_under_consideration - } - custom_description = { - text = is_not_considering_offer_of_subjugation - NOT = { - is_target_in_variable_list = { - name = subjugation_offer_under_consideration - target = scope:recipient - } - } - } - } - trigger_if = { - limit = { - has_realm_law = japanese_bureaucracy_3 - this != top_liege - } - custom_tooltip = { - text = non_admin_vassal_japanese_bureaucracy_3 - government_allows = administrative - } - } - } - scope:recipient = { - custom_tooltip = { - text = is_a_herder_recipient_tt - NOT = { government_has_flag = government_is_true_herder } # herders can't fight - } - NOT = { is_tributary_of_suzerain_or_above = scope:actor } # can't fight your tributaries or your tributaries' tributaries - NOT = { has_strong_hook = scope:actor } - trigger_if = { - limit = { is_imprisoned = yes } - imprisoner != scope:actor - } - } - scope:actor = { - trigger_if = { - limit = { - NOT = { government_allows = administrative } - liege ?= { - has_realm_law_flag = vassal_all_wars_banned_permanent - this != scope:actor - } - } - custom_tooltip = { - text = admin_all_vassal_wars_banned - always = no - } - } - trigger_if = { - limit = { - government_allows = administrative - top_liege = scope:recipient.top_liege - scope:recipient = { government_allows = administrative } - top_liege != scope:recipient - NOT = { - top_participant_group:dynastic_cycle ?= { - has_participant_group_parameter = dynastic_cycle_vassal_internal_wars_allowed - } - } - } - custom_tooltip = { - text = admin_cannot_declare_internal_wars - always = no - } - } - trigger_if = { # Admin - Laws only allow frontier and naval themes to declare war - limit = { - government_allows = administrative - top_liege != this - top_liege = { - this != scope:recipient.top_liege - has_realm_law_flag = admin_vassal_wars_restricted - } - } - custom_tooltip = { - text = admin_all_vassal_wars_banned - OR = { - vassal_contract_has_flag = admin_theme_frontier - vassal_contract_has_flag = admin_theme_naval - } - } - } - trigger_if = { # Admin - Laws only allow frontier and naval themes to declare war IF they have permission - limit = { - government_allows = administrative - OR = { - vassal_contract_has_flag = admin_theme_frontier - vassal_contract_has_flag = admin_theme_naval - } - top_liege = { - this != scope:recipient.top_liege - has_realm_law_flag = admin_vassal_wars_permission_only - NOT = { has_realm_law_flag = admin_vassal_wars_banned } - } - } - custom_tooltip = { - text = admin_vassal_wars_permission_only_desc - has_variable = admin_permission_to_declare_war - } - } - trigger_if = { # Admin - Laws prevent all vassals from declaring war - limit = { - government_allows = administrative - OR = { - vassal_contract_has_flag = admin_theme_frontier - vassal_contract_has_flag = admin_theme_naval - } - top_liege = { - this != scope:recipient.top_liege - has_realm_law_flag = admin_vassal_wars_banned - } - } - custom_tooltip = { - text = admin_all_vassal_wars_banned - always = no - } - } - trigger_if = { - limit = { - scope:recipient = { - OR = { - has_subject_contract_group = tributary_celestial - has_subject_contract_group = tributary_hegemonic - } - } - is_independent_ruler = no # to avoid duplicating tooltips already applying to the top_liege - } - NOT = { - scope:recipient = { - is_tributary_of = scope:actor.top_liege - } - } - } - } - scope:actor = { - trigger_if = { - limit = { has_government = landless_adventurer_government } - custom_tooltip = { - text = camp_located_in_defender_realm.tt - domicile.domicile_location.county.holder = { - NOR = { - this = scope:recipient - any_liege_or_above = { this = scope:recipient } - } - } - } - } - } - trigger_if = { - limit = { - scope:actor = { - is_confederation_member = yes - } - } - NOT = { - scope:recipient = { - is_member_of_confederation = scope:actor.confederation - } - } - } - } - - has_valid_target_showing_failures_only = { - custom_description = { - text = "declare_war_hook_on_liege" - OR = { - war_declarer_needs_hook_on_liege = no - always = scope:hook - } - } - scope:actor = { - NOR = { - is_at_war_with = scope:recipient - custom_description = { #A vassal cannot go to war against someone their Liege is already at war with - text = liege_is_at_war_with_recipient - object = scope:recipient - liege = { - is_at_war_with = scope:recipient - } - } - } - } - } - - send_options_exclusive = no - send_option = { - is_shown = { - war_declarer_needs_hook_on_liege = yes - } - is_valid = { - scope:actor = { - has_usable_hook = liege - } - } - flag = hook - localization = WAR_LIEGE_HOOK - can_invalidate_interaction = yes - } - should_use_extra_icon = { - war_declarer_needs_hook_on_liege = yes - scope:actor = { has_usable_hook = liege } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - on_accept = { - scope:actor = { - #Feedback! - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = declare_war_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - custom_tooltip = declare_war_interaction_notification_tooltip - - show_as_tooltip = { - if = { - limit = { always = scope:hook } - use_hook = liege - } - } - } - } - - #Has the instigator promised a vassal a war (vassal.2601)? - if = { - limit = { - exists = var:promised_war - var:promised_war = { - is_alive = yes - this != scope:recipient - } - } - trigger_event = { - id = vassal.2610 - days = { 7 10 } - } - } - - if = { - limit = { always = scope:hook } - use_hook = liege - } - - #Send break up event if they are your lover - if = { - limit = { - has_relation_lover = scope:recipient - NOT = { has_relation_rival = scope:recipient } #To enable really strange love stories - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - primary_defender = scope:recipient - any_target_title = { } - } - } - } - scope:recipient = { - trigger_event = { - id = lover.0103 - days = { 14 30 } - } - } - } - - #Invalidate any wars your vassals have going against recipient atm - scope:recipient = { - if = { - limit = { - any_character_war = { - primary_attacker = { - is_vassal_or_below_of = scope:actor - trigger_if = { #Ai should never invalidate a player's war! - limit = { - this = { is_ai = no } - } - scope:actor = { - is_ai = no - } - } - } - } - } - every_character_war = { - limit = { - primary_attacker = { - is_vassal_or_below_of = scope:actor - trigger_if = { #Ai should never invalidate a player's war! - limit = { - this = { is_ai = no } - } - scope:actor = { - is_ai = no - } - } - } - } - show_as_tooltip = { end_war = invalidated } #Actually ended in the event - primary_attacker = { trigger_event = war_event.1001 } - } - } - } - #Notify defender's vassals if the war is targeting one or more of their titles - scope:recipient = { - if = { - limit = { - any_vassal = { - save_temporary_scope_as = attacked_vassal - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - primary_defender = scope:recipient - any_target_title = { - holder = { - OR = { - this = scope:attacked_vassal - is_vassal_or_below_of = scope:attacked_vassal - } - } - } - } - } - } - } - every_vassal = { - save_temporary_scope_as = attacked_vassal - limit = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - primary_defender = scope:recipient - any_target_title = { - holder = { - OR = { - this = scope:attacked_vassal - is_vassal_or_below_of = scope:attacked_vassal - } - } - } - } - } - } - send_interface_toast = { - type = msg_war_declared_on_liege - title = declare_war_interaction_notification - - left_icon = scope:actor - right_icon = scope:recipient - - custom_tooltip = declare_war_interaction_notification_tooltip - } - } - } - } - - # If you are admin and had permission to start war, spend said permission - if = { - limit = { - has_variable = admin_permission_to_declare_war - } - remove_variable = admin_permission_to_declare_war - } - } - } - - auto_accept = yes -} - -end_war_attacker_victory_interaction = { - special_interaction = end_war_attacker_victory_interaction - hidden = yes - use_diplomatic_range = no - secondary_scopes_optional = yes - - ai_targets = { - ai_recipients = primary_war_enemies - } - - ai_frequency_by_tier = { - barony = 0 - county = 1 - duchy = 1 - kingdom = 1 - empire = 1 - hegemony = 1 - } - - # Depending on who was the attacker, we need to send a different notification message to the recipient. - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - } - } - } - } - desc = end_war_attacker_victory_attacker_desc - } - desc = end_war_attacker_victory_defender_desc - } - } - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - can_be_picked = { - scope:war ?= { - custom_tooltip = { - text = hostage_exchange_invalid_for_crusade_tt - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - custom_tooltip = { - text = hostage_exchange_invalid_for_cb_tt - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - } - - redirect = { - # secondary recipient is always set, so we need to clear it - # if can_send condition depends on the scope being empty - clear_saved_scope = secondary_recipient - } - - on_accept = { - casus_belli = { - primary_attacker = { - save_scope_as = attacker_winner - } - primary_defender = { - save_scope_as = defender_loser - } - } - - if = { - limit = { - scope:war ?= { - using_cb = fp3_free_house_member_cb - } - } - } - else = { - release_prisoners_of_war_effect = yes - } - - # Hostages - # Save scopes for clarity - if = { - limit = { - scope:war ?= { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - if = { - limit = { - exists = scope:secondary_actor - scope:recipient = { is_landed_or_landless_administrative = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_actor - WARDEN = scope:recipient - HOME_COURT = scope:actor - } - } - if = { - limit = { - exists = scope:secondary_recipient - scope:actor = { is_landed_or_landless_administrative = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_recipient - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - } - } - - #Send notification to vassals - hidden_effect = { - scope:attacker_winner = { - if = { - limit = { - any_vassal = { - this != scope:defender_loser - } - } - every_vassal = { - limit = { this != scope:defender_loser } - send_interface_toast = { - type = msg_liege_war_ended_attacker_win - title = war_event.notification_liege_win.t - left_icon = scope:attacker_winner - right_icon = scope:defender_loser - custom_tooltip = war_event.1901 - } - } - } - } - scope:defender_loser = { - if = { - limit = { - any_vassal = { this != scope:attacker_winner } - } - every_vassal = { - limit = { - this != scope:attacker_winner - } - send_interface_toast = { - type = msg_liege_war_ended_attacker_win - title = war_event.notification_liege_loss.t - left_icon = scope:defender_loser - right_icon = scope:attacker_winner - custom_tooltip = war_event.1902 - } - } - } - } - } - - #Special bookmark event for Aella of Northumbria - bookmark_867_northmen_aellas_capture_war_imprisonment_effect = yes - - end_war = attacker - } - - on_decline = { - } - - ai_potential = { - is_at_war = yes - any_character_war = { - is_war_leader = root - OR = { - attacker_war_score >= 100 - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - root = { - has_perk = peacemaker_perk - } - primary_defender = { - is_ai = yes - } - } - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - has_perk = peacemaker_perk - } - } - } - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - primary_defender = { - is_ai = yes - } - } - #SENT A SCARY SEVERED HEAD AAAAHHH - AND = { - attacker_war_score >= 70 - primary_defender = { - is_ai = yes - save_temporary_scope_as = defender - } - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - } - primary_defender = { - is_ai = yes - has_variable = conqueror - } - } - } - } - - ai_will_do = { - base = 0 - - modifier = { - scope:war = { - primary_attacker = scope:actor - OR = { - attacker_war_score >= 100 - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - root = { - has_perk = peacemaker_perk - } - primary_defender = { - is_ai = yes - } - } - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - has_perk = peacemaker_perk - } - } - } - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - primary_defender = { - is_ai = yes - } - } - #SENT A SCARY SEVERED HEAD AAAAHHH - AND = { - attacker_war_score >= 70 - primary_defender = { - is_ai = yes - save_temporary_scope_as = defender - } - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - } - AND = { - NOR = { - using_cb = undirected_great_holy_war - using_cb = mongol_invasion_war - using_cb = mongol_realm_invasion_war - using_cb = mpo_gok_onslaught_cb - } - primary_defender = { - is_ai = yes - has_variable = conqueror - } - } - } - } - add = 100 - } - modifier = { - scope:war = { - primary_defender = scope:actor - attacker_war_score >= 100 - days_since_max_war_score >= 180 - } - add = 100 - } - } - - ai_accept = { - base = -99 - - compare_modifier = { - target = scope:war - value = attacker_war_score - desc = "WARSCORE_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_attacker = { - has_perk = peacemaker_perk - this != scope:recipient - } - } - - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_attacker = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - NOT = { this = scope:recipient } - } - } - - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - save_temporary_scope_as = defender - } - primary_attacker = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - primary_defender = { - is_ai = yes - } - } - add = 30 - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - - # Hostages - modifier = { - exists = scope:secondary_actor - add = war_actor_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_OFFER_VALUE - } - modifier = { - exists = scope:secondary_recipient - add = war_recipient_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_DEMAND_VALUE - } - # The AI cannot accept the outcome, if they will lose all their land and you try to take a hostage from them - modifier = { - scope:war = { - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - NOT = { - scope:recipient = { - any_held_title = { - tier = tier_county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - } - add = -10000 - desc = WAR_OVERVIEW_HOSTAGE_DEMAND_BLOCKED - } - # This is a bit of a hidden modifier, only used to make sure we get the right icon when you force it through at 100 war score, and the opponent has more realm left - modifier = { - scope:war = { - attacker_war_score >= 100 - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - scope:recipient = { - any_held_title = { - tier = tier_county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - add = 1000 - desc = "WARSCORE_MODIFIER" - } - } - - auto_accept = { - trigger_if = { - limit = { - OR = { - scope:war = { - attacker_war_score >= 100 - } - AND = { - scope:recipient = { is_ai = yes } - primary_attacker = scope:recipient - } - scope:war.casus_belli = { # Conquerors know when to fold - primary_attacker = { - is_ai = yes - current_military_strength >= scope:recipient.fifty_percent_more_of_current_military_strength - } - primary_defender = { - is_ai = yes - has_variable = conqueror - this = scope:recipient - } - } - } - } - always = yes - } - trigger_else = { - always = no - } - # The auto accept kind of messes up the hostage interaction a bit, so we block the auto accept if they try to grab a hostage and all the opponent's land at the same time - scope:war = { - trigger_if = { - limit = { - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - NOT = { - scope:recipient = { - any_held_title = { - tier = tier_county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - } - always = no - } - } - } - - is_valid_showing_failures_only = { - scope:war = { - has_valid_casus_belli = yes - trigger_if = { # Cannot exchange hostages with soon to be landless - limit = { - OR = { - exists = scope:secondary_actor - exists = scope:secondary_recipient - } - casus_belli = { - any_target_title = { - count >= 1 - add_to_temporary_list = target_titles - } - } - } - custom_tooltip = { - text = hostage_no_land_after_war_tt - scope:recipient = { - any_held_title = { - title_tier = county - NOT = { - any_this_title_or_de_jure_above = { is_in_list = target_titles } - } - } - } - } - } - } - } -} - -end_war_attacker_white_peace_interaction = { - - special_interaction = end_war_white_peace_interaction - hidden = yes - use_diplomatic_range = no - secondary_scopes_optional = yes - send_name = "WHITE_PEACE_INTERACTION" - - ai_targets = { - ai_recipients = primary_war_enemies - } - - ai_frequency_by_tier = { - barony = 0 - county = 12 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - - # Depending on who was the attacker, we need to send a different notification message to the recipient. - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - } - } - } - } - desc = end_war_attacker_white_peace_attacker_desc - } - desc = end_war_attacker_white_peace_defender_desc - } - } - - redirect = { - # secondary recipient is always set, so we need to clear it - # if can_send condition depends on the scope being empty - clear_saved_scope = secondary_recipient - } - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - can_be_picked = { - scope:war ?= { - custom_tooltip = { - text = hostage_exchange_invalid_for_crusade_tt - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - custom_tooltip = { - text = hostage_exchange_invalid_for_cb_tt - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - } - - on_accept = { - casus_belli = { - primary_attacker = { - save_scope_as = attacker_white_peace - } - primary_defender = { - save_scope_as = defender_white_peace - } - } - - if = { - limit = { - scope:war ?= { - using_cb = fp3_free_house_member_cb - } - } - } - else = { - release_prisoners_of_war_effect = yes - } - - # Hostages - # Save scopes for clarity - if = { - limit = { - scope:war ?= { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - if = { - limit = { - exists = scope:secondary_actor - scope:recipient = { is_landed_or_landless_administrative = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_actor - WARDEN = scope:recipient - HOME_COURT = scope:actor - } - } - if = { - limit = { - exists = scope:secondary_recipient - scope:actor = { is_landed_or_landless_administrative = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_recipient - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - } - } - - #Send notification to vassals - hidden_effect = { - scope:attacker_white_peace = { - if = { - limit = { - any_vassal = { this != scope:defender_white_peace } - } - every_vassal = { - limit = { - this != scope:defender_white_peace - } - send_interface_toast = { - type = msg_liege_war_ended_white_peace - title = WAR_RESULTS_WHITE_PEACE - left_icon = scope:attacker_white_peace - right_icon = scope:defender_white_peace - custom_tooltip = war_event.1903 - } - } - } - } - scope:defender_white_peace = { - if = { - limit = { - any_vassal = { this != scope:attacker_white_peace } - } - every_vassal = { - limit = { - this != scope:attacker_white_peace - } - send_interface_toast = { - type = msg_liege_war_ended_white_peace - title = WAR_RESULTS_WHITE_PEACE - left_icon = scope:defender_white_peace - right_icon = scope:attacker_white_peace - custom_tooltip = war_event.1904 - } - } - } - } - } - - end_war = white_peace - } - - on_decline = { - } - - ai_potential = { - any_character_war = { - count >= 1 - casus_belli = { - OR = { - primary_attacker = root - primary_defender = root - } - } - } - - trigger_if = { - limit = { - exists = scope:war - } - NOR = { # Don't send inane white peace offers to the player - scope:war = { - casus_belli = { - primary_defender = root - primary_attacker = { - is_ai = no - } - } - attacker_war_score >= 10 - } - scope:war = { - casus_belli = { - primary_attacker = root - primary_defender = { - is_ai = no - } - } - defender_war_score >= 70 - } - } - } - } - - ai_will_do = { - base = 0 - - # Attacker concerned about defending in other wars - modifier = { - scope:war.casus_belli = { - primary_attacker = root - } - scope:war = { - war_days >= 365 - attacker_war_score <= 0 - } - any_character_war = { - this != scope:war - casus_belli = { - primary_defender = root - } - } - add = { - value = 10 - if = { - limit = { - scope:war = { - attacker_war_score <= -50 - } - } - add = 40 - } - } - } - - # Attacker Greed - ai_value_modifier = { - ai_greed = { - if = { - limit = { - scope:war.casus_belli = { - primary_attacker = root - } - scope:war = { - war_days >= 365 - attacker_war_score <= 10 - } - ai_greed > -20 - } - value = -0.25 - } - } - ai_vengefulness = { - if = { - limit = { ai_vengefulness > 0 } - value = -1 - } - } - } - - # Defender prefers White Peace to loss - modifier = { - scope:war.casus_belli = { - primary_defender = root - } - scope:war = { - war_days >= 182 - defender_war_score <= 15 - } - add = { - value = 10 - if = { - limit = { - scope:war = { - defender_war_score <= -40 - } - } - add = 50 - } - } - } - - # Defenders want to end wars that's taking too long to win - modifier = { - scope:war.casus_belli = { - primary_defender = root - } - scope:war = { - war_days >= 365 - } - add = { - value = scope:war.war_days - divide = 30 - if = { - limit = { - scope:war = { - defender_war_score > 0 - } - } - subtract = scope:war.defender_war_score - } - if = { # If you're this close, perhaps it's worth waiting a few more months for ticking warscore? - limit = { - scope:war = { - defender_war_score >= 70 - } - } - subtract = scope:war.defender_war_score - } - min = 0 - } - } - - # I'm in debt, how about a white peace? Defender - modifier = { - scope:war = { - war_days >= 182 - } - scope:war.casus_belli = { - primary_defender = root - } - OR = { - debt_level >= 1 - treasury_debt_level >= 1 - } - - add = { - value = debt_level - multiply = 20 - - if = { - limit = { scope:war = { defender_war_score > 0 }} - subtract = scope:war.defender_war_score - } - if = { # Push through to the end, it's worth it at this point... - limit = { scope:war = { defender_war_score >= 80 }} - subtract = scope:war.defender_war_score - } - min = 0 - } - } - - - # I'm in debt, how about a white peace? Attacker - modifier = { - scope:war = { - war_days >= 182 - } - scope:war.casus_belli = { - primary_attacker = root - } - OR = { - debt_level >= 1 - treasury_debt_level >= 1 - } - - - add = { - value = debt_level - multiply = 20 - - if = { - limit = { scope:war = { attacker_war_score > 0 }} - subtract = scope:war.attacker_war_score - } - min = 0 - } - } - - # Do not attempt white peace vs. players if you're losing - modifier = { - OR = { - AND = { - scope:war.casus_belli = { - primary_attacker = root - primary_defender = { is_ai = no } - } - scope:war = { - defender_war_score >= 30 - } - } - AND = { - scope:war.casus_belli = { - primary_defender = root - primary_attacker = { is_ai = no } - } - scope:war = { - attacker_war_score >= 30 - } - } - } - factor = 0 - } - # Can end with hostages of equalish value - modifier = { - exists = scope:secondary_recipient - exists = scope:secondary_actor - scope:war = { - war_days >= 365 - NOR = { - defender_war_score >= 30 - attacker_war_score >= 30 - } - } - trigger_if = { - limit = { scope:war.primary_attacker = scope:actor } - interaction_relative_hostage_value > -10 - } - trigger_else = { interaction_relative_hostage_value > -20 } - add = { - value = 0 - if = { - limit = { interaction_relative_hostage_value < 0 } - add = { - value = interaction_relative_hostage_value - multiply = -1 - } - } - else = { add = interaction_relative_hostage_value } - if = { - limit = { scope:actor.ai_boldness < 0 } - add = { - value = scope:actor.ai_boldness - multiply = -0.25 - } - } - if = { - limit = { scope:actor.ai_honor < 0 } - add = { - value = scope:actor.ai_honor - multiply = 0.1 - } - } - else = { - add = { - value = scope:actor.ai_honor - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_rationality < 0 } - add = { - value = scope:actor.ai_rationality - multiply = 0.1 - } - } - else = { - add = { - value = scope:actor.ai_rationality - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_greed > 0 } - add = { - value = scope:actor.ai_greed - multiply = -0.1 - } - } - else = { - add = { - value = scope:actor.ai_greed - multiply = -0.25 - } - } - } - } - # Can end with hostage demand - modifier = { - exists = scope:secondary_recipient - NOT = { exists = scope:secondary_actor } - scope:war = { - war_days >= 365 - NOR = { - defender_war_score >= 30 - attacker_war_score >= 30 - } - } - add = { - value = 0 - add = { - value = interaction_recipient_hostage_value - multiply = 0.1 - } - if = { - limit = { scope:actor.ai_boldness < 0 } - add = { - value = scope:actor.ai_boldness - multiply = -0.25 - } - } - if = { - limit = { scope:actor.ai_honor < 0 } - add = { - value = scope:actor.ai_honor - multiply = -0.25 - } - } - else = { - add = { - value = scope:actor.ai_honor - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_rationality < 0 } - add = { - value = scope:actor.ai_rationality - multiply = 0.25 - } - } - else = { - add = { - value = scope:actor.ai_rationality - multiply = 0.25 - } - } - if = { - limit = { scope:actor.ai_greed > 0 } - add = { - value = scope:actor.ai_greed - multiply = 0.25 - } - } - else = { - add = { - value = scope:actor.ai_greed - multiply = -0.1 - } - } - } - } - - # I don't have time for this, I need to conquer - modifier = { - scope:war.casus_belli = { - primary_defender = { - this = scope:actor - has_variable = conqueror - } - primary_attacker = { is_ai = yes } - } - - add = 100 - } - } - - ai_accept = { - base = -30 - compare_modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - } - } - target = scope:war - value = attacker_war_score - desc = "WARSCORE_MODIFIER" - } - compare_modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - } - } - target = scope:war - value = defender_war_score - desc = "WARSCORE_MODIFIER" - } - - # Length of War - compare_modifier = { - target = scope:war - trigger = { - scope:war = { - war_days >= 365 - } - } - value = { - value = war_days - divide = 91 # 40 in 10 years - } - desc = "WAR_LENGTH" - } - - # I'm in debt, how about a white peace? - modifier = { - scope:war = { - war_days >= 182 - } - scope:war.casus_belli = { - primary_defender = root - } - OR = { - debt_level >= 1 - treasury_debt_level >= 1 - } - - - add = { - value = debt_level - multiply = 20 - } - desc = COMPLETELY_BANKRUPT - } - - # Attacker concerned about other wars - modifier = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - } - scope:recipient = { - any_character_war = { - this != scope:war - primary_defender = scope:recipient - } - } - add = 10 - - desc = CONCERN_ABOUT_OTHER_WARS - } - - # Vengefulness - ai_value_modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - } - } - ai_vengefulness = { - if = { - limit = { - scope:war.casus_belli = { - primary_defender = scope:recipient - } - } - value = -0.25 - } - } - ai_greed = { - if = { - limit = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - } - } - value = -0.25 - } - } - ai_zeal = { - value = -0.2 - if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:actor.faith - value = 2 - } - } - } - multiply = 2 - } - if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:actor.faith - value = 3 - } - } - } - multiply = 3 - } - if = { - limit = { - OR = { - ai_zeal <= 0 - faith = { - faith_hostility_level = { - target = scope:actor.faith - value <= 0 - } - } - } - } - value = 0 - } - } - } - - # Peacemaker Perk - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_attacker = { has_perk = peacemaker_perk } - } - } - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_defender = { has_perk = peacemaker_perk } - } - } - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_attacker = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_defender = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - primary_defender = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - } - add = 30 - - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_defender = { - is_ai = yes - save_temporary_scope_as = defender - } - primary_attacker = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:defender - } - } - } - } - add = 30 - - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - - # Cultural Traditions - modifier = { - trigger = { - scope:war.casus_belli = { - primary_defender = scope:recipient - primary_attacker = { culture = { has_cultural_parameter = facilitate_white_peace } } - } - } - add = 10 - - desc = "TRADITION_BONUS_WHITE_PEACE" - } - modifier = { - trigger = { - scope:war.casus_belli = { - primary_attacker = scope:recipient - primary_defender = { culture = { has_cultural_parameter = facilitate_white_peace } } - } - } - add = 10 - - desc = "TRADITION_BONUS_WHITE_PEACE" - } - - # Struggles - modifier = { - trigger = { - scope:actor = { - OR = { - any_character_struggle = { - involvement = involved - is_struggle_parameter_active_secondary_character_involvement_either_trigger = { - PARAMETER = white_peace_acceptance_between_involved_or_interloper_with_region_easier - CHAR = scope:recipient - } - } - any_character_struggle = { - involvement = interloper - is_struggle_parameter_active_secondary_character_involvement_either_trigger = { - PARAMETER = white_peace_acceptance_between_involved_or_interloper_with_region_easier - CHAR = scope:recipient - } - } - } - } - } - add = 10 - - desc = "STRUGGLE_INVOLVED_OR_INTERLOPER_PHASE_BONUS" - } - - # GoK war - modifier = { - desc = WAR_OVERVIEW_WHITE_PEACE_GOK - add = -70 - scope:war = { - using_cb = mpo_gok_onslaught_cb - primary_defender = scope:actor - } - } - # GoK war but have counties occupied - modifier = { - desc = WAR_OVERVIEW_WHITE_PEACE_GOK_OCCUPATION - add = { - value = 0 - scope:war.primary_defender = { - every_sub_realm_county = { - limit = { - county_controller = scope:war.primary_attacker - } - add = 2 - } - } - max = 200 - } - scope:war = { - using_cb = mpo_gok_onslaught_cb - attacker_war_score <= 25 - primary_defender = { - any_sub_realm_county = { - county_controller = scope:war.primary_attacker - } - } - primary_defender = scope:actor - } - } - - # Hostages - modifier = { - exists = scope:secondary_actor - add = { - value = war_actor_hostage_value - multiply = 0.5 - } - desc = WAR_OVERVIEW_WHITE_PEACE_HOSTAGE_OFFER_VALUE - } - modifier = { - exists = scope:secondary_recipient - add = { - value = war_recipient_hostage_value - multiply = 0.5 - } - desc = WAR_OVERVIEW_WHITE_PEACE_HOSTAGE_DEMAND_VALUE - } - } - - is_valid_showing_failures_only = { - exists = scope:war - scope:war = { - has_valid_casus_belli = yes - } - is_white_peace_possible = yes - } -} - -end_war_attacker_defeat_interaction = { - special_interaction = end_war_attacker_defeat_interaction - hidden = yes - use_diplomatic_range = no - secondary_scopes_optional = yes - - ai_targets = { - ai_recipients = primary_war_enemies - } - - ai_frequency_by_tier = { - barony = 0 - county = 1 - duchy = 1 - kingdom = 1 - empire = 1 - hegemony = 1 - } - - # Depending on who was the attacker, we need to send a different notification message to the recipient. - notification_text = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - any_character_war = { - casus_belli = { - primary_attacker = scope:actor - } - } - } - } - desc = end_war_attacker_defeat_attacker_desc - } - desc = end_war_attacker_defeat_defender_desc - } - } - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - can_be_picked = { - scope:war ?= { - custom_tooltip = { - text = hostage_exchange_invalid_for_crusade_tt - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - } - custom_tooltip = { - text = hostage_exchange_invalid_for_cb_tt - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - } - - redirect = { - # secondary recipient is always set, so we need to clear it - # if can_send condition depends on the scope being empty - clear_saved_scope = secondary_recipient - } - - on_accept = { - casus_belli = { - primary_attacker = { - save_scope_as = attacker_loser - } - primary_defender = { - save_scope_as = defender_winner - set_signature_weapon_effect = yes - } - } - - if = { - limit = { - scope:war ?= { - using_cb = fp3_free_house_member_cb - } - } - } - else = { - release_prisoners_of_war_effect = yes - } - - # Hostages - # Save scopes for clarity - if = { - limit = { - scope:war ?= { - NOR = { - using_cb = undirected_great_holy_war - using_cb = directed_great_holy_war - } - bp2_hostage_exchange_invalid_cb_trigger = no - } - } - if = { - limit = { - exists = scope:secondary_actor - scope:recipient = { is_landed = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_actor - WARDEN = scope:recipient - HOME_COURT = scope:actor - } - } - if = { - limit = { - exists = scope:secondary_recipient - scope:actor = { is_landed = yes } - } - hostage_depart_effect = { - HOSTAGE = scope:secondary_recipient - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - } - } - - #Send notification to vassals - hidden_effect = { - scope:attacker_loser = { - if = { - limit = { - any_vassal = { - this != scope:defender_winner - } - } - every_vassal = { - limit = { - this != scope:defender_winner - } - send_interface_toast = { - type = msg_liege_war_ended_defender_win - title = war_event.notification_liege_loss.t - left_icon = scope:attacker_loser - right_icon = scope:defender_winner - custom_tooltip = war_event.1905 - } - } - } - } - scope:defender_winner = { - if = { - limit = { - any_vassal = { this != scope:attacker_loser } - } - every_vassal = { - limit = { - this != scope:attacker_loser - } - send_interface_toast = { - type = msg_liege_war_ended_defender_win - title = war_event.notification_liege_win.t - left_icon = scope:defender_winner - right_icon = scope:attacker_loser - custom_tooltip = war_event.1906 - } - } - } - } - } - - end_war = defender - } - - on_decline = { - - } - - ai_potential = { - is_at_war = yes - any_character_war = { - is_war_leader = root - OR = { - defender_war_score >= 100 - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - } - } - root = { - has_perk = peacemaker_perk - } - primary_defender = { - is_ai = yes - } - } - AND = { - OR = { - attacker_war_score >= 90 - AND = { - attacker_war_score >= 80 - root = { - has_perk = peacemaker_perk - } - } - } - root = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - primary_defender = { - is_ai = yes - } - } - AND = { - defender_war_score >= 70 - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - } - } - } - - ai_will_do = { - base = 0 - - modifier = { - scope:war = { - primary_defender = scope:actor - OR = { - defender_war_score >= 100 - AND = { - defender_war_score >= 90 - scope:actor = { - OR = { - has_perk = peacemaker_perk - culture = { - has_cultural_parameter = can_end_defensive_wars_earlier - } - } - } - primary_attacker = { - is_ai = yes - } - } - AND = { - defender_war_score >= 90 - scope:actor = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - } - primary_attacker = { - is_ai = yes - } - } - AND = { - defender_war_score >= 70 - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - root = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - } - } - add = 100 - } - modifier = { - scope:war = { - primary_attacker = scope:actor - defender_war_score >= 100 - days_since_max_war_score >= 180 - } - add = 100 - } - } - - ai_accept = { - base = -99 - - compare_modifier = { - target = scope:war - value = defender_war_score - desc = "WARSCORE_MODIFIER" - } - modifier = { - add = 1000 - scope:war.casus_belli = { - primary_defender = scope:recipient - } - desc = "WOULD_WIN_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - has_perk = peacemaker_perk - this != scope:recipient - } - } - - add = peacemaker_value - - desc = "PEACEMAKER_PERK_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_3 } - NOT = { this = scope:recipient } - } - } - - add = 10 - - desc = "NOMAD_LEGACY_PERK_MODIFIER" - } - - modifier = { - scope:war.casus_belli = { - primary_attacker = { - is_ai = yes - save_temporary_scope_as = attacker - } - primary_defender = { - has_variable = peace_acceptance_head_scare - var:peace_acceptance_head_scare = { - this = scope:attacker - } - } - } - add = 30 - desc = "COWED_BY_SEVERED_HEAD_MODIFIER" - } - modifier = { - scope:war.casus_belli = { - primary_defender = { - culture = { - has_cultural_parameter = can_end_defensive_wars_earlier - } - this != scope:recipient - } - } - - add = 10 - - desc = "TRADITION_BONUS_DEFENSIVE_WARS" - } - # Hostages - modifier = { - exists = scope:secondary_actor - add = war_actor_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_OFFER_VALUE - } - modifier = { - exists = scope:secondary_recipient - add = war_recipient_hostage_value - desc = WAR_OVERVIEW_HOSTAGE_DEMAND_VALUE - } - } - - auto_accept = { - OR = { - scope:war = { - defender_war_score >= 100 - } - AND = { - scope:recipient = { is_ai = yes } - primary_defender = scope:recipient - } - } - } - - is_valid_showing_failures_only = { - scope:war = { - has_valid_casus_belli = yes - } - } -} - -view_war_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - - special_interaction = offer_peace_interaction - interface = offer_peace - use_diplomatic_range = no - ignores_pending_interaction_block = yes - - is_shown = { - scope:actor = { - is_at_war_with = scope:recipient - NOT = { - any_character_war = { - is_war_leader = scope:actor - is_participant = scope:recipient - } - } - } - } - auto_accept = yes -} - -offer_peace_interaction = { - category = interaction_category_diplomacy - common_interaction = yes - icon = war_won_icon - - special_interaction = offer_peace_interaction - interface = offer_peace - use_diplomatic_range = no - - is_shown = { - scope:actor = { - is_at_war_with = scope:recipient - any_character_war = { - is_war_leader = scope:actor - is_participant = scope:recipient - } - } - } - auto_accept = yes -} diff --git a/common/character_interactions/03_fp2_interactions.txt b/common/character_interactions/03_fp2_interactions.txt index e3fe3533..625f5d38 100644 --- a/common/character_interactions/03_fp2_interactions.txt +++ b/common/character_interactions/03_fp2_interactions.txt @@ -3189,7 +3189,7 @@ contract_assistance_interaction = { is_shown = { # Actor is Involved in Struggle scope:actor = { - NOT = { government_has_flag = government_is_true_herder } + NOT = { government_has_flag = government_is_herder } OR = { any_character_struggle = { involvement = involved diff --git a/common/character_interactions/05_bp2_interactions.txt b/common/character_interactions/05_bp2_interactions.txt deleted file mode 100644 index 2cc2af32..00000000 --- a/common/character_interactions/05_bp2_interactions.txt +++ /dev/null @@ -1,4988 +0,0 @@ -#Interactions relating to hostages - -### Offer hostage - unilateral -# actor = offerer -# recipient = receiver -# secondary_actor = hostage -offer_hostage_interaction = { - category = interaction_category_diplomacy - common_interaction = no - interface_priority = 11 - ai_min_reply_days = 4 - ai_max_reply_days = 9 - popup_on_receive = yes - pause_on_receive = yes - icon = icon_hostage - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - desc = offer_hostage_interaction_desc - - prompt = OFFER_HOSTAGE_SELECT_HOSTAGE_TO_TRANSFER - - notification_text = OFFER_HOSTAGE_PROPOSAL - - cooldown_against_recipient = { years = 3 } - - is_shown = { - scope:recipient != scope:actor - # Cannot exchange hostages with a herder - # Only significant rulers use hostages - scope:recipient.highest_held_title_tier > tier_barony - # Laamps can't do anything with hostages but return/recall them. - scope:recipient = { - NOR = { - government_has_flag = government_is_landless_adventurer - government_has_flag = government_is_true_herder - } - } - #Inside a merit realm vassals won't offer hostages except to your top liege. - trigger_if = { - limit = { - scope:actor.top_liege = { government_has_flag = government_has_merit } - scope:actor.top_liege != scope:actor - scope:recipient != scope:actor.top_liege - } - NAND = { - scope:actor = { government_has_flag = government_has_merit } - scope:recipient = { government_has_flag = government_has_merit } - } - } - } - - is_valid_showing_failures_only = { - NOR = { - # Must be at peace - scope:recipient = { is_at_war_with = scope:actor } - # Allies don't need hostages - scope:recipient = { is_allied_to = scope:actor } - # Only family oriented governments use hostages - scope:actor = { - government_has_flag = government_is_theocracy - } - scope:recipient = { - government_has_flag = government_is_theocracy - } - # 1 hostage per home court - custom_tooltip = { - text = "already_has_your_hostage_tt" - scope:recipient = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - custom_description = { - text = hostage_already_travelling_tt - subject = scope:actor - object = scope:recipient - scope:actor = { - any_close_family_member = { - exists = var:hostage_travelling_to_warden - var:hostage_travelling_to_warden = scope:recipient - } - } - } - } - scope:actor = { - OR = { - is_landless_ruler = no - is_landless_administrative = yes - } - } - scope:recipient = { - OR = { - is_landless_ruler = no - is_landless_administrative = yes - } - } - # Stop AI spamming hostage offers - trigger_if = { - limit = { - scope:actor = { is_ai = yes } - exists = scope:secondary_actor - } - NOT = { - scope:secondary_actor = { has_character_flag = ai_should_not_offer_hostage } - } - } - # Tooltip for players in case of no valid hostages to offer - trigger_else = { - scope:actor = { - custom_description = { - text = "basic_valid_hostage_to_offer" - object = scope:recipient - any_close_family_member = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - } - } - } - # Hostages still valid - trigger_if = { - limit = { - exists = scope:secondary_actor - exists = scope:actor - } - scope:secondary_actor = { - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - } - tgp_blocked_action_against_tenno_trigger = { - ACTOR = scope:actor - TARGET = scope:recipient - } - } - - can_be_picked = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - # Under offer - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { exists = var:hostage_travelling_to_warden } - } - } - - can_send = { - scope:actor = { # AI only offer to more powerful neighbors - trigger_if = { - limit = { is_ai = yes } - bp2_valid_to_offer_hostage_ai_trigger = yes - # AI should not offer close family of players without their consent - NOR = { - scope:secondary_actor = { - any_close_family_member = { - is_ai = no - OR = { - is_parent_of = scope:secondary_actor - is_grandparent_of = scope:secondary_actor - } - this != scope:actor - } - } - # A hostage died on their watch - var:hostage_died ?= scope:recipient - } - } - } - scope:recipient = { - trigger_if = { - limit = { is_ai = no } - NOT = { - scope:secondary_actor = { has_character_flag = ai_should_not_offer_hostage } - } - } - } - # Adult hostages must be loyal enough to go along with it - scope:secondary_actor = { - trigger_if = { - limit = { is_adult = yes } - OR = { - AND = { - custom_tooltip = { - text = hostage_opinion_too_low_tt - opinion = { - target = scope:actor - value >= -25 - } - } - NOT = { has_trait = disloyal } - } - has_trait = loyal - } - } - # Under offer - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - } - } - - cost = {} - - on_send = { - scope:secondary_actor = { - add_character_flag = { - flag = under_offer_as_hostage_flag - months = 1 - } - } - if = { - limit = { - scope:recipient = { is_ai = no } - } - hidden_effect = { - scope:secondary_actor = { - add_character_flag = { - flag = ai_should_not_offer_hostage - years = 3 - } - } - } - } - } - - on_accept = { - # Save scopes for clarity - scope:actor = { save_scope_as = hostage_sender } - scope:secondary_actor = { save_scope_as = hostage } - scope:recipient = { save_scope_as = hostage_taker } - custom_description_no_bullet = { text = hostage_pacts_on_arrival_tt } - custom_description_no_bullet = { text = hostage_execution_warning_tt } - custom_description_no_bullet = { text = hostage_attack_warning_tt } - hostage_depart_effect = { - HOSTAGE = scope:hostage - WARDEN = scope:hostage_taker - HOME_COURT = scope:hostage_sender - } - scope:actor = { trigger_event = char_interaction.0330 } - # If we're of the same clan this interaction affects unity - if = { - limit = { - scope:actor = { government_has_flag = government_is_clan } - scope:actor.house = scope:recipient.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_hostage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0300 - } - scope:secondary_actor = { remove_character_flag = under_offer_as_hostage_flag } - } - - auto_accept = { - trigger_if = { - limit = { - scope:hook ?= yes - scope:actor = { has_strong_hook = scope:recipient } - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook ?= yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - trigger_else = { always = no } - } - - can_be_blocked = { - custom_description = { #Hook from Recipient can counteract, but only if Actor is not forcing the action via Strong Hook. - text = "spending_hook" - subject = scope:recipient - object = scope:actor - scope:recipient = { has_hook = scope:actor } - NAND = { - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - on_blocked_effect = { - scope:recipient = { - remove_hook = { target = scope:actor } - } - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - # AI - ai_accept = { - base = 0 # Try to make it 0 for most interactions - - ######### PERSONALITY - - bp2_hostage_offer_personality_modifier = yes - - ######### OPINION - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - - ######### RELATIONS - - bp2_hostage_relation_modifier = yes - - ######### DREAD - - bp2_hostage_dread_modifier = yes - - ######### HOSTAGE IMPORTANCE - - # Hostages - modifier = { - exists = scope:secondary_actor - add = interaction_actor_hostage_value - desc = HOSTAGE_VALUE_ACTOR_REASON - } - - ######### RELATIVE POWER - - bp2_hostage_tier_neighbor_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_vassals_lieges_modifier = { # Political situation - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:actor - RECEIVER = scope:recipient - } - - ######### CULTURAL DIFFERENCES - - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - - ######### CULTURAL TRADITIONS - - modifier = { - scope:recipient.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - desc = HOSTAGE_EQUITABLE_TRADITION_REASON - } - modifier = { - scope:recipient.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - desc = HOSTAGE_ESTEEMED_HOSPITALITY_TRADITION_REASON - } - modifier = { - scope:recipient = { - is_vassal_of = scope:actor - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_LOYAL_SUBJECTS_TRADITION_REASON - } - - ######### OTHER - - modifier = { # Already have a truce - scope:recipient ?= { has_truce = scope:actor } - desc = HOSTAGE_RECIPIENT_EXISTING_TRUCE_REASON - add = -20 - } - modifier = { # Already fighting a war - scope:recipient ?= { is_at_war = yes } - desc = HOSTAGE_AT_WAR_REASON - add = 15 - } - modifier = { # Already have their hostage - scope:actor = { - any_warden_hostage = { home_court ?= scope:recipient } - } - desc = HOSTAGE_ALREADY_DEMANDED_REASON - add = 50 - } - modifier = { - add = -50 - scope:actor = { has_character_modifier = attacked_warden } - desc = attacked_warden - } - modifier = { # Conqueror - scope:recipient ?= { - has_variable = conqueror - } - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - add = -1000 - } - } - - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = peer_vassals - ai_recipients = vassals - max = 10 - } - - ai_targets = { - ai_recipients = liege - } - - ai_frequency_by_tier = { - barony = 0 - county = 120 - duchy = 120 - kingdom = 360 - empire = 0 - hegemony = 0 - } - - is_available = { - trigger_if = { - limit = { - is_ai = yes - } - NOT = { has_variable = conqueror } - } - NOT = { - government_has_flag = government_is_landless_adventurer - } - } - - ai_will_do = { - base = 0 - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Opinion Factor - who = scope:actor - opinion_target = scope:secondary_actor - multiplier = -0.1 - desc = AI_OPINION_REASON - } - bp2_hostage_tier_neighbor_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_vassals_lieges_modifier = { # Political situation - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:hook = yes - add = -1 - } - modifier = { # Attacked a hostage's home court - add = -50 - scope:recipient = { has_character_modifier = attacked_home_court } - desc = attacked_home_court - } - modifier = { # Hostage died on their watch - exists = scope:actor.var:hostage_died - scope:recipient = { - NOR = { - var:let_my_hostage_die ?= scope:actor - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_REASON - add = -25 - } - modifier = { # MY Hostage died on their watch - scope:recipient = { - var:let_my_hostage_die ?= scope:actor - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_HOME_COURT_REASON - add = -100 - } - modifier = { # Killed my hostage!!! - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - desc = HOSTAGE_KILLED_REASON - add = -200 - } - modifier = { # Not neighboring - NOR = { - scope:recipient = { - character_is_land_realm_neighbor = scope:actor - top_liege = scope:actor.top_liege - } - } - add = -50 - } - modifier = { - scope:recipient = { has_character_flag = halved_hostage_prestige_income } - desc = HOSTAGE_RETAINED_ADULTHOOD_REASON - add = -25 - } - # Cultural traditions - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - } - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - } - modifier = { - scope:actor = { - is_vassal_of = scope:recipient - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_CULTURAL_TRADITION_REASON - } - } -} - -### Demand hostage - unilateral -# actor = receiver -# recipient = offerer -# secondary_recipient = hostage -demand_hostage_interaction = { - category = interaction_category_diplomacy - common_interaction = no - ai_min_reply_days = 4 - ai_max_reply_days = 9 - popup_on_receive = yes - pause_on_receive = yes - icon = icon_hostage - interface_priority = 13 - - desc = demand_hostage_interaction_desc - - prompt = DEMAND_HOSTAGE_SELECT_HOSTAGE_TO_OFFER - - notification_text = DEMAND_HOSTAGE_PROPOSAL - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - cooldown_against_recipient = { years = 3 } - - is_shown = { - # Cannot exchange hostages with self - scope:recipient != scope:actor - # Cannot exchange hostages with a herder - NOT = { scope:recipient = { government_has_flag = government_is_true_herder } } - # Only significant rulers use hostages - scope:actor.highest_held_title_tier > tier_barony - OR = { - scope:recipient.highest_held_title_tier > tier_barony - scope:recipient.liege ?= { - highest_held_title_tier > tier_barony - any_close_family_member = { - this = scope:recipient - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient.liege } - } - } - } - # Laamps can't do anything with hostages but return/recall them. - NOR = { - scope:actor = { government_has_flag = government_is_landless_adventurer } - scope:recipient = { government_has_flag = government_is_landless_adventurer } - } - #Inside a merit realm vassals won't demand hostages. - trigger_if = { - limit = { - scope:actor.top_liege = { government_has_flag = government_has_merit } - scope:actor.top_liege != scope:actor - } - NAND = { - scope:actor = { government_has_flag = government_has_merit } - scope:recipient = { government_has_flag = government_has_merit } - } - NOT = { scope:recipient = scope:actor.top_liege } - } - } - - redirect = { - if = { - limit = { - scope:recipient ?= { - is_playable_character = no - is_landless_ruler = no - } - } - scope:recipient ?= { save_scope_as = secondary_recipient } - scope:secondary_recipient.liege ?= { save_scope_as = recipient } - } - } - - is_valid_showing_failures_only = { - # Must be approachable - scope:recipient = { - NOT = { has_strong_hook = scope:actor } - } - scope:actor = { - OR = { - is_landless_ruler = no - is_landless_administrative = yes - } - } - scope:recipient = { - OR = { - is_landless_ruler = no - is_landless_administrative = yes - } - } - NOR = { - # Must be at peace - scope:recipient = { is_at_war_with = scope:actor } - # Allies don't need hostages - scope:recipient = { is_allied_to = scope:actor } - # Only family oriented governments use hostages - scope:actor = { - government_has_flag = government_is_theocracy - } - scope:recipient = { - government_has_flag = government_is_theocracy - } - # 1 hostage per court - custom_tooltip = { - text = "already_have_their_hostage_tt" - scope:actor = { - any_warden_hostage = { home_court ?= scope:recipient } - } - } - custom_description = { - text = "hostage_already_travelling_tt" - subject = scope:actor - object = scope:recipient - scope:actor = { - any_close_family_member = { - exists = var:hostage_travelling_to_warden - var:hostage_travelling_to_warden = scope:recipient - } - } - } - } - # Stop AI spamming hostage offers - trigger_if = { - limit = { - scope:recipient = { is_ai = yes } - exists = scope:secondary_recipient - } - NOT = { - scope:secondary_recipient = { has_character_flag = ai_should_not_demand_hostage } - } - } - # Tooltip for players in case of no valid hostages to demand - # Make sure this exactly matches "can_be_picked" section below - trigger_else = { - scope:recipient = { - custom_description = { - text = "basic_valid_hostage_to_demand" - subject = scope:actor - object = scope:recipient - any_close_family_member = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - } - } - } - # Hostages still valid - trigger_if = { - limit = { - exists = scope:secondary_recipient - exists = scope:recipient - } - scope:secondary_recipient = { - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - } - tgp_blocked_action_against_tenno_trigger = { - ACTOR = scope:actor - TARGET = scope:recipient - } - } - - can_send = { - scope:actor = { - custom_description = { - text = "character_interactions_hostile_actions_disabled_delay" - NOT = { has_character_flag = flag_hostile_actions_disabled_delay } - } - trigger_if = { # AI only demand from less powerful neighbors - limit = { is_ai = yes } - bp2_valid_to_demand_hostage_ai_trigger = yes - NOR = { - scope:secondary_recipient ?= { has_character_flag = ai_should_not_demand_hostage } - # AI should not demand close family of players without their consent - scope:secondary_recipient = { - any_close_family_member = { - is_ai = no - OR = { - is_parent_of = scope:secondary_recipient - is_grandparent_of = scope:secondary_recipient - } - this != scope:recipient - } - } - # A hostage died on their watch - var:hostage_died ?= scope:recipient - } - } - } - # Adult hostages must be loyal enough to go along with it - scope:secondary_recipient = { - trigger_if = { - limit = { is_adult = yes } - OR = { - AND = { - custom_tooltip = { - text = hostage_opinion_too_low_tt - opinion = { - target = scope:recipient - value >= -25 - } - NOT = { has_trait = disloyal } - } - } - has_trait = loyal - } - } - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - } - } - - can_be_picked = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { exists = var:hostage_travelling_to_warden } - } - } - - cost = {} - - on_send = { - scope:secondary_recipient = { - add_character_flag = { - flag = under_offer_as_hostage_flag - months = 1 - } - } - scope:actor = { - add_character_flag = { - flag = flag_hostile_actions_disabled_delay - days = 10 - } - } - if = { - limit = { - scope:recipient = { is_ai = no } - } - scope:secondary_recipient = { - add_character_flag = { - flag = ai_should_not_demand_hostage - years = 3 - } - } - } - } - - on_accept = { - # Save scopes for clarity - scope:actor = { save_scope_as = hostage_taker } - scope:recipient = { save_scope_as = hostage_sender } - scope:secondary_recipient = { save_scope_as = hostage } - custom_description_no_bullet = { text = hostage_pacts_on_arrival_tt } - custom_description_no_bullet = { text = hostage_execution_warning_tt } - custom_description_no_bullet = { text = hostage_attack_warning_tt } - hostage_depart_effect = { - HOSTAGE = scope:hostage - WARDEN = scope:hostage_taker - HOME_COURT = scope:hostage_sender - } - show_as_tooltip = { - if = { - limit = { - scope:recipient = { is_vassal_of = scope:actor } - } - scope:recipient = { - if = { - limit = { is_ai = yes } - add_opinion = { - modifier = liege_demanded_hostage_opinion - target = scope:actor - } - } - } - scope:actor = { - # Tyranny for demanding from vassals - add_tyranny = minor_tyranny_gain - } - } - } - scope:actor = { trigger_event = char_interaction.0331 } - # If we're of the same clan this interaction affects unity - if = { - limit = { - scope:actor = { government_has_flag = government_is_clan } - scope:actor.house = scope:recipient.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = minor_unity_loss - DESC = clan_unity_hostage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - } - - on_decline = { - show_as_tooltip = { - if = { # Effects for refusing demand from liege - limit = { - scope:recipient = { is_vassal_of = scope:actor } - } - scope:recipient = { - if = { - limit = { is_ai = yes } - add_opinion = { - modifier = liege_demanded_hostage_opinion - target = scope:actor - } - } - } - scope:actor = { - # Tyranny for demanding from vassals - add_tyranny = minor_tyranny_gain - if = { - limit = { is_ai = yes } - add_opinion = { - modifier = vassal_refused_hostage_demand_opinion - target = scope:recipient - } - } - } - } - } - scope:actor = { - trigger_event = char_interaction.0301 - } - scope:secondary_recipient = { remove_character_flag = under_offer_as_hostage_flag } - } - - auto_accept = { - trigger_if = { - limit = { - scope:hook ?= yes - scope:actor = { has_strong_hook = scope:recipient } - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook ?= yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - trigger_else = { always = no } - } - - can_be_blocked = { - custom_description = { #Hook from Recipient can counteract, but only if Actor is not forcing the action via Strong Hook. - text = "spending_hook" - subject = scope:recipient - object = scope:actor - scope:recipient = { has_hook = scope:actor } - NAND = { - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - on_blocked_effect = { - scope:recipient = { - remove_hook = { target = scope:actor } - } - } - - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - # AI - ai_accept = { - base = 0 - - ######### PERSONALITY - - bp2_hostage_demand_personality_modifier = yes - - ######### OPINION - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = -0.1 - desc = AI_OPINION_REASON - } - - ######### RELATIONS - - bp2_hostage_relation_modifier = yes - - ######### DREAD - - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - ######### HOSTAGE IMPORTANCE - - modifier = { - exists = scope:secondary_recipient - add = interaction_recipient_hostage_value - desc = HOSTAGE_VALUE_RECIPIENT_REASON - } - - ######### RELATIVE POWER - - bp2_hostage_tier_neighbor_modifier = { # Realm relative position - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { # Desire for land/war - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_vassals_lieges_modifier = { # Political situation - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:actor - RECEIVER = scope:recipient - } - modifier = { - desc = HOSTAGE_IMMINENT_THREAT_REASON - scope:actor = { has_any_cb_on = scope:recipient } - scope:actor.current_strength_with_allies_fifty_percent_value > scope:recipient.current_strength_with_allies_value - add = 25 - } - - ######### CULTURAL DIFFERENCES - - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - - ######### CULTURAL TRADITIONS - - modifier = { - scope:recipient.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - desc = HOSTAGE_EQUITABLE_TRADITION_REASON - } - modifier = { - scope:recipient.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - desc = HOSTAGE_ESTEEMED_HOSPITALITY_TRADITION_REASON - } - modifier = { - scope:recipient = { - is_vassal_of = scope:actor - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_LOYAL_SUBJECTS_TRADITION_REASON - } - - ######### OTHER - - modifier = { # Hostage died on their watch - exists = scope:actor.var:hostage_died - scope:recipient = { - NOR = { - var:let_my_hostage_die ?= scope:actor - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_REASON - add = -25 - } - modifier = { # MY Hostage died on their watch - scope:recipient = { - var:let_my_hostage_die ?= scope:actor - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_HOME_COURT_REASON - add = -100 - } - modifier = { # Killed my hostage!!! - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - desc = HOSTAGE_KILLED_REASON - add = -200 - } - modifier = { # Already have a truce - scope:actor ?= { has_truce = scope:recipient } - desc = HOSTAGE_ACTOR_EXISTING_TRUCE_REASON - add = -20 - } - modifier = { # Already fighting a war - scope:recipient ?= { is_at_war = yes } - desc = HOSTAGE_AT_WAR_REASON - add = 15 - } - modifier = { # Already have your hostage - scope:recipient = { - any_warden_hostage = { home_court ?= scope:actor } - } - desc = HOSTAGE_ALREADY_OFFERED_REASON - add = 50 - } - modifier = { # Attacked a hostage's home court - add = -50 - scope:actor = { has_character_modifier = attacked_home_court } - desc = attacked_home_court - } - modifier = { - scope:hook = yes - add = 40 - desc = SCHEME_WEAK_HOOK_USED - } - modifier = { - scope:secondary_recipient ?= { is_adult = no } - scope:actor = { has_character_flag = halved_hostage_prestige_income } - desc = HOSTAGE_RETAINED_ADULTHOOD_REASON - add = -25 - } - modifier = { # Conqueror - scope:recipient ?= { - has_variable = conqueror - } - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - add = -1000 - } - } - - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = peer_vassals - ai_recipients = vassals - max = 10 - } - - ai_targets = { - ai_recipients = liege - } - - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_potential = { - highest_held_title_tier >= tier_county - NOT = { has_variable = conqueror } - } - - ai_will_do = { - base = 0 - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - bp2_hostage_tier_neighbor_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_vassals_lieges_modifier = { # Political situation - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - modifier = { - add = -50 - scope:recipient = { has_character_modifier = attacked_warden } - desc = attacked_warden - } - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:hook = yes - add = -1 - } - modifier = { # Not neighboring - NOR = { - scope:recipient = { - character_is_land_realm_neighbor = scope:actor - top_liege = scope:actor.top_liege - } - } - add = -50 - } - # Cultural traditions - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - } - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - } - modifier = { - scope:actor = { - is_vassal_of = scope:recipient - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_CULTURAL_TRADITION_REASON - } - } -} - -### Exchange hostages - bilateral -# actor = receiver -# recipient = offerer -# secondary_actor = hostage -# secondary_recipient = hostage -exchange_hostage_interaction = { - category = interaction_category_diplomacy - common_interaction = no - ai_min_reply_days = 4 - ai_max_reply_days = 9 - popup_on_receive = yes - pause_on_receive = yes - icon = icon_hostage - interface_priority = 12 - - desc = exchange_hostage_interaction_desc - - prompt = EXCHANGE_HOSTAGE_SELECT_HOSTAGE_TO_OFFER - - notification_text = EXCHANGE_HOSTAGE_PROPOSAL - - populate_actor_list = { - scope:actor = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - add_to_list = characters - } - } - } - - populate_recipient_list = { - scope:recipient = { - every_close_family_member = { - limit = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - add_to_list = characters - } - } - } - - cost = {} - - cooldown_against_recipient = { years = 3 } - - is_shown = { - # Cannot exchange hostages with self - scope:recipient != scope:actor - # Cannot exchange hostages with a herder - NOT = { scope:recipient = { government_has_flag = government_is_true_herder } } - # Only significant rulers use hostages - scope:actor.highest_held_title_tier > tier_barony - OR = { - scope:recipient.highest_held_title_tier > tier_barony - scope:recipient.liege ?= { - highest_held_title_tier > tier_barony - any_close_family_member = { - this = scope:recipient - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient.liege } - } - } - } - # Laamps can't do anything with hostages but return/recall them. - NOR = { - scope:actor = { government_has_flag = government_is_landless_adventurer } - scope:recipient = { government_has_flag = government_is_landless_adventurer } - } - #Inside a merit realm vassals won't exchange hostages. - trigger_if = { - limit = { - scope:actor.top_liege = { government_has_flag = government_has_merit } - scope:actor.top_liege != scope:actor - } - NAND = { - scope:actor = { government_has_flag = government_has_merit } - scope:recipient = { government_has_flag = government_has_merit } - } - NOT = { scope:recipient = scope:actor.top_liege } - } - } - - redirect = { - if = { - limit = { - scope:recipient ?= { - is_playable_character = no - is_landless_ruler = no - } - } - scope:recipient ?= { save_scope_as = secondary_recipient } - scope:secondary_recipient.liege ?= { save_scope_as = recipient } - } - } - - is_valid_showing_failures_only = { - scope:actor = { - NOR = { - # Must be at peace - is_at_war_with = scope:recipient - # Allies don't need hostages - is_allied_to = scope:recipient - # Only family oriented governments use hostages - government_has_flag = government_is_theocracy - scope:recipient = { - government_has_flag = government_is_theocracy - } - # 1 hostage per court - custom_tooltip = { - text = "already_has_your_hostage_tt" - scope:recipient = { - any_warden_hostage = { home_court ?= scope:actor } - } - } - custom_tooltip = { - text = "already_have_their_hostage_tt" - any_warden_hostage = { home_court ?= scope:recipient } - } - custom_description = { - text = "hostage_already_travelling_tt" - subject = scope:recipient - object = scope:actor - any_close_family_member = { - exists = var:hostage_travelling_to_warden - var:hostage_travelling_to_warden = scope:recipient - } - } - custom_description = { - text = "hostage_already_travelling_tt" - subject = scope:actor - object = scope:recipient - scope:recipient = { - any_close_family_member = { - exists = var:hostage_travelling_to_warden - var:hostage_travelling_to_warden = scope:actor - } - } - } - } - OR = { - is_landless_ruler = no - is_landless_administrative = yes - } - # Stop AI spamming hostage offers - trigger_if = { - limit = { - is_ai = yes - exists = scope:secondary_actor - } - NOT = { - scope:secondary_actor = { has_character_flag = ai_should_not_demand_hostage } - } - } - # Tooltip for players in case of no valid hostages to demand - # Make sure this exactly matches "can_be_picked" section below - trigger_else = { - scope:recipient = { - custom_description = { - text = "basic_valid_hostage_to_demand" - subject = scope:actor - object = scope:recipient - any_close_family_member = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - } - } - } - # Stop AI spamming hostage offers - trigger_if = { - limit = { - is_ai = yes - exists = scope:secondary_actor - } - NOT = { - scope:secondary_actor = { has_character_flag = ai_should_not_offer_hostage } - } - } - # Tooltip for players in case of no valid hostages to offer - trigger_else = { - custom_description = { - text = "basic_valid_hostage_to_offer" - object = scope:recipient - subject = scope:actor - any_close_family_member = { - # Unlanded, at sender's court, child/sibling/nibling/grandchild - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - } - } - } - scope:recipient = { - OR = { - is_landless_ruler = no - is_landless_administrative = yes - } - } - # Hostages still valid - trigger_if = { - limit = { - exists = scope:secondary_recipient - exists = scope:recipient - } - scope:secondary_recipient = { - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:recipient } - } - } - trigger_if = { - limit = { - exists = scope:secondary_actor - exists = scope:actor - } - scope:secondary_actor = { - bp2_valid_to_offer_as_hostage_trigger = { SENDER = scope:actor } - } - } - tgp_blocked_action_against_tenno_trigger = { - ACTOR = scope:actor - TARGET = scope:recipient - } - } - - on_send = { - scope:secondary_actor = { - add_character_flag = { - flag = under_offer_as_hostage_flag - months = 1 - } - } - scope:secondary_recipient = { - add_character_flag = { - flag = under_offer_as_hostage_flag - months = 1 - } - } - } - - can_send = { - scope:actor = { - trigger_if = { - limit = { is_ai = yes } - bp2_valid_to_exchange_hostage_ai_trigger = yes - # AI should not demand close family of players without their consent - NOR = { - scope:secondary_actor = { - any_close_family_member = { - is_ai = no - OR = { - is_parent_of = scope:secondary_actor - is_grandparent_of = scope:secondary_actor - } - this != scope:actor - } - } - scope:secondary_recipient = { - any_close_family_member = { - is_ai = no - OR = { - is_parent_of = scope:secondary_recipient - is_grandparent_of = scope:secondary_recipient - } - this != scope:recipient - } - } - # A hostage died on their watch - var:hostage_died ?= scope:recipient - } - } - } - scope:secondary_actor = { - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - # Adult hostages must be loyal enough to go along with it - trigger_if = { - limit = { is_adult = yes } - OR = { - AND = { - custom_tooltip = { - text = hostage_opinion_too_low_tt - opinion = { - target = scope:actor - value >= -25 - } - NOT = { has_trait = disloyal } - } - } - has_trait = loyal - } - } - } - scope:secondary_recipient = { - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - # Adult hostages must be loyal enough to go along with it - trigger_if = { - limit = { is_adult = yes } - OR = { - AND = { - custom_tooltip = { - text = hostage_opinion_too_low_tt - opinion = { - target = scope:recipient - value >= -25 - } - NOT = { has_trait = disloyal } - } - } - has_trait = loyal - } - } - } - } - - # whether a character can be picked for the interaction, interface only (e.g. picking the first character in the marriage interaction) - # in character scope, actor and recipient event targets can be used, but not the secondary characters (because none exist yet) - can_be_picked = { - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { has_character_flag = under_offer_as_hostage_flag } - } - # Already offered - custom_tooltip = { - text = hostage_already_offered_awaiting_response_tt - NOT = { exists = var:hostage_travelling_to_warden } - } - } - - on_accept = { - # Save scopes for clarity - scope:actor = { save_scope_as = hostage_sender_1 } - scope:secondary_actor = { save_scope_as = hostage_1 } - scope:recipient = { save_scope_as = hostage_sender_2 } - scope:secondary_recipient = { save_scope_as = hostage_2 } - custom_description_no_bullet = { text = hostage_pacts_on_arrival_tt } - custom_description_no_bullet = { text = hostage_execution_warning_tt } - custom_description_no_bullet = { text = hostage_attack_warning_tt } - hostage_depart_effect = { - HOSTAGE = scope:hostage_1 - WARDEN = scope:hostage_sender_2 - HOME_COURT = scope:hostage_sender_1 - } - hostage_depart_effect = { - HOSTAGE = scope:hostage_2 - WARDEN = scope:hostage_sender_1 - HOME_COURT = scope:hostage_sender_2 - } - scope:actor = { trigger_event = char_interaction.0332 } - # If we're of the same clan this interaction affects unity - if = { - limit = { - scope:actor = { government_has_flag = government_is_clan } - scope:actor.house = scope:recipient.house - } - add_clan_unity_interaction_effect = { - CHARACTER = scope:actor - TARGET = scope:recipient - VALUE = medium_unity_loss - DESC = clan_unity_hostage.desc - REVERSE_NON_HOUSE_TARGET = no - } - } - scope:actor.house = { - change_house_relation_effect = { - HOUSE = scope:recipient.house - VALUE = house_relation_improve_medium_value - REASON = hostage_exchange - CHAR = scope:actor - TARGET_CHAR = scope:recipient - TITLE = scope:dummy_gender - } - } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0311 - } - scope:secondary_actor = { remove_character_flag = under_offer_as_hostage_flag } - scope:secondary_recipient = { remove_character_flag = under_offer_as_hostage_flag } - } - - # AI - ai_accept = { - base = -25 - - ######## PERSONALITY - - bp2_hostage_exchange_personality_modifier = yes - - ######### OPINION - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = -0.1 - desc = AI_OPINION_REASON - } - - ######### RELATIONS - - bp2_hostage_relation_modifier = yes - - - ######### DREAD - - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - ######### HOSTAGE IMPORTANCE - - - modifier = { - exists = scope:secondary_actor - NOT = { exists = scope:secondary_recipient } - add = interaction_actor_hostage_value - desc = HOSTAGE_VALUE_ACTOR_REASON - } - modifier = { - NOT = { exists = scope:secondary_actor } - exists = scope:secondary_recipient - add = interaction_recipient_hostage_value # already negative - desc = HOSTAGE_VALUE_RECIPIENT_REASON - } - - ######### RELATIVE POWER - - bp2_hostage_tier_neighbor_modifier = { # Realm relative position - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { # Desire for land/war - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_vassals_lieges_modifier = { # Political situation - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:actor - RECEIVER = scope:recipient - } - modifier = { - desc = HOSTAGE_IMMINENT_THREAT_REASON - scope:actor = { has_any_cb_on = scope:recipient } - scope:actor.current_strength_with_allies_fifty_percent_value > scope:recipient.current_strength_with_allies_value - add = 25 - } - - ######### CULTURAL DIFFERENCES - - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - - ######### CULTURAL TRADITIONS - - modifier = { - scope:recipient.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - desc = HOSTAGE_EQUITABLE_TRADITION_REASON - } - modifier = { - scope:recipient.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - desc = HOSTAGE_ESTEEMED_HOSPITALITY_TRADITION_REASON - } - modifier = { - scope:recipient = { - is_vassal_of = scope:actor - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_LOYAL_SUBJECTS_TRADITION_REASON - } - - ######### OTHER - - modifier = { # Hostage died on their watch - exists = scope:actor.var:hostage_died - scope:recipient = { - NOR = { - var:let_my_hostage_die ?= scope:actor - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_REASON - add = -25 - } - modifier = { # MY Hostage died on their watch - scope:recipient = { - var:let_my_hostage_die ?= scope:actor - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_HOME_COURT_REASON - add = -100 - } - modifier = { # Killed my hostage!!! - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - desc = HOSTAGE_KILLED_REASON - add = -200 - } - modifier = { # Already have a truce - scope:actor ?= { has_truce = scope:recipient } - desc = HOSTAGE_ACTOR_EXISTING_TRUCE_REASON - add = -20 - } - modifier = { # Already fighting a war - scope:recipient ?= { is_at_war = yes } - desc = HOSTAGE_AT_WAR_REASON - add = 15 - } - modifier = { # Already have your hostage - scope:recipient = { - any_warden_hostage = { home_court ?= scope:actor } - } - desc = HOSTAGE_ALREADY_OFFERED_REASON - add = 50 - } - modifier = { - add = -50 - scope:actor = { has_character_modifier = attacked_warden } - desc = attacked_warden - } - modifier = { # Attacked a hostage's home court - add = -50 - scope:actor = { has_character_modifier = attacked_home_court } - desc = attacked_home_court - } - modifier = { - scope:hook = yes - add = 40 - desc = SCHEME_WEAK_HOOK_USED - } - modifier = { - scope:secondary_recipient ?= { is_adult = no } - scope:actor = { has_character_flag = halved_hostage_prestige_income } - desc = HOSTAGE_RETAINED_ADULTHOOD_REASON - add = -25 - } - modifier = { # Conqueror - scope:recipient ?= { - has_variable = conqueror - } - desc = NO_FRIVOLOUS_ACTIVITIES_REASON - add = -1000 - } - } - - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = peer_vassals - ai_recipients = vassals - max = 10 - } - - ai_targets = { - ai_recipients = liege - } - - ai_target_quick_trigger = { - adult = yes - } - - ai_frequency_by_tier = { - barony = 0 - county = 0 - duchy = 360 - kingdom = 120 - empire = 36 - hegemony = 36 - } - - ai_potential = { - is_adult = yes - highest_held_title_tier >= tier_county - NOT = { has_variable = conqueror } - } - - ai_will_do = { - base = 0 - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Opinion Factor - who = scope:actor - opinion_target = scope:secondary_actor - multiplier = -0.1 - desc = AI_OPINION_REASON - } - bp2_hostage_tier_neighbor_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_vassals_lieges_modifier = { # Political situation - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - modifier = { # The AI will only use a Hook if they couldn't otherwise do this - scope:hook = yes - add = -1 - } - modifier = { # Attacked a hostage's warden - add = -50 - scope:recipient = { has_character_modifier = attacked_warden } - desc = attacked_warden - } - modifier = { # Attacked a hostage's home court - add = -50 - scope:recipient = { has_character_modifier = attacked_home_court } - desc = attacked_home_court - } - modifier = { # Hostage died on their watch - exists = scope:actor.var:hostage_died - scope:recipient = { - NOR = { - var:let_my_hostage_die ?= scope:actor - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_REASON - add = -25 - } - modifier = { # MY Hostage died on their watch - scope:recipient = { - var:let_my_hostage_die ?= scope:actor - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_HOME_COURT_REASON - add = -100 - } - modifier = { # Killed my hostage!!! - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - desc = HOSTAGE_KILLED_REASON - add = -200 - } - modifier = { # Not neighboring - NOR = { - scope:recipient = { - character_is_land_realm_neighbor = scope:actor - top_liege = scope:actor.top_liege - } - } - add = -50 - } - modifier = { - scope:recipient = { has_character_flag = halved_hostage_prestige_income } - desc = HOSTAGE_RETAINED_ADULTHOOD_REASON - add = -25 - } - # Cultural traditions - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - } - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - } - modifier = { - scope:actor = { - is_vassal_of = scope:recipient - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_CULTURAL_TRADITION_REASON - } - } - - #Use hook - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - send_options_exclusive = no - greeting = positive -} - -### Return hostage - unilateral -# actor = warden -# recipient = home_court -# secondary_actor = hostage -return_hostage_interaction = { - category = interaction_category_diplomacy - common_interaction = no - popup_on_receive = yes - pause_on_receive = yes - icon = icon_hostage - - desc = return_hostage_interaction_desc - - populate_recipient_list = { - scope:actor = { - every_warden_hostage = { - limit = { home_court ?= scope:recipient } - add_to_list = characters - } - } - } - - cost = {} - - is_shown = { - # Cannot return hostages to self - scope:recipient != scope:actor - # Must have a hostage - OR = { - scope:actor = { - any_warden_hostage = { home_court ?= scope:recipient } - } - scope:recipient.warden ?= scope:actor - } - } - - redirect = { - if = { - limit = { - scope:recipient.warden ?= scope:actor - } - scope:recipient = { save_scope_as = secondary_recipient } - scope:recipient.home_court = { save_scope_as = recipient } - } - } - - is_valid_showing_failures_only = { - NOR = { - # Must be at peace - scope:recipient = { is_at_war_with = scope:actor } - # Only family oriented governments use hostages - scope:actor = { - OR = { - government_has_flag = government_is_theocracy - government_has_flag = government_is_landless_adventurer - } - } - scope:recipient = { - OR = { - government_has_flag = government_is_theocracy - government_has_flag = government_is_landless_adventurer - } - } - } - } - - # whether a character can be picked for the interaction, interface only (e.g. picking the first character in the marriage interaction) - # in character scope, actor and recipient event targets can be used, but not the secondary characters (because none exist yet) - can_be_picked = {} - - can_send = { - NOT = { - scope:actor = { is_at_war_with = scope:recipient } - } - } - - on_send = {} - - auto_accept = yes - - on_accept = { - # Save scopes for clarity - scope:actor = { save_scope_as = warden } - scope:recipient = { save_scope_as = home_court } - scope:secondary_recipient = { save_scope_as = hostage } - # Send toast informing sender of acceptance - scope:home_court = { - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_good - title = return_hostage_interaction_notification - left_icon = scope:hostage - right_icon = scope:warden - show_as_tooltip = { - bp2_return_hostage_effect = { HOSTAGE = scope:hostage } - } - } - } - } - scope:warden = { - send_interface_toast = { - type = event_toast_effect_neutral - title = return_hostage_interaction_notification - left_icon = scope:hostage - right_icon = scope:home_court - show_as_tooltip = { - bp2_return_hostage_effect = { HOSTAGE = scope:hostage } - } - } - if = { - limit = { has_character_flag = flag_hostile_actions_disabled_delay } - remove_character_flag = flag_hostile_actions_disabled_delay - } - } - # Notify home court with letter event - scope:home_court = { - trigger_event = { id = char_interaction.0320 } - } - } - - ai_targets = { - ai_recipients = neighboring_rulers - ai_recipients = peer_vassals - ai_recipients = vassals - ai_recipients = liege - ai_recipients = family # Redirects - } - - ai_frequency_by_tier = { - barony = 0 - county = 60 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 - } - - ai_will_do = { - base = 0 - modifier = { - NOR = { - # Alliances - is_allied_to = scope:recipient - is_spouse_of = scope:recipient - # Protected by liege - AND = { - OR = { - top_liege != this - scope:recipient = { top_liege != this } - } - top_liege != scope:recipient.top_liege - } - # Adult hostage been here awhile and we are not in immiment danger - AND = { - any_warden_hostage = { - age >= 20 - hostage_duration = { years >= 5 } - } - NOT = { - scope:recipient = { - has_any_cb_on = scope:actor - scope:recipient.current_strength_with_allies_fifty_percent_value > scope:actor.current_strength_with_allies_value - } - } - } - } - factor = 0 - } - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - modifier = { - add = 25 - scope:actor = { - has_any_cb_on = scope:recipient - scope:actor.current_strength_with_allies_fifty_percent_value > scope:recipient.current_strength_with_allies_value - } - } - modifier = { - scope:recipient = { - OR = { - is_allied_to = scope:actor - is_spouse_of = scope:recipient - } - } - add = 50 - } - modifier = { - scope:recipient = { - has_any_cb_on = scope:actor - scope:recipient.current_strength_with_allies_fifty_percent_value > scope:actor.current_strength_with_allies_value - } - add = -50 - } - bp2_hostage_return_personality_modifier = { - WARDEN = scope:actor - HOME_COURT = scope:recipient - } - # Cultural traditions - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_equitable } - add = 25 - } - modifier = { - scope:actor.culture = { has_cultural_tradition = tradition_esteemed_hospitality } - add = 25 - } - modifier = { - scope:actor = { - is_vassal_of = scope:recipient - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - add = 25 - desc = HOSTAGE_CULTURAL_TRADITION_REASON - } - #DO NOT SEND BACK FRANKOKRATIA CLAIMANT - modifier = { - scope:hostage ?= { - has_character_flag = byz_claimant_flag - } - exists = global_var:byz_claimant_champion - factor = 0 - } - } - - send_options_exclusive = no - - show_effects_in_notification = no - greeting = positive - - notification_text = { - } -} - -### Recall hostage - bilateral -# actor = home_court -# recipient = warden -# secondary_recipient = hostage -recall_hostage_interaction = { - category = interaction_category_diplomacy - common_interaction = no - popup_on_receive = yes - pause_on_receive = yes - icon = icon_hostage - - desc = recall_hostage_interaction_desc - - populate_recipient_list = { - scope:actor = { - every_home_court_hostage = { - limit = { warden ?= scope:recipient } - add_to_list = characters - } - } - } - - cost = {} - - is_shown = { - # AI don't use this interaction at all - scope:actor = { is_ai = no } - # Cannot recall hostages from self - scope:recipient != scope:actor - # Must have a hostage - OR = { - scope:actor = { - any_home_court_hostage = { warden ?= scope:recipient } - } - scope:recipient.home_court ?= scope:actor - } - } - - redirect = { - if = { - limit = { - scope:recipient.home_court ?= scope:actor - } - scope:recipient = { save_scope_as = secondary_recipient } - scope:recipient.warden = { save_scope_as = recipient } - } - } - - is_valid_showing_failures_only = { - NOR = { - # Must be at peace - scope:recipient = { is_at_war_with = scope:actor } - # Only family oriented governments use hostages - scope:actor = { government_has_flag = government_is_theocracy } - scope:recipient = { government_has_flag = government_is_theocracy } - } - } - - # whether a character can be picked for the interaction, interface only (e.g. picking the first character in the marriage interaction) - # in character scope, actor and recipient event targets can be used, but not the secondary characters (because none exist yet) - can_be_picked = {} - - can_send = { - NOT = { - scope:actor = { is_at_war_with = scope:recipient } - } - } - - on_send = {} - - on_accept = { - # Save scopes for clarity - scope:actor = { save_scope_as = home_court } - scope:recipient = { save_scope_as = warden } - scope:secondary_recipient = { save_scope_as = hostage } - # Send toast informing sender of acceptance - scope:warden = { - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = recall_hostage_interaction_notification - left_icon = scope:hostage - right_icon = scope:home_court - show_as_tooltip = { - bp2_return_hostage_effect = { HOSTAGE = scope:hostage } - } - } - } - } - scope:home_court = { - send_interface_toast = { - type = event_toast_effect_good - title = recall_hostage_interaction_notification - left_icon = scope:hostage - right_icon = scope:warden - show_as_tooltip = { - bp2_return_hostage_effect = { HOSTAGE = scope:hostage } - } - } - if = { - limit = { has_character_flag = flag_hostile_actions_disabled_delay } - remove_character_flag = flag_hostile_actions_disabled_delay - } - } - # Notify home court with letter event - scope:home_court = { trigger_event = char_interaction.0340 } - } - - on_decline = { - scope:actor = { - trigger_event = char_interaction.0341 - } - } - - ai_accept = { - base = 0 - - ######### PERSONALITY - - bp2_hostage_return_personality_modifier = { - HOME_COURT = scope:actor - WARDEN = scope:recipient - } - - ######### OPINION - - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = -0.1 - desc = AI_OPINION_REASON - } - - ######### RELATIONS - - bp2_hostage_relation_modifier = yes - - ######### DREAD - - modifier = { - add = intimidated_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { - add = cowed_halved_reason_value - scope:recipient = { - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - - ######### HOSTAGE IMPORTANCE - - modifier = { - exists = scope:secondary_recipient - add = interaction_recipient_hostage_value - desc = HOSTAGE_VALUE_RECIPIENT_REASON - } - - ######### HOSTAGE TIME - - modifier = { # Hostage is grown up - add = 25 - scope:secondary_recipient = { is_adult = yes } - desc = HOSTAGE_ADULT_REASON - } - modifier = { # Time as a hostage - add = -25 - scope:secondary_recipient = { - hostage_duration = { years < 1 } - } - desc = HOSTAGE_MINIMUM_STAY_REASON - } - modifier = { # Time as a hostage - add = { - value = 10 - scope:secondary_recipient = { - if = { - limit = { - hostage_duration = { years >= 3 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 4 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 5 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 6 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 7 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 8 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 9 } - } - add = 10 - } - if = { - limit = { - hostage_duration = { years >= 10 } - } - add = 10 - } - } - } - scope:secondary_recipient = { - hostage_duration = { years >= 2 } - } - desc = HOSTAGE_DURATION_REASON - } - - ######### RELATIVE POWER - - bp2_hostage_recall_tier_neighbor_modifier = { # Realm relative position - RECALLER = scope:actor - WARDEN = scope:recipient - } - bp2_hostage_claims_casus_bellis_modifier = { # Desire for land/war - SENDER = scope:actor - RECEIVER = scope:recipient - } - bp2_hostage_recall_vassals_lieges_modifier = { # Political situation - RECALLER = scope:actor - WARDEN = scope:recipient - } - bp2_hostage_relative_strength_modifier = { # Relative military strength - SENDER = scope:recipient - RECEIVER = scope:actor - } - modifier = { - desc = HOSTAGE_IMMINENT_THREAT_REASON - scope:actor = { has_any_cb_on = scope:recipient } - scope:actor.current_strength_with_allies_fifty_percent_value > scope:recipient.current_strength_with_allies_value - add = -25 - } - - ######### CULTURAL DIFFERENCES - - bp2_hostage_culture_faith_modifier = { - SENDER = scope:actor - RECEIVER = scope:recipient - } - - ######### CULTURAL TRADITIONS - - modifier = { - scope:recipient = { - culture = { has_cultural_tradition = tradition_equitable } - NOT = { - any_home_court_hostage = { warden = scope:actor } - } - } - scope:secondary_recipient = { - hostage_duration = { years >= 2 } - } - add = 25 - desc = HOSTAGE_EQUITABLE_TRADITION_REASON - } - modifier = { - scope:recipient = { - culture = { has_cultural_tradition = tradition_esteemed_hospitality } - NOT = { - any_home_court_hostage = { warden = scope:actor } - } - } - scope:secondary_recipient = { - hostage_duration = { years >= 2 } - } - add = 25 - desc = HOSTAGE_ESTEEMED_HOSPITALITY_TRADITION_REASON - } - modifier = { - scope:recipient = { - is_vassal_of = scope:actor - culture = { has_cultural_tradition = tradition_loyal_soldiers } - } - scope:secondary_recipient = { - hostage_duration = { years >= 2 } - } - add = 25 - desc = HOSTAGE_LOYAL_SUBJECTS_TRADITION_REASON - } - - ######### OTHER - - modifier = { # Hostage died on their watch - exists = scope:actor.var:hostage_died - scope:recipient = { - NOR = { - var:let_my_hostage_die ?= scope:actor - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_REASON - add = -25 - } - modifier = { # MY Hostage died on their watch - scope:recipient = { - var:let_my_hostage_die ?= scope:actor - NOT = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - } - desc = HOSTAGE_PREVIOUSLY_DIED_HOME_COURT_REASON - add = -100 - } - modifier = { # Killed my hostage!!! - scope:recipient = { - has_opinion_modifier = { - target = scope:actor - modifier = killed_hostage_opinion - } - } - desc = HOSTAGE_KILLED_REASON - add = -200 - } - modifier = { # Already have a truce - scope:actor ?= { has_truce = scope:recipient } - desc = HOSTAGE_ACTOR_EXISTING_TRUCE_REASON - add = 20 - } - modifier = { # Already fighting a war - scope:recipient ?= { is_at_war = yes } - desc = HOSTAGE_AT_WAR_REASON - add = -25 - } - modifier = { # Attacked a hostage's home court - add = -50 - scope:actor = { has_character_modifier = attacked_home_court } - desc = attacked_home_court - } - modifier = { - scope:hook = yes - add = 40 - desc = SCHEME_WEAK_HOOK_USED - } - modifier = { # Has my hostage - add = -50 - scope:recipient = { - any_home_court_hostage = { warden = scope:actor } - } - desc = HOSTAGE_HAS_MINE_REASON - } - #DO NOT SEND BACK FRANKOKRATIA CLAIMANT - modifier = { - desc = crusading_claim_cb_reason - scope:hostage = { - has_character_flag = byz_claimant_flag - } - exists = global_var:byz_claimant_champion - add = -5000 - } - } - - auto_accept = { - trigger_if = { - limit = { - scope:hook ?= yes - scope:actor = { has_strong_hook = scope:recipient } - } - custom_description = { - text = "spending_hook" - subject = scope:actor - object = scope:recipient - scope:hook ?= yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - trigger_else = { always = no } - } - - can_be_blocked = { - custom_description = { #Hook from Recipient can counteract, but only if Actor is not forcing the action via Strong Hook. - text = "spending_hook" - subject = scope:recipient - object = scope:actor - scope:recipient = { has_hook = scope:actor } - NAND = { - scope:hook = yes - scope:actor = { has_strong_hook = scope:recipient } - } - } - } - - on_blocked_effect = { - scope:recipient = { - remove_hook = { target = scope:actor } - } - } - - send_option = { - is_valid = { - scope:actor = { has_usable_hook = scope:recipient } - } - flag = hook - localization = SCHEME_HOOK - } - should_use_extra_icon = { - scope:actor = { has_usable_hook = scope:recipient } - } - extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" - - send_options_exclusive = no - - show_effects_in_notification = yes - greeting = positive - - notification_text = RECALL_HOSTAGE_PROPOSAL -} - -### Trait interaction for guardians -# actor = guardian -# recipient = ward/hostage -# This has to be update every time a new trait is added to the game, otherwise you won't be able to pass it down -influence_child_personality_interaction = { - category = interaction_category_friendly - common_interaction = yes - interface_priority = 60 - icon = child - ai_maybe = yes - ai_min_reply_days = 4 - ai_max_reply_days = 9 - can_send_despite_rejection = yes - popup_on_receive = yes - pause_on_receive = yes - - pre_answer_maybe_key = ANSWER_MIGHT_SUCCEED - pre_answer_no_key = ANSWER_CANT_SUCCEED - pre_answer_yes_key = ANSWER_WILL_SUCCEED - pre_answer_maybe_breakdown_key = ANSWER_SUM_CHANCE - - desc = influence_child_personality_interaction_desc - - is_shown = { #any ai ward/hostage - has_bp2_dlc_trigger = yes - scope:recipient = { - is_ai = yes - is_adult = no - OR = { - scope:actor = { has_relation_ward = scope:recipient } - is_hostage_of = scope:actor - } - } - } - - is_valid_showing_failures_only = { - scope:recipient = { #be old enough to talk and have some room for new personlaity traits - age >= 4 - custom_description = { - text = influence_child_personality_interaction_trait_limit - number_of_personality_traits < 4 - } - #checking all trait individually through the set scope in order to catch if all of your traits are either the same or opposite - custom_description = { - text = influence_child_personality_interaction_all_same_traits - switch = { - trigger = yes - scope:lustful = { - scope:recipient = { NOT = { has_trait = lustful } } - } - scope:chaste = { - scope:recipient = { NOT = { has_trait = chaste } } - } - scope:gluttonous = { - scope:recipient = { NOT = { has_trait = gluttonous } } - } - scope:temperate = { - scope:recipient = { NOT = { has_trait = temperate } } - } - scope:greedy = { - scope:recipient = { NOT = { has_trait = greedy } } - } - scope:generous = { - scope:recipient = { NOT = { has_trait = generous } } - } - scope:lazy = { - scope:recipient = { NOT = { has_trait = lazy } } - } - scope:diligent = { - scope:recipient = { NOT = { has_trait = diligent } } - } - scope:wrathful = { - scope:recipient = { NOT = { has_trait = wrathful } } - } - scope:calm = { - scope:recipient = { NOT = { has_trait = calm } } - } - scope:patient = { - scope:recipient = { NOT = { has_trait = patient } } - } - scope:impatient = { - scope:recipient = { NOT = { has_trait = impatient } } - } - scope:arrogant = { - scope:recipient = { NOT = { has_trait = arrogant } } - } - scope:humble = { - scope:recipient = { NOT = { has_trait = humble } } - } - scope:deceitful = { - scope:recipient = { NOT = { has_trait = deceitful } } - } - scope:honest = { - scope:recipient = { NOT = { has_trait = honest } } - } - scope:craven = { - scope:recipient = { NOT = { has_trait = craven } } - } - scope:brave = { - scope:recipient = { NOT = { has_trait = brave } } - } - scope:shy = { - scope:recipient = { NOT = { has_trait = shy } } - } - scope:gregarious = { - scope:recipient = { NOT = { has_trait = gregarious } } - } - scope:ambitious = { - scope:recipient = { NOT = { has_trait = ambitious } } - } - scope:content = { - scope:recipient = { NOT = { has_trait = content } } - } - scope:arbitrary = { - scope:recipient = { NOT = { has_trait = arbitrary } } - } - scope:just = { - scope:recipient = { NOT = { has_trait = just } } - } - scope:cynical = { - scope:recipient = { NOT = { has_trait = cynical } } - } - scope:zealous = { - scope:recipient = { NOT = { has_trait = zealous } } - } - scope:paranoid = { - scope:recipient = { NOT = { has_trait = paranoid } } - } - scope:trusting = { - scope:recipient = { NOT = { has_trait = trusting } } - } - scope:compassionate = { - scope:recipient = { NOT = { has_trait = compassionate } } - } - scope:callous = { - scope:recipient = { NOT = { has_trait = callous } } - } - scope:sadistic = { - scope:recipient = { NOT = { has_trait = sadistic } } - } - scope:stubborn = { - scope:recipient = { NOT = { has_trait = stubborn } } - } - scope:fickle = { - scope:recipient = { NOT = { has_trait = fickle } } - } - scope:eccentric = { - scope:recipient = { NOT = { has_trait = eccentric } } - } - scope:vengeful = { - scope:recipient = { NOT = { has_trait = vengeful } } - } - scope:forgiving = { - scope:recipient = { NOT = { has_trait = forgiving } } - } - } - } - } - scope:actor = { - is_adult = yes - number_of_personality_traits >= 1 #just in case you have to have at least some personality - } - } - - cooldown_against_recipient = { years = 3 } - - can_send = { - } - #each option is shown if the actor has the corresponding trait and valid if recipient don't have it yet or don't have an opposite trait - send_option = { - is_shown = { - scope:actor = { has_trait = lustful } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = lustful - trait:lustful = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - has_sexuality = none - has_sexuality = asexual - } - } - } - flag = lustful - localization = trait_lustful - } - send_option = { - is_shown = { - scope:actor = { has_trait = chaste } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = chaste - trait:chaste = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - has_sexuality = none - has_sexuality = asexual - } - } - } - flag = chaste - localization = trait_chaste - } - send_option = { - is_shown = { - scope:actor = { has_trait = gluttonous } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = gluttonous - trait:gluttonous = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = gluttonous - localization = trait_gluttonous - } - send_option = { - is_shown = { - scope:actor = { has_trait = temperate } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = temperate - trait:temperate = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = temperate - localization = trait_temperate - } - send_option = { - is_shown = { - scope:actor = { has_trait = greedy } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = greedy - trait:greedy = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = greedy - localization = trait_greedy - } - send_option = { - is_shown = { - scope:actor = { has_trait = generous } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = generous - trait:generous = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = generous - localization = trait_generous - } - send_option = { - is_shown = { - scope:actor = { has_trait = lazy } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = lazy - trait:lazy = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = lazy - localization = trait_lazy - } - send_option = { - is_shown = { - scope:actor = { has_trait = diligent } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = diligent - trait:diligent = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = diligent - localization = trait_diligent - } - send_option = { - is_shown = { - scope:actor = { has_trait = wrathful } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = wrathful - trait:wrathful = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = wrathful - localization = trait_wrathful - } - send_option = { - is_shown = { - scope:actor = { has_trait = calm } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = calm - trait:calm = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = calm - localization = trait_calm - } - send_option = { - is_shown = { - scope:actor = { has_trait = patient } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = patient - trait:patient = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = patient - localization = trait_patient - } - send_option = { - is_shown = { - scope:actor = { has_trait = impatient } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = impatient - trait:impatient = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = impatient - localization = trait_impatient - } - send_option = { - is_shown = { - scope:actor = { has_trait = arrogant } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = arrogant - trait:arrogant = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = arrogant - localization = trait_arrogant - } - send_option = { - is_shown = { - scope:actor = { has_trait = humble } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = humble - trait:humble = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = humble - localization = trait_humble - } - send_option = { - is_shown = { - scope:actor = { has_trait = deceitful } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = deceitful - trait:deceitful = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = deceitful - localization = trait_deceitful - } - send_option = { - is_shown = { - scope:actor = { has_trait = honest } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = honest - trait:honest = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = honest - localization = trait_honest - } - send_option = { - is_shown = { - scope:actor = { has_trait = craven } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = craven - trait:craven = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = craven - localization = trait_craven - } - send_option = { - is_shown = { - scope:actor = { has_trait = brave } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = brave - trait:brave = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = brave - localization = trait_brave - } - send_option = { - is_shown = { - scope:actor = { has_trait = shy } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = shy - trait:shy = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = shy - localization = trait_shy - } - send_option = { - is_shown = { - scope:actor = { has_trait = gregarious } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = gregarious - trait:gregarious = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = gregarious - localization = trait_gregarious - } - send_option = { - is_shown = { - scope:actor = { has_trait = ambitious } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = ambitious - trait:ambitious = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = ambitious - localization = trait_ambitious - } - send_option = { - is_shown = { - scope:actor = { has_trait = content } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = content - trait:content = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = content - localization = trait_content - } - send_option = { - is_shown = { - scope:actor = { has_trait = arbitrary } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = arbitrary - trait:arbitrary = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = arbitrary - localization = trait_arbitrary - } - send_option = { - is_shown = { - scope:actor = { has_trait = just } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = just - trait:just = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = just - localization = trait_just - } - send_option = { - is_shown = { - scope:actor = { has_trait = cynical } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = cynical - trait:cynical = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = cynical - localization = trait_cynical - } - send_option = { - is_shown = { - scope:actor = { has_trait = zealous } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = zealous - trait:zealous = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = zealous - localization = trait_zealous - } - send_option = { - is_shown = { - scope:actor = { has_trait = paranoid } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = paranoid - trait:paranoid = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = paranoid - localization = trait_paranoid - } - send_option = { - is_shown = { - scope:actor = { has_trait = trusting } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = trusting - trait:trusting = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = trusting - localization = trait_trusting - } - send_option = { - is_shown = { - scope:actor = { has_trait = compassionate } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = compassionate - trait:compassionate = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = compassionate - localization = trait_compassionate - } - send_option = { - is_shown = { - scope:actor = { has_trait = callous } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = callous - trait:callous = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = callous - localization = trait_callous - } - send_option = { - is_shown = { - scope:actor = { has_trait = sadistic } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = sadistic - trait:sadistic = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = sadistic - localization = trait_sadistic - } - send_option = { - is_shown = { - scope:actor = { has_trait = stubborn } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = stubborn - trait:stubborn = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = stubborn - localization = trait_stubborn - } - send_option = { - is_shown = { - scope:actor = { has_trait = fickle } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = fickle - trait:fickle = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = fickle - localization = trait_fickle - } - send_option = { - is_shown = { - scope:actor = { has_trait = eccentric } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = eccentric - trait:eccentric = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = eccentric - localization = trait_eccentric - } - send_option = { - is_shown = { - scope:actor = { has_trait = vengeful } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = vengeful - trait:vengeful = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = vengeful - localization = trait_vengeful - } - send_option = { - is_shown = { - scope:actor = { has_trait = forgiving } - } - is_valid = { - scope:recipient = { - NOR = { - has_trait = forgiving - trait:forgiving = { - any_opposite_trait = { - scope:recipient = { has_trait = prev } - } - } - } - } - } - flag = forgiving - localization = trait_forgiving - } - - send_options_exclusive = yes - - on_send = { - switch = {#save which trait was chosen as scope:target_trait - trigger = yes - scope:lustful = { - trait:lustful = { save_scope_as = target_trait } - } - scope:chaste = { - trait:chaste = { save_scope_as = target_trait } - } - scope:gluttonous = { - trait:gluttonous = { save_scope_as = target_trait } - } - scope:temperate = { - trait:temperate = { save_scope_as = target_trait } - } - scope:greedy = { - trait:greedy = { save_scope_as = target_trait } - } - scope:generous = { - trait:generous = { save_scope_as = target_trait } - } - scope:lazy = { - trait:lazy = { save_scope_as = target_trait } - } - scope:diligent = { - trait:diligent = { save_scope_as = target_trait } - } - scope:wrathful = { - trait:wrathful = { save_scope_as = target_trait } - } - scope:calm = { - trait:calm = { save_scope_as = target_trait } - } - scope:patient = { - trait:patient = { save_scope_as = target_trait } - } - scope:impatient = { - trait:impatient = { save_scope_as = target_trait } - } - scope:arrogant = { - trait:arrogant = { save_scope_as = target_trait } - } - scope:humble = { - trait:humble = { save_scope_as = target_trait } - } - scope:deceitful = { - trait:deceitful = { save_scope_as = target_trait } - } - scope:honest = { - trait:honest = { save_scope_as = target_trait } - } - scope:craven = { - trait:craven = { save_scope_as = target_trait } - } - scope:brave = { - trait:brave = { save_scope_as = target_trait } - } - scope:shy = { - trait:shy = { save_scope_as = target_trait } - } - scope:gregarious = { - trait:gregarious = { save_scope_as = target_trait } - } - scope:ambitious = { - trait:ambitious = { save_scope_as = target_trait } - } - scope:content = { - trait:content = { save_scope_as = target_trait } - } - scope:arbitrary = { - trait:arbitrary = { save_scope_as = target_trait } - } - scope:just = { - trait:just = { save_scope_as = target_trait } - } - scope:cynical = { - trait:cynical = { save_scope_as = target_trait } - } - scope:zealous = { - trait:zealous = { save_scope_as = target_trait } - } - scope:paranoid = { - trait:paranoid = { save_scope_as = target_trait } - } - scope:trusting = { - trait:trusting = { save_scope_as = target_trait } - } - scope:compassionate = { - trait:compassionate = { save_scope_as = target_trait } - } - scope:callous = { - trait:callous = { save_scope_as = target_trait } - } - scope:sadistic = { - trait:sadistic = { save_scope_as = target_trait } - } - scope:stubborn = { - trait:stubborn = { save_scope_as = target_trait } - } - scope:fickle = { - trait:fickle = { save_scope_as = target_trait } - } - scope:eccentric = { - trait:eccentric = { save_scope_as = target_trait } - } - scope:vengeful = { - trait:vengeful = { save_scope_as = target_trait } - } - scope:forgiving = { - trait:forgiving = { save_scope_as = target_trait } - } - fallback = { - scope:actor = { - random_character_trait = { - limit = { has_trait_category = personality } - save_scope_as = target_trait - } - } - } - } - } - - on_accept = { - scope:actor = { - # Trait you're trying to make your ward gained is saved as scope:target_trait - trigger_event = bp2_character_interaction.1001 - show_as_tooltip = { - add_prestige = minor_prestige_loss - add_stress = minor_stress_gain - add_opinion = { - target = scope:recipient - modifier = pleased_opinion - opinion = 20 - } - } - } - scope:recipient = { - show_as_tooltip = { - switch = {#save which trait was chosen as scope:target_trait - trigger = yes - scope:lustful = { - trait:lustful = { save_scope_as = target_trait } - } - scope:chaste = { - trait:chaste = { save_scope_as = target_trait } - } - scope:gluttonous = { - trait:gluttonous = { save_scope_as = target_trait } - } - scope:temperate = { - trait:temperate = { save_scope_as = target_trait } - } - scope:greedy = { - trait:greedy = { save_scope_as = target_trait } - } - scope:generous = { - trait:generous = { save_scope_as = target_trait } - } - scope:lazy = { - trait:lazy = { save_scope_as = target_trait } - } - scope:diligent = { - trait:diligent = { save_scope_as = target_trait } - } - scope:wrathful = { - trait:wrathful = { save_scope_as = target_trait } - } - scope:calm = { - trait:calm = { save_scope_as = target_trait } - } - scope:patient = { - trait:patient = { save_scope_as = target_trait } - } - scope:impatient = { - trait:impatient = { save_scope_as = target_trait } - } - scope:arrogant = { - trait:arrogant = { save_scope_as = target_trait } - } - scope:humble = { - trait:humble = { save_scope_as = target_trait } - } - scope:deceitful = { - trait:deceitful = { save_scope_as = target_trait } - } - scope:honest = { - trait:honest = { save_scope_as = target_trait } - } - scope:craven = { - trait:craven = { save_scope_as = target_trait } - } - scope:brave = { - trait:brave = { save_scope_as = target_trait } - } - scope:shy = { - trait:shy = { save_scope_as = target_trait } - } - scope:gregarious = { - trait:gregarious = { save_scope_as = target_trait } - } - scope:ambitious = { - trait:ambitious = { save_scope_as = target_trait } - } - scope:content = { - trait:content = { save_scope_as = target_trait } - } - scope:arbitrary = { - trait:arbitrary = { save_scope_as = target_trait } - } - scope:just = { - trait:just = { save_scope_as = target_trait } - } - scope:cynical = { - trait:cynical = { save_scope_as = target_trait } - } - scope:zealous = { - trait:zealous = { save_scope_as = target_trait } - } - scope:paranoid = { - trait:paranoid = { save_scope_as = target_trait } - } - scope:trusting = { - trait:trusting = { save_scope_as = target_trait } - } - scope:compassionate = { - trait:compassionate = { save_scope_as = target_trait } - } - scope:callous = { - trait:callous = { save_scope_as = target_trait } - } - scope:sadistic = { - trait:sadistic = { save_scope_as = target_trait } - } - scope:stubborn = { - trait:stubborn = { save_scope_as = target_trait } - } - scope:fickle = { - trait:fickle = { save_scope_as = target_trait } - } - scope:eccentric = { - trait:eccentric = { save_scope_as = target_trait } - } - scope:vengeful = { - trait:vengeful = { save_scope_as = target_trait } - } - scope:forgiving = { - trait:forgiving = { save_scope_as = target_trait } - } - } - if = { - limit = { exists = scope:target_trait } - add_trait = scope:target_trait - } - add_opinion = { - target = scope:actor - modifier = admiration_opinion - opinion = 20 - } - } - } - } - - on_decline = { - scope:actor = { - # Trait you're trying to make your ward gained is saved as scope:target_trait - trigger_event = bp2_character_interaction.1002 - show_as_tooltip = { - add_prestige = minor_prestige_loss - add_stress = medium_stress_gain - add_opinion = { - target = scope:recipient - modifier = disappointed_opinion - opinion = -20 - } - } - } - scope:recipient = { - show_as_tooltip = { - add_opinion = { - target = scope:actor - modifier = confused_opinion - opinion = -20 - } - } - } - } - - auto_accept = no - - ai_accept = { - base = 0 # Try to make it 0 for most interactions - opinion_modifier = { # Opinion Factor - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - - modifier = { # Perk boost - desc = influence_children_groomed_to_rule_perk_tt - trigger = { - scope:actor = { has_perk = groomed_to_rule_perk } - } - add = groomed_to_rule_value - } - - modifier = { #more likely if you already have something in common - add = { - value = 5 - if = { - limit = { - number_of_personality_traits_in_common = { - target = scope:recipient - value = 2 - } - } - multiply = 2 - } - else_if = { - limit = { - number_of_personality_traits_in_common = { - target = scope:recipient - value = 3 - } - } - multiply = 3 - } - } - number_of_personality_traits_in_common = { - target = scope:recipient - value >= 1 - } - desc = we_are_alike_tt - } - - modifier = { #less likely if you already have opposite traits - add = { - value = -5 - if = { - limit = { - scope:recipient = { - number_of_opposing_personality_traits = { - target = scope:actor - value = 2 - } - } - } - multiply = 2 - } - else_if = { - limit = { - scope:recipient = { - number_of_opposing_personality_traits = { - target = scope:actor - value = 3 - } - } - } - multiply = 3 - } - } - scope:recipient = { - number_of_opposing_personality_traits = { - target = scope:actor - value >= 1 - } - } - desc = we_are_NOT_alike_tt - } - - modifier = { #adding your knowledge - add = { - value = scope:actor.learning - multiply = 0.5 - } - desc = HAS_LEARNING_SKILL_REASON - } - - modifier = { #adding your oratory skills - add = { - value = scope:actor.diplomacy - multiply = 0.5 - } - desc = HAS_DIPLOMACY_SKILL_REASON - } - - modifier = { #more likely with a Wet Nurse employed - exists = scope:actor.court_position:wet_nurse_court_position - add = 10 - desc = HAS_WET_NURSE_REASON - } - - modifier = { #more likely if chosen trait is a virtue in recipients faith - add = 10 - switch = { - trigger = yes - scope:sadistic = { - scope:recipient.faith = { - trait_is_virtue = trait:sadistic - } - } - scope:lustful = { - scope:recipient.faith = { - trait_is_virtue = trait:lustful - } - } - scope:chaste = { - scope:recipient.faith = { - trait_is_virtue = trait:chaste - } - } - scope:gluttonous = { - scope:recipient.faith = { - trait_is_virtue = trait:gluttonous - } - } - scope:temperate = { - scope:recipient.faith = { - trait_is_virtue = trait:temperate - } - } - scope:greedy = { - scope:recipient.faith = { - trait_is_virtue = trait:greedy - } - } - scope:generous = { - scope:recipient.faith = { - trait_is_virtue = trait:generous - } - } - scope:lazy = { - scope:recipient.faith = { - trait_is_virtue = trait:lazy - } - } - scope:diligent = { - scope:recipient.faith = { - trait_is_virtue = trait:diligent - } - } - scope:wrathful = { - scope:recipient.faith = { - trait_is_virtue = trait:wrathful - } - } - scope:calm = { - scope:recipient.faith = { - trait_is_virtue = trait:calm - } - } - scope:patient = { - scope:recipient.faith = { - trait_is_virtue = trait:patient - } - } - scope:impatient = { - scope:recipient.faith = { - trait_is_virtue = trait:impatient - } - } - scope:arrogant = { - scope:recipient.faith = { - trait_is_virtue = trait:arrogant - } - } - scope:humble = { - scope:recipient.faith = { - trait_is_virtue = trait:humble - } - } - scope:deceitful = { - scope:recipient.faith = { - trait_is_virtue = trait:deceitful - } - } - scope:honest = { - scope:recipient.faith = { - trait_is_virtue = trait:honest - } - } - scope:craven = { - scope:recipient.faith = { - trait_is_virtue = trait:craven - } - } - scope:brave = { - scope:recipient.faith = { - trait_is_virtue = trait:brave - } - } - scope:shy = { - scope:recipient.faith = { - trait_is_virtue = trait:shy - } - } - scope:gregarious = { - scope:recipient.faith = { - trait_is_virtue = trait:gregarious - } - } - scope:ambitious = { - scope:recipient.faith = { - trait_is_virtue = trait:ambitious - } - } - scope:content = { - scope:recipient.faith = { - trait_is_virtue = trait:content - } - } - scope:arbitrary = { - scope:recipient.faith = { - trait_is_virtue = trait:arbitrary - } - } - scope:just = { - scope:recipient.faith = { - trait_is_virtue = trait:just - } - } - scope:cynical = { - scope:recipient.faith = { - trait_is_virtue = trait:cynical - } - } - scope:zealous = { - scope:recipient.faith = { - trait_is_virtue = trait:zealous - } - } - scope:paranoid = { - scope:recipient.faith = { - trait_is_virtue = trait:paranoid - } - } - scope:trusting = { - scope:recipient.faith = { - trait_is_virtue = trait:trusting - } - } - scope:compassionate = { - scope:recipient.faith = { - trait_is_virtue = trait:compassionate - } - } - scope:callous = { - scope:recipient.faith = { - trait_is_virtue = trait:callous - } - } - scope:stubborn = { - scope:recipient.faith = { - trait_is_virtue = trait:stubborn - } - } - scope:fickle = { - scope:recipient.faith = { - trait_is_virtue = trait:fickle - } - } - scope:eccentric = { - scope:recipient.faith = { - trait_is_virtue = trait:eccentric - } - } - scope:vengeful = { - scope:recipient.faith = { - trait_is_virtue = trait:vengeful - } - } - scope:forgiving = { - scope:recipient.faith = { - trait_is_virtue = trait:forgiving - } - } - } - desc = selected_virtuous_trait_tt - } - - modifier = { #more likely if chosen trait is compatible with recipients childhood personality - add = 15 - switch = { - trigger = yes - scope:sadistic = { - scope:recipient = { - OR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:lustful = { - scope:recipient = { - OR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:chaste = { - scope:recipient = { - has_trait = pensive - } - } - scope:gluttonous = { - scope:recipient = { - OR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:temperate = { - scope:recipient = { - OR = { - has_trait = pensive - has_trait = charming - } - } - } - scope:greedy = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:generous = { - scope:recipient = { - OR = { - has_trait = charming - has_trait = curious - } - } - } - scope:lazy = { - scope:recipient = { - has_trait = rowdy - } - } - scope:diligent = { - scope:recipient = { - OR = { - has_trait = pensive - has_trait = curious - } - } - } - scope:wrathful = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:calm = { - scope:recipient = { - has_trait = pensive - } - } - scope:patient = { - scope:recipient = { - has_trait = pensive - } - } - scope:impatient = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:arrogant = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:humble = { - scope:recipient = { - has_trait = pensive - } - } - scope:deceitful = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = charming - } - } - } - scope:honest = { - scope:recipient = { - OR = { - has_trait = pensive - has_trait = rowdy - } - } - } - scope:craven = { - scope:recipient = { - has_trait = pensive - } - } - scope:brave = { - scope:recipient = { - OR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:shy = { - scope:recipient = { - has_trait = pensive - } - } - scope:gregarious = { - scope:recipient = { - OR = { - has_trait = charming - has_trait = curious - } - } - } - scope:ambitious = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = curious - } - } - } - scope:content = { - scope:recipient = { - OR = { - has_trait = pensive - has_trait = charming - } - } - } - scope:arbitrary = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:just = { - scope:recipient = { - OR = { - has_trait = pensive - has_trait = charming - } - } - } - scope:cynical = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = pensive - } - } - } - scope:zealous = { - scope:recipient = { - OR = { - has_trait = charming - has_trait = curious - } - } - } - scope:paranoid = { - scope:recipient = { - OR = { - has_trait = pensive - has_trait = rowdy - } - } - } - scope:trusting = { - scope:recipient = { - OR = { - has_trait = charming - has_trait = curious - } - } - } - scope:compassionate = { - scope:recipient = { - OR = { - has_trait = charming - has_trait = pensive - } - } - } - scope:callous = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:stubborn = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = curious - } - } - } - scope:fickle = { - scope:recipient = { - OR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:eccentric = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = charming - has_trait = curious - } - } - } - scope:vengeful = { - scope:recipient = { - OR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:forgiving = { - scope:recipient = { - OR = { - has_trait = charming - has_trait = curious - } - } - } - } - desc = has_compatible_personality_tt - } - - modifier = { #less likely if chosen trait is incompatible with recipients childhood personality - add = -15 - switch = { - trigger = yes - scope:sadistic = { - scope:recipient = { - NOR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:lustful = { - scope:recipient = { - NOR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:chaste = { - scope:recipient = { - NOT = { has_trait = pensive } - } - } - scope:gluttonous = { - scope:recipient = { - NOR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:temperate = { - scope:recipient = { - NOR = { - has_trait = pensive - has_trait = charming - } - } - } - scope:greedy = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:generous = { - scope:recipient = { - NOR = { - has_trait = charming - has_trait = curious - } - } - } - scope:lazy = { - scope:recipient = { - NOT = { has_trait = rowdy } - } - } - scope:diligent = { - scope:recipient = { - NOR = { - has_trait = pensive - has_trait = curious - } - } - } - scope:wrathful = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:calm = { - scope:recipient = { - NOT = { has_trait = pensive } - } - } - scope:patient = { - scope:recipient = { - NOT = { has_trait = pensive } - } - } - scope:impatient = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:arrogant = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:humble = { - scope:recipient = { - NOT = { has_trait = pensive } - } - } - scope:deceitful = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = charming - } - } - } - scope:honest = { - scope:recipient = { - NOR = { - has_trait = pensive - has_trait = rowdy - } - } - } - scope:craven = { - scope:recipient = { - NOT = { has_trait = pensive } - } - } - scope:brave = { - scope:recipient = { - NOR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:shy = { - scope:recipient = { - NOT = { has_trait = pensive } - } - } - scope:gregarious = { - scope:recipient = { - NOR = { - has_trait = charming - has_trait = curious - } - } - } - scope:ambitious = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = curious - } - } - } - scope:content = { - scope:recipient = { - NOR = { - has_trait = pensive - has_trait = charming - } - } - } - scope:arbitrary = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:just = { - scope:recipient = { - NOR = { - has_trait = pensive - has_trait = charming - } - } - } - scope:cynical = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = pensive - } - } - } - scope:zealous = { - scope:recipient = { - NOR = { - has_trait = charming - has_trait = curious - } - } - } - scope:paranoid = { - scope:recipient = { - NOR = { - has_trait = pensive - has_trait = rowdy - } - } - } - scope:trusting = { - scope:recipient = { - NOR = { - has_trait = charming - has_trait = curious - } - } - } - scope:compassionate = { - scope:recipient = { - NOR = { - has_trait = charming - has_trait = pensive - } - } - } - scope:callous = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:stubborn = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = curious - } - } - } - scope:fickle = { - scope:recipient = { - NOR = { - has_trait = curious - has_trait = rowdy - } - } - } - scope:eccentric = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = charming - has_trait = curious - } - } - } - scope:vengeful = { - scope:recipient = { - NOR = { - has_trait = bossy - has_trait = rowdy - } - } - } - scope:forgiving = { - scope:recipient = { - NOR = { - has_trait = charming - has_trait = curious - } - } - } - } - desc = has_incompatible_personality_tt - } - - modifier = { #less likely if chosen trait is a sin in recipients faith - add = -10 - switch = { - trigger = yes - scope:sadistic = { - scope:recipient.faith = { - trait_is_sin = trait:sadistic - } - } - scope:lustful = { - scope:recipient.faith = { - trait_is_sin = trait:lustful - } - } - scope:chaste = { - scope:recipient.faith = { - trait_is_sin = trait:chaste - } - } - scope:gluttonous = { - scope:recipient.faith = { - trait_is_sin = trait:gluttonous - } - } - scope:temperate = { - scope:recipient.faith = { - trait_is_sin = trait:temperate - } - } - scope:greedy = { - scope:recipient.faith = { - trait_is_sin = trait:greedy - } - } - scope:generous = { - scope:recipient.faith = { - trait_is_sin = trait:generous - } - } - scope:lazy = { - scope:recipient.faith = { - trait_is_sin = trait:lazy - } - } - scope:diligent = { - scope:recipient.faith = { - trait_is_sin = trait:diligent - } - } - scope:wrathful = { - scope:recipient.faith = { - trait_is_sin = trait:wrathful - } - } - scope:calm = { - scope:recipient.faith = { - trait_is_sin = trait:calm - } - } - scope:patient = { - scope:recipient.faith = { - trait_is_sin = trait:patient - } - } - scope:impatient = { - scope:recipient.faith = { - trait_is_sin = trait:impatient - } - } - scope:arrogant = { - scope:recipient.faith = { - trait_is_sin = trait:arrogant - } - } - scope:humble = { - scope:recipient.faith = { - trait_is_sin = trait:humble - } - } - scope:deceitful = { - scope:recipient.faith = { - trait_is_sin = trait:deceitful - } - } - scope:honest = { - scope:recipient.faith = { - trait_is_sin = trait:honest - } - } - scope:craven = { - scope:recipient.faith = { - trait_is_sin = trait:craven - } - } - scope:brave = { - scope:recipient.faith = { - trait_is_sin = trait:brave - } - } - scope:shy = { - scope:recipient.faith = { - trait_is_sin = trait:shy - } - } - scope:gregarious = { - scope:recipient.faith = { - trait_is_sin = trait:gregarious - } - } - scope:ambitious = { - scope:recipient.faith = { - trait_is_sin = trait:ambitious - } - } - scope:content = { - scope:recipient.faith = { - trait_is_sin = trait:content - } - } - scope:arbitrary = { - scope:recipient.faith = { - trait_is_sin = trait:arbitrary - } - } - scope:just = { - scope:recipient.faith = { - trait_is_sin = trait:just - } - } - scope:cynical = { - scope:recipient.faith = { - trait_is_sin = trait:cynical - } - } - scope:zealous = { - scope:recipient.faith = { - trait_is_sin = trait:zealous - } - } - scope:paranoid = { - scope:recipient.faith = { - trait_is_sin = trait:paranoid - } - } - scope:trusting = { - scope:recipient.faith = { - trait_is_sin = trait:trusting - } - } - scope:compassionate = { - scope:recipient.faith = { - trait_is_sin = trait:compassionate - } - } - scope:callous = { - scope:recipient.faith = { - trait_is_sin = trait:callous - } - } - scope:stubborn = { - scope:recipient.faith = { - trait_is_sin = trait:stubborn - } - } - scope:fickle = { - scope:recipient.faith = { - trait_is_sin = trait:fickle - } - } - scope:eccentric = { - scope:recipient.faith = { - trait_is_sin = trait:eccentric - } - } - scope:vengeful = { - scope:recipient.faith = { - trait_is_sin = trait:vengeful - } - } - scope:forgiving = { - scope:recipient.faith = { - trait_is_sin = trait:forgiving - } - } - } - desc = selected_sinful_trait_tt - } - - modifier = { #more likely if actor is afraid of you - add = intimidated_halved_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 1 - } - } - desc = INTIMIDATED_REASON - } - modifier = { #more likely if actor is afraid of you - add = cowed_halved_reason_value - scope:recipient = { - target_is_liege_or_above = scope:actor - has_dread_level_towards = { - target = scope:actor - level = 2 - } - } - desc = COWED_REASON - } - modifier = { #less likely if actor already has 3 personality traits - add = -50 - scope:recipient = { - number_of_personality_traits = 3 - } - desc = has_three_traits_already - } - } - - # AI - ai_potential = { - any_relation = { type = ward } - } - ai_frequency_by_tier = { - barony = 0 - county = 36 - duchy = 12 - kingdom = 12 - empire = 12 - hegemony = 12 - } - ai_targets = { - ai_recipients = courtiers - } - ai_will_do = { - base = -100 - modifier = { # If the recipient is a player, do not bother sending - factor = 0 - scope:recipient = { - is_ai = no - } - } - modifier = { #we don't want characters running around with 4 traits - add = -100 - scope:recipient = { - number_of_personality_traits = 3 - } - } - modifier = { - add = 50 - ai_honor > 0 - } - modifier = { - add = 50 - ai_compassion > 0 - } - modifier = { - add = 50 - ai_sociability > 0 - } - modifier = { - add = 50 - ai_boldness > 0 - } - modifier = { - add = 50 - scope:paranoid = yes - } - } -} - diff --git a/common/character_interactions/09_mpo_interactions.txt b/common/character_interactions/09_mpo_interactions.txt index ae55136e..0dfc0f4d 100644 --- a/common/character_interactions/09_mpo_interactions.txt +++ b/common/character_interactions/09_mpo_interactions.txt @@ -179,7 +179,7 @@ faith = scope:actor.faith faith = { has_doctrine = doctrine_pluralism_pluralistic } government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -218,7 +218,7 @@ faith = scope:actor.faith scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } faith = { has_doctrine = doctrine_pluralism_pluralistic } } @@ -257,7 +257,7 @@ NOR = { faith = scope:actor.faith government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } faith = { has_doctrine = doctrine_pluralism_pluralistic } @@ -1199,7 +1199,7 @@ desc = CONFEDERATION_HERDER_REASON trigger = { scope:recipient = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -1778,7 +1778,7 @@ promote_divergent_or_hybrid_culture_interaction = { scope:recipient = { OR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -1886,7 +1886,7 @@ promote_divergent_or_hybrid_culture_interaction = { desc = CONFEDERATION_HERDER_REASON trigger = { scope:recipient = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -2161,7 +2161,7 @@ inspire_conversion_interaction = { scope:recipient = { OR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -2270,7 +2270,7 @@ inspire_conversion_interaction = { desc = CONFEDERATION_HERDER_REASON trigger = { scope:recipient = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -2828,7 +2828,7 @@ migration_interaction = { scope:recipient = { NOR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -2847,7 +2847,7 @@ migration_interaction = { } modifier = { # Herders move away immediately trigger = { - scope:recipient = { government_has_flag = government_is_true_herder } + scope:recipient = { government_has_flag = government_is_herder } } add = 150 desc = MIGRATION_INTERACTION_HERDER @@ -3109,7 +3109,7 @@ migration_interaction = { desc = JUST_SETTLED_REASON scope:recipient = { is_tributary = yes - NOT = { government_has_flag = government_is_true_herder } + NOT = { government_has_flag = government_is_herder } capital_county = { title_held_years < 3 } @@ -3214,7 +3214,7 @@ migration_interaction = { # The recipient is a Herder modifier = { - scope:recipient = { government_has_flag = government_is_true_herder } + scope:recipient = { government_has_flag = government_is_herder } add = 10 } @@ -4859,7 +4859,7 @@ mpo_ask_for_herd_interaction = { } scope:recipient = { NOT = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -5033,7 +5033,7 @@ mpo_ask_for_herd_interaction = { if = { limit = { #herders cannot give you more herd scope:recipient = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } scope:actor = { @@ -7033,7 +7033,7 @@ feudalize_nomadic_holding_interaction = { this = scope:recipient NOR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -7289,7 +7289,7 @@ feudalize_herder_holding_interaction = { this = scope:recipient NOR = { government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -8339,7 +8339,7 @@ mpo_offer_submission_or_ruin = { #HERDER modifier = { - scope:recipient = { government_has_flag = government_is_true_herder } + scope:recipient = { government_has_flag = government_is_herder } add = 10000 desc = HERDER_REASON } @@ -9261,7 +9261,7 @@ mpo_offer_submission_or_ruin = { add = -50 scope:recipient = { NOT = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } scope:send_tribute = yes @@ -9497,7 +9497,7 @@ mpo_offer_submission_or_ruin = { is_shown = { scope:recipient = { NOT = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -9511,7 +9511,7 @@ mpo_offer_submission_or_ruin = { scope:recipient = { OR = { highest_held_title_tier < tier_duchy - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -9524,7 +9524,7 @@ mpo_offer_submission_or_ruin = { is_shown = { scope:recipient = { NOT = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } highest_held_title_tier >= tier_duchy } @@ -9543,7 +9543,7 @@ mpo_offer_submission_or_ruin = { is_shown = { scope:recipient = { NOR = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder government_has_flag = government_is_tribal government_has_flag = government_is_nomadic } @@ -9565,7 +9565,7 @@ mpo_offer_submission_or_ruin = { is_shown = { scope:recipient = { NOT = { - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -10264,7 +10264,7 @@ join_confederation_interaction = { faith = scope:actor.faith faith = { has_doctrine = doctrine_pluralism_pluralistic } government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } } } @@ -10303,7 +10303,7 @@ join_confederation_interaction = { faith = scope:actor.faith scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } faith = { has_doctrine = doctrine_pluralism_pluralistic } } @@ -10342,7 +10342,7 @@ join_confederation_interaction = { NOR = { faith = scope:actor.faith government_has_flag = government_is_nomadic - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } faith = { has_doctrine = doctrine_pluralism_pluralistic } diff --git a/common/character_interactions/tgp_tribute_mission_interactions.txt b/common/character_interactions/tgp_tribute_mission_interactions.txt deleted file mode 100644 index b41ebcd5..00000000 --- a/common/character_interactions/tgp_tribute_mission_interactions.txt +++ /dev/null @@ -1,911 +0,0 @@ - -#Tribute Missions - a set of hidden Character Interactions, triggered by the Pay Tribute decision - what do you send? - -tribute_mission_gold_interaction = { - hidden = yes - - popup_on_receive = yes - pause_on_receive = yes - - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - #Small Tribute - send_option = { - flag = small_gold_tribute - is_valid = { - scope:actor = { - gold >= { - value = small_gold_tribute_value - if = { - limit = { has_variable = offered_gold_value } - add = var:offered_gold_value - } - } - } - } - } - #Adequate Tribute - send_option = { - flag = adequate_gold_tribute - is_valid = { - scope:actor = { - gold >= { - value = adequate_gold_tribute_value - if = { - limit = { has_variable = offered_gold_value } - add = var:offered_gold_value - } - } - } - } - } - #Excessive Tribute - send_option = { - flag = excessive_gold_tribute - is_valid = { - scope:actor = { - gold >= { - value = excessive_gold_tribute_value - if = { - limit = { has_variable = offered_gold_value } - add = var:offered_gold_value - } - } - } - } - } - - on_accept = { - scope:actor = { - #Gold - switch = { - trigger = yes - scope:small_gold_tribute ?= { - #Define how much gold it is - set_variable = { - name = tribute_mission_type - value = flag:small_gold_tribute - } - set_or_change_offered_tribute_value_effect = { - TYPE = gold - VALUE = small_gold_tribute_value - } - - custom_tooltip = tribute_mission_gold_interaction.small_reserved_gold - } - scope:adequate_gold_tribute ?= { - #Define how much gold it is - set_variable = { - name = tribute_mission_type - value = flag:adequate_gold_tribute - } - set_or_change_offered_tribute_value_effect = { - TYPE = gold - VALUE = adequate_gold_tribute_value - } - - custom_tooltip = tribute_mission_gold_interaction.adequate_reserved_gold - } - scope:excessive_gold_tribute ?= { - #Define how much gold it is - set_variable = { - name = tribute_mission_type - value = flag:excessive_gold_tribute - } - set_or_change_offered_tribute_value_effect = { - TYPE = gold - VALUE = excessive_gold_tribute_value - } - - custom_tooltip = tribute_mission_gold_interaction.excessive_reserved_gold - } - } - - #Some Mandala piety - show_as_tooltip = { tribute_mission_mandala_piety_effect = yes } - - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - } - - auto_accept = yes - - ai_will_do = { - base = 50 - } -} - -tribute_mission_herd_interaction = { - hidden = yes - - popup_on_receive = yes - pause_on_receive = yes - - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - #Small Tribute - send_option = { - flag = small_herd_tribute - - is_valid = { - scope:actor = { - domicile ?= { - herd >= { - value = { - add = small_herd_tribute_value - if = { - limit = { has_variable = offered_herd_value } - add = var:offered_herd_value - } - } - } - } - } - } - } - - #Adequate Tribute - send_option = { - flag = adequate_herd_tribute - - is_valid = { - scope:actor = { - domicile ?= { - herd >= { - value = { - add = adequate_herd_tribute_value - if = { - limit = { has_variable = offered_herd_value } - add = var:offered_herd_value - } - } - } - } - } - } - } - #Excessive Tribute - send_option = { - flag = excessive_herd_tribute - - is_valid = { - scope:actor = { - domicile ?= { - herd >= { - value = { - add = excessive_herd_tribute_value - if = { - limit = { has_variable = offered_herd_value } - add = var:offered_herd_value - } - } - } - } - } - } - } - - on_accept = { - scope:actor = { - #Herd - switch = { - trigger = yes - scope:small_herd_tribute ?= { - #Define how much herd it is - set_variable = { - name = tribute_mission_type - value = flag:small_herd_tribute - } - #set_or_change_offered_tribute_value_effect = { #Herd value scale by era shenanigans here - # TYPE = herd - # VALUE = small_herd_tribute_value - #} - set_variable = { - name = offered_herd_value - value = domicile.small_herd_tribute_value - } - - custom_tooltip = tribute_mission_herd_interaction.small_reserved_herd - } - scope:adequate_herd_tribute ?= { - #Define how much herd it is - set_variable = { - name = tribute_mission_type - value = flag:adequate_herd_tribute - } - #set_or_change_offered_tribute_value_effect = { - # TYPE = herd - # VALUE = adequate_herd_tribute_value - #} - set_variable = { - name = offered_herd_value - value = domicile.adequate_herd_tribute_value - } - - custom_tooltip = tribute_mission_herd_interaction.adequate_reserved_herd - } - scope:excessive_herd_tribute ?= { - #Define how much herd it is - set_variable = { - name = tribute_mission_type - value = flag:excessive_herd_tribute - } - #set_or_change_offered_tribute_value_effect = { - # TYPE = herd - # VALUE = excessive_herd_tribute_value - #} - set_variable = { - name = offered_herd_value - value = domicile.excessive_herd_tribute_value - } - - custom_tooltip = tribute_mission_herd_interaction.excessive_reserved_herd - } - } - - #Some Mandala piety - show_as_tooltip = { tribute_mission_mandala_piety_effect = yes } - - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - } - - auto_accept = yes - - ai_will_do = { - base = 50 - } -} - -tribute_mission_artifact_interaction = { - hidden = yes - - target_type = artifact - target_filter = actor_artifacts - - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - can_be_picked_artifact = { - scope:target = { - is_suitable_artifact_tribute_trigger = yes - } - } - - on_accept = { - scope:target = { - set_variable = is_tribute_mission_artifact - } - scope:actor = { - #Save the Artifact - set_variable = { - name = tribute_mission_type - value = flag:artifact_tribute - } - set_variable = { - name = offered_artifact - value = scope:target - } - custom_tooltip = tribute_mission_artifact_interaction.tooltip - #Some Mandala piety - show_as_tooltip = { tribute_mission_mandala_piety_effect = yes } - - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - } - - auto_accept = { - OR = { - scope:actor = { subject_standing >= 0 } - scope:recipient = { is_ai = no } - } - } - - ai_accept = { - base = 0 - modifier = { - add = 100 - desc = ARTIFACT_REASON - } - modifier = { - add = -80 - NOT = { - can_equip_artifact = scope:target - } - desc = ARTIFACT_NOT_EQUIPPABLE_REASON - } - modifier = { - add = -40 - NOT = { - can_benefit_from_artifact = scope:target - } - desc = ARTIFACT_NOT_BENEFIT_REASON - } - modifier = { - add = -500 - scope:target = { - has_variable = unwanted_artifact - } - #No harm in reusing the wording - desc = ARTIFACT_CURSED_REASON - } - modifier = { - add = -1000 - scope:target = { - has_variable = cursed_artifact - } - desc = ARTIFACT_CURSED_REASON - } - modifier = { - add = 100 - exists = scope:target.var:banner_dynasty - exists = scope:recipient.dynasty - scope:recipient = scope:target.var:banner_dynasty.dynast - desc = ARTIFACT_DYNASTY_BANNER_REASON - } - modifier = { - add = -200 - OR = { - exists = scope:target.var:banner_dynasty - exists = scope:target.var:banner_house - } - exists = scope:recipient.house - trigger_if = { - limit = { exists = scope:target.var:banner_dynasty } - scope:target.var:banner_dynasty != scope:recipient.dynasty - } - trigger_else = { - scope:target.var:banner_house != scope:recipient.house - } - desc = ARTIFACT_USELESS_BANNER_REASON - } - } - - ai_will_do = { - base = 50 - } -} - -tribute_mission_concubine_interaction = { - hidden = yes - - populate_recipient_list = { - scope:actor = { - every_courtier_or_guest = { - limit = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = scope:actor - CHARACTER = scope:actor.overlord - } - has_any_disease_trigger = no - has_easily_mocked_physical_attribute_trigger = no - } - add_to_list = characters - } - } - } - - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - can_be_picked = { - is_adult = yes - } - - auto_accept = { - OR = { - scope:actor = { subject_standing >= 0 } - scope:recipient = { is_ai = no } - } - } - - on_accept = { - scope:actor = { - #Save the concubine - set_variable = { - name = tribute_mission_type - value = flag:concubine_tribute - } - set_variable = { - name = offered_concubine - value = scope:secondary_recipient - } - scope:secondary_recipient = { - add_character_flag = { - flag = cannot_be_diarch # just enough to make sure they don't succeed to the diarchy while en route - years = 2 - } - } - custom_tooltip = tribute_mission_concubine_interaction.tooltip - #Some Mandala piety - show_as_tooltip = { tribute_mission_mandala_piety_effect = yes } - - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - } - - ai_accept = { - base = 50 - - modifier = { - add = { - value = 50 - multiply = scope:secondary_recipient.num_of_good_genetic_traits - } - scope:secondary_recipient = { - num_of_good_genetic_traits > 0 - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_POSITIVE_TRAIT_REASON - } - - modifier = { - add = { - value = 50 - } - scope:secondary_recipient = { - is_lowborn = no - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_DYNASTY_PRESTIGE_REASON_NOBLE - } - - modifier = { - add = { - value = -50 - multiply = scope:secondary_recipient.num_of_bad_genetic_traits - } - scope:secondary_recipient = { - OR = { - num_of_bad_genetic_traits > 0 - } - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_NEGATIVE_TRAIT_REASON - } - - modifier = { - add = { - value = -50 - } - scope:secondary_recipient = { - is_lowborn = yes - num_of_good_genetic_traits = 0 - trigger_if = { - limit = { - is_female = yes - } - is_aging_character = no - } - } - desc = AI_DYNASTY_PRESTIGE_REASON_LOWBORN_NO_POSITIVE_TRAIT - } - - opinion_modifier = { # Opinion of you - who = scope:recipient - opinion_target = scope:actor - multiplier = 1.0 - desc = AI_OPINION_REASON - } - - opinion_modifier = { # Opinion of concubine - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = 0.25 - desc = AI_OPINION_REASON - } - - compare_modifier = { # Recipient is reluctant to marry old women (procreation is a key factor) - trigger = { - scope:secondary_recipient = { - is_young_character = no - is_female = yes - } - } - target = scope:secondary_recipient - value = age - multiplier = -5.0 - step = 1 - offset = -29 - desc = MARRY_AGE - } - - modifier = { # A Recipient is unwilling to take a same-sex concubine if their faith doesn't support it - add = -1000 - - scope:recipient = { - allowed_to_marry_same_sex_trigger = no - sex_same_as = scope:secondary_recipient - } - desc = SAME_SEX_MARRIAGE_FAITH_REASON_RECIPIENT - } - - modifier = { # Unwilling if they don't have a batch of kids and opposite sex consorts to handle that situation - add = -200 - scope:recipient = { - allowed_to_marry_same_sex_trigger = yes - sex_same_as = scope:secondary_recipient - trigger_if = { - limit = { - NOT = { - any_consort = { - can_have_children_with = { CHARACTER = scope:recipient } - fertility > 0.1 - } - } - } - any_child = { is_player_heir_of = root } - } - trigger_else = { - always = no - } - } - desc = AI_NO_FERTILITY_REASON - } - - modifier = { - add = 50 - scope:recipient = { - is_attracted_to_gender_of = scope:secondary_recipient - } - desc = AI_ATTRACTION_REASON - } - - #More/Less likely based on difference in rank between actor and recipient - modifier = { - add = 20 - scope:actor = { - tier_difference = { - target = scope:recipient - value = 1 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 30 - scope:actor = { - tier_difference = { - target = scope:recipient - value = 2 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 40 - scope:actor = { - tier_difference = { - target = scope:recipient - value = 3 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 50 - scope:actor = { - tier_difference = { - target = scope:recipient - value = 4 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = 60 - scope:actor = { - tier_difference = { - target = scope:recipient - value = 5 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -20 - scope:actor = { - tier_difference = { - target = scope:recipient - value = -1 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -30 - scope:actor = { - tier_difference = { - target = scope:recipient - value = -2 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -40 - scope:actor = { - tier_difference = { - target = scope:recipient - value = -3 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -50 - scope:actor = { - tier_difference = { - target = scope:recipient - value = -4 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -60 - scope:actor = { - tier_difference = { - target = scope:recipient - value = -5 - } - } - desc = AI_RANK_DIFF - } - modifier = { - add = -250 - scope:secondary_recipient = { - has_std_trigger = yes - } - desc = AI_STD_REASON - } - modifier = { - add = -250 - scope:secondary_recipient = { - has_epidemic_disease_trigger = yes - } - desc = AI_CONTAGIOUS_REASON - } - modifier = { - add = -5000 - scope:secondary_recipient = { - fertility <= 0 - } - desc = AI_FERTILITY_REASON - } - - # Unity modifiers - evaluate_action_increasing_house_unity = { - VALUE = 100 - } - } - - ai_will_do = { - base = 50 - } -} - -tribute_mission_eunuch_interaction = { - hidden = yes - - populate_recipient_list = { - scope:actor = { - every_courtier = { - limit = { - tribute_mission_is_available_eunuch_trigger = yes - NAND = { - faith = { has_doctrine = doctrine_theocracy_temporal } - this = scope:actor.cp:councillor_court_chaplain - } - } - add_to_list = characters - } - } - } - - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - can_be_picked = { - has_any_disease_trigger = no - } - - auto_accept = { - OR = { - scope:actor = { subject_standing >= 0 } - scope:recipient = { is_ai = no } - } - } - - on_accept = { - scope:actor = { - #Save the eunuch - set_variable = { - name = tribute_mission_type - value = flag:eunuch_tribute - } - set_variable = { - name = offered_eunuch - value = scope:secondary_recipient - } - custom_tooltip = tribute_mission_eunuch_interaction.tooltip - stress_impact = { - compassionate = medium_stress_impact_gain - sadistic = minor_stress_impact_loss - } - #Some Mandala piety - show_as_tooltip = { tribute_mission_mandala_piety_effect = yes } - - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - scope:secondary_recipient = { - if = { - limit = { is_eunuch_trigger = no } - add_opinion = { - modifier = slated_for_castration_opinion - target = scope:actor - opinion = -50 - } - custom_tooltip = tribute_mission_eunuch_interaction.slated_for_castration - #Escape or no escape? - hidden_effect = { - random_list = { - 30 = { - modifier = { - has_trait = brave - add = 10 - } - modifier = { - has_trait = wrathful - add = 10 - } - modifier = { - add = prowess - } - #I'm outta here! - add_character_flag = tribute_mission_attempt_escape - scope:actor = { - trigger_event = { - id = tribute_mission.9760 - days = { 10 20 } - } - } - } - 70 = { - modifier = { - has_trait = craven - add = 10 - } - modifier = { - has_trait = lazy - add = 10 - } - #No escape - } - } - } - } - } - } - - ai_accept = { - base = -50 - ######### OPINION OF TRIBUTARY - opinion_modifier = { - who = scope:recipient - opinion_target = scope:actor - multiplier = 0.5 - desc = AI_OPINION_REASON - } - ######### OPINION OF EUNUCH - opinion_modifier = { - who = scope:recipient - opinion_target = scope:secondary_recipient - multiplier = 0.5 - desc = AI_OPINION_REASON - } - ######## EUNUCH AGE - modifier = { - add = { - value = 50 - subtract = scope:secondary_recipient.age - } - desc = AI_REASON_EUNUCH_AGE - } - ######## EUNUCH SKILLS - modifier = { - add = { - add = scope:secondary_recipient.diplomacy - add = scope:secondary_recipient.intrigue - add = scope:secondary_recipient.stewardship - add = scope:secondary_recipient.martial - add = scope:secondary_recipient.learning - } - desc = AI_REASON_EUNUCH_SKILLS - } - ######## EUNUCH SKILLS - modifier = { - scope:secondary_recipient = { - has_trait = beardless_eunuch - } - add = 25 - desc = AI_REASON_BEARDLESS_EUNUCH - } - } - - ai_will_do = { - base = 50 - } -} - -#Player only -tribute_mission_bunga_mas_interaction = { - hidden = yes - - target_type = artifact - target_filter = actor_artifacts - - ai_min_reply_days = 0 - ai_max_reply_days = 0 - - can_be_picked_artifact = { - scope:target = { var:bunga_mas_created_by ?= scope:actor } - } - - on_accept = { - scope:target = { - set_variable = is_tribute_mission_artifact - } - scope:actor = { - #Save the Artifact - set_variable = { - name = tribute_mission_type - value = flag:bunga_mas_tribute - } - set_variable = { - name = offered_bunga_mas - value = scope:target - } - custom_tooltip = tribute_mission_bunga_mas_interaction.tooltip - #Some Mandala piety - show_as_tooltip = { tribute_mission_mandala_piety_effect = yes } - - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - } - - auto_accept = { - always = yes - } - - ai_accept = { - base = 100 - } - - ai_will_do = { - base = 50 - } -} diff --git a/common/scripted_triggers/00_marriage_triggers.txt b/common/scripted_triggers/00_marriage_triggers.txt index 16451d34..e715eeda 100644 --- a/common/scripted_triggers/00_marriage_triggers.txt +++ b/common/scripted_triggers/00_marriage_triggers.txt @@ -30,7 +30,7 @@ can_marry_common_trigger = { } is_leading_faction_type = peasant_faction is_leading_faction_type = populist_faction - government_has_flag = government_is_true_herder + government_has_flag = government_is_herder } }